People often say that the goal of mining is to get a certain number of "leading zeroes", because that is easy to visualize, but a more precise statement is that the goal is to find x
such that int(SHA256(SHA256(x))) < T
for some target T
, where int( )
means we are interpreting the 256-bit hash as a 256 bit unsigned integer.
This is almost equivalent to the "leading zeroes" formulation. If you think about two hexadecimal 32-byte sequences, then the one with more leading zeroes is the smaller number when interpreted as an integer.
For example, a recent BTC block has hash
0x00000000000000000003b2cd31ba3f0c99f96aee5cd7d7d0dace2e86f0afde6d
Which is less than the target
0x000000000000000000365a170000000200000000000000000000000000000000
The block happens to have more zeroes in front, but a hash of
0x000000000000000000265a170000000200000000000000000000000000000000
would have worked as well, since it is smaller than the target, despite having just as many zeroes.
Ethereum uses a more complicated PoW function, but the idea is the same: find some input that minimizes the result of some one-way function.The difference is that instead of aiming for a small blockhash, Ethereum uses a field called the "mix hash" that together with the nonce serves as the proof of work. This leads to block hashes that look random, as opposed to BTC's which all have many leading zeroes.