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

blockchain: run BIP30 if we are on non-BIP34 fork

Public commit record

What the developer wrote

Authored by Boris Nagaev

76/100 · Adequate
blockchain: run BIP30 if we are on non-BIP34 fork

Mirror BIP34-aware BIP30 skip logic from Bitcoin Core.

PR https://github.com/bitcoin/bitcoin/pull/6931 in Bitcoin Core introduced
an optimization that skips the expensive BIP30 duplicate coinbase check once
BIP34 is active *and* the chain actually contains the recorded activation block.
See the comment in that PR "//Only continue to enforce if we're below BIP34
activation height or the block hash at that height doesn't correspond."

btcd used to drop the check purely based on height. On a fork that lacks the
BIP34 activation block, that difference lets a duplicate coinbase slip through
consensus. This patch ports the missing pieces: we store the activation hash in
chain parameters and only disable BIP30 after we see that block on-chain.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a subtle consensus bug in btcd, a Bitcoin implementation. BIP30 prevents two blocks from having the same special 'coinbase' transaction ID, and BIP34 makes duplicate coinbase IDs practically impossible once it activates. btcd was skipping the BIP30 check based only on block height, but on an alternate chain that has not actually activated BIP34 at that height, a duplicate coinbase could slip through. The fix mirrors Bitcoin Core by also checking that the known BIP34 activation block hash is present on the current chain before disabling BIP30.

Recommended action

Review and merge the fix, then ensure all deployed btcd nodes are upgraded. Nodes running older code risk consensus divergence on chains that lack the BIP34 activation block. Consider backporting to supported release branches.

Security signals we found

01

Consensus-rule divergence from Bitcoin Core

02

BIP30 duplicate-coinbase check could be skipped incorrectly on alternate/forked chains

03

Potential for duplicate transaction IDs if exploited

04

Fix mirrors Bitcoin Core PR #6931 behavior

Risk score

Why this scored 72/100

Our methodology →
Potential impact 25/30
Exploitability 15/25
Stealth signal 10/15
Affected reach 10/15
Confidence 8/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.