Bitcoin core as cold storage, sign transactions offline and generate receiving addresses from the watch-only wallet part II.
If you’ve followed the first part, you already have a watch-only wallet where you can receive funds.
We are going to receive some funds and sign transactions offline.
I’ve received 2 transactions in two different addresses:
Now to spend them, just do as usual, enter the address to pay to, set fees, and when done click Create Unsigned.
Then save it and you will get a .psbt file
This is the file we will need to sign the transaction with the offline wallet, save it in a USB flash drive.
It is recommended to have a dedicated offline PC (any old PC will do the job), if that is the case it will not be necessary to install bitcoin core/knots and import the wallet file each time. But since I am using tails for this tutorial, I will reproduce the steps:
We boot tails and will copy the bitcoin core/knots software from USB Flash drive as we did in first part (open bitcoin-qt and close which will create the directory files where wallet will be imported).
We will copy the wallet to the bitcoin folder, in this tutorial I did a backup and named it “wallet_tutorial.dat”.
Bitcoin core/knots will not recognize it so as you can see in the screenshot I copy my wallet to the wallets bitcoin folder renaming it to “wallet.dat”.
cp /home/amnesia/Documents/wallet_tutorial.dat ~/.bitcoin/wallets/wallet.dat
File→Load PSBT from file
Review the information and click sign transaction.
Passphrase will be prompted, enter the passphrase in order to sign and click ok.
If you are using bitcoin core 0.22 and your wallet is encrypted (which should be if you have followed all the steps in this tutorial) you will get an error (Could not sign any more inputs), passphrase is not even asked. This will be fixed in the next release.
to sign we must unlock wallet first:
window→console and type:
walletpassphrase “mypassprhase” 120
Between “” you enter your passphrase and 120 can be replaced by any number, in this case wallet will remain unlocked for 120 seconds and after that time, it will lock automatically.
After the transaction is signed, since we do not have internet and we can not broadcast it, we will click save, and save the signed psbt file to the USB flash drive.
On the online PC:
File→Load psbt from file
Click Broadcast Tx
And done! Transaction has been broadcasted.
Following this steps you will be using the most reviewed and secure client while your keys are always offline.