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

txscript: recognize P2A witness program during script execution

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

73/100 · Adequate
txscript: recognize P2A witness program during script execution

In this commit, we modify the execution logic, such that the P2A witness
program doesn't appear as a unknown witness program version. For
execution, we just make sure the script passes.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit changes how btcd recognizes a new Bitcoin output type called 'pay-to-anchor' (P2A) when checking whether a transaction is allowed to spend it. Before the change, P2A outputs were treated as an unknown future witness version, which could cause btcd to reject valid P2A spends or behave differently from Bitcoin Core. The fix makes btcd explicitly accept P2A spends as valid 'anyone-can-spend' outputs, matching expected network rules. There is no direct evidence in the commit that this is a security bug, but inconsistent script validation between node implementations can lead to chain splits or transaction relay problems.

Recommended action

Review that the P2A detection constants and behavior exactly match the Bitcoin Core implementation and any relevant BIP/specification. Run the new tests and cross-validate P2A transaction acceptance against Bitcoin Core to avoid consensus divergence. Monitor for any follow-up commits that refine the rules.

Security signals we found

01

Script validation logic changed for a new witness program type

02

P2A outputs treated as anyone-can-spend with unconditional success path

03

Guard added to prevent P2SH-wrapped P2A from taking the success path

04

Test cases added for valid and invalid P2A spends

05

Potential consensus/standardness divergence risk if P2A rules differ from Bitcoin Core

Risk score

Why this scored 59/100

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