<p>The keypool is a collection of unused addresses in your wallet.  The keypool parameter tells the client how many unused addresses to keep in its pool.</p>

<p>Almost every time you send a Bitcoin payment, some change is generated and sent to a previously unused address.  If you have a keypool, then each time a new address is needed one of the keypool addresses is used, and a new address is created and placed in the keypool to replace the one that was just used.</p>

<p>The purpose of the keypool is to allow you to backup your wallet file less frequently and still have access to all your funds in the event of a hard drive failure.  If you didn't have a keypool, and made a backup of your wallet, then made a payment, and then suffered a disk crash, you would lose the change which came from that payment because it would have been sent to a new address that wasn't in the backup.</p>

<p>With a keypool of 100 addresses, you can make up to 100 payments between backups and still be able to access all your funds.</p>

<p><a href="https://en.bitcoin.it/wiki/Key_pool">https://en.bitcoin.it/wiki/Key_pool</a></p>

CC BY-SA 3.0
2011-11-05T19:43:20.060Z
2011-11-05T19:43:20.060Z
Chris Moore
<p>You can do <code>getnewaddress</code> as many times as you want. The <code>keypool</code> parameter just sets how many <em>extra</em> keys the client creates when it needs to create keys. With <code>keypool</code> set to 1, the client will create one extra key every time it needs to create a key.</p>

<p>Setting <code>keypool</code> low will keep your wallet smaller. But it will mean you have to backup your wallet more often to avoid losing the keys to newly-created addresses.</p>

CC BY-SA 3.0
2011-09-08T21:11:29.573Z
2011-09-08T21:11:29.573Z
David Schwartz
<p>I am doing some test, and am getting weird behavior with keypool.</p>

<p>In the 0.4.0rc1 bitcoin client:</p>

<p>If I set keypool=1, how many times should I be able to do getnewaddress?</p>

<p>Are there any resources where I can read about keypool, and how it works?</p>

CC BY-SA 3.0
2011-09-08T19:26:57.373Z
Presumably you are referring to the default Bitcoin client?  If so you should probably specify in the post, as it otherwise is devoid of context.
Michael McGowan
CC BY-SA 3.0
2011-09-08T19:31:57.660Z
I have edited the question to show that I mean the 0.4.0rc1 client
Alex Waters
CC BY-SA 3.0
2011-11-05T20:01:39.710Z
Others have provided the explanation on what keypool=1 does.  I would strongly recommend not using a small kelpool unless you perform backs after each transaction.  When the client creates an address it does so randomly.  So if an address is created AFTER a backup then that address will be lost if wallet is lost.  With keypool of 100 (the default) you could make 100 new addresses (via new transactions) and the backup would still be valid.
DeathAndTaxes
<testing>
What does -keypool=1 do?
Alex Waters
# What does -keypool=1 do?

(Asked by: username_0 on 2011-09-08)

I am doing some test, and am getting weird behavior with keypool.

In the 0.4.0rc1 bitcoin client:

If I set keypool=1, how many times should I be able to do getnewaddress?

Are there any resources where I can read about keypool, and how it works?

**Tags:** testing

> **Comments:**
> **username_1**: Presumably you are referring to the default Bitcoin client?  If so you should probably specify in the post, as it otherwise is devoid of context.  
> **username_0**: I have edited the question to show that I mean the 0.4.0rc1 client  
> **username_2**: Others have provided the explanation on what keypool=1 does.  I would strongly recommend not using a small kelpool unless you perform backs after each transaction.  When the client creates an address it does so randomly.  So if an address is created AFTER a backup then that address will be lost if wallet is lost.  With keypool of 100 (the default) you could make 100 new addresses (via new transactions) and the backup would still be valid.  

---

## 2 answers

### Answer by username_4 on 2011-09-08. Score: 13 | Accepted answer

You can do `getnewaddress` as many times as you want. The `keypool` parameter just sets how many *extra* keys the client creates when it needs to create keys. With `keypool` set to 1, the client will create one extra key every time it needs to create a key.

Setting `keypool` low will keep your wallet smaller. But it will mean you have to backup your wallet more often to avoid losing the keys to newly-created addresses.


---

### Answer by username_3 on 2011-11-05. Score: 7

The keypool is a collection of unused addresses in your wallet. The keypool parameter tells the client how many unused addresses to keep in its pool.

Almost every time you send a Bitcoin payment, some change is generated and sent to a previously unused address. If you have a keypool, then each time a new address is needed one of the keypool addresses is used, and a new address is created and placed in the keypool to replace the one that was just used.

The purpose of the keypool is to allow you to backup your wallet file less frequently and still have access to all your funds in the event of a hard drive failure. If you didn't have a keypool, and made a backup of your wallet, then made a payment, and then suffered a disk crash, you would lose the change which came from that payment because it would have been sent to a new address that wasn't in the backup.

With a keypool of 100 addresses, you can make up to 100 payments between backups and still be able to access all your funds.

<https://en.bitcoin.it/wiki/Key_pool>


---

