MuSig2#794
Draft
Sjors wants to merge 20 commits into
Draft
Conversation
4 tasks
Member
Author
|
Cherry-picked the latest version of all the independent PRs. Other than displaying an address this should be all you need to use MuSig2. |
This was referenced Aug 1, 2025
Open
5dd2951 to
ec2a844
Compare
Member
Author
|
Somehow I thought I already implemented sending, but it seems I didn't. Done now. Tested with key path as well as script path. |
This was referenced Sep 5, 2025
Closed
The rolling nightly toolchain has drifted past what trezor-firmware core/v2.9.6 supports: recent nightlies reject its reexport_test_harness_main attribute with error E0658. Pin the nightly to 2025-04-15, matching the firmware's own shell.nix. Co-authored-by: Claude (Fable 5) <noreply@anthropic.com>
cache_unsigned_tx_pieces() decided whether to call setup_from_tx() by checking if self.tx is None. But it never is: __init__ sets it to an empty CTransaction. So for PSBTv2, which has no global transaction, setup_from_tx() replaced the deserialized tx version and fallback locktime with the empty transaction's defaults (version 1, locktime 0). This silently modified any PSBTv2 transaction with a different version or locktime, such as those made by Bitcoin Core (version 2 and an anti-fee-sniping locktime), invalidating signatures created before the round-trip through HWI. Check the PSBT version instead, as the docstring already describes. Co-authored-by: Claude (Fable 5) <noreply@anthropic.com>
Also drops Python 3.6 dataclasses leftover.
Member
Author
|
Did a complete overhaul to match Sjors/async-hwi#2 (though just Ledger, we'll leave ColdCard for a followup). Much vibed, but manually tested. I'll extract smaller patches as separate PR's later. This PR is orthogonal to #819, however I would prefer to use the newer Ledger app version from it, since it contains various MuSig2 related fixes. |
This was referenced Jul 3, 2026
The Ledger bitcoin app repos have moved: - new: from LedgerHQ/app-bitcoin-new to LedgerHQ/app-bitcoin - legacy: from LedgerHQ/app-bitcoin to LedgerHQ/app-bitcoin-legacy
Taken from LedgerHQ/app-bitcoin-new at 2.4.1 Conflicts: hwilib/devices/ledger.py Rename tx to psbt.
This adds support handling public nonces and partial signatures.
Co-authored-by: Claude (Opus 4.8) <noreply@anthropic.com>
Co-authored-by: Claude (Opus 4.8) <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.
This is based on:
(I marked these as draft, because I need to rebase them and make some adjustments to match the approach here - after that I'll redo this branch as a series of merges followed by individual commits)
To be used with, and developed in parallel to:
The general workflow is:
tr(musig(...))descriptorbitcoin-cli registerpolicy "MuSigTest"(Core callshwi registerand stores the hmac)bitcoin-cli walletdisplayaddress(Core callshwi displayaddress --policy-name ...)bitcoin rpc send '[{"bc1p...": 0.000001}]' fee_rate=1hwi signtx --policy-name ...per device), round 2 collects partial signatures, then Core aggregates and broadcastswalletprocesspsbtresumes the dancehwi signtx/walletprocesspsbtround-tripping by hand still works if you prefer to drive the rounds yourselfTo work around a Ledger quirk, we stash other participants' pubnonce and partial sig before sending it to the device and merge them back afterwards.
Works with the Ledger Bitcoin app 2.4.1, i.e. this does not depend on #819.
CI runs an end-to-end scenario (register → display → fund → 2-round spend → confirm) against a bitcoind built from the Core branch above, plus device tests for register/displayaddress against speculos.
Potential follow-ups: