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

Cover all generated witness PSBTs

Public commit record

What the developer wrote

Authored by rockstardev

45/100 · Thin
Cover all generated witness PSBTs
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit changes how BTCPay Server decides whether a Bitcoin transaction input is a SegWit (witness) type when building PSBTs (Partially Signed Bitcoin Transactions). Previously the code only recognized three specific SegWit formats: native SegWit pay-to-pubkey-hash, native SegWit pay-to-script-hash, and Taproot. The new code uses a broader check that covers any script type classified as a witness script, including possible future SegWit versions. It also adds calls to fill in the 'witness UTXO' field in two wallet controller flows that previously did not do so. The practical effect is to make PSBTs more complete and compatible with future Bitcoin upgrades, and to reduce the chance that a wallet or signer will fall back to less secure non-witness data handling.

Recommended action

Treat as a hardening/compatibility fix. Review whether other PSBT creation paths in the codebase also need AddWitnessUtxoToSegwitInputs(), and verify that downstream signers/hardware wallets handle generic ScriptType.Witness inputs correctly. No immediate incident response is indicated, but the change should be included in release notes as a robustness improvement.

Security signals we found

01

Broadens SegWit detection from a fixed allow-list to any ScriptType.Witness, mitigating future-version compatibility issues

02

Adds missing WitnessUtxo population in two wallet PSBT creation paths

03

Witness UTXO data reduces reliance on NonWitnessUtxo (full previous transaction) for SegWit inputs, which is a known PSBT hardening recommendation

04

Test coverage added for a future witness version (OP_2 witness program)

Risk score

Why this scored 57/100

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