-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Update basic multisig test/docs to use multipath descriptor #23308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update basic multisig test/docs to use multipath descriptor #23308
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
|
Concept ACK on doc changes. Thanks for working on this! Some questions though: Should these doc changes also go in the descriptor BIP in addition to doc/descriptors.md? @achow101 |
ecbdd0b to
367d6a3
Compare
|
Rebased |
To prepare for returning multipath descriptors which will be a shorthand for specifying 2 descriptors, change ParseScript's signature to return a pair.
To prepare for multipath descriptors, have ParsePubkey return a pair of PubkeyProviders and have ParseScript be able to handle them.
Multipath specifiers are derivation path indexes of the form `<r;c>` used for specifying derivation paths for receiving and change descriptors. Only one multipath specifier is allowed per PubkeyProvider, and it must only contain two path indexes. This is syntactic sugar which is parsed into two distinct descriptors. One descriptor will have all of the `r` paths, the other all of the `c` paths. ParseKeypath will always return a pair of keypaths. If no multipath descriptor is provided, the second one will be a std::nullopt. The callers of this function are updated to deal with this case and return multiple PubkeyProviders. Their callers have also been updated to handle pairs of PubkeyProviders.
When given a descriptor which contins a multipath derivation specifier, a pair of descriptors will be returned.
When given a multipath descriptor, derive both the receiving and change descriptors. The derived addresses will be returned in an object consisting of 2 arrays. For compatibility, when given a single path descriptor, the addresses are provided in a single array as before.
Instead of applying internal-ness to all keys being imported at the same time, apply it on a per key basis. So each key that is imported will carry with it whether it is for the change keypool.
Multipath descriptors will be imported as two separate descriptors with the first one for receiving addreses, and the second for change addresses. When importing a multipath descriptor, 'internal' cannot be specified because of the implicit receive and change descriptors.
Multipath descriptors will be imported as two separate descriptors with the first for receiving addresses and the second for change. This mirrors importmulti.
Test that both importmulti and importdescriptors behave as expected when importing a multipath descriptor.
367d6a3 to
688c692
Compare
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
1 similar comment
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
|
Closing for now. This can be reopened or a new pull be created. |
This is on top of #22838, only my last commit should be considered here. This highlights how a basic multisig like our example can be cleaned up a bit with multipath descriptors. Also serves as some light additional testing for #22838