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

Merge pull request #2601 from vbrekher/fix/psbt-multi-a-finalizer

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

58/100 · Thin
Merge pull request #2601 from vbrekher/fix/psbt-multi-a-finalizer

psbt: fix multi_a taproot finalization
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This change fixes how btcd finalizes a specific type of Bitcoin Taproot smart contract called multi_a. Previously, the finalizer simply stacked signatures in the order they appeared in the PSBT file. For multi_a contracts, signatures must be placed in the exact reverse order of the public keys written into the script, and unused key slots need empty placeholders. If the order was wrong, the resulting transaction would be rejected by the Bitcoin network, effectively locking or breaking the spend. The patch adds parsing logic to recognize multi_a scripts and build the witness stack correctly.

Recommended action

Reviewers should verify that parseTaprootMultiA's template matching is strict enough for all intended multi_a variants, confirm that empty placeholder elements are valid for skipped CHECKSIGADD positions, and ensure no regression occurs for non-multi_a script-path spends. Downstream users who finalize multi_a PSBTs should upgrade.

Security signals we found

01

Incorrect witness ordering for multi_a tapscripts could produce invalid Bitcoin transactions

02

New parser enforces standard multi_a template and rejects unsupported CHECKSIGADD constructions

03

Duplicate and non-matching signatures now return ErrInvalidPsbtFormat

04

Insufficient signatures now return ErrNotFinalizable

05

Excess signatures are deterministically ignored rather than all included

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.