Optionally pass BIP388 policy to displayaddress - #841
Draft
Sjors wants to merge 21 commits into
Draft
Conversation
Draft
Sjors
force-pushed
the
2026/08/display-address-bip388
branch
2 times, most recently
from
August 4, 2026 19:56
499c52a to
9223771
Compare
Member
Author
|
Rebased to follow the approach in #842.
|
Sjors
force-pushed
the
2026/08/display-address-bip388
branch
from
August 4, 2026 20:59
9223771 to
c2ac62c
Compare
Member
Author
The sort in sortedmulti occurs only during script expansion. Keep the pubkeys in the order that they were provided to the parser.
For BIP388 policies, we will need to know wht index of each key expression, so keep track of them explicitly with a key expression index stored in each PubkeyProvider. This also mirrors what Bitcoin Core does for descriptors.
The derivation path should be parsed and validated for correctness, not just copied directly into a pubkey provider.
get_bip388_template returns the descriptor as a BIP 388 Wallet Descriptor Template string. get_pubkey_providers returns all of the pubkey providers from the descriptor, in the same order as the placeholders in the bip388 template. Callers can get the strings for the key information vector by calling PubkeyProvider.to_string_no_deriv()
After a descriptor is registered, we want to return to the caller some information about the registration. RegisteredDescriptor is a class that contains the name, the descriptor, the device type, and any data that the device returned in response to the registration. This class can be de/serialized from/to a string.
Adds registerdescriptor CLI command and its handlers. Adds register_descriptor to HardwareWalletClient with boilerplate implementation.
BitBox01, Trezor, and Keepkey do not support registering descriptors. Implement the function as a throw.
Add a helper that selects a receive or change branch and address index without mutating the original descriptor.
Accept a serialized registered descriptor, address index, and change flag, then request that address from the selected device.
Extend the generic descriptor registration test to display address index 7 from the registered policy.
Reconstruct the wallet policy from the registered descriptor, then display the selected receive or change address.
Derive the selected wsh(sortedmulti()) policy address and display it through the existing multisig command. Approve descriptor enrollment in the simulator and iterate over its multisig path mapping values when confirming enrollment.
Use the registered descriptor name to request the selected receive or change address.
Move BIP388 policy translation into a helper without changing registration behavior.
Translate the registered policy into a BitBox02 script configuration and display the selected receive or change address.
Sjors
force-pushed
the
2026/08/display-address-bip388
branch
from
August 6, 2026 08:01
c2ac62c to
c2b14d1
Compare
Member
Author
|
Rebased and now using Note that ColdCard edge firmware has more broad policy support, but this PR doesn't but this PR doesn't switch to that. This might be worth doing once we add MuSig2. |
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 builds on #842 and adds address display for registered BIP388
descriptor policies.
displayaddressaccepts:RegisteredDescriptorregistration returned byregisterdescriptor(introduced by Addregisterdescriptorscommand for registering a descriptor with a device #842)A generic device test registers the simple multisig policy introduced by
#842 and then displays address index 7. Device support is added one
device per commit.