Skip to content

bip54: exempt genesis from coinbase checks - #2326

Open
nervana21 wants to merge 1 commit into
bitcoin:masterfrom
nervana21:bip54-skip-genesis
Open

nervana21 wants to merge 1 commit into
bitcoin:masterfrom
nervana21:bip54-skip-genesis

Conversation

@nervana21

Copy link
Copy Markdown
Contributor

The BIP54 reference implementation skips genesis when checking the new coinbase locktime and sequence rules. However this wasn't specified in the BIP.

Update the BIP to reflect that genesis is exempt from these checks.

@fametrano

Copy link
Copy Markdown
Contributor

Concept ACK. All 7 cases in bip-0054/test_vectors/coinbases.json start from the mainnet genesis block. Its coinbase has nLockTime 0 and nSequence 0xffffffff, so the rule as written makes all of them invalid. bitcoin/bitcoin#35793 also skips the check at height 0.

The timewarp rule has the same gap: at N=0 there is no TN−1, and timestamps.json also starts from genesis. One sentence could exempt genesis from both rules.

@murchandamus murchandamus added Proposed BIP modification PR by non-owner to update BIP content Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels Oct 16, 2026
Comment thread bip-0054.md
Comment on lines -79 to -80
The coinbase transaction's `nLockTime` field must be set to the height of the block minus 1[^2]
and its `nSequence` field must not be equal to 0xffffffff.

@murchandamus murchandamus Oct 16, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems incorrect and redundant to me. In technical writing, usually specific rules beat general rules. So, the proposed phrasing implies that all blocks except the Genesis block would have to follow this rule. However, such a rule would cause the entire blockchain after the Genesis block to be invalid.

The specification section starts with “For all blocks after activation the following new rules apply” (emphasis added), which is the accurate range of blocks for which this rule applies. Obviously, the soft fork cannot activate before or on the Genesis block in mainnet, and testnet5, is also proposed to activate the rules on block 1 rather than applying it for the Genesis block.

So, this rephrasing seems like a disimprovement to me.

@murchandamus

Copy link
Copy Markdown
Member

cc: @darosior

@darosior darosior left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @murchandamus. This is already covered (for all checks, not only the nLockTime one) by

For all blocks after activation the following new rules apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified Proposed BIP modification PR by non-owner to update BIP content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants