Repository navigation
Merge upstream: multisig output claim hardening + high fee warning - #469
Merged
Merged
Conversation
Names the input shape: a list of child indices below parent_key, which is what the cache is keyed on. A companion that takes a psbt entry's DerivationPath object follows; the two names then say which one a caller holds.
A multisig output lists one derivation path entry per cosigner. The output check verified only the first entry claiming this seed against the committed script, so a second claim of ours whose key the script has no use for went unreported when listed behind our real entry or in the place of another cosigner's entry (which keeps the entry count at n and passes the surplus count). Every entry claiming this seed is now held to the script. To feed that, the ownership scan keeps every entry it proved per input and output, as the psbt's own DerivationPath objects, instead of the first one's path. _derive_with_cache_via_derivation_path is added beside the index-taking primitive for callers holding such an entry; it reads only the entry's path, since the single-sig rebuild and the multisig fallback derive at entries carrying a foreign fingerprint on purpose. change_data keeps the index-list path the views read.
Co-authored-by: alvroble <50918598+alvroble@users.noreply.github.com>
Both PSBTOverviewView and PSBTMathView asked the parser whether the fee was high, and the overview asked twice (once for the screen, once for routing). Each call re-summed the outputs through psbt.tx, which rebuilds the whole transaction on every access. The totals it depends on are all fixed by the end of parse(), so compute it there once and store it as is_high_fee, the same way the other totals are exposed. has_high_fee() stays as the computation itself.
…warning [Feature] Warning Screen for High Tx Fees
…claims [security] Store multiple verified derivation path entries per input/output; reject all decoy keys
Brings in SeedSigner#1044 (hold every claim of ours on a multisig output to its script) and SeedSigner#722 (warn when the fee is high relative to what is being sent). Conflict resolution, keeping the fork's behaviour: - verified_[input|output]_derivation_paths adopt upstream's List[List[DerivationPath]] shape; the fork's can_verify_derivations (WIF/BIP38/seedless pre-parse) and root_path (smartcard account xpub) handling are kept. _derive_with_cache_via_derivation_path gains an optional root_path so account-relative derivation keeps working. - Upstream's PSBT*Error classes map onto the fork's InvalidPSBTError + RejectCode (FORGED_OUTPUT_OWNERSHIP, SURPLUS_DERIVATIONS, ...). - High fee: upstream's PSBTHighFeeWarningView runs first in post_overview_destination, then continues into the fork's risk warning / identify-change flow. The fork's HIGH_FEE risk text is suppressed when the dedicated high fee screen has already been shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges the 9 new commits from
SeedSigner/seedsignerdev:How the conflicts were resolved
All conflicts were in the PSBT parser, views, parser tests and screenshot generator. The fork's behaviour is kept throughout:
List[List[DerivationPath]]shape, so every claim of ours on a scope is kept and checked, not just the first one. The fork'scan_verify_derivations(WIF, BIP38 and the seedless multisig pre-parse) androot_path(smartcard account xpub) handling are unchanged._derive_with_cache_via_derivation_pathtakes an optionalroot_pathso account-relative derivation still works._derive_with_cacheis renamed to_derive_with_cache_via_indiceseverywhere, to match upstream.PSBT*Errorclasses map onto the fork'sInvalidPSBTError+RejectCode(FORGED_OUTPUT_OWNERSHIP,SURPLUS_DERIVATIONS). The fork does its mixed-derivation-map check in_verify_claim_shapes, so upstream's copy of that check is dropped.HIGH_FEEfires when the fee is ≥10% of the inputs; upstream's fires when the fee is >25% of the outputs, not counting change. Both are kept:PSBTHighFeeWarningView(dire warning) is the first step inpost_overview_destination. It then continues into the fork's own warning screens and the identify-change / no-change / math flow.HIGH_FEEline is left out ofPSBTRiskWarningViewso the fee isn't warned about twice.HIGH_FEE_RATEstill shows.raises_rejectstyle, including the third decoy placement (the decoy replacing another cosigner's entry) and the stranger-padding case.test_flows_smartcard_hardwareis updated for the new list shape.Testing
test_psbt_parser.py+test_psbt_test_suite.py: 918 passed (with the pinnedembit==0.8.0).devin the same environment: 5 l10n tests (local translations checkout), plustest_shipped_json_is_plausibleandtest_real_connector_has_satodime_ndef_v2.Follow-up
The new strings ("High Fee!" and its body text) still need fork translations.
🤖 Generated with Claude Code