<p>In the default Bitcoin client, and most clients based on it (<a href="https://github.com/dogecoin/dogecoin/blob/87c59cadb1953f88a680e656bce334ed39b44a49/src/wallet.cpp" rel="nofollow">including Dogecoin-QT</a>), 100 private <a href="https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File" rel="nofollow">keys are pre-generated</a>, so that the wallet you backup is useful both for existing and some future transactions (roughly 50 transactions, assuming you receive on a new address and send change to a new address each time). When you ask the client to generate an address for you, it pulls from a private key from this pool (and generates another to put the pool back up to 100 at some point), from which a public key and address can be calculated. This pool size is configurable in your .conf file:</p>

<pre><code> # Pre-generate this many public/private key pairs, so wallet backups will be valid for
 # both prior transactions and several dozen future transactions.
 #keypool=100
</code></pre>

CC BY-SA 3.0
2014-02-13T08:39:24.563Z
the other answer is just saying priv key is created when I create a new address. in your answer I find that there will be a private key needed for every transaction. at around 50 + 1 transactions (receiving and sending summed up) for every action i do a new prv key is created. what is correct?
Stefan
CC BY-SA 3.0
2014-02-13T12:57:39.703Z
When a private key is **created** is dependent on what wallet software you're using. I've described Bitcoin-QT; xenoky either described another wallet or described it incorrectly. When a private key is actually **used** is when you make a new address. You could send and receive everything from one address (in which case, you'll never need new private keys), but for anonymity (so people can't look at the blockchain and easily know all of your transactions) you should make them basically single-use. In this case, you might run through 100 in 50 transactions.
Tim S.
CC BY-SA 3.0
2014-02-12T16:30:18.243Z
2014-02-12T16:35:53.793Z
2014-02-12T16:35:53.793Z
Tim S.
<p>I have just started mining and in another question of mine it came up, that there can be multiple private keys in a wallet because of defining a backup strategy.</p>

<p>I would like to understand when private keys are created in the wallet?
If it is specific of the coin / wallet, I am refering to dogecoin wallet application with currently 1 address created in it.</p>

<wallet>
When are private Keys created on Wallets?
Stefan
# When are private Keys created on Wallets?

(Asked by: username_0 on 2014-02-12)

I have just started mining and in another question of mine it came up, that there can be multiple private keys in a wallet because of defining a backup strategy.

I would like to understand when private keys are created in the wallet?
If it is specific of the coin / wallet, I am refering to dogecoin wallet application with currently 1 address created in it.

**Tags:** wallet


---

## 1 answers

### Answer by username_1 on 2014-02-12. Score: 2 | Accepted answer

In the default Bitcoin client, and most clients based on it ([including Dogecoin-QT](https://github.com/dogecoin/dogecoin/blob/87c59cadb1953f88a680e656bce334ed39b44a49/src/wallet.cpp)), 100 private [keys are pre-generated](https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File), so that the wallet you backup is useful both for existing and some future transactions (roughly 50 transactions, assuming you receive on a new address and send change to a new address each time). When you ask the client to generate an address for you, it pulls from a private key from this pool (and generates another to put the pool back up to 100 at some point), from which a public key and address can be calculated. This pool size is configurable in your .conf file:

```
 # Pre-generate this many public/private key pairs, so wallet backups will be valid for
 # both prior transactions and several dozen future transactions.
 #keypool=100

```

> **Comments:**
> **username_0**: the other answer is just saying priv key is created when I create a new address. in your answer I find that there will be a private key needed for every transaction. at around 50 + 1 transactions (receiving and sending summed up) for every action i do a new prv key is created. what is correct?  
> **username_1**: When a private key is **created** is dependent on what wallet software you're using. I've described Bitcoin-QT; xenoky either described another wallet or described it incorrectly. When a private key is actually **used** is when you make a new address. You could send and receive everything from one address (in which case, you'll never need new private keys), but for anonymity (so people can't look at the blockchain and easily know all of your transactions) you should make them basically single-use. In this case, you might run through 100 in 50 transactions.  

---

