While reading bitcoin source I found this short comment:
// Height first in coinbase required for block.version=2
Why this is required? Does it prevent some misuse or attack?
Putting the height in the coinbase is desired for at least two reasons:
- It guarantees that every subsequent block and transaction hash is unique.
- It can be used to better reason about plausible difficulty for not-yet-connected blocks.
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".