Why Bitcoin Core users need a fresh backup after first-time wallet encryption

By: cryptoslate.com|

Bitcoin Core developers merged a change on Nov. 20 that disables encryptwallet by default in development builds containing the patch. The command encrypts an existing wallet for the first time and generates a new seed. Backups made before encryption cannot recover bitcoin sent to addresses derived from that seed.

Bitcoin Optech highlighted the change on Nov. 27. The pull request #36387 landed on Bitcoin Core's development branch, and the project's release index listed 32.1 as its latest release on Nov. 29.

Bitcoin Core says first-time encryption creates a new seed and a fresh set of active descriptors, the rules the wallet uses to derive addresses and their keys. A backup made before encryption still covers addresses controlled by keys it contains or can derive. That can include a payment received after encryption at an address already covered by the older backup. A separate Bitcoin multisig backup proposal addresses a different recovery problem in which a seed alone may be insufficient.

If the live wallet and every usable copy with the new key material are lost, restoring the old file cannot recover bitcoin sent to addresses derived from the new seed. The project directs users who still have the wallet to make a fresh, secure copy after encryption using backupwallet. Its wallet guide recommends storing backups on reliable offline devices.

What your wallet backup can recover

In Bitcoin Core, the keys saved in a backup determine which addresses it can recover after first-time wallet encryption.
Backup coverage after first-time encryption A backup made before encryption covers the earlier keys it holds or derives. First-time encryption creates a new seed. A fresh backup of the encrypted wallet saves the new seed and can recover funds at addresses derived from it. BACKUPKEY MATERIALRECOVERY COVERAGEOld backupMade before encryptionEarlier keysHeld or derived by the copyFunds at covered addressesEven for later paymentsFirst-time encryption creates a new seedFresh backupMade after encryptionNew seedSaved in the fresh backupFunds at new addressesDerived from the new seed
Backup coverage after first-time encryption A backup made before encryption covers the earlier keys it holds or derives. First-time encryption creates a new seed. A fresh backup of the encrypted wallet saves the new seed and can recover funds at addresses derived from it. Old backupMade before encryptionEarlier keys it holds or derivesFunds at covered addressesEven for later paymentsFirst-time encryptionCreates a new seedFresh backupMade after encryptionNew seed saved in the backupFunds at new-seed addresses

A pre-encryption backup lacks the fresh seed. Back up the encrypted wallet to preserve the new keys.

The old backup covers only earlier keys it contains or can derive. The fresh-backup path highlights newly generated keys.
Sources and evidence

Sources

  1. Bitcoin Core encryptwallet reference
  2. Bitcoin Core pull request
  3. Bitcoin Optech newsletter
  4. Bitcoin Core wallet guide

Supporting facts

  • Bitcoin Core's documented first-time encryptwallet flow generates a new HD seed and a fresh set of active descriptors, the rules that derive addresses and their spending keys. [1] [2]
  • A pre-encryption backup can recover funds controlled by keys it contains or can derive, including at old addresses covered by that backup. It cannot derive the keys for addresses created from the new seed during or after first-time encryption. [1] [2] [3] [4]
  • Bitcoin Core tells users who run encryptwallet to make a fresh secure backup of the encrypted wallet with backupwallet. The practical loss scenario is restoring only an older copy after losing the live wallet and other recovery material for the new seed. [1] [3] [4]

Method

Maps the documented generation of a new seed to the key material in a backup taken before or after encryption. Paths show recovery coverage.

Scope

The old backup covers only earlier keys it contains or can derive. The fresh-backup path highlights newly generated keys.
Infographic by CryptoSlate

The pull request also says encrypting an existing wallet may leave remnants of unencrypted private keys on disk. Older unencrypted backup files still hold the key material saved in them and need to be kept secure.

Which scripts need to change

Scripts that call encryptwallet will need an explicit opt-in when they connect to a node running a build with the change. That includes command-line scripts that use bitcoin-cli to create an unencrypted wallet and add encryption in a separate call. The development release note says to start bitcoind with -deprecatedrpc=encryptwallet. That option keeps the command available during the deprecation period. Bitcoin Core plans to remove the RPC in a future major release and has yet to name the version in the note.

For new wallets, automation can pass a passphrase to createwallet to encrypt from the outset. Existing encrypted wallets remain supported, and their owners can still use walletpassphrasechange to update the passphrase. A reviewer on the pull request said the graphical Encrypt Wallet action uses a separate interface and falls outside this patch.

This content is provided for general informational purposes only and doesn't constitute financial, investment, legal, or tax advice. Any events, rewards, online promotions, or related information mentioned herein should not be considered a recommendation, solicitation, or invitation to purchase, sell, trade, or otherwise deal in any crypto assets. Crypto assets are highly volatile and may result in loss. The availability of WEEX services, products, and related events may vary by region. You are responsible for ensuring that your participation is in accordance with applicable local laws and regulations.

You may also like

iconiconiconiconiconiconiconiconicon
Customer Support:@weikecs
Business Cooperation:@weikecs
Quant Trading & MM:bd@weex.com
VIP Program:support@weex.com