<p>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.</p>

<p>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.</p>

CC BY-SA 4.0
2019-01-15T20:26:19.507Z
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
CC BY-SA 4.0
2019-01-15T22:45:19.273Z
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.
Ava Chow
CC BY-SA 4.0
2019-01-15T23:44:13.717Z
What if the backup is encrypted? Would the sync/rescan process be paused, to ask the user for passphrase?
Chris Chen
CC BY-SA 4.0
2018-09-06T19:32:01.710Z
2018-09-06T19:32:01.710Z
Ava Chow
<p>I'm a bit confused.</p>

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

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

<wallet><bitcoind>
keypool option with HD wallet
Revinand
# keypool option with HD wallet

(Asked by: username_0 on 2018-09-06)

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?

**Tags:** wallet, bitcoind


---

## 1 answers

### Answer by username_1 on 2018-09-06. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_2**: 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?  
> **username_1**: 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.  
> **username_2**: What if the backup is encrypted? Would the sync/rescan process be paused, to ask the user for passphrase?  

---

