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

blockchain: run BIP30 check at BIP0034Height

Public commit record

What the developer wrote

Authored by Boris Nagaev

76/100 · Adequate
blockchain: run BIP30 check at BIP0034Height

Sync the behaviour with Bitcoin Core.

See https://github.com/bitcoin/bitcoin/pull/6931

In Core, the BIP30 flag is cleared only if the previous block's ancestor chain
already contains the BIP34 activation block. For the activation block itself
(height = BIP0034Height), pindex->pprev->GetAncestor(BIP34Height) returns
nullptr, so the flag stays on and BIP30 is still enforced. In other words, Core
enforces BIP30 for the activation block and skips it starting with the following
block.
✓ 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 off-by-one bug in btcd's blockchain validation. BIP30 is a rule that prevents duplicate coinbase transactions, which could otherwise allow an attacker to overwrite existing Bitcoin funds. BIP34 later made duplicate coinbases impossible by requiring unique block heights in coinbase data. btcd was skipping the BIP30 duplicate check starting exactly at the BIP34 activation block, but Bitcoin Core still runs the BIP30 check for that one activation block. The change aligns btcd with Core by moving the skip point one block later, so the duplicate-coinbase check is still enforced at the BIP34 activation height.

Recommended action

Treat as a consensus-correctness fix worth backporting to maintained release branches. Nodes should upgrade to avoid potential chain-split risk if a block at the BIP34 activation height were crafted to trigger the divergent rule. Review whether any other height-based BIP activation checks have similar off-by-one discrepancies with Bitcoin Core.

Security signals we found

01

Consensus-rule divergence from Bitcoin Core

02

Off-by-one height comparison in validation logic

03

BIP30 duplicate-coinbase enforcement gap at BIP34 activation block

04

Added regression test for activation-height behavior

Risk score

Why this scored 60/100

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