Setting up 2 Bitcoin Core wallets

19 replies 293 views
DarkSeedSenior Member
Posts: 209 · Reputation: 1423
#1Jan 20, 2022, 06:08 AM
I'm searching for a step-by-step guide on how to configure 2 Bitcoin Core wallets. One wallet needs to be set up on an airgapped laptop that stays completely offline and holds the wallet.dat with the private keys, while the other laptop should be online and set up as a watch-only wallet. This wallet dates back to the Bitcoin v0.8.0 version, so I’m guessing the wallet file might need to be updated too? Looking for detailed instructions. The guide should include the setup process and how to execute transactions securely using Coin Control. I’m using Debian as the operating system. Also, if possible, I’d like some tips on enhancing privacy, like running it through a VPN or Tor. That should cover everything. If anyone has a video or a written guide, I’d really appreciate it.
5 Reply Quote Share
gwei_minerSenior Member
Posts: 197 · Reputation: 966
#2Jan 20, 2022, 08:47 PM
Sincerely I don't think there is any tutorial that exist with such description you've made, except you have to write them yourself after succeeding with this one. I did a quick search to see if there exist a YouTube tutorial but I couldn't find one but here I found a post on Reddit[1] that has to be related but the truth is it has not enough details has you desired but I believe it could be a ground for your research. I also think nc50lc could have a knowledge about this maybe if I mention him and he has solution then he would provide them manually because I believe there is no tutorial or written down format for it.  [1] https://www.reddit.com/r/Bitcoin/comments/oirfm8/offline_node_online_node_how_to_receive_and_send/?sort=new
6 Reply Quote Share
p1x3l365Senior Member
Posts: 511 · Reputation: 1890
#3Jan 21, 2022, 12:07 AM
You can get a public key, and import it to create a watch only wallet. If you only have a private key, import it first, then extract the public address and use that address to import a Watch only wallet. With a Watch-only wallet, you can not spend your bitcoins. Use commands It is an very old version of Bitcoin Core and not recommended to use it nowadays.
4 Reply Quote Share
DarkSeedSenior Member
Posts: 209 · Reputation: 1423
#4Jan 23, 2022, 04:36 AM
The wallet contains several addresses, like 100, with annotations that describe the transaction. As far as I know there is a system in place now (PSBT) that works to make this process of offline signing and watch only stuff faster and safer than screwing around with importing keys. But I would really need a step by step tutorial to not get anything wrong. Also the wallet was from around 0.8.0 era, however newer versions were used, around 0.15. So now it would be going from there to the latest version. I reckon the wallet needs to be converted to a new format or something. I would first make a backup. I would really like to get the whole thing explained within the same post to not have different bits of information all over the place so I can follow it properly. I need to learn to: 1) Get the old wallet from around version 0.15 opened properly running within the new version on the offline laptop 2) Get this a watch only version of this wallet safely running on the online laptop and making sure it does not contain any private keys 3) Sign a transaction selecting the desired utxos on Coin Control on the offline laptop which as far as I know it is now done with the psbt file 4) Send this file into the online watch only wallet and broadcast the contents of the psbt file so the transaction can be sent 5) Do this whole thing with reasonable privacy (using Tor or VPN) 6) Anything else useful I should need If anyone has the time please provide these instructions. I will be testing with testnet coins first. Any help is appreciated.
5 Reply Quote Share
hash_bossLegendary
Posts: 1166 · Reputation: 5261
#5Jan 23, 2022, 07:53 AM
I agree with @Churchillvv that such specific tutorial probably isn't exist. Since Bitcoin-qt 0.8.0, it creates wallet file using BDB (Berkeley DB) environment[1] which will supported until Bitcoin Core 28.0[2]. I'm not 100% sure, but i expect you can open that wallet file on latest version of Bitcoin Core without any problem. If you want to perform conversion to new format, Bitcoin Core already provide that feature under migratewallet RPC call. [1] https://bitcoindev.network/understanding-the-data/ [2] https://github.com/bitcoin/bitcoin/issues/20160
6 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#6Jan 23, 2022, 09:47 AM
The thing is, if you haven't set an HD seed to your wallet in versions >0.13, the wallet remains non-HD even after using v0.15. This isn't recommended to use since newer keys beyond the keypool that it will create cannot be re-created in the online machine (vice versa) since those aren't generated from an HD seed. Migrating it into a "descriptor wallet" will work but there'll be hundreds of single key descriptors since those aren't linked with each other, there'll also be newly generated HD ranged descriptors of each script type for receiving and change. Creating a watching-only wallet based from those ranged descriptors should be easy but including the single key descriptors would be troublesome (but doable). If you want to proceed (you'll have to, if you want to use future Bitcoin Core versions): The first step is to migrate it into a descriptor wallet using the command migratewallet: Close Bitcoin Core and update it to the latest version, make a backup of your wallet file.Start Bitcoin Core and go to "Window->Console", select your wallet in console's drop-down menu if you have more than one wallet.Enter the command migratewallet and wait for [executing] to finish, it'll be replaced with "wallet name and backup path" once it's done. This process will take a few minutes since there'll be hundreds of descriptors to create.After that, the wallet is now an HD descriptor wallet and you can proceed to create the watching-only wallet in the online machine. For the Setup of watching-only wallet and PSBT workflow, follow this guide by TracaChang: https://bitcointalk.org/index.php?topic=5392824.0 (already in step-by-step format) Notes: Start from "listdescriptor" step in the offline wallet since you already have a wallet, and you'd have to import all (now) 8 parent descriptors if you want to be able to use all 4 available address types. You should also import the single key descriptor(s) of the funded address(es) to be able to update your balance: If you already have a funded address list, get each address' descriptor from the offline wallet with: getaddressinfo <address>The "desc:" should look like this: pkh([01234567]041dd9c5ae0921....e79ed5039c56f94a641aa9)#1111zzzzImport all of those to the online watching-only wallet using importdescriptors command in this format: importdescriptors "[{\"desc\": \"descriptor_1\", \"timestamp\": \"0\"},{\"desc\": \"descriptor_2\", \"timestamp\": \"0\"},{\"desc\": \"descriptor_3\", \"timestamp\": \"0\"}]" Each descriptor is separated by a comma. example (importing two descriptors): Now the fun part, if you have/want to import all those 100 single address descriptors, you'll have to import them using the instructions above. So instead of just the funded ones, get all the descriptors from the offline wallet's listdescriptors command and import them to the watching-only wallet. The ranged descriptors still require the range, active, internal, etc. to be specified (refer to the instructions in the link). But honestly, it would be simpler if you just create a new air-gap setup using the instructions in the link instead and send all your bitcoins there. I'll leave this to others.
3 Reply Quote Share
im_lynxHero Member
Posts: 515 · Reputation: 2161
#7Jan 23, 2022, 02:29 PM
I haven't done this yet manually with a legacy wallet. For the watch-only wallet it's of course important to import only the pubkey descriptors! Do not move your private key descriptors from your offline wallet and machine! A pubkey descriptor is Wouldn't it be more versatile for the watch-only wallet to import combo(pubkey) descriptors? combo() descriptors match any address type (except taproot). getaddressinfo <address> gives you also the pubkey. To use it as a combo() descriptor like you would need to feed combo(...) into getdescriptorinfo to get the descriptor's checksum (#gvgcz9wt in above example).
2 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#8Jan 24, 2022, 11:00 AM
It's a step to be followed after he "migrate" his wallet into a descriptor wallet but it will work in offline legacy wallet paired with watching-only descriptor wallet. For the private key concern, getaddressinfo or listdescriptor (descriptor wallet only) wont output the descriptor with private key, the latter requires additional positional argument for it. But given that it will be depreciated soon, I can't recommend him to keep using the old wallet format. It's not a bad idea when pairing it with an offline legacy wallet since it defaults different script types, the watching-only descriptor wallet wont derive bech32m that the legacy wallet doesn't support. For descriptor wallets, it depends on what will appear in listdescriptors command (in the next paragraph if he want to re-use those). But point in importing those non-ranged descriptors to the online watching-only wallet is to be able to use the remaining coins, So only the necessary script type so that the transactions will update, new addresses will be derived from the newly added ranged descriptors.
3 Reply Quote Share
0xMaxiFull Member
Posts: 78 · Reputation: 347
#9Jan 26, 2022, 04:03 AM
What about wallets that have very few addresses with balances? If you create an empty watch wallet in which there is only a single address/descriptor and you create a transaction that does not fully spend the bitcoins on the address, where does the exchange go? I had posted something here: https://bitcointalk.org/index.php?topic=5485846.msg63753896#msg63753896 However, I use a total of three devices. A server with Tor at a hoster. A laptop at home that connects to the server directly via SSH. And my offline device (not the subject of my little guide). Also I use Bitcoind.
4 Reply Quote Share
im_lynxHero Member
Posts: 515 · Reputation: 2161
#10Jan 26, 2022, 08:06 AM
A smart wallet will send the excess change coins back to the single available address in the wallet, which results in address re-use but that's better than losing the change coins as transaction fee. I have tested this once with Electrum because I was curious what would happen. Thanks to Testnet coins, there was no real risk involved. Can't tell how other wallets behave as I've only made a test with Electrum so far. I would also only use a wallet that clearly shows me all details of a transaction before signing and broadcasting it.
4 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#11Jan 26, 2022, 10:29 AM
To your change address of the default/preferred script type. After migrating to descriptor wallet, it will automatically be HD, aside from the single address, it now contains descriptors of each script types for both change and receiving addresses. In case the first step to migrate to descriptor wallet isn't followed, and only a single address is available: Bitcoin Core won't let you proceed to create the (unsigned) transaction for having no available change, If you want to proceed, you'll have to manually set it by enabling "Coin control features" in the GUI's settings to display "Use custom change address" in the send tab. Once ticked, you can paste any address that you own to receive the change. In the command line, the transaction has to be manually created.
4 Reply Quote Share
0xMaxiFull Member
Posts: 78 · Reputation: 347
#12Jan 26, 2022, 02:14 PM
Does this mean that you can also create unsigned transactions with the GUI client? To be on the safe side, I could perhaps import a handful of the empty addresses in addition to the one or two addresses with a balance and then transfer the balances to new bc1 addresses ? Maybe making a separate transaction for each utxo to a new bc1 address in the new wallet to have relatively easy-to-read transactions. If you set the transfer amount slightly below the balance of the utxo, then that is automatically the fee right?
6 Reply Quote Share
paul.stakeHero Member
Posts: 651 · Reputation: 3798
#13Jan 26, 2022, 02:26 PM
You certainly can, but you'll probably have to use the console, unless there exists a GUI setting I'm unaware of. However, if the wallet is watch-only, you can copy the PSBT to clipboard according to this SE post: https://bitcoin.stackexchange.com/a/99112/134811. What's the problem with doing what nc50lc says? You're risking losing more money in fees. Right.
4 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#14Jan 28, 2022, 06:28 AM
Yes, If your wallet is a watching-only descriptor wallet, the "Send" button in the send tab will be replaced with "Create Unsigned". The wallet is considered "watching-only" if it's created with "disable_private_keys" arg or checkbox. Then you can only import descriptors with extended pubKey/pubKey into it.
1 Reply Quote Share
0xMaxiFull Member
Posts: 78 · Reputation: 347
#15Jan 28, 2022, 09:35 AM
A very valuable tip. I will definitely look into the GUI client next. I assume I can use the same data directory as for the Bitcoind? Can the GUI client hide behind a full node like the Bitcoind? Could the GUI Client be configured like this? See: https://bitcointalk.org/index.php?topic=5485846.msg63753896#msg63753896
2 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#16Jan 28, 2022, 11:36 AM
Everything bitcoind can do, the GUI can, since it is basically a daemon and GUI client in one package. You can even use your current "bitcoin.conf" for bitcoind in the GUI as long as it's pointed to the correct path. For example: If you're using bitcoind without an arg to change the datadir but rely of the config file to set a custom datadir, then by setting the default datadir in bitcoin-qt will make it use the same config file in the default data directory and use the settings in it. In the same manner, if you've been using bitcoind with an arg to set the datadir instead of the bitcoin.conf file, set that datadir in the GUI. If you already set a custom datadir in Bitcoin-qt, you can use: bitcoin-qt --choosedatadir to set it. Yes, as long as there's no conflicting settings. If you want use bitcoind and bitcoin-qt seamlessly with one datadir, wallets, etc. (but only one running instance at a time), just minimize the config to one source. Preferably, your bitcoin.conf file.
2 Reply Quote Share
0xMaxiFull Member
Posts: 78 · Reputation: 347
#17Jan 30, 2022, 09:11 PM
Under Linux, I use the standard ".bitcoin" directory in the user's home directory. I have not changed the location of the directory at all. I start the bitcoind with the command: Similarly, I would start the qt client using: If I have understood you correctly, the bitcoind is a headless "qt" client. If I accidentally start both at the same time, can this lead to data corruption?
0 Reply Quote Share
DarkSeedSenior Member
Posts: 209 · Reputation: 1423
#18Jan 31, 2022, 01:55 AM
Thanks for input. I will definitely need to study this and do testing with testnet wallet. I guess to do the whole thing properly, I will need to create a wallet from pre-HD era (what was the latest version before HD was introduced? 0.12 perhaps) and get some testnet coins there, so I can replicate the entire process safely without screwing up with actual keys. I don't even know what descriptors are. I remember reading on PSBT files. The idea was that you do the transaction, then it creates this PSBT file that is loaded on the watch-only wallet, and you simple open this file there and you can broadcast the transaction without screwing up with the console by manually inputing raw transactions isn't it? I get this, but I need to read up on descriptors etc. Addresses are also mostly legacy addresses, is this relevant? Someone mentioned making a new wallet and sending the coins there, I will not do that, so I need to do this with existing addresses. So im going to need 1) The last version with non-HD wallet to create the wallet and get testnet coins there (unless there is a way to generate an old school wallet in the latest version) 2) Get the testnet coins in different addresses 3) Do the whole migration of the wallet into the new format and descriptions thing which right now is a mess that I have to study to see what's really going on during the process 4) Make some PSBT file and broadcast this in the other laptop on testnet This is going to take some days since I have to sync the blockchain again for the watch-only laptop will report with results once I get the stuff setup.
2 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#19Jan 31, 2022, 06:51 AM
That should do. The one started last wont be able to use the data directory and will not proceed to start. You can create a copy of your current wallet.dat, load it as another wallet then do the instructions with it. Using migratewallet also automatically creates a backup of the original wallet.dat. But yeah, it wouldn't hurt to test it in TestNet, you can even go for "RegTest" so you wont have to sync if you do not have a TestNet setup. You're right, you can use v0.12.1 to create non-HD wallet.
3 Reply Quote Share
DarkSeedSenior Member
Posts: 209 · Reputation: 1423
#20Jan 31, 2022, 07:59 AM
Hi, im downloading debian and im going to be installing the OS first, then compile Bitcoin Core from the source. Just to be clear, there is no way to create a 0.12 era (non HD) wallet on the latest version? because then I will have to start building 0.12. Once I build 0.12 and its installed and I get the wallet, do I compile the latest version and install on top of this existing folder isn't it? so I would need to be sure to get the wallet to test properly. Im gonna get some coins from testnet and test the migration with testnet wallet, im assuming it just works the same when you do it with the real wallet.
3 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics