I’m using Bitcoin Core version 28.0.0 and I recently switched my old wallet to a new descriptor wallet. I’ve got the new wallet.dat for the descriptor wallet stored safely. Now, I want to set up a watchonly wallet to monitor my funds.
So, I made a new wallet with all private keys turned off. I imported two descriptors using the wpkh command for Pay-to-witness-pubkey-hash scripts, one for incoming transactions and another for change.
Here’s the issue: since my wallet was merged from a legacy one, this new watchonly setup will only track future transactions. While that’s cool, I also need to include all my past transactions from the legacy wallet.
Is there a way to do this? Is there a descriptor that can bring in all the previous legacy transactions that I can import?
Creating a watchonly wallet after migrating to a descriptor wallet
4 replies 422 views
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#2Dec 16, 2023, 06:29 PM
Do you mean "migrated"?
If so, those migrated keys' descriptors should show among the results of listdescriptors command.
Copy all of your descriptors including the additional information and import all of those with importdescriptors command just like how you imported the previous two.
However, this will be a tedious task if your legacy wallet was not HD and you've previously used a lot of keys since each of your public/private keys are imported as "combo" descriptors.
In that case, you'll need to import all of those to track their past and future transactions.
Thank you for your help. Yes, I meant "migrated" and corrected it in the title, sorry for the confusion.
There were some errors when importing all the descriptors, I don't know why.
In the meantime, I asked "Copilot" and it told me that the command also works for addresses
I can even combine it to import all addresses from the legacy wallet at once.
This did the job, problem solved
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#4Dec 17, 2023, 03:23 AM
The error should indicate what went wrong including errors in the command/arg's syntax.
Yes, there's an addr descriptor to directly import addresses.
The difference of using the migrated combo(pubKey/prvKey) descriptor(s) is it works the same as your legacy wallet which includes all major script types per key (excluding TapRoot).
For reference here are the available descriptors in Bitcoin Core: https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#features
Set the timestamp as appropriate when importing, or force a rescan after importing with rescanblockchain. Either way, once a rescan completes, any historical transactions will be discovered and included.
Related topics
- Issue with Bitcoin Core Wallet after power outage 8
- Recovering a Bitcoin wallet and address 8
- Creating a list of non-zero wallets and their balances using Python 4
- CipherSeed: A Comprehensive Guide to Super-Secure Crypto Wallet Backups 5
- What derivation path does mm-gen wallet use? 3
- Looking for wallet software that supports custom P2SH redeem scripts? 19