Skip to content

Merge upstream: multisig output claim hardening + high fee warning - #469

Merged
3rdIteration merged 10 commits into
devfrom
merge-upstream-psbt-claims
Oct 6, 2026
Merged

3rdIteration merged 10 commits into
devfrom
merge-upstream-psbt-claims

Conversation

@3rdIteration

Copy link
Copy Markdown
Owner

Merges the 9 new commits from SeedSigner/seedsigner dev:

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:

  • Verified derivation paths now use upstream's List[List[DerivationPath]] shape, so every claim of ours on a scope is kept and checked, not just the first one. The fork's can_verify_derivations (WIF, BIP38 and the seedless multisig pre-parse) and root_path (smartcard account xpub) handling are unchanged. _derive_with_cache_via_derivation_path takes an optional root_path so account-relative derivation still works. _derive_with_cache is renamed to _derive_with_cache_via_indices everywhere, to match upstream.
  • Errors: upstream's PSBT*Error classes map onto the fork's InvalidPSBTError + 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 fee: the two checks measure different things. The fork's HIGH_FEE fires 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:
    • Upstream's PSBTHighFeeWarningView (dire warning) is the first step in post_overview_destination. It then continues into the fork's own warning screens and the identify-change / no-change / math flow.
    • If the dedicated high-fee screen was already shown, the fork's HIGH_FEE line is left out of PSBTRiskWarningView so the fee isn't warned about twice. HIGH_FEE_RATE still shows.
    • The overview and math screens mark the fee with upstream's " (!)".
  • Tests: upstream's new tests are ported to the fork's raises_reject style, including the third decoy placement (the decoy replacing another cosigner's entry) and the stranger-padding case. test_flows_smartcard_hardware is updated for the new list shape.

Testing

  • test_psbt_parser.py + test_psbt_test_suite.py: 918 passed (with the pinned embit==0.8.0).
  • Full suite: 2535 passed, 7 failed. All 7 also fail on dev in the same environment: 5 l10n tests (local translations checkout), plus test_shipped_json_is_plausible and test_real_connector_has_satodime_ndef_v2.
  • Not tested on hardware or with a real smartcard. The smartcard parser tests skip without a reader.

Follow-up

The new strings ("High Fee!" and its body text) still need fork translations.

🤖 Generated with Claude Code

kdmukai and others added 10 commits September 19, 2026 15:41
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>
@3rdIteration
3rdIteration merged commit 1dc57f6 into dev Oct 6, 2026
32 checks passed
@3rdIteration
3rdIteration deleted the merge-upstream-psbt-claims branch October 6, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants