I understand that the Bitcoin mining problem is to find a string s (hash of previous block + transaction hashes + nonce) such that sha256(s) has n leading zeros, where n determines the mining difficulty.

The result of sha256(s) is a 64-length hexadecimal string. Each position of 64 has 36 possibilities (a-z, 0-9). So, the expected number of guesses would be 36^n.

The hash of block #485891 is


which has 18 leading zeros. Thus, the expected number of guesses is

36^18 = 10314424798490535546171949056.

This hash was found by Antpool which has a hash power of 1284.32 PH/s. Therefore, the expected time for Antpool to find the hash would be

36^18 / (1284.32 * 10^15) = 8.03104*10^9 s = 255 years.

This time is obviously incorrect. Is there anything I missed out?


As you say, the result of sha256 is a hexadecimal string. Hexadecimal only uses the digits 0-9 and a-f, which is 16 possibilities, not 36.

If you redo your calculation with 16^18 instead of 36^18, you get an average time of around 3600 seconds, or 1 hour.

Your Answer

