wallet: reenable sethdseed for descriptor wallets#29054
Closed
achow101 wants to merge 28 commits intobitcoin:masterfrom
Closed
wallet: reenable sethdseed for descriptor wallets#29054achow101 wants to merge 28 commits intobitcoin:masterfrom
achow101 wants to merge 28 commits intobitcoin:masterfrom
Conversation
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process. 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. |
The activehdkey record will now be loaded into the wallet as its own member variable. Since the private keys will always be in existing descriptors in the wallet, the key for the active hd key is also pulled out of those descriptors on loading.
We often need to construct a CExtKey given an CExtPubKey and CKey, so implement a constructor that does that for us.
Best reviewed with `git show -w`
This was referenced Dec 11, 2023
This was referenced Dec 12, 2023
This was referenced Dec 12, 2023
04657fa to
0369823
Compare
…ster The test creates a wallet on master, downgrades and encrypts the wallet. Then, it tries to open it again on master.
We will need access to a function that sets up a singular DescriptorSPKM, so refactor this out of the multiple DescriptorSPKM setup function.
If WALLET_FLAG_HAS_HDKEY_RECORDS is already set, then it's okay to just
use the hd{c}key records.
Descriptor wallets store an HD master key that is used for new automatically generated descriptors. sethdseed is an existing RPC that can be repurposed to allow the users to set that HD key whenever they want. Using sethdseed with a descriptor wallet sets the HAS_HDKEY_RECORDS flag. Also fixes the whitespace of sethdseed. Best to review this with --ignore-all-space
0369823 to
655c57b
Compare
Wote74
approved these changes
Dec 22, 2023
Contributor
|
EDIT: deleted comment intended for #29136, which replaces this PR |
Member
Author
|
Superseded by #29136 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Enable
sethdseedfor descriptor wallets. To be able to usecreatewalletdescriptorwith the other address types, we need a way to change the wallet extended key, and sosethdseedhas been updated and enabled for descriptor wallets. As with legacy wallets, when called without parameters, it will generate a new random master key for the wallet. It can also take a xprv and set that as the master key. It still takes a BIP 32 seed as WIF or as hex as we do for legacy wallets. The seed will be transformed into and stored as a BIP 32 extended key. The latter is to give us greater compatibility with other wallets which often produce non-WIF HD seeds.Split from #25907