Post
Topic
Board Bitcoin Technical Support
Re: [Bitcoin Knots] porting an old wallet and 2 laptop airgap setup
by
takuma sato
on 23/08/2025, 04:57:13 UTC
So there is a "migrate" option? you just click "restore", then click "migrate" and you are set?
Yes, you should see the restored wallet's name in Migrate.
But take note that if the wallet contains a lot of private keys that are not derived from an HDkey, it could take a while for the migrate to finish.
And also, your wallet will now start to use new active descriptors for the new addresses that you'll request but it will still retain its old keys.

-snip- And to create the watch-only wallet, what is the workflow compared to Core? I remember reading a tutorial but im not sure now, you have to dumpprivkeys or something, but I don't get it since I only want to export the public keys into the watch-only wallet.
Yes same as Core.
Basically; create a descriptor wallet with "disable private keys" option, them import your public descriptors (with xpub) to it via importdescriptors command.
You can easily test this by installing the software itself and start it in RegTest (--regtest) and preferably pointed to a temp datadir (--datadir=<path>).

As for the tutorial, here's one by TraChang: /index.php?topic=5392824.0 (for HD descriptor wallets)
If you want it to have all four available script types, you must also import the receiving and change descriptors of the other three script types from the cold-storage wallet.

But for old wallets with "Just a Bunch of Keys" this will be a tedious task as you'll have to import each public key as single key descriptor,

Example single key descriptors (should show in listdescriptors after migrate):
pkh(03544894cbe2a7bed80948846d41d46ab37ea9cb437bd2581011108bee120fc67c)
pkh(02146dd1c325050cc6869eff1dd88208d222e74c374aad9753bbbf2a8441bd2ed9)
pkh(03957f7bd48709d8fdcf326425ef16ff677472bb6f0a0ec96ac263e96b7eb743d3)

example import to watch-only wallet:
Code:
importdescriptors "[{\"desc\": \"pkh(03544894cbe2a7bed80948846d41d46ab37ea9cb437bd2581011108bee120fc67c)#p6xx8tek\",\"label\": \"Key1\",\"timestamp\": \"now\"},{\"desc\": \"pkh(02146dd1c325050cc6869eff1dd88208d222e74c374aad9753bbbf2a8441bd2ed9)#qxxda7ux\",\"label\": \"Key2\",\"timestamp\": \"now\"},{\"desc\": \"pkh(03957f7bd48709d8fdcf326425ef16ff677472bb6f0a0ec96ac263e96b7eb743d3)#59fu36gk\",\"label\": \"Key3\",\"timestamp\": \"now\"}]"

For each of the descriptors' checksum in the import command above (e.g.: #p6xx8tek),
I just did the "lazy method" of putting a placehodler of "#00000000" and let Core/Knots show me the correct checksum in respective order.
Then I edit those placeholders with the correct checksum.

Lastly, if you're doing it by batch, once you import the last descriptor, replace \"timestamp\": \"now\" with \"timestamp\": 0 for it to rescan.
Alternatively, use rescanblockchain command.

What would happen if I used Bitcoin Knots to run the online node but use Sparrow wallet to manage private keys and craft the transactions (to be broadcasted on the Bitcoin Knots node)? I mean, since it's an old wallet.dat, will Sparrow wallet software have any problems?

I still haven't tried with Knots btw. I just installed Debian and will try tomorrow syncing the Bitcoin Knots online node and then I have to install Debian again on another laptop for the offline airgap cold storage and decide if I use Knots of Sparrow for this. I assume I will end up using Knots.