We recently covered the new descriptor wallet format in Bitcoin Core, which replaced the wallet.dat file, in this article. This time, we will look at how to back up your descriptor Bitcoin wallet and subsequently restore it.

Important: Simply saving your wallet.dat file and its password is no longer sufficient to restore a wallet in Bitcoin Core if you have converted it to the descriptor format. This is because while the wallet.dat file still exists, it contains different data that will not be enough to regain access to your bitcoins.

To restore your Bitcoin Core wallet instead of relying on wallet.dat, you can take two paths.

  1. You can save the entire wallet folder (bitcoin/wallets/your_wallet_name/), as well as the wallet.dat and settings.json files, and create an encrypted archive with a password.
  2. The second, and more preferable, option is to save the descriptors, especially since there is a specific command for writing all of the wallet's descriptors to a text file.

Saving Descriptors in Bitcoin Core

As mentioned, there is a specific command to retrieve all descriptors of your Bitcoin wallet, but there is one IMPORTANT nuance: the command must be executed with the argument true. Only in this case will you receive the private descriptors, which are necessary to regain control of your crypto assets.

listdescriptors true > bitcoin_descriptors_backup.txt

As a result of this command, a file named bitcoin_descriptors_backup.txt is created, containing the complete list of all descriptors required for wallet restoration. If you run the command without the true argument, the file will only contain public data, which will naturally be insufficient for regaining control of your assets.

The complete data in bitcoin_descriptors_backup.txt looks like this:

{
  "desc": "wpkh([d34db33f/84'/0'/0']xpub6CERLc.../0/*)#abc123",
  "internal": false,
  "timestamp": 1634567890,
  "active": true,
  "range": [0, 1000],
  "next_index": 42
}

The obtained descriptor file must be stored offline in multiple locations (e.g., USB drive, disk), and it is also advisable to create an encrypted archive with a password. Otherwise, if you lose this file, anyone in the world could gain access to your wallet. Alternatively, your bitcoins could be lost forever if, for example, the USB drive simply fails after some time.

P.S. For added security, you can rename the file bitcoin_descriptors_backup.txt to a less conspicuous name, such as game.txt.

Restoring a Bitcoin Core Wallet

To restore your wallet using the bitcoin_descriptors_backup.txt file, you need to perform two steps.

1 Create a new descriptor wallet in Bitcoin Core using the command:

createwallet "restored_wallet" true true "" false true

2 Import the descriptor file:

importdescriptors "$(cat bitcoin_descriptors_backup.txt)"

After this, wait for the wallet to synchronize so that Bitcoin Core downloads the entire blockchain and verifies all inputs and outputs for your BTC addresses.

Conclusion: For complete restoration of access to a Bitcoin Core wallet, it is sufficient to have the bitcoin_descriptors_backup.txt file created using the listdescriptors command with the true argument. The descriptor file must be stored only offline and in multiple locations.