Saturday, May 4, 2024

What restrictions does the model discipline within the block header have?


nVersion is a 4-byte little-endian signed integer. Little-endianness signifies that the least important byte is first. The order of bits in a byte stays the identical.

I’m conscious of the next restrictions:

  • BIP65 requires blocks to have at the very least model 4.
  • Since nVersion is a signed integer, setting the highest bit would flip it adverse.

Subsequently, any bit sample that doesn’t set the highest bit and units at the very least one bit amongst positions 2…30 will likely be permitted.

Be aware that within the context of BIP-9-style deployments, the highest three bits should be set to 001 and solely in that case the remaining bits are interpreted as a bit vector the place every place might sign readiness for a softfork proposal’s activation.

Let’s take a look at some examples in hexadecimal and binary:

Signal (topbit):

0b 00000000 00000000 00000000 ±0000000
                              ^
                              Signal (topbit)

Model 0, least and most important bytes:

0x 00       00       00       00
0b 00000000 00000000 00000000 00000000
   ^______^                   ^______^
     LSB                        MSB

Model 1:

0x 01       00       00       00
0b 00000001 00000000 00000000 00000000

Model 4:

0x 04       00       00       00
0b 00000100 00000000 00000000 00000000

BIP-9 (not signaling):

0x 00       00       00       20
0b 00000000 00000000 00000000 00100000

Signaling for Taproot on bit 2:

0x 04       00       00       20
0b 00000100 00000000 00000000 00100000

Model of Block 779,960 (model discipline used for extra entropy):

0x 32       47       40       00
0b 00110010 01000111 01000000 00000000

The ultimate instance here’s a block by which the model discipline is used as an extra supply of randomness within the block header: it’s quicker to vary the model discipline as an alternative of adjusting the additional nonce within the coinbase transaction as a result of altering the model discipline won’t require recalculating the left flank of the Merkle tree to replace the Merkle root.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles