-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wallet: reenable sethdseed for descriptor wallets #29054
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
Conversation
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`
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
EDIT: deleted comment intended for #29136, which replaces this PR |
Superseded by #29136 |
Enable
sethdseed
for descriptor wallets. To be able to usecreatewalletdescriptor
with the other address types, we need a way to change the wallet extended key, and sosethdseed
has 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