2

The hash of a bitcoin block is generated from:

  1. Block version number (partially fixed*, 32 bits)
  2. Previous block hash (fixed, 256 bits)
  3. Merkle root (not fixed, 256 bits),
  4. Time (not fixed, 32 bits),
  5. Bits (partially fixed*, 32 bits),
  6. Nonce (not fixed, 32 bits).

So, the block hash is generated from 640 bits. You can change 320 bits freely to try to have a hash that matches the current diff, and 320 bits are immutable.

Is there a property on the SHA-256 function that asserts that on these 320 bits of freedom, one combination will give us a hash that is matching the diff requirements?

If not, does that mean that the blockchain could get stuck on a block because nobody can mine on it?


* "Partially fixed" values could be changed by software updates for example. I assume that partially fixed values are fixed to simplify.

1
  • The bits value is completely fixed. If you get it wrong, the block will be invalid. Jan 3, 2018 at 9:17

1 Answer 1

2

Is there a property on the SHA-256 function that asserts that on these 320 bits of freedom, one combination will give us a hash that is matching the diff requirements?

No.

AFAIK there are in general hardly any research results about the possible SHA-256 output values and their probabilities.

Satoshi Nakamoto probably assumed that you will always be able to find a possible block by modifying the nonce and the Merkle root.

If not, does that mean that the blockchain could get stuck on a block because nobody can mine on it?

Yes (Theoretically, but it is very unlikely which was already pointed out by Alpha)

Let us try to be more precise. If you only change the nonce and the Merkle root there are 256 + 32 = 288 bits you can change. So you have 2<sup>288</sup> (~4.97 x 10<sup>86</sup>) possible inputs for the SHA-256 function ( If you find all 2<sup>256</sup> possible Merkle roots, which is also very difficult admittedly. but let's assume you accomplish this because you have many ways to change the Merkle root like changing bytes in the coinbase transaction and you can choose every combination of arbitrary valid transactions from the mempool).

Now take a look at the possible SHA-256 results, there are 16<sup>64</sup>(~1.16 x 10<sup>77</sup>) possible SHA-256 outputs and 2<sup>288</sup> (~4.97 x 10<sup>86</sup>) possible inputs. With these you should be able to find atleast one hash below the target. It would then be possible to create a new block.

Remember there are 2^288/16^64=2^32=4294967296 times more inputs than the possible SHA-256 outputs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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