How to Backup and Restore a Bitcoin Wallet

A wallet backup protects your bitcoins against computer or software failure. It may also help you retrieve your funds after your device was stolen or lost.

There are generally 3 ways to backup a Bitcoin wallet. Different software supports different methods.

Make sure you’re familiar with your wallet before loading it with bitcoins.

If you lose the backup and can’t access your wallet for some reasons, your bitcoins are permanently gone!

Remember: Always encrypt your wallet with a strong password to make it more difficult for an attacker to steal your coins!

Wallet.dat

This method is used by Bitcoin Core (and few others) and comprises of backing up a wallet.datfile. It’s a file that holds keys to spend outputs, addresses, transaction information, and other metadata such as contacts.

It has a different location based on an operating system.

Windows: %APPDATA%\Bitcoin
Linux: ~/.bitcoin/
Mac OS X: ~/Library/Application Support/Bitcoin/

Backup

Locate wallet.dat and copy it to another device only you have an access to. It may be a USB drive, CD, another computer or your private home cloud storage.

You may also copy it to a cloud storage such as Mega or Dropbox but make sure it’s encrypted. Anyone that gets access to the unencrypted file will be able to steal your coins.

Note: If you use Bitcoin Core make sure to backup wallet.dat file regularly after every ~100 transactions. This way you make sure you have backup of all wallet and change addresses.

Restore

To restore the backup, simply copy your backed up wallet.dat over an existing one in the bitcoin data location.

BIP 32

BIP 32 is a method of determining key pairs from a single seed. This seed is used to generate a master private key (xprv) which then can be imported to any BIP 32 compliant HD wallet.

xprv9s21ZrQH143K2PXgtDvNp1e5Mzxncb3D3qM7pcXEp6eaSZ8HNaUxb18ohbw9jqRkGaYhquPmn1rH2BxnQ54uEMrw8xxaUSo3KxnrCJ3AaD7

To backup your wallet either copy the master key to a text file and back it up to another device (encrypted of course) or create a QR code, print it and store it somewhere safe (e.g. vault).

If you decide to store the master key as a QR code make sure to disconnect from the internet.

To restore the backup, simply paste the xprv string to your wallet when asked to.

We won’t go into details because most BIP 32 compliant wallets also support the next feature. If they don’t, you may avoid using them.

BIP 39

BIP 39 describes a method of generating a mnemonic sentence – easy to remember set of words – that represents a seed which can be then used to determine wallet addresses (e.g. BIP 32).

When creating a wallet for the first time, you’re presented with the list of seemingly random 12 to 24 words. The more the words the bigger the security.

Some wallets like Trezor let you choose the entropy yourself.

Backup

Write down the words on a piece of paper in an exact order and store it somewhere safe like a vault. You can split it to many papers and hide each piece somewhere else.

As with the master private key, you may also want to print the words as a QR code. Be creative.

Note: If you have to store the mnemonic on your computer or a device connected to the Internet, make sure it’s encrypted!

Restore

To restore the backup, open your wallet software and look for “New/Restore” feature in the menu. When prompted, type in the mnemonic from your paper in the exact order.

The wallet will then determine the rest of your keys and addresses.

It will also restore your transaction history from the blockchain but you won’t see any metadata such as contacts or transaction labels.

If you need them, you will have to backup a wallet data file too. Each wallet uses different location and a file name and it’s beyond the scope of this post to mention it all.

Best Practices

When backing up your Bitcoin wallet make sure to follow these rules to avoid potential funds loses:

  • Always encrypt your wallet with a strong password.
  • Store backups in multiple locations (CD, USB drive, paper, encrypted cloud etc)
  • Encrypt online backups with tools such as GnuPG or VeraCrypt
  • Backup regularly when backing up a data file (such as wallet.dat)

Leave a Reply

Your email address will not be published. Required fields are marked *