<p>When you create a new wallet you create 100 new private keys. From these can be derived the public keys and the "address". The keys are created randomly, so could in theory be the same as one already in existence, but that is so unlikely it will never happen.</p>

<p>Difference between the public key and the address is that the address is a "hash" of the public key along with a checksum added (so you can not mistype it) and is converted into characters that can be displayed and copy/pasted easily (base58). </p>

<p>Technical details are here: <a href="https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses" rel="nofollow">https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses</a></p>

<p>The only reason that 100 addresses are created is that when you backup your wallet, you will have saved the next 100 address you will use. So even if you do some transactions then lose the wallet and have to restore from backup you should still be able to get your bitcoins back (assuming you used less than 100 addresses since the backup).</p>

CC BY-SA 3.0
2014-04-15T10:00:31.863Z
Good point recovering from the backup! Note this is a double–edged sword: if someone steals your backup (or access your osx time machine at a point where there was no encryption!), your future transactions will be stolen too.
laffuste
CC BY-SA 3.0
2012-07-21T16:56:35.393Z
2012-07-21T17:55:41.063Z
2012-07-21T17:55:41.063Z
nibor
<p>Your wallet is a collection of private keys and a record of the transactions relating to them.  By default your wallet has a key pool of 100 keys.  So when your wallet is created, around 100 private keys are randomly generated and stored in your wallet.</p>

<p>Each private key has a corresponding public key, and each public key has a corresponding address.  A public key isn't "the same thing as" an address, but there is an algorithm that can give you the address corresponding to any given public key.  The reverse isn't true.  There are many different public keys for each address, since public keys are 256 bits wide and addresses are only 160 bits wide.</p>

<p>When you click 'new address' in the 'receive coins' tab of the client, it will show you an address you've not seen before.  It is taken from the 100 address keypool.  The keypool is topped up when possible to always contain 100 unseen addresses.  If your wallet is encrypted then it's not possible to top up the keypool until the wallet is unlocked with the passphrase.</p>

<p>Also, when you make a transaction out of your wallet, it's quite likely that the amount you are sending doesn't exactly match the sum of any of the inputs you currently have private keys for, and so some 'change' needs to be sent back to your wallet.  When this happens an address from your 100 address keypool is used to receive the change.  In this case the keypool will be immediately topped up, since your wallet will need to be unlocked since you're spending coins.</p>

<p>This all happens behind the scenes - you won't see any evidence of it happening unless you look at the blockchain.</p>

CC BY-SA 3.0
2012-07-21T18:04:40.180Z
2012-07-21T18:04:40.180Z
Chris Moore
<p><strong>I am asking for what is being created when there is a new wallet created.</strong> </p>

<p>And the second part of my question is considering public key. <strong>Is the public key the same thing as the address?</strong> I read that there is for every private key a large pool of 100 adresses. Every adress is used when sending any single transaction and "creating" new adress. </p>

CC BY-SA 3.0
2012-07-21T20:06:12.450Z
There are many types of wallets and clients, each of which can operate in a unique way regarding how it stores and manages the wallet.  You may wish to clarify that you are inquiring specifically about wallet for the Bitcoin.org client.
Stephen Gornick
CC BY-SA 3.0
2012-07-21T20:27:54.127Z
For each private key corresponds a public key, and an address is the hash of a public key. There is no pool of 100 addresses -per private key-, rather the wallet has a pool of 100 private keys, each of which corresponds to an address. (This is referring to the standard client)
Meni Rosenfeld
<wallet><address><private-key><public-key>
What exactly happens when a new wallet is created?
Comodore
# What exactly happens when a new wallet is created?

(Asked by: username_0 on 2012-07-21)

**I am asking for what is being created when there is a new wallet created.**

And the second part of my question is considering public key. **Is the public key the same thing as the address?** I read that there is for every private key a large pool of 100 adresses. Every adress is used when sending any single transaction and "creating" new adress.

**Tags:** wallet, address, private-key, public-key

> **Comments:**
> **username_1**: There are many types of wallets and clients, each of which can operate in a unique way regarding how it stores and manages the wallet.  You may wish to clarify that you are inquiring specifically about wallet for the Bitcoin.org client.  
> **username_2**: For each private key corresponds a public key, and an address is the hash of a public key. There is no pool of 100 addresses -per private key-, rather the wallet has a pool of 100 private keys, each of which corresponds to an address. (This is referring to the standard client)  

---

## 2 answers

### Answer by username_5 on 2012-07-21. Score: 6 | Accepted answer

Your wallet is a collection of private keys and a record of the transactions relating to them. By default your wallet has a key pool of 100 keys. So when your wallet is created, around 100 private keys are randomly generated and stored in your wallet.

Each private key has a corresponding public key, and each public key has a corresponding address. A public key isn't "the same thing as" an address, but there is an algorithm that can give you the address corresponding to any given public key. The reverse isn't true. There are many different public keys for each address, since public keys are 256 bits wide and addresses are only 160 bits wide.

When you click 'new address' in the 'receive coins' tab of the client, it will show you an address you've not seen before. It is taken from the 100 address keypool. The keypool is topped up when possible to always contain 100 unseen addresses. If your wallet is encrypted then it's not possible to top up the keypool until the wallet is unlocked with the passphrase.

Also, when you make a transaction out of your wallet, it's quite likely that the amount you are sending doesn't exactly match the sum of any of the inputs you currently have private keys for, and so some 'change' needs to be sent back to your wallet. When this happens an address from your 100 address keypool is used to receive the change. In this case the keypool will be immediately topped up, since your wallet will need to be unlocked since you're spending coins.

This all happens behind the scenes - you won't see any evidence of it happening unless you look at the blockchain.


---

### Answer by username_3 on 2012-07-21. Score: 3

When you create a new wallet you create 100 new private keys. From these can be derived the public keys and the "address". The keys are created randomly, so could in theory be the same as one already in existence, but that is so unlikely it will never happen.

Difference between the public key and the address is that the address is a "hash" of the public key along with a checksum added (so you can not mistype it) and is converted into characters that can be displayed and copy/pasted easily (base58).

Technical details are here: <https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses>

The only reason that 100 addresses are created is that when you backup your wallet, you will have saved the next 100 address you will use. So even if you do some transactions then lose the wallet and have to restore from backup you should still be able to get your bitcoins back (assuming you used less than 100 addresses since the backup).

> **Comments:**
> **username_4**: Good point recovering from the backup! Note this is a double–edged sword: if someone steals your backup (or access your osx time machine at a point where there was no encryption!), your future transactions will be stolen too.  

---

