keypool option with HD wallet

1

I'm a bit confused.

According to https://bitcoincore.org/en/2018/02/26/release-0.16.0/#hd-wallets-by-default HD wallet is enabled by default. However there is still keypool option of bitcoind which sets how many addresses will be pregenerated on wallet loading. keypool assumes regular wallet backups in order to not to loose keys generated above keypool value and keypool restore.

So, my question is: with HD wallets does keypool option have any meaning? And do I still need to do these regular backups?

Revinand

Posted 2018-09-06T18:49:26.973

Reputation: 113

Answers

1

The keypool is how Bitcoin Core achieves the lookahead functionality when you restore a backup. It is effectively the "gap limit". While BIP 32 does mean that one backup should be sufficient, it is possible that the keypool is too small (if you somehow hand out thousands of addresses but never receive at them) so backing up routinely is still a good thing to do. Also, backing up routinely allows you to keep metadata like labels when you restore.

The keypool is also useful for encrypted wallets as it allows getting new addresses to give out without having to unlock the wallet every time.

Andrew Chow

Posted 2018-09-06T18:49:26.973

Reputation: 40 910

What if the keypool of an HD-enabled wallet.dat is exhausted? Is it possible that the wallet may silently ignore some funds when an old backup is imported?Chris Chen 2019-01-15T20:26:19.507

As keys from the keypool are used, new keys are generated. So the keypool is constantly being refilled during a rescan which means that funds will not be skipped.Andrew Chow 2019-01-15T22:45:19.273

What if the backup is encrypted? Would the sync/rescan process be paused, to ask the user for passphrase?Chris Chen 2019-01-15T23:44:13.717