Trim input amount explanations duplicated outside _verify_input_amounts()
What changed, and why it matters
This commit only removes explanatory comments from two places in the code. No program logic, validation checks, or security behavior changed. It is a documentation cleanup, not a security fix.
No action needed; this is a non-functional comment-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes duplicated explanatory text inside the docstring of PSBTInputAmountVerificationError and shortens a comment for UNCOMMITTED_AMOUNT_SCRIPT_TYPES. The actual list of script types and the _verify_input_amounts() method are untouched. No code paths or security decisions were modified.
Changed components
src/seedsigner/models/psbt_parser.pyInspect captured patch +2 / −8
### src/seedsigner/models/psbt_parser.py
@@ -106,12 +106,7 @@ class PSBTOutputOwnershipContradictionError(PSBTVerificationError):
class PSBTInputAmountVerificationError(PSBTVerificationError):
"""
An input's declared amount could not be verified, so the fee this device would display
- cannot be trusted. See PSBTParser._verify_input_amounts().
-
- Segwit inputs carrying only a witness_utxo are deliberately NOT rejected: there the
- sighash commits the amount, so a lie invalidates the signature rather than burning
- funds. _verify_input_amounts() covers why the residual risk (CVE-2020-14199) is accepted
- rather than warned about.
+ cannot be trusted.
"""
pass
@@ -168,8 +163,7 @@ class PSBTParser():
# just stops getting cache hits once the cache is full.
MAX_CACHED_DERIVATIONS = 1000
- # Input types whose sighash does NOT commit to the input amount. A lie about the
- # input amount still allows a valid signature, so these inputs must supply a non_witness_utxo.
+ # Input types whose sighash does NOT commit to the input amount.
UNCOMMITTED_AMOUNT_SCRIPT_TYPES = [None, "p2pkh", "p2sh"]
# Warn when the fee exceeds this percentage of what is being sent (outputs other thanWhy this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.