mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-04 17:52:25 +01:00
Merge bitcoin/bitcoin#19602: wallet: Migrate legacy wallets to descriptor wallets
53e7ed075cdoc: Release notes and other docs for migration (Andrew Chow)9c44bfe244Test migratewallet (Andrew Chow)0b26e7cdf2descriptors: addr() and raw() should return false for ToPrivateString (Andrew Chow)31764c3f87Add migratewallet RPC (Andrew Chow)0bf7b38bffImplement MigrateLegacyToDescriptor (Andrew Chow)e7b16f925aImplement MigrateToSQLite (Andrew Chow)5b62f095e7wallet: Refactor SetupDescSPKMs to take CExtKey (Andrew Chow)22401f17e0Implement LegacyScriptPubKeyMan::DeleteRecords (Andrew Chow)35f428fae6Implement LegacyScriptPubKeyMan::MigrateToDescriptor (Andrew Chow)ea1ab390e4scriptpubkeyman: Implement GetScriptPubKeys in Legacy (Andrew Chow)e664af2976Apply label to all scriptPubKeys of imported combo() (Andrew Chow) Pull request description: This PR adds a new `migratewallet` RPC which migrates a legacy wallet to a descriptor wallet. Migrated wallets will need a new backup. If a wallet has watchonly stuff in it, a new watchonly descriptor wallet will be created containing those watchonly things. The related transactions, labels, and descriptors for those watchonly things will be removed from the original wallet. Migrated wallets will not have any of the legacy things be available for fetching from `getnewaddress` or `getrawchangeaddress`. Wallets that have private keys enabled will have newly generated descriptors. Wallets with private keys disabled will not have any active `ScriptPubKeyMan`s. For the basic HD wallet case of just generated keys, in addition to the standard descriptor wallet descriptors using the master key derived from the pre-existing hd seed, the migration will also create 3 descriptors for each HD chain in: a ranged combo external, a ranged combo internal, and a single key combo for the seed (the seed is a valid key that we can receive coins at!). The migrated wallet will then have newly generated descriptors as the active `ScriptPubKeyMan`s. This is equivalent to creating a new descriptor wallet and importing the 3 descriptors for each HD chain. For wallets containing non-HD keys, each key will have its own combo descriptor. There are also tests. ACKs for top commit: Sjors: tACK53e7ed075cw0xlt: reACK53e7ed075cTree-SHA512: c0c003694ca2e17064922d08e8464278d314e970efb7df874b4fe04ec5d124c7206409ca701c65c099d17779ab2136ae63f1da2a9dba39b45f6d62cf93b5c60a
This commit is contained in:
@@ -341,6 +341,7 @@ BASE_SCRIPTS = [
|
||||
'feature_dirsymlinks.py',
|
||||
'feature_help.py',
|
||||
'feature_shutdown.py',
|
||||
'wallet_migration.py',
|
||||
'p2p_ibd_txrelay.py',
|
||||
# Don't append tests at the end to avoid merge conflicts
|
||||
# Put them in a random line within the section that fits their approximate run-time
|
||||
|
||||
Reference in New Issue
Block a user