Bitcoin Forum
January 09, 2026, 10:00:41 PM *
News: Due to a wallet-migration bug, you should not upgrade Bitcoin Core. But if you already did, there's no need to downgrade.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Watchonly for a migrated descriptor wallet  (Read 121 times)
.crypto (OP)
Member
**
Offline Offline

Activity: 140
Merit: 17


View Profile
December 27, 2024, 11:58:43 AM
Last edit: December 27, 2024, 08:21:22 PM by .crypto
Merited by ABCbits (1)
 #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?
nc50lc
Legendary
*
Offline Offline

Activity: 3024
Merit: 8221


Self-proclaimed Genius


View Profile
December 27, 2024, 02:30:21 PM
Merited by ABCbits (1)
 #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.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
.crypto (OP)
Member
**
Offline Offline

Activity: 140
Merit: 17


View Profile
December 27, 2024, 06:44:09 PM
Last edit: December 27, 2024, 08:24:47 PM by .crypto
 #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
nc50lc
Legendary
*
Offline Offline

Activity: 3024
Merit: 8221


Self-proclaimed Genius


View Profile
December 28, 2024, 03:24:40 AM
 #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

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3878
Merit: 7566


Just writing some code


View Profile WWW
December 29, 2024, 01:00:19 AM
 #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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!