So, if you came across a wallet from 2013 packed with some coins, what’s the best way to get it up and running? I’m on Debian and planning to compile Bitcoin Core, sync a full node, and I also have two laptops one for cold storage (air-gapped) and another for the online node to broadcast transactions. I'm interested in using the new psbt method, but I’m kinda lost on how to pick specific utxos using Coin Control and add them to a psbt file.
How do I go about this without messing up the wallet.dat file? Seems like Bitcoin Core has piled on so many features lately, some of which seem unnecessary since I prefer simplicity and usability, like the Coin Control. But it feels like there’s too much extra stuff now, and the wallets don’t seem to work with older versions unless I do some sketchy conversion. Can anyone break it down step by step to ensure I won’t mess anything up (already backed up the wallet)?
Tips for handling a 2013 wallet
4 replies 103 views
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#2Mar 30, 2018, 01:15 PM
Load it using "File->Restore" and it'll be copied to the correct folder then it will be loaded automatically.
Migrating a legacy to descriptor wallet isn't mandatory as of now.
After that, export the wallet's addresses or public keys (for p2pkh) or redeem scripts if you have any (for P2SH, rarely used in 2013).
One way to do that is to use dumpwallet command but addresstype=legacy has to be added to your bitcoin.conf file (requires restart) for it to output legacy addresses.
bitcoincore.org/en/doc/29.0.0/rpc/wallet/dumpwallet
You'll need a watch-only wallet in your online Bitcoin Core for that.
Create one by ticking "Disable Private Keys" during Create Wallet process.
You can then import the addresses, public keys or redeem scripts contained in your offline Bitcoin Core wallet via importdescriptors command.
References for you to check how to use it:
bitcoincore.org/en/doc/29.0.0/rpc/wallet/importdescriptors (use timestamp "now" to skip rescan)github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md(this part is tedious since your wallet isn't HD, you wont be able to utilize extended public keys)
Rescan the wallet/sync the node, then tick "Enable coin-control features" in the 'Settings->Options' and you'll be able to select specific UTXO in the 'Send' tab.
Using the 'Send' tab of you watch-only wallet will let you create a PSBT that you can send to your offline wallet.
What does this do specifically? Because you mentioned it will be "loaded". What is loaded? I would imagine, this just loads the wallet normally, but there is an additional step here:
So I don't get it. What is loaded if the wallet requires that you export the keys? Why is this step necessary? The addresses are legacy addresses (p2pkh). I just don't understand what im doing there. I think im being confused. This is just to export the public keys to create a watch-only wallet on the online wallet im assuming? So this means that "File->Restore" is all I need to do to have the private keys ready.
I may have been confused with the descriptor thing, which required some more convoluted migration process. Why are they going to force this? Why not just keep it backwards compatible? That just introduces extra steps to guarantee you eventually screw up. Also I don't need anything but legacy addresses, everything else for me is just clutter.
yield_forkFull Member
Posts: 162 · Reputation: 728
#4Mar 30, 2018, 08:53 PM
nc50lc is referring to the restoration of the wallet.dat file. Bitcoin Core has an option called restore wallet; when selecting the wallet.dat file, that same file will be copied into the "wallets" folder of Bitcoin Core. What is loaded is the wallet, in this case, your restored wallet.dat.
For the online laptop, importing the descriptors of the public keys of the addresses via importdescriptors is necessary for it to function as a watch-only wallet and signing PSBT transactions is more flexible in descriptor wallets. That's why nc50lc suggested that you create a new wallet without private keys (watch-only) based on descriptors.
If you don't use a descriptor wallet in the wallet.dat that will stay on the online laptop, it won't be possible to create PSBTs that communicate with the offline wallet.dat wallet (which must also be a descriptor wallet), because wallets with the same architecture (descriptor wallet) will have keys that communicate using the same derivation path as the wallet that will sign the transaction.
The dumpwallet command will dump all the private keys and addresses (p2pkh) from the wallet.dat file to a new file that you specify as the destination path. Example:
The line addresstype=legacy in the bitcoin.conf file keeps the address generation in the old format (p2pkh) and in the file dumped by dumpwallet, the addresses that you specified in addresstype=legacy/bech32/p2sh-segwit... will appear.
It will be used to import the keys into other wallets or use it to form descriptors to be imported into a descriptor-based wallet.dat, with or without redeem script (e.g., segwit or multisig addresses like p2wpkh-p2sh). It is a complete backup of all addresses contained in the wallet and obviously must be encrypted when you finish using it.
I'll leave that one for nc50lc or others to answer.
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#5Apr 2, 2018, 04:00 AM
It's convoluted because the requirement is to use offline and online machines and PSBT procedure.
That requires a watch-only wallet in the online Bitcoin Core and the actual wallet with private keys in the offline Bitcoin Core.
If you want simpler procedure (doesn't need to sync Bitcoin Core but w/ less privacy): You can use Electrum to create a watch-only wallet with "Import Bitcoin Addresses or Private Keys" option during wallet creation.
Paste your addresses there (one line per address) and finish setting up the [imported] Electrum wallet.
When using Send in Electrum, after clicking "Preview" or "Ok", it can export a compatible PSBT file in "Share->Save to file" that your offline Bitcoin Core can sign.
Transfer that to your offline machine where the 2013 wallet.dat is already restored in a Bitcoin Core version that has PSBT support.
Load it using the menu: "File->Load PSBT from file"; Sign it with "Sign Tx" (requires passphrase), then "Copy to Clipboard" for the next step.
The only additional step here is it needs to be converted from PSBT to serialized transaction so that Electrum can broadcast it:
So, open the console (Window->Console) and type: finalizepsbt "your_copied_signed_psbt"
Copy the output (e.g. to a text file)
And back to the online machine; transfer that text to your online watch-only Electrum via "Tool->Load transaction->From text".
Check the outputs, fee and amount if everything is good, click "Broadcast".
Related topics
- Recovering a Bitcoin wallet and address 8
- CipherSeed: A Comprehensive Guide to Super-Secure Crypto Wallet Backups 5
- What derivation path does mm-gen wallet use? 3
- Looking for wallet software that supports custom P2SH redeem scripts? 19
- Simple Offline Wallet (key-pair) Setup on Linux Without GUI 0
- 2010 Wallet Delivery and Encryption Mystery 19