Can a coinbase transaction contain only data: 03 - length and 030303 - coinbase itself, or should the coinbase itself contain the height of the block?
Asked
Active
Viewed 423 times
1 Answers
1
https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki
Add height as the first item in the coinbase transaction's scriptSig, and increase block version to 2. The format of the height is "serialized CScript" -- first byte is number of bytes in the number (will be 0x03 on main net for the next 150 or so years with 223-1 blocks), following bytes are little-endian representation of the number (including a sign bit). Height is the height of the mined block in the block chain, where the genesis block is height zero (0).

Claris
- 15,408
- 2
- 26
- 43
50cf07(hex little endian) == 511824(dec) – ivishnevskijmeander-groupru Mar 10 '18 at 15:10