Author

Topic: Watchonly for a migrated descriptor wallet (Read 112 times)

member
Activity: 140
Merit: 16
December 29, 2024, 11:12:50 AM
#6
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.
Thank you achow101 for your feedback. I checked the date of my first transaction and choose a date 3 months before that, then transferred it to unixtime and used that date for the command, I only imported the wpkh descriptors. At first I was surprised that the legacy transactions didn't show up in the history. Then I checked for the receiving addresses and change addresses of the descriptors and found out, that these are new addresses - so I assumed that the legacy transactions must be inside some other descriptors. I tried to import the combo descriptors as proposed by nc50lc , but unfortunately the import was not successful, I can't remember the error code but I assume I made a mistake with the command syntax.

For the average user it is not easy to accomplish this task - but I'm learning Smiley
staff
Activity: 3458
Merit: 6793
Just writing some code
December 28, 2024, 08:00:19 PM
#5
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.
legendary
Activity: 2646
Merit: 6681
Self-proclaimed Genius
December 27, 2024, 10:24:40 PM
#4
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
Code:
importdescriptors
also works for addresses
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
member
Activity: 140
Merit: 16
December 27, 2024, 01:44:09 PM
#3
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  Smiley
legendary
Activity: 2646
Merit: 6681
Self-proclaimed Genius
December 27, 2024, 09:30:21 AM
#2
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.
member
Activity: 140
Merit: 16
December 27, 2024, 06:58:43 AM
#1
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?
Jump to: