Bitcoin Forum
September 06, 2025, 12:58:44 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Bitcoin Knots] porting an old wallet and 2 laptop airgap setup  (Read 284 times)
takuma sato (OP)
Hero Member
*****
Offline Offline

Activity: 737
Merit: 609


View Profile
May 25, 2025, 03:06:35 PM
Merited by ABCbits (2)
 #1

If you wanted to port an old 2013-created wallet into a Bitcoin Knots wallet, do you need to convert the wallet into a new format, or it is fully compatible?

Im asking because Bitcoin Core requires that you convert the wallet format into the new format. For now, it is simply solved by using "File->Restore" but eventually Bitcoin Core will deprecate the old wallets to a point you need to do some extra stuff due the new descriptor wallet. I wanted to use 2 Bitcoin Core instances, one for offline, and other for online, and use the PSBT file to move the signed transaction into the online wallet. But since I want to support Bitcoin Knots now, I was wondering how do to this on that software. If anyone knows let me know.
nc50lc
Legendary
*
Offline Offline

Activity: 2898
Merit: 7562


Self-proclaimed Genius


View Profile
May 26, 2025, 04:56:41 AM
Merited by pooya87 (3), ABCbits (2), apogio (1)
 #2

-snip- But since I want to support Bitcoin Knots now, I was wondering how do to this on that software. If anyone knows let me know.
I've tested this and it's pretty much the same.
It has the same options to Restore and Migrate; PSBT workflow is also the same.

The "extra stuff" is just one step after restore: migrate. (at least in the current version)
I'd recommend to do this now if you're planning to do that later though, since you wont be able to directly restore a legacy wallet in the next version of Bitcoin Core.
That's when you'll have to do more extra steps.

What isn't clear is if Knots will follow Core's removal of legacy wallet. (which is now merged and will be applied to the next release)

apogio
Legendary
*
Offline Offline

Activity: 910
Merit: 1877


Duelbits.com - Rewarding, beyond limits.


View Profile WWW
May 26, 2025, 05:07:55 AM
Last edit: May 27, 2025, 04:57:12 AM by apogio
 #3

What isn't clear is if Knots will follow Core's removal of legacy wallet. (which is now merged and will be applied to the next release)

Alright, that's exactly my chance for grabbing fresh knowledge.
Since Knots is a Core's fork, can't they simply follow totally separated paths? And if so, shouldn't Knots notify (via Github) about their intentions in matters like this? In short, what I 'm asking is, what is the process of Knots taking action and doing commits that are relevant to what Core does? If Core has a feature A, that they wanna merge in the upcoming release, what does Knots need to do about it?

nc50lc
Legendary
*
Offline Offline

Activity: 2898
Merit: 7562


Self-proclaimed Genius


View Profile
May 26, 2025, 12:15:26 PM
 #4

What isn't clear is if Knots will follow Core's removal of legacy wallet. (which is now merged and will be applied to the next release)
In short, what I 'm asking is, what is the process of Knots taking actiong and doing commits that are relevant to what Core does? If Core has a feature A, that they wanna merge in the upcoming release, what does Knots need to do about it?
I'm also not sure, as the context of that quote implies.

The only clue that I found is it's mainly based from development in Core rather than directly to Knots. (check reference)
And the main developer is asking on how to to make its development more visible and not much reliant on the reference client.
Maybe we'll see a related PR or issue a few days/weeks from now.

Ref: github.com/bitcoinknots/bitcoin/discussions/128

apogio
Legendary
*
Offline Offline

Activity: 910
Merit: 1877


Duelbits.com - Rewarding, beyond limits.


View Profile WWW
May 27, 2025, 04:55:07 AM
 #5

I'm also not sure, as the context of that quote implies.

The only clue that I found is it's mainly based from development in Core rather than directly to Knots. (check reference)
And the main developer is asking on how to to make its development more visible and not much reliant on the reference client.
Maybe we'll see a related PR or issue a few days/weeks from now.

Ref: github.com/bitcoinknots/bitcoin/discussions/128

Thanks.
What surprised me is that I don't see any approved PR, by any member and I 'm only seeing commits by Luke. Am I wrong? Anyway, it's better to discuss it in another thread, perhaps I 'll open one within the week.

takuma sato (OP)
Hero Member
*****
Offline Offline

Activity: 737
Merit: 609


View Profile
May 27, 2025, 07:27:03 PM
 #6

-snip- But since I want to support Bitcoin Knots now, I was wondering how do to this on that software. If anyone knows let me know.
I've tested this and it's pretty much the same.
It has the same options to Restore and Migrate; PSBT workflow is also the same.

The "extra stuff" is just one step after restore: migrate. (at least in the current version)
I'd recommend to do this now if you're planning to do that later though, since you wont be able to directly restore a legacy wallet in the next version of Bitcoin Core.
That's when you'll have to do more extra steps.

What isn't clear is if Knots will follow Core's removal of legacy wallet. (which is now merged and will be applied to the next release)

So there is a "migrate" option? you just click "restore", then click "migrate" and you are set? 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.

As for legacy support, I think they should keep it. Make things as backwards compatible as possible.
nc50lc
Legendary
*
Offline Offline

Activity: 2898
Merit: 7562


Self-proclaimed Genius


View Profile
May 28, 2025, 04:09:29 AM
 #7

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.

takuma sato (OP)
Hero Member
*****
Offline Offline

Activity: 737
Merit: 609


View Profile
August 23, 2025, 04:57:13 AM
 #8

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. Im just not sure yet I understand all the steps. Is there someone that did a video tutorial or at least a tutorial of this process somewhere showing the different steps when using an old wallet format?
nc50lc
Legendary
*
Offline Offline

Activity: 2898
Merit: 7562


Self-proclaimed Genius


View Profile
August 24, 2025, 04:46:32 AM
 #9

-snip-
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)?
Do you mean use Bitcoin Knots as server?
If so, there shouldn't be any issue for using Knots in place of Core as "Bitcoin Core" server option.

Just enable "Bitcoin RPC server" option in the settings or add "server=1" to your bitcoin.conf file so it will create a '.cookie' file that Sparrow requires.

Quote from: takuma sato
I mean, since it's an old wallet.dat, will Sparrow wallet software have any problems?
This is where the question became confusing, do you mean loading the old wallet.dat to Sparrow?
Because you mentioned a wallet.dat file, yet, you intended to use Sparrow as the wallet and Knots as server.

The actual auto-setup that will happen is, Sparrow will create a descriptor wallet named "cormorant" in Knots for you that will contain your Sparrow wallet's watch-only descriptors (containing xpubs).
Any other old/new wallets it already has will not be affected nor required by using it as server for Sparrow.

takuma sato (OP)
Hero Member
*****
Offline Offline

Activity: 737
Merit: 609


View Profile
August 31, 2025, 03:54:27 AM
 #10

-snip-
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)?
Do you mean use Bitcoin Knots as server?
If so, there shouldn't be any issue for using Knots in place of Core as "Bitcoin Core" server option.

Just enable "Bitcoin RPC server" option in the settings or add "server=1" to your bitcoin.conf file so it will create a '.cookie' file that Sparrow requires.

Quote from: takuma sato
I mean, since it's an old wallet.dat, will Sparrow wallet software have any problems?
This is where the question became confusing, do you mean loading the old wallet.dat to Sparrow?
Because you mentioned a wallet.dat file, yet, you intended to use Sparrow as the wallet and Knots as server.

The actual auto-setup that will happen is, Sparrow will create a descriptor wallet named "cormorant" in Knots for you that will contain your Sparrow wallet's watch-only descriptors (containing xpubs).
Any other old/new wallets it already has will not be affected nor required by using it as server for Sparrow.

No, let's forget about Sparrow and keep things as basic as possible without adding additional layers of complexity (and for me having to trust another software is just that). Let's recap, this is what I want:

1) Laptop 1: Bitcoin Knots, fully synced. I need a watch-only wallet to broadcast transactions
2) Laptop 2: Bitcoin Knots, no blockchain, airgap. Wallet with keys sits there. I need to make the old 2013 wallet work there. Then create the watch-only wallet for the Laptop 1.

I need to learn how to use PSBT, so I can send a transaction from Laptop 2 to 1, using the GUI with Coin Control to select utxos. For this, I want to use testnet coins first. I will need to see how testnet works, I think I used it ages ago but don't remember.

Anyway, so how do I do this? In this thread there is some convoluted way where im going to need to go key by key? wtf. There is no other way? It's a 2013 wallet, but was used until 2015, so im not sure if it was converted to HD by the 2015 Core version which I think it was around when HD was introduced, or its just the same wallet. I also hope I can get the keys with their descriptions, since they are named to identify the source of funds (or where coins were sent at).

I need to know what im doing here and I don't have a clear gameplan yet of how to proceed.

nc50lc
Legendary
*
Offline Offline

Activity: 2898
Merit: 7562


Self-proclaimed Genius


View Profile
August 31, 2025, 05:25:02 AM
 #11

Quote from: takuma sato
It's a 2013 wallet, but was used until 2015, so im not sure if it was converted to HD by the 2015 Core version which I think it was around when HD was introduced
Do this:
  • Open Bitcoin Core (GUI)
  • Select the wallet in the drop-down menu if you have multiple wallets loaded.
  • Check the HD icon on the lower-right-hand side of Bitcoin Core, it's crossed-out if the selected wallet isn't HD.

Anyway, so how do I do this? In this thread there is some convoluted way where im going to need to go key by key? wtf. There is no other way?
For non-HD wallet; no, there's not other way but to import each public key to the watch-only wallet since those aren't derived from a single master key.
For HD wallet, you'll just need to import the parent descriptors (that has xpub) to the watch-only wallet.

takuma sato (OP)
Hero Member
*****
Offline Offline

Activity: 737
Merit: 609


View Profile
September 04, 2025, 02:49:36 PM
Last edit: September 04, 2025, 03:25:36 PM by takuma sato
 #12

Quote from: takuma sato
It's a 2013 wallet, but was used until 2015, so im not sure if it was converted to HD by the 2015 Core version which I think it was around when HD was introduced
Do this:
  • Open Bitcoin Core (GUI)
  • Select the wallet in the drop-down menu if you have multiple wallets loaded.
  • Check the HD icon on the lower-right-hand side of Bitcoin Core, it's crossed-out if the selected wallet isn't HD.

Anyway, so how do I do this? In this thread there is some convoluted way where im going to need to go key by key? wtf. There is no other way?
For non-HD wallet; no, there's not other way but to import each public key to the watch-only wallet since those aren't derived from a single master key.
For HD wallet, you'll just need to import the parent descriptors (that has xpub) to the watch-only wallet.

But if you use the Migrate option, doesn't it convert it to HD format? or the existing keys will still be non-HD derived so you would still need to manually import each existing public key?

I mean if I import the .json file (Import on the GUI or command importdescriptors) after doing the Migrate process, I will get what exactly?

Im just concerned it may not import all the public keys. Or if you use the Migrate option it will work even with the oldest keys? Because im not sure if in 2015 Core converted the wallet to HD. I remember some sort of updating of the wallet format, but I think the actual wallet.dat file was never update. So I think the wallet is non HD. So if it's a non-HD wallet, the Migrate option will not work? what then? Im assuming it just converts it to a modern HD wallet with descriptors, so I can just use that new converted wallet file and I can export this as a watch-only wallet easily, with the option listdescriptors false enabled so no private key stuff is exported.
nc50lc
Legendary
*
Offline Offline

Activity: 2898
Merit: 7562


Self-proclaimed Genius


View Profile
September 05, 2025, 05:49:56 AM
 #13

But if you use the Migrate option, doesn't it convert it to HD format? or the existing keys will still be non-HD derived so you would still need to manually import each existing public key?
Both are true.
It'll set an HD key to be used for its new active HD descriptors (for your new addresses).
And the previous loose keys are converted to single-key descriptors like: pkh(WIF) or combo(WIF).
Of course, the new HD parent descriptors can't be related to your old non-HD keys.

If you're interested on an alternative, there's a way to skip that:
Copy an updated blockchain to the offline machine, reindex your offline Bitcoin Core, rescan for txns, then create, sign & export the transaction to the online node.

To do that, simply copy your own online Bitcoin Node's "blocks" folder (you may exclude the "index" folder inside) to an external drive and paste it to the offline machine's node's datadir.
Then start your offline Node with --reindex and it'll create its own index and chainstate directories. (this will take hours to finish, but it will not fully sync since it's offline).
With a blockchain, even offline, you can load and rescan your wallet up to the last available block and create a transaction there. (manually set the fee)
Just export it to the online machine once it's signed to be broadcasted.

After you spent the bitcoins from the old wallet, create a new wallet so that you can set-up a normal cold-storage setup or create it prior to use as the recipient.

