<p>A modern Bitcoin wallet program can generate many private-keys, each private-key has a public-key. For the most common transaction types, a Bitcoin-address is derived from the public-key.</p>
<p>As you say it is normal to generate a new address (i.e. a new set of keys) for each transaction. This is because all the transaction data is public knowledge - it is in the replicated journal of transactions we call the blockchain. Anyone can see all transactions for a specific address, so if ten people each pay you 1 BTC to the same address, they can all see that you have received 10 BTC in total at that address. This is a privacy concern. If the addresses are all different, they can't tell which belong to the same person.</p>
<p>In the Bitcoin network there are no accounts, no virtual accounts and no balances.</p>
<p>A wallet can read through the whole transaction journal and add up all the unspent amounts in transactions where the receiving address is one for which the wallet knows it has the corresponding private-key. That way it can present a total amount to the user. People refer to this total as a balance but that's misleading. The Bitcoin network does not keep a record of people's balances. The Bitcoin network does not know how much money anyone has in total. The US Mint does not know how many US one-cent coins I have sitting in a plastic bag on my shelf, it doesn't keep track of my balance or have an account in my name.</p>
<p>The terminology for Bitcoin is a bit muddled. Bitcoin was designed as digital cash. Accounts and balances are associated with banks, not with piles of dollar bills under your mattress or in your leather wallet. If you were talking about cash in the form of paper money and metal coins you wouldn't think about accounts and balances. You'd just want to know the total amount of money you have in paper banknotes and metal coins.</p>
<p>Modern wallets are what is called Hierarchical Deterministic (HD) wallets. From the initial private key (or seed phrase) it is possible to generate all the subsidiary keys and addresses in a predictable and repeatable way. You don't need to make a backup of each generated key and generated address.</p>

CC BY-SA 4.0
2020-09-15T22:03:13.377Z
2020-09-15T22:15:43.540Z
2020-09-15T22:15:43.540Z
RedGrittyBrick
<blockquote>
<p>A new bitcoin user &quot;U&quot; first generates a private key. He can compute several public keys from this private key.</p>
</blockquote>
<p>The kind of private key you are referring to is an extended private key which is described in the Bitcoin Improvement Proposal 0032 (BIP32) or, like RedGrittyBrick explained, what powers HD wallets.</p>
<p>An extended private key contains only one &quot;regular&quot; private key in them, and can generate directly only one extended public key.</p>
<p>However, these extended private keys contain also some other information that makes it possible for them to generate other vast amount of <strong>child</strong> extended private keys that also contain &quot;regular&quot; private keys, and these child extended private keys can have their own vast amount of child extended private keys, and this can go on and on.</p>
<blockquote>
<p>When he wants to receive bitcoins, the user should generate an address. I do not understand if this address is a public key or if it is 2 different things.</p>
</blockquote>
<p>They are 2 different things. There are also different type of addresses, but excluding the multi-signature kind of addresses, they are all computed by encoding the hash of the public key. So an address <strong>is not</strong> a public key, but it is derived from it (P2PKH, P2WPKH). The type of address lets you know what kind of Bitcoin technology you are using to lock the BTCs.</p>
<blockquote>
<p>If my &quot;U&quot; user should receive bitcoin from 10 different people, he can generate a single common address for this 10 peoples but they will be able to see &quot;U&quot; balance, and see that he receives 10 transactions. The solution is to generate 10 different addresses. With this solution, each sender will only see its own transaction and won't see the 9 others. I am wrong ?</p>
</blockquote>
<p>This is exactly why BIP32 was proposed. An extended private key is also referred as a master private key which can generate all the child keys necessary to ensure privacy. Since you can generate with the master key an infinite amount of private keys, and therefore public keys, then you can generate an infinite amount of addresses.</p>
<blockquote>
<p>So, to shortcut, can we say &quot;U&quot; generates 10 &quot;virtual accounts&quot;, linked to its private key ?</p>
</blockquote>
<p>Yes, but remember that they would be linked to the <strong>master</strong>/<strong>extended</strong> private key. Each address has its own private key, and the private key is generated by the master key.</p>
<blockquote>
<p>If so, i do not understand how &quot;U&quot; can computes its own balance: Is there a way for him to recover all public/address he generates from its private key ? Or should user keep all the addresses he generates in a file ?</p>
</blockquote>
<p>I think RedGrittyBrick does an amazing job at explaining why we shouldn't use the term &quot;balance&quot; or &quot;virtual account&quot;, etc. But, I guess your question is how can you know how many BTCs you have access to with your master private key, right? well that is the job of the wallet. A wallet must be able to store or generate the addresses that you have used, and then scan the blockchain for Unspent Transaction Outputs (UTXOs) or in other words, unspent Bitcoins that related to those addresses. Then, The wallet adds up all these BTCs to present you with this single final amount that some people wrongly call &quot;balance&quot;.</p>

CC BY-SA 4.0
2020-09-16T06:23:51.140Z
Thanks a lot for your answer. There is something i do not understand: Imagine a lose my wallet. I have read i can recover my bitcoins if i keep my private key. So how does it work ? Should i also baclup my UTXOs somewhere ?
Bob5421
CC BY-SA 4.0
2020-09-16T07:12:14.453Z
Try to look up BIP32, BIP44 and BIP39. So, basically wallets try to use standards for address creation, which means that it's pretty easy to know what addresses the wallet is going to try to use first from the hierarchy tree (BIP32) that is derived from the master private key. So if you have you master private key, or you mnemonic phrase, then any wallet can scan the addresses derived following the BIP44 pattern to discover your UTXOs. Not all wallets are the same tho. Try to stick to one that follows BIPs or at least lets you know what protocol for address creation they use.
Oscar Serna
CC BY-SA 4.0
2020-09-16T04:08:19.433Z
2020-09-16T04:08:19.433Z
Oscar Serna
<p>There is something i am not sure to understand on bitcoin private/public keys and addresses.</p>
<p>A new bitcoin user &quot;U&quot; first generates a private key.
He can compute several public keys from this private key.</p>
<p>When he wants to receive bitcoins, the user should generate an address. I do not understand if this address is a public key or if it is 2 different things.</p>
<p>If my &quot;U&quot; user should receive bitcoin from 10 different people, he can generate a single common address for this 10 peoples but they will be able to see &quot;U&quot; balance, and see that he receives 10 transactions.
The solution is to generate 10 different addresses. With this solution, each sender will only see its own transaction and won't see the 9 others. I am wrong ?</p>
<p>So, to shortcut, can we say &quot;U&quot; generates 10 &quot;virtual accounts&quot;, linked to its private key ?</p>
<p>If so, i do not understand how &quot;U&quot; can computes its own balance: Is there a way for him to recover all public/address he generates from its private key ? Or should user keep all the addresses he generates in a file ?</p>
<p>Thanks</p>

<address><private-key><public-key>
Public key management
Bob5421
# Public key management

(Asked by: username_0 on 2020-09-15)

There is something i am not sure to understand on bitcoin private/public keys and addresses.

A new bitcoin user "U" first generates a private key.
He can compute several public keys from this private key.

When he wants to receive bitcoins, the user should generate an address. I do not understand if this address is a public key or if it is 2 different things.

If my "U" user should receive bitcoin from 10 different people, he can generate a single common address for this 10 peoples but they will be able to see "U" balance, and see that he receives 10 transactions.
The solution is to generate 10 different addresses. With this solution, each sender will only see its own transaction and won't see the 9 others. I am wrong ?

So, to shortcut, can we say "U" generates 10 "virtual accounts", linked to its private key ?

If so, i do not understand how "U" can computes its own balance: Is there a way for him to recover all public/address he generates from its private key ? Or should user keep all the addresses he generates in a file ?

Thanks

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


---

## 2 answers

### Answer by username_1 on 2020-09-15. Score: 2

A modern Bitcoin wallet program can generate many private-keys, each private-key has a public-key. For the most common transaction types, a Bitcoin-address is derived from the public-key.

As you say it is normal to generate a new address (i.e. a new set of keys) for each transaction. This is because all the transaction data is public knowledge - it is in the replicated journal of transactions we call the blockchain. Anyone can see all transactions for a specific address, so if ten people each pay you 1 BTC to the same address, they can all see that you have received 10 BTC in total at that address. This is a privacy concern. If the addresses are all different, they can't tell which belong to the same person.

In the Bitcoin network there are no accounts, no virtual accounts and no balances.

A wallet can read through the whole transaction journal and add up all the unspent amounts in transactions where the receiving address is one for which the wallet knows it has the corresponding private-key. That way it can present a total amount to the user. People refer to this total as a balance but that's misleading. The Bitcoin network does not keep a record of people's balances. The Bitcoin network does not know how much money anyone has in total. The US Mint does not know how many US one-cent coins I have sitting in a plastic bag on my shelf, it doesn't keep track of my balance or have an account in my name.

The terminology for Bitcoin is a bit muddled. Bitcoin was designed as digital cash. Accounts and balances are associated with banks, not with piles of dollar bills under your mattress or in your leather wallet. If you were talking about cash in the form of paper money and metal coins you wouldn't think about accounts and balances. You'd just want to know the total amount of money you have in paper banknotes and metal coins.

Modern wallets are what is called Hierarchical Deterministic (HD) wallets. From the initial private key (or seed phrase) it is possible to generate all the subsidiary keys and addresses in a predictable and repeatable way. You don't need to make a backup of each generated key and generated address.


---

### Answer by username_2 on 2020-09-16. Score: 0

> A new bitcoin user "U" first generates a private key. He can compute several public keys from this private key.

The kind of private key you are referring to is an extended private key which is described in the Bitcoin Improvement Proposal 0032 (BIP32) or, like username_1 explained, what powers HD wallets.

An extended private key contains only one "regular" private key in them, and can generate directly only one extended public key.

However, these extended private keys contain also some other information that makes it possible for them to generate other vast amount of **child** extended private keys that also contain "regular" private keys, and these child extended private keys can have their own vast amount of child extended private keys, and this can go on and on.

> When he wants to receive bitcoins, the user should generate an address. I do not understand if this address is a public key or if it is 2 different things.

They are 2 different things. There are also different type of addresses, but excluding the multi-signature kind of addresses, they are all computed by encoding the hash of the public key. So an address **is not** a public key, but it is derived from it (P2PKH, P2WPKH). The type of address lets you know what kind of Bitcoin technology you are using to lock the BTCs.

> If my "U" user should receive bitcoin from 10 different people, he can generate a single common address for this 10 peoples but they will be able to see "U" balance, and see that he receives 10 transactions. The solution is to generate 10 different addresses. With this solution, each sender will only see its own transaction and won't see the 9 others. I am wrong ?

This is exactly why BIP32 was proposed. An extended private key is also referred as a master private key which can generate all the child keys necessary to ensure privacy. Since you can generate with the master key an infinite amount of private keys, and therefore public keys, then you can generate an infinite amount of addresses.

> So, to shortcut, can we say "U" generates 10 "virtual accounts", linked to its private key ?

Yes, but remember that they would be linked to the **master**/**extended** private key. Each address has its own private key, and the private key is generated by the master key.

> If so, i do not understand how "U" can computes its own balance: Is there a way for him to recover all public/address he generates from its private key ? Or should user keep all the addresses he generates in a file ?

I think username_1 does an amazing job at explaining why we shouldn't use the term "balance" or "virtual account", etc. But, I guess your question is how can you know how many BTCs you have access to with your master private key, right? well that is the job of the wallet. A wallet must be able to store or generate the addresses that you have used, and then scan the blockchain for Unspent Transaction Outputs (UTXOs) or in other words, unspent Bitcoins that related to those addresses. Then, The wallet adds up all these BTCs to present you with this single final amount that some people wrongly call "balance".

> **Comments:**
> **username_0**: Thanks a lot for your answer. There is something i do not understand: Imagine a lose my wallet. I have read i can recover my bitcoins if i keep my private key. So how does it work ? Should i also baclup my UTXOs somewhere ?  
> **username_2**: Try to look up BIP32, BIP44 and BIP39. So, basically wallets try to use standards for address creation, which means that it's pretty easy to know what addresses the wallet is going to try to use first from the hierarchy tree (BIP32) that is derived from the master private key. So if you have you master private key, or you mnemonic phrase, then any wallet can scan the addresses derived following the BIP44 pattern to discover your UTXOs. Not all wallets are the same tho. Try to stick to one that follows BIPs or at least lets you know what protocol for address creation they use.  

---

