Sub topic 7
Hardware wallets in practice
This chapter assumes you know what a private key and a seed phrase are, and that you have sent and received crypto before. It covers how a hardware wallet works internally, how to set one up and use it, and the errors people most often make with one.
What a hardware wallet is
A hardware wallet is a small, purpose-built device that generates and stores private keys and signs transactions inside itself. The key never leaves the device. Your computer or phone sends the device an unsigned transaction. The device shows the details on its own screen, waits for you to confirm with a physical button, signs, and returns only the signature.
This is why a hardware wallet counts as a practical form of cold storage even though you plug it into a connected computer. The signing key is not on the networked machine at any point. Only the data to be signed goes in, and only the signature comes out.
The term "cold" is a matter of degree here. A device that is always offline and passes data by QR code or SD card is colder than one connected over USB or Bluetooth. Most hardware wallets sit between a pure hot wallet and a fully air-gapped setup.
How signing works inside the device
The device holds a secret, usually derived from a seed phrase. When you request a payment, three things happen.
- The host software (a wallet app on your computer or phone) builds an unsigned transaction. It can do this with only public information, such as your extended public key.
- The device parses the transaction, shows the destination address and amount, and asks you to confirm.
- After you confirm, the device signs with the private key and returns the signed data. The host software broadcasts it.
The important design point is the trusted display. The host computer may be infected with malware that changes the destination address in what you see on your monitor. The device screen is the one place you can check what you are really signing. If you skip comparing the address on the device screen, you lose most of the protection.
What a hardware wallet protects against, and what it does not
Measured against the threat model from earlier chapters:
| Threat | Does a hardware wallet help? | Notes |
|---|---|---|
| Malware on your computer | Yes | Malware cannot extract the key. It can still try to alter the transaction, so verify on the device screen. |
| Phishing sites | Partly | A fake site can trick you into approving a bad transaction, or into typing your seed phrase. The device cannot stop you from approving. |
| Physical theft of the device | Partly | A PIN limits access, and repeated wrong PINs wipe the device. Without a backup of the seed you lose funds, but a thief does not gain them. |
| Loss or damage of the device | Only with a backup | Recovery relies on the seed phrase backup, not on the device. |
| Theft of the seed backup | No | Anyone with the seed can rebuild your wallet on another device. |
| Coercion | No | A single-key device can be unlocked under threat. |
| Supply-chain tampering | Depends | See the section on buying and setup below. |
Setting up a device safely
Setup is where most avoidable mistakes happen. A sound sequence looks like this.
- Buy from the manufacturer or an authorized reseller. Used or marketplace devices may have been tampered with. A common attack is shipping a device with a pre-written seed phrase card. If you use that seed, the attacker already has your keys.
- Check the packaging and the device's authenticity checks. Many devices verify their own firmware at first boot. Follow the vendor's instructions for this.
- Install firmware and companion software only from the vendor's official site. Verify signatures or checksums where the vendor provides them.
- Let the device generate the seed. Never type in a seed that someone else gave you, and never accept a pre-filled recovery card.
- Set a PIN that is not a birthday or a simple pattern.
- Write the seed on the backup medium while the device displays it. Do not photograph it or type it into a computer.
- Verify the backup by completing the device's recovery check, or by wiping and restoring (see below).
- Send a small test amount first, confirm you can see it, and spend it back before moving larger funds.
Passphrases: a second factor with a sharp edge
Many hardware wallets support an optional passphrase, sometimes called the "25th word". It is combined with the seed to derive a different set of keys. The same seed with a different passphrase gives a completely different wallet.
This has two effects.
- A thief who finds your seed backup still cannot reach the funds without the passphrase.
- If you lose or forget the passphrase, the funds are unrecoverable. There is no reset, and a typo creates a valid but empty wallet with no warning.
Use a passphrase only if you have a plan to store it separately from the seed and to test that recovery works with it. Store it somewhere different from the seed, so one burglary does not take both. Treat the passphrase as part of the backup, not as an afterthought.
Using a hardware wallet day to day
Most people pair the device with a software wallet that holds only public keys. This software shows balances, builds transactions, and talks to the network. It is effectively a watch-only wallet with a signer plugged in.
A typical payment follows this routine:
- Open the wallet app and enter the destination and amount.
- The app sends the transaction to the device.
- Read the full address on the device screen. Compare at least the first and last several characters, and preferably the whole address, against the address you intended.
- Check the amount and the fee.
- Confirm on the device.
Address checking matters because of clipboard malware. This kind of malware watches for a copied address and silently replaces it with the attacker's address. The address pasted into the app is then wrong. Only the device screen, which malware cannot alter, shows the truth.
Receiving addresses deserve the same check. When you generate a receive address, ask the app to display it on the device, then compare it to the app's version. This confirms that the app is not showing an address that belongs to someone else.
Connection types and their trade-offs
| Connection | Convenience | Exposure | Notes |
|---|---|---|---|
| USB cable | High | Low to moderate | Data passes through the host. Use the vendor's cable. |
| Bluetooth | Highest | Moderate | Larger attack surface because of the radio stack. Some users disable it. |
| QR codes | Moderate | Low | Camera and screen only. Closer to air-gapped. |
| microSD card | Lower | Low | Files move by hand. Used by air-gapped designs. |
The next chapter covers offline signing in more detail. For now, the point is that fewer wireless features mean fewer ways in, and more manual steps mean more friction. Choose the level you will actually keep using.
A transaction flow you can inspect
Hardware wallets commonly exchange transactions as PSBTs (partially signed Bitcoin transactions), a standard format that lets different programs and devices cooperate. Here is a small check you can run to see the structure of a PSBT before you sign it. It uses only the Python standard library and reads the PSBT's header.
import base64
PSBT_MAGIC = b"psbt\xff"
def check_psbt_header(psbt_base64):
"""Return True if the base64 string starts with the PSBT magic bytes."""
raw = base64.b64decode(psbt_base64, validate=True)
return raw.startswith(PSBT_MAGIC)
# A PSBT always begins with the five bytes 'psbt' followed by 0xff.
example = base64.b64encode(PSBT_MAGIC + b"\x00").decode()
print(check_psbt_header(example)) # True
print(check_psbt_header(base64.b64encode(b"hello").decode())) # FalseThis check only confirms the format. It does not tell you whether the destination and amount are what you intended. For that, decode the PSBT with bitcoin-cli decodepsbt "<psbt_string>" and read the outputs, then confirm on the device screen.
Common errors
- Trusting the computer screen over the device screen. The computer can be compromised. The device screen is the check.
- Photographing or storing the seed digitally. Cloud photo backups, notes apps and email turn an offline secret into an online one.
- Buying second-hand or from an unofficial seller. This reopens the supply-chain risk that the sealed device is meant to close.
- Never testing recovery. A backup that has not been restored is only a guess. If the device fails on the day you need it, you find out then.
- Keeping all funds on one device with one backup. One fire, one flood or one lost card takes everything. Consider a second location for the backup, or multisignature (covered in a later chapter).
- Ignoring firmware updates. Updates fix security bugs. Apply them from the official source and check the signature, and always have your seed backup ready before updating.
- Blind signing. Some transactions, especially smart contract interactions on chains like Ethereum, show only an opaque data blob on the device. If the screen cannot show what you are approving in readable form, you are trusting the host software. Prefer devices and apps that decode the transaction, and enable blind-signing options only when needed.
- Entering the seed into a computer after a "problem". Scams that claim your device is compromised and need a recovery are common.
Choosing a device
There is no single best device. Compare on criteria that match your threat model.
- Open or auditable firmware. You can inspect what runs on the device.
- Secure element. A tamper-resistant chip that stores secrets. Some devices use one, others deliberately do not, trading hardware protection for transparency. Both choices have defenders.
- Screen size and clarity. A larger screen shows a full address and makes checking easier.
- Supported coins and standards. Confirm it supports the chains you hold and PSBT if you use Bitcoin.
- Connection methods. Match them to how cold you want the setup to be.
- Vendor track record. Look at how the vendor handled past vulnerabilities and customer data leaks.
- Multisignature support. Useful if you plan to split keys across devices, ideally from different vendors.
A hardware wallet is a better fit than a software wallet when the balance is meaningful and you can accept the extra steps. A single-key device is a worse fit when you need protection against a single point of failure, such as loss, coercion or one compromised vendor. That is the case for multisignature, covered later.
Recovery test
A hardware wallet is only as good as your ability to restore it. A basic test is:
- Fund the wallet with a small amount.
- Record the first receiving address.
- Wipe the device, or use a second device of the same or another brand.
- Restore from the seed (and passphrase, if used).
- Check that the first receiving address and the balance match.
If they match, the backup works. If they do not, you found the problem while the stakes were small.
Exercise
You receive a hardware wallet in a box with a sticker over the seam. Inside is a card with 24 words already printed and a note that says "Your recovery phrase, ready to use." What should you do, and why?
Show answer
Do not use the device or the printed words. A legitimate device generates its own seed, so a pre-printed phrase means someone else may already know it and can empty the wallet at any time. Stop, contact the seller or manufacturer, and report it. If you keep the device, reset it and generate a new seed on the device only after confirming through the vendor that the hardware and firmware are authentic. Buying directly from the manufacturer prevents this.
Exercise
Your computer is infected with clipboard malware. You copy a destination address into your wallet app, and the app shows an address that you do not recognize. You send the transaction to your hardware wallet. Where do you catch the error, and what is the limit of what the device itself can do for you?
Show answer
You catch it on the device screen, where the destination address is shown independently of the computer. Compare it to the address you intended and reject the transaction if it differs. The limit is that the device cannot know which address you meant. It only displays what it is asked to sign, so the protection depends on you actually reading and comparing the address.
Exercise
You set up a hardware wallet with a passphrase and write down only the 24-word seed. Six months later the device breaks and you restore from the seed on a new device. The wallet opens with a zero balance and no error. What happened, and how do you fix it?
Show answer
Restoring without the passphrase derives a different, valid but empty wallet. The funds are in the wallet derived from the seed plus the passphrase. Restore again and enter the exact passphrase, including capitalization, spaces and punctuation. If the passphrase was never recorded, the funds cannot be recovered. To avoid this, store the passphrase in a separate location from the seed and test a full recovery before relying on the setup.