takuma sato (OP)
Hero Member
*****
Offline Offline

Activity: 737
Merit: 609


View Profile
September 05, 2025, 11:03:32 PM
 #14

But if you use the Migrate option, doesn't it convert it to HD format? or the existing keys will still be non-HD derived so you would still need to manually import each existing public key?
Both are true.
It'll set an HD key to be used for its new active HD descriptors (for your new addresses).
And the previous loose keys are converted to single-key descriptors like: pkh(WIF) or combo(WIF).
Of course, the new HD parent descriptors can't be related to your old non-HD keys.

But basically, if I use Migrate on the 2013 wallet, then can't I just export what I need for the watch-only wallet using importdescriptors false which should output a list of all your public addresses' descriptors so you can safely copy this data into a .json file, encrypt it, put it an USB and copy it into the online laptop where you have create a fresh watch-only wallet, and then use importdescriptors [filename.json]. Then rescan and the watch-only wallet should be working?

If you're interested on an alternative, there's a way to skip that:
Copy an updated blockchain to the offline machine, reindex your offline Bitcoin Core, rescan for txns, then create, sign & export the transaction to the online node.

To do that, simply copy your own online Bitcoin Node's "blocks" folder (you may exclude the "index" folder inside) to an external drive and paste it to the offline machine's node's datadir.
Then start your offline Node with --reindex and it'll create its own index and chainstate directories. (this will take hours to finish, but it will not fully sync since it's offline).
With a blockchain, even offline, you can load and rescan your wallet up to the last available block and create a transaction there. (manually set the fee)
Just export it to the online machine once it's signed to be broadcasted.

After you spent the bitcoins from the old wallet, create a new wallet so that you can set-up a normal cold-storage setup or create it prior to use as the recipient.

I did consider this, since it's the only way you could be able to actually see your funds are there in your offline laptop. There is something upsetting about seeing 0.00 BTC there, even tho the private keys are there, since the watch-only wallet supposedly should be matching all of your existing private keys with the public keys watch-only descriptors there. And I assume, that since the wallet was migrated with the Migrate option, it is now an HD wallet for any new addresses generated from this point, meaning that the .json file you exported and then imported into the online watch-only wallet, guarantees that you can create new receiving addreses on the offline laptop which will match them on the online wallet (however im not sure how this exactly works). And now with all this migrating stuff of wallets and so on, im a bit paranoid you would screw up at some point. If I could have the actual blockchain on the offline wallet, when signing the PSBT, it would be nice seeing your funds there.

Im really going to need to test with testnet coins but the thing is the wallet would be a modern version 28 wallet so I wouldn't encounter the initial migrate step. Either way I need to get comfortable with the flow of how this works when monitoring and sending transactions with the 2 laptop setup. As of right now it's not clear to me. I think I should actually keep another copy of the blockchain on the offline laptop, because I don't want to have 0.00 BTC here. But of course, this is very annoying to maintain, since you have to spend double the time validating blocks which is increasingly slower with all this spam crap on the blockchain, plus I only have additional 1TB drives which given the current size of the blockchain may not last very long.

Also you open this attack of vector of constantly sending files with your USB pendrive to keep the blocks up to date. I mean if you have linux on both machines and only use them for this task is unlikely anything on the USB leaks specially if you encrypt it but it's one of those things. Please let me know if im missing something. I have seen different step by step tutorials and each time someone mentions something different. For instance, apparently listdescriptors false will not accurately have the stuff in order and you need to edit the json file to properly import it or something.
nc50lc
Legendary
*
Offline Offline

Activity: 2898
Merit: 7562


Self-proclaimed Genius


View Profile
Today at 04:02:05 AM
 #15

But basically, if I use Migrate on the 2013 wallet, then can't I just export what I need for the watch-only wallet using importdescriptors false -snip-
You probably meant: "listdescriptors false"
Yes, that's if you already know which descriptors to pick, otherwise you may miss one with associated UTXO if you wont export all since it's offline and not synced.

Quote from: takuma sato
Im really going to need to test with testnet coins but the thing is the wallet would be a modern version 28 wallet so I wouldn't encounter the initial migrate step.
You can download an old version of Bitcoin Core (pre-descriptor), start it with datadir pointing to your preferred temporary test datadir.
Even if it's done in the same machine, that shouldn't interfere with your current setup unless you overwrite something by using the same directories.

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!