5

In addition to the nonce and the Merkle Root, there are 4 other fields in the header - version, previous header hash, time and nbits.

Assuming a miner does not want to change the merkle root because of the additional computation involved, and obviously cannot change the previous header hash, to what extent are they able to change the version, time and/or nbits field to get additional nonce space?

2 Answers 2

7

nBits cannot be changed at all. Its value must equal the (compact encoding of) the target value for that block, which is determined entirely by the predecessors of the block. In other words, if the prevblock hash is given, so is nBits.

nVersion: can be modified arbitrarily, though its value is subject to interpretation under BIP34 (requiring it to be at least 2), BIP66 (requiring it to be at least 3), BIP65 (requiring it to be at least 4), and BIP9 (assigning potential future meanings to certain bits if the value is within a specific range).

nTime: can be rolled within a window starting at the median of the past 11 blocks + 1 up to 7200 seconds in the future at the time the block is mined.

0
6

nTime: blocks must have a higher timestamp than the median of the 11 previous blocks, and a lower timestamp than two hours in the future of the validating node's own clock. Assuming a regular block interval of ten minutes and a correctly set local time, the block can therefore be stamped between about one hour in the past and two hours in the future.

nBits: This encodes the block target (the reciprocal of the difficulty) and cannot be changed.

nVersion: The version field is 32 bits, and must be at least 2, 3 or 4 (i.e. the first three bits must be 010, 011, or 001 due to nVersion being encoded little endian). When using version 4 (001…) the remainder of the bits is defined by BIP9 which has attached meaning to some of the last few bits that have been previously used to signal activation of soft forks. All remaining bits beside the above mentioned can be used to mutate the block header. They are for example used for "overt ASICBOOST"-style mining.

2
  • 3
    Nit: BIP9 does not require the top bits to be 001; 011 and 010 are allowed as well, but no versionbits semantics are applied in that case (or in other words: using those prefix bits will be treated similar to 0010000...000). Commented Sep 15, 2019 at 22:54
  • @PieterWuille: Thanks, issuing a correction.
    – Murch
    Commented Sep 21, 2019 at 4:07

Your Answer

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

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