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

docs: clarify BIP34 rules and fix related test

Public commit record

What the developer wrote

Authored by jrakibi

100/100 · Strong
docs: clarify BIP34 rules and fix related test

According to BIP34, the coinbase scriptSig must start with a push of
the block height, which already supersedes the lower bound of 2 bytes.

We keep EMPTY_COINBASE producing a 0-byte scriptSig for backward
compatibility with PSBT. Add a comment explaining this behavior.

Also update a test failing due to the new validation rule
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit is a documentation and test fix, not a security patch. It adds a comment explaining that an 'empty coinbase' helper produces a 0-byte scriptSig that is technically invalid under Bitcoin consensus rules (which require 2-100 bytes), but is kept for backward compatibility in PSBT workflows where the scriptSig is filled in later. It also re-enables and updates a previously ignored unit test to use a valid 2-byte coinbase scriptSig.

Recommended action

No security action required. Reviewers may consider whether the EMPTY_COINBASE helper's invalid-by-default state could be misused, but the commit explicitly documents this and it is not a new issue.

Security signals we found

01

Documentation of consensus-invalid helper (EMPTY_COINBASE)

02

Test fix for BIP34 coinbase scriptSig length rule

03

No functional code change to validation or consensus logic

Risk score

Why this scored 12/100

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