forex.pm forex forum binary options trade

 Сryptocurrency exchanges => Binance - Сryptocurrency exchanges => Topic started by: Bitcoin on Feb 17, 2022, 02:09 pm

Title: Why block height is required in coinbase?
Post by: Bitcoin on Feb 17, 2022, 02:09 pm
Why block height is required in coinbase?

While reading bitcoin source I found this short comment:



// Height first in coinbase required for block.version=2


(From https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp#L338).



Why this is required? Does it prevent some misuse or attack?



I found that this change was introduced in BIP-0034. In relevant pull request it is justified by following points:




 

Putting the height in the coinbase is desired for at least two reasons:


 
 

     
  1. It guarantees that every subsequent block and transaction hash is unique.

  2.  
  3. It can be used to better reason about plausible difficulty for not-yet-connected blocks.

  4.  



But for me this explains nothing: I don't see how adding height guarantees unique block hashes and I don't understand what is "plausible difficulty for not-yet-connected blocks".


Source: Why block height is required in coinbase? (https://bitcoin.stackexchange.com/questions/30764/why-block-height-is-required-in-coinbase)