bitcoin core quickest method legacy -> descriptor wallet migration
bitcoin core quickest method legacy -> descriptor wallet migration
Loading saved threads...
arrrrrg · External communityPost link
External question — Bitcoin Stack Exchange
Author: arrrrrg
Original post: https://bitcoin.stackexchange.com/questions/130713
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I had a power outage recently and realized my current setup needs to change.
The old ass laptop that I use for just bitcoin core needs to be retired. I've been running a pruned node on it forever. it's been OS updated recently and the blockchain is catching up once again. I'm thinking to move to Sparrow wallet synced to a Raspiblitz instance (over tor) and the have a method for importing the bitcoin core wallet via output descriptors.
However the few times I've tried to migrate the legacy wallet bitcoin core (v31 now) have complained about the process and demanded a blockchain re-index. ex:
[error] Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of a pruned node)
That's not really feasible even if I wanted to since this old machine is struggling even to catch up to the last week of being offline, nor do I even have the space on it anymore for a full blockchain.
So the question
is, how can I just migrate the legacy wallet -> descriptor one without needing a fully synced bitcoincore node ?
Before anyone suggests it I'd rather not sweep the keys and broadcast a transaction, this machine mostly stays offline / airgapped except via tor proxy.
Quote
Report
BlockchainFan445 · External communityPost link
External answer — Bitcoin Stack Exchange
Author: BlockchainFan445
Original post: https://bitcoin.stackexchange.com/a/130718
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
You dont need a fully synced node to migrate a legacy wallet to a descriptor wallet..
The problem comes from the wallet rescan, not the descriptor conversion itself. On a pruned node, Bitcoin Core cannot scan blocks that were already deleted, so it asks for -reindex.
The quickest method is:
Backup the legacy wallet
Create a descriptor wallet
Export descriptors / keys from the old wallet
Import them into the new wallet with "rescan": false
Example flow:
createwallet "newdesc" false false "" false true
Then from the legacy wallet:
listdescriptors true
Or export keys manually if needed.
Then import into the descriptor wallet:
importdescriptors '[{ "desc": "...", "timestamp": "now",
"active": true, "internal": false }]'
The important part:
use "timestamp": "now" or "rescan": false
That prevents Core from trying to scan old pruned blocks.
You will lose automatic historical transaction discovery on that machine, but the wallet structure itself migrates fine.
Quote
Report
Pol Espinasa · External communityPost link
External answer — Bitcoin Stack Exchange
Author: Pol Espinasa
Original post: https://bitcoin.stackexchange.com/a/130841
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
When migrating a Legacy wallet into a Descriptor wallet, the node tries to load the wallet by default after migrating. If the node is pruned below the wallet birthday it will be unable to load it. This is because the wallet might have some transactions in blocks that the node no longer has. So it is missing some wallet information.
Since
#35266
you can migrate the wallet without loading it by setting
load_wallet
argument to
False
.
This option is not yet available in an official release, but it is expected to be included in Bitcoin Core v32.0, which should be released around October/November.
Note: To use it before the v32.0 release you can compile Bitcoin Core's master branch, which already includes the feature. It is not recommended to run nodes with unofficial releases, so first be sure to manually backup the old wallet file, just in case.
Note that by using
load_wallet=False
the new wallet will still not be able to be loaded in the node anyway if it is pruned. The problem will remain the same, but at least the wallet will be able to be migrated. A non-pruned node will be needed to load the wallet.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Bitcoin Stack Exchange Author: BlockchainFan445 Source score (net votes, not local likes): -2 Original post: https://bitcoin.stackexchange.com/a/130718 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. You dont need a fully synced node to migrate a legacy wallet to a descriptor wallet.. The problem comes from the wallet rescan, not the descriptor conversion itself. On a pruned node, Bitcoin Core cannot scan blocks that were already deleted, so it asks for -reindex. The quickest method is: Backup the legacy wallet Create a descriptor wallet Export descriptors / keys from the old wallet Import them into the new wallet with "rescan": false Example flow: createwallet "newdesc" false false "" false true Then from the legacy wallet: listdescriptors true Or export keys manually if needed. Then import into the descriptor wallet: importdescriptors '[{ "desc": "...", "timestamp": "now", "active": true, "internal": false }]' The important part: use "timestamp": "now" or "rescan": false That prevents Core from trying to scan old pruned blocks. You will lose automatic historical transaction discovery on that machine, but the wallet structure itself migrates fine.
Checking account access…