|
Title: Watchonly for a migrated descriptor wallet Post by: .crypto on December 27, 2024, 11:58:43 AM I use Bitcoin Core v28.0.0 and just recently merged my legacy wallet to a new descriptor wallet standard. The new wallet.dat of the descriptor wallet will be stored at a save place. In order to keep track of my wallet, I would like to create a watchonly wallet.
I have created a new, empty wallet with private keys disabled. Next, I have imported two descriptors with the command Code: importdescriptors for wpkh (Pay-to-witness-pubkey-hash scripts), one with Code: "internal\": false, for the receiving addresses and Code: "internal\": true, for the change addresses.The problem: Because this is a merged legacy wallet, the new watchonly will only cover the new, future transactions. This is good, but I also want to cover all the history, legacy transactions included. How can I accomplish this? Is there a descriptor that covers all the legacy wallet transactions, that I can import? Title: Re: Watchonly for a merged descriptor wallet Post by: nc50lc on December 27, 2024, 02:30:21 PM I use Bitcoin Core v28.0.0 and just recently merged my legacy wallet to a new descriptor wallet standard. 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. Title: Re: Watchonly for a migrated descriptor wallet Post by: .crypto on December 27, 2024, 06:44:09 PM 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 Code: importdescriptors also works for addresses Code: importdescriptors '[{ "desc": "addr(ADDRESS)#HASH, "timestamp": UNIXTIME }]' I can even combine it to import all addresses from the legacy wallet at once. This did the job, problem solved :) Title: Re: Watchonly for a migrated descriptor wallet Post by: nc50lc on December 28, 2024, 03:24:40 AM There were some errors when importing all the descriptors, I don't know why. The error should indicate what went wrong including errors in the command/arg's syntax.In the meantime, I asked "Copilot" and it told me that the command Yes, there's an addr descriptor to directly import addresses.Code: importdescriptors also works for addressesThe 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 (https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#features) Title: Re: Watchonly for a migrated descriptor wallet Post by: achow101 on December 29, 2024, 01:00:19 AM The problem: Because this is a merged legacy wallet, the new watchonly will only cover the new, future transactions. This is good, but I also want to cover all the history, legacy transactions included. 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. |