Sub topic 8
Signing Offline: Moving Transactions, Not Keys
Prerequisites: you should understand public and private keys, addresses, and the basic steps in a blockchain transaction. You should also know how to send cryptocurrency from a wallet or exchange.
Offline signing separates transaction preparation from transaction authorization. An online computer can choose inputs, calculate fees, and build a transaction. An offline device can then approve that transaction without exposing its private keys to the network.
What moves between the devices
A wallet does not contain coins. It contains keys that can authorize spending recorded on the blockchain. To spend, a wallet creates a transaction and signs it with the private key for each selected input.
A partially signed Bitcoin transaction, or PSBT, is a standard container for this workflow. It can hold:
- The proposed inputs and outputs.
- Fee and transaction metadata.
- Information needed by a signer.
- One or more signatures.
The online wallet can create an unsigned PSBT because it has transaction history and network access. The offline wallet adds signatures because it has the private keys. The private keys themselves never need to leave the offline wallet.
| Item | Online computer | Offline signer |
|---|---|---|
| Blockchain and fee information | Uses it | May not need live access |
| Private keys | Must not have them | Stores them |
| Builds transaction | Yes | Usually no |
| Adds signatures | No | Yes |
| Broadcasts final transaction | Yes | No |
The signing workflow
The process has four main stages:
- The online watch-only wallet selects unspent transaction outputs and creates a PSBT.
- You transfer the PSBT to the offline signer using a memory card, QR code, or another controlled method.
- The offline signer checks the transaction, displays its important details, and adds signatures.
- You transfer the signed PSBT back, finalize it, and broadcast it from the online computer.
A watch-only wallet can see addresses and balances but does not hold the private keys needed to spend. This makes it useful on an internet-connected machine.
With Bitcoin Core, the commands can look like this:
# Online machine: the watch-only wallet holds no private keys.
bitcoin-cli -rpcwallet=watchonly walletcreatefundedpsbt '[]' '[{"<destination_address>":0.01}]'
# Offline machine: replace the placeholder with the returned PSBT.
bitcoin-cli -rpcwallet=cold walletprocesspsbt "<psbt_string>"
# Online machine: finalize and broadcast the signed result.
bitcoin-cli finalizepsbt "<signed_psbt_string>"
bitcoin-cli sendrawtransaction "<final_hex>"In a real workflow, the commands return JSON containing fields such as psbt, hex, and complete. You must pass the correct returned field to the next command. If complete is false, the transaction still needs another required signature.
What to verify before signing
Offline signing protects private keys, but it does not automatically make every transaction safe. Malware on the online computer could replace the destination address or change the fee before you transfer the PSBT.
The signer should verify:
- The destination address, preferably on a trusted screen.
- The amount and asset.
- The fee and change output.
- The transaction network, such as Bitcoin mainnet or testnet.
- The derivation path or account when the wallet displays it.
The offline device must also be genuine and initialized correctly. An “air-gapped” device is simply isolated from networks. It still requires secure backups, trusted software, and careful handling of imported transaction data.
Choosing a transfer method
QR codes avoid inserting removable storage, but large transactions may require several animated frames. A memory card is simple but can carry malware between systems. Whichever method you use, transfer transaction data only, label the direction clearly, and eject removable media safely.
For multiple signers, each signer can process the same PSBT independently. The PSBT is passed between signers until it contains the required number of signatures. The final signed transaction can then be finalized and broadcast.
Exercise
Why is a signed PSBT safe to return to an online computer, while an unsigned PSBT must still be protected?
Show answer
A signed PSBT contains authorization for the specified transaction but does not need the private key to be broadcast. An unsigned PSBT could still be changed or signed later, so the signing device must verify it before authorizing it.