AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 18 Bitcoin

mining: only pad with OP_0 at heights <= 16

Public commit record

What the developer wrote

Authored by Sjors Provoost

90/100 · Strong
mining: only pad with OP_0 at heights <= 16

Drop the include_dummy_extranonce branch from the OP_0 padding
condition in CreateNewBlock(), so that the dummy extraNonce is
only appended when consensus actually requires it (heights <= 16,
where the BIP34 height push alone would yield a 1-byte scriptSig
and trigger bad-cb-length).

The include_dummy_extranonce option struct field is now unused by
the miner and is removed in the next commit. Callers still set it,
so that this commit compiles.

Regenerate the hardcoded coinbase / block hashes throughout the
unit and functional test suites and update the regtest assumeutxo
snapshot in chainparams.

Additional side-effects:

- Without the dummy extranonce, coinbase scriptSigs are 1 byte
shorter at heights > 16, making every block 1 byte smaller.
This shifts where block files wrap and therefore where pruning
boundaries land.

- feature_assumeutxo malleation cases:
- case 1: error message changes due to UTXO reordering, similar
to 8f2078af6a55448c003b3f7f3021955fbb351caa
- case 4: the corruption byte is swapped from \x82 to \x83
because \x82 happened to be the actual value at that
offset in the new snapshot.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This Bitcoin Core change removes an unnecessary extra zero byte (OP_0) from newly mined coinbase transactions after block height 16. That byte was originally added to satisfy a minimum coinbase script length rule, but only heights 1-16 actually need it. The change is a cleanup that makes blocks one byte smaller and updates many hardcoded test hashes accordingly. It does not fix a vulnerability and does not appear exploitable.

Recommended action

No security action required. Reviewers and downstream integrators should expect changed deterministic block/UTXO hashes in regtest/test networks and update any external fixtures that depend on the old values. The deprecated include_dummy_extranonce option should be removed in a follow-up as noted by the TODO.

Security signals we found

01

No security-relevant bug is fixed; the change is a miner behavior cleanup.

02

Consensus rule (bad-cb-length) is still satisfied: heights <= 16 keep the OP_0 padding.

03

Block serialization size decreases by 1 byte for heights > 16, affecting deterministic test hashes and pruning thresholds.

04

include_dummy_extranonce is deprecated/ignored, not removed yet, to keep callers compiling.

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 1/15
Affected reach 2/15
Confidence 9/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.