achow101
commented at 8:00 pm on December 11, 2023:
member
Enable sethdseed for descriptor wallets. To be able to use createwalletdescriptor with the other address types, we need a way to change the wallet extended key, and so sethdseed 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.
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.
achow101 renamed this:
Descriptor sethdseed
wallet: reenable sethdseed for descriptor wallets
on Dec 11, 2023
DrahtBot added the label
Wallet
on Dec 11, 2023
walletdb: Read and write activehdkey record8bb7a8b06f
wallet: Load activehdkey and its private keys
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.
2e840bcfc0
wallet: Store master key used for automatically generated descriptors2e2545c3a2
wallet: Retrieve active hd pubkey4569cb1666
key: Add constructor for CExtKey that takes CExtPubKey and CKey
We often need to construct a CExtKey given an CExtPubKey and CKey, so
implement a constructor that does that for us.
116a4252d6
wallet: Implement GetActiveHDPrivkey77408c0bdb
wallet, rpc: Add gethdkey RPC9b760c1049
descriptor: Be able to get the pubkeys involved in a descriptor5800b75a54
wallet: Always set WALLET_FLAG_GLOBAL_HD_KEY for new wallets4a82d27872
wallet, rpc: Check WALLET_FLAG_GLOBAL_HD_KEY in gethdkeybb02b9eb94
wallet: Automatically upgrade a wallet to have global hd keyce5495a4b2
tests: Test for gethdkey9ac7fe7da8
test: Test automatic upgrade of descriptor wallets to have hd key5679b4a885
wallet: Set global hd key for migrated wallets18879984d1
test: Also do backwards compat test with encrypted wallets
Best reviewed with `git show -w`
af3667a13c
walletdb: Check that unencrypted and crypted keys are mutually exclusive1bbbb732b5
test: Check that no unencrypted records persist after encrypting291cb32237
DrahtBot added the label
CI failed
on Dec 11, 2023
achow101 marked this as a draft
on Dec 12, 2023
achow101 force-pushed
on Dec 19, 2023
achow101 force-pushed
on Dec 19, 2023
test: add coverage for re-opening a downgraded encrypted wallet on master
The test creates a wallet on master, downgrades and encrypts the wallet.
Then, it tries to open it again on master.
db6b61e9e7
wallet: Refactor function for single DescSPKM setup
We will need access to a function that sets up a singular
DescriptorSPKM, so refactor this out of the multiple DescriptorSPKM
setup function.
f4ebc290b6
wallet, descspkm: Refactor wallet descriptor generation to static func7d724083ae
wallet: Write hd{c}key when HAS_HDKEY_RECORDS is set
If WALLET_FLAG_HAS_HDKEY_RECORDS is already set, then it's okay to just
use the hd{c}key records.
bd491ed67c
wallet: Re-enable sethdseed for descriptors wallets
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
840516148c
test: Test descriptor wallet sethdseed655c57bbe6
achow101 force-pushed
on Dec 19, 2023
DrahtBot removed the label
CI failed
on Dec 20, 2023
Wote74 approved
ryanofsky
commented at 4:39 am on December 23, 2023:
contributor
EDIT: deleted comment intended for #29136, which replaces this PR
achow101
commented at 0:06 am on January 6, 2024:
member
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-12-22 06:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me