forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin#29130: wallet: Add
createwalletdescriptor
and `gethdk…
…eys` RPCs for adding new automatically generated descriptors 746b6d8 test: Add test for createwalletdescriptor (Ava Chow) 2402b63 wallet: Test upgrade of pre-taproot wallet to have tr() descriptors (Ava Chow) 460ae1b wallet, rpc: Add createwalletdescriptor RPC (Ava Chow) 8e1a475 wallet: Be able to retrieve single key from descriptors (Ava Chow) 85b1fb1 wallet: Add GetActiveHDPubKeys to retrieve xpubs from active descriptors (Ava Chow) 73926f2 wallet, descspkm: Refactor wallet descriptor generation to standalone func (Andrew Chow) 54e74f4 wallet: Refactor function for single DescSPKM setup (Andrew Chow) 3b09d0e tests: Test for gethdkeys (Ava Chow) 5febe28 wallet, rpc: Add gethdkeys RPC (Ava Chow) 66632e5 wallet: Add IsActiveScriptPubKeyMan (Ava Chow) fa6a259 desc spkm: Add functions to retrieve specific private keys (Ava Chow) fe67841 descriptor: Be able to get the pubkeys involved in a descriptor (Ava Chow) ef67458 key: Add constructor for CExtKey that takes CExtPubKey and CKey (Ava Chow) Pull request description: This PR adds a `createwalletdescriptor` RPC which allows users to add new automatically generated descriptors to their wallet, e.g. to upgrade a 0.21.x wallet to contain a taproot descriptor. This RPC takes 3 arguments: the output type to create a descriptor for, whether the descriptor will be internal or external, and the HD key to use if the user wishes to use a specific key. The HD key is an optional parameter. If it is not specified, the wallet will use the key shared by the active descriptors, if they are all single key. For most users in the expected upgrade scenario, this should be sufficient. In more advanced cases, the user must specify the HD key to use. Currently, specified HD keys must already exist in the wallet. To make it easier for the user to know, `gethdkeys` is also added to list out the HD keys in use by all of the descriptors in the wallet. This will include all HD keys, whether we have the private key, for it, which descriptors use it and their activeness, and optionally the extended private key. In this way, users with more complex wallets will be still be able to get HD keys from their wallet for use in other scenarios, and if they want to use `createwalletdescriptor`, they can easily get the keys that they can specify to it. See also bitcoin#26728 (comment) ACKs for top commit: Sjors: re-utACK 746b6d8 furszy: ACK 746b6d8 ryanofsky: Code review ACK 746b6d8, and this looks ready to merge. There were various suggested changes since last review where main change seems to be switching `gethdkeys` output to use normalized descriptors (removing hardened path components). Tree-SHA512: f2849101e6fbf1f59cb031eaaaee97af5b1ae92aaab54c5716940d210f08ab4fc952df2725b636596cd5747b8f5beb1a7a533425bc10d09da02659473516fbda
- Loading branch information
Showing
16 changed files
with
775 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.