Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible typos and grammar issues:
2026-11-29 08:11:35 |
|
Concept NACK, unless this is part of a larger end-to-end implementation (with some buy-in), like a GUI or RPC that actually uses this new method. But I also think that's premature. Wallet setup is a one-off thing, and it's not obvious what the best approach is. A Python utility is more flexible. A full c++ implementation is also likely to need a huge stack of commits, see e.g. Sjors#91 which only implements spending from an existing multisig wallet. So I think the better sequence is: 1.introduce a Python utility that helps the user construct and import a multisig descriptor Step (2) is where changes like this may be useful. |
That sequencing makes sense. Would exposing this via an RPC in the same PR address the "nothing uses it" concern, or do you specifically want the Python flow to exist first so the RPC surface is shaped by what that flow needs? |
Yes, but.
I think that's the better yes. |
Following the discussion on bitcoin#36143, this commit adds a python utility implementing the multisig setup flow tracked in bitcoin#35645 using available RPCs and implements work arounds for missing RPC or wallet features. Adds wallet creation and key generation step. The wallet cannot store a name for a key, so cosigner names live in the setup and are lost on import.
Following the discussion on bitcoin#36143, this commit adds a python utility implementing the multisig setup flow tracked in bitcoin#35645 using available RPCs and implements work arounds for missing RPC or wallet features. Adds wallet creation and key generation step. The wallet cannot store a name for a key, so cosigner names live in the setup and are lost on import.
|
Following the Python wizard #36325, which exercises the actual setup flow, the contract for It becomes a function that constructs ranged, multipath descriptors for bech32 and bech32m, as well as the unranged plain-key case createmultisig builds today. This fits the multisig setup process better because the descriptor is built up front and becomes the source of truth, and bech32m falls out naturally. By contrast, |
Step 1 is #36325. |
In general it is, we want the GUI to be calling a utility function like this one to construct the descriptors for import. We already have a
I think this is entirely unnecessary. The RPC already exists, it should be modernized and refactored such that the GUI can use it too. |
e0b664f to
13fed1a
Compare
|
|
13fed1a to
f89c8dd
Compare
f89c8dd to
589f3fe
Compare
fametrano
left a comment
There was a problem hiding this comment.
Concept ACK
rxbryan wrote that the descriptor is built up front and becomes the source of truth for the setup, so I checked that string against code outside Core, on 589f3fe. Over 98 cases (2 to 6 account xpubs with origin, every threshold, 49 per output type), Core's string equals the descriptor I expected, checksummed by bip32-descriptors, a library I maintain, in 98 of 98. The library derives the same receive and change scriptPubKeys at indexes 0 to 4: 980 of 980, 490 of them Taproot.
The string still depends on the order the keys come in: the six orders of the test's three keys give six descriptors and six checksums per output type, with the same scriptPubKeys, so cosigners who enter the keys in a different order get descriptors that do not compare equal. Sorting canonical_keys before assembly gave one descriptor for all six orders, scriptPubKeys unchanged. Could the keys be sorted, or the header say that the string depends on their order?
The multisig setup flows need to assemble a descriptor from collected cosigner keys without hand-crafting the descriptor string, which today means bash interpolation with no validation of key forms, duplicates, or threshold. CreateMultisigDescriptor() takes a threshold, a list of key expressions with origin info, and an output type, and returns a ranged, multipath wsh(sortedmulti(...)) descriptor with checksum. Parsing is done by the existing internal ParsePubkey(); the setup-specific policy is applied here on top of it. Private key, missing origin info, keys that already carry a derivation, and duplicate keys are all rejected. The /<0;1>/* suffix is appended internally, so callers supply bare account xpubs only. Covered by unit tests in descriptor_tests.cpp. Part of the multisig wizard backend tracked in bitcoin#35645.
For taproot the key path is a MuSig2 aggregate of all n keys rather than a fixed or variable NUMS point: it cannot bypass the policy, since spending that way needs every signer, and it avoids the fingerprinting that a well-known internal key would cause. keys must be bare because derivation before aggregation cannot be expressed in a BIP 388 policy
sortedmulti and sortedmulti_a sort keys when building the script, and musig() sorts its participants when aggregating, so the key input order does not affect address generation but does affect the descriptor string. We sort the keys so descriptor string and checksum produced doesn't vary with key input order.
589f3fe to
753744f
Compare
|
Thanks @fametrano for the checks. |

The multisig setup flows need to assemble a descriptor from collected cosigner keys without hand-crafting the descriptor string, which today means bash interpolation with no validation of key forms, duplicates, or threshold.
CreateMultisigDescriptor() takes a threshold, a list of key expressions with origin info, and an output type, and returns a ranged, multipath wsh(sortedmulti(...)) descriptor with checksum.
Part of the multisig wizard tracking issue #35645.