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

psbt: reject conflicting input UTXOs

Public commit record

What the developer wrote

Authored by yyforyongyu

68/100 · Adequate
psbt: reject conflicting input UTXOs

Check witness and non-witness output descriptions for consistency before
using their value in fee calculation. Reuse the existing output lookup,
bounds check and comparison helper, and propagate conflicts as errors.

Cover matching descriptions, conflicting amounts and scripts, and an
invalid output index through the public fee API.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change tightens how a Bitcoin partial-signed transaction (PSBT) library calculates fees. Previously, if a PSBT input contained two different descriptions of the same unspent coin—one full transaction and one witness-only snapshot—the library would silently prefer the witness snapshot and ignore the other. That could let a malicious or buggy PSBT report a lower fee than the actual transaction would pay. The patch now requires both descriptions to match before using their value, and returns an error if they conflict or point to a non-existent output. The library still does not verify that the supplied coins are real or belong to the transaction, so callers must do that separately.

Recommended action

Review any downstream callers of GetTxFee or SumUtxoInputValues to ensure they handle the new error cases gracefully. Do not rely on this change as a substitute for validating that supplied UTXOs are real, unspent, and correctly signed; the commit explicitly leaves authentication to the caller. Consider adding integration tests for mixed witness/non-witness PSBT workflows.

Security signals we found

01

Inconsistent dual UTXO descriptions could cause incorrect fee reporting

02

Witness-only UTXO previously took precedence over full non-witness transaction data

03

Fee calculation now cross-validates witness and non-witness descriptions

04

Out-of-range previous output index now returns an error instead of panicking or being ignored

05

Caller is explicitly reminded that UTXO authentication remains their responsibility

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.