1

I have a question about bitcoin, lets say that the output is uniformly random and that it is 256 bits in length. The output of the hash function y=H(t) begins with 25 zeros - how many times would one have to call the hash function to get something that starts with 25 zeros?

Secondly, how does one verify the solution and how many hashes would be attempted to solve it?

  • Does "zeros" mean zero bits or zero hex digits (which would be 100 bits)? – Nate Eldredge Sep 25 '14 at 3:16
  • zero binary bits as stated. – mcdoomington Sep 25 '14 at 13:42
1

It's pretty simple. Since the hashes are uniformly distributed, 25 zeroes is as likely as any other possible value for the first 25 hexadecimal digits. There are 16 possible values for each hexadecimal digit, so the number of possible combinations is 16^25, or about a 1,2676506×1030. This also means that on average, one in 1,2676506×1030 hashes will start with 25 hexadecimal zero digits.

To verify the solution, you just compute the hash once and check if it starts with the required number of zeroes. So, it's 1030 times easier to check the hash than to find it.

  • I should restate my question as it appears that it might not be complete. If the output is 256 bits, that would be binary {0,1} and not hexadecimal correct? If I assume the later, then there would be 2^25 possible hashes which start with twenty five zeros. What would the number of hashes approximately then would I need to compute in order to find one that satisfies this? (2^25)/(2^256)??? – mcdoomington Sep 25 '14 at 3:07
  • 1
    In addition to the bits versus hex digits confusion, it looks like 25 turned into 15 somewhere along the line? – Nate Eldredge Sep 25 '14 at 3:19
  • 1
    If you're looking for 25 zero bits, it would be (2^25). The fact that there are 256 total bits is irrelevant. – David Schwartz Sep 25 '14 at 3:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.