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

Merge bitcoin/bitcoin#29843: policy: Allow non-standard scripts with -acceptnonstdtxn=1 (test nets only)

Public commit record

What the developer wrote

Authored by merge-script

100/100 · Strong
Merge bitcoin/bitcoin#29843: policy: Allow non-standard scripts with -acceptnonstdtxn=1 (test nets only)

1176a20d5263d6ae7ff80398928a2a5b1a0ebd6a doc: add release note for -acceptnonstdtxn changes (Anthony Towns)
1df5910720495eb2e8e453fb40da222dd794424a validation: Add compile-time checks for consensus flags (Anthony Towns)
425115713c5e37e78c9051b1b0a997ad62067ec8 validation: Check only (potential) block script flags when -acceptnonstdtxn is set (Anthony Towns)
703ebdf9de87ffb6010d89e3f0bd49e3c6cdb030 validation: Be explicit about whether CheckInputScripts is for block/mempool (Anthony Towns)
81ef18236fc74913344bd9e28b1e27a50a4e3ae7 tests: test tx rejection for both -acceptnonstdtxn=0 and 1 (Anthony Towns)
9b6342e5d295e337791984af2d42681d9c8e08bb tests: in p2p_segwit, check non-mandatory errors with -acceptnonstdtxn=0 node (Anthony Towns)

Pull request description:

This PR changes `-acceptnonstdtxn=1` so that it also skips the non-mandatory script checks, allowing txs that (eg) use OP_NOPx or OP_SUCCESS into the mempool. This remains only available on test nets.

ACKs for top commit:
fjahr:
reACK 1176a20d5263d6ae7ff80398928a2a5b1a0ebd6a
instagibbs:
reACK 1176a20d5263d6ae7ff80398928a2a5b1a0ebd6a

Tree-SHA512: 6157072c98369d06642bd7383bfabe82a4054a1f204b7a669a90b01429a2104e8815bd20785b11910f1b4d578db11e8a5a71f7f043d1aad083ec120233c9690c
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change loosens transaction acceptance rules only on Bitcoin test networks when a special command-line option (-acceptnonstdtxn=1) is used. It lets developers test unusual or experimental scripts in the mempool, while still enforcing all consensus rules that protect real money. Main network behavior is unchanged, and the option is not available there.

Recommended action

No urgent action needed. This is an intentional testnet-only policy relaxation with defensive compile-time and runtime checks. Operators running test networks with -acceptnonstdtxn=1 should understand that their mempool will accept non-standard but consensus-valid transactions. Reviewers should verify that the new CONSENSUS_SCRIPT_VERIFY_FLAGS set and GetAllConsensusScriptFlags remain complete as future soft forks add flags.

Security signals we found

01

Relaxes mempool policy checks under an explicit opt-in testnet-only flag

02

Adds static_assert ensuring standard flags remain a superset of consensus flags

03

Adds runtime Assume checks tying block script flags to tracked consensus flags

04

Introduces explicit CheckInputScriptsFor enum to separate consensus vs standardness failure reporting

05

Changes error classification from NOT_STANDARD to TX_NOT_STANDARD/TX_CONSENSUS based on caller context

Risk score

Why this scored 22/100

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