<p>When you generate a wallet, then the wallet contains by default <a href="https://en.bitcoin.it/wiki/Key_pool" rel="nofollow">100 bitcoin addresses</a>. This is good for many reasons, e.g. old backups of your wallet might be able to recover all loses in case of a harddrive failure, etc.</p>

<p>The "privacy reason" is that someone looking at the blockchain can't see which bitcoin go to the receiver and which is the change of the inputs.</p>

<p>And last but not least, the "security reason" is because every bitcoin addresses is just a hash of a public key, so someone with a working quantum computer can't attack the public key (as he can only see a hash of the key, not the key itself). But whenever you need to spend bitcoins, you need to reveal the public key, so all addresses that have previously spend bitcoins will be "vulnerable" (but new addresses wont).</p>

CC BY-SA 3.0
2013-03-07T11:22:30.923Z
So the answer to the question in the title is "Yes".
Stephen Gornick
CC BY-SA 3.0
2013-03-08T20:56:42.567Z
How about "does it generate a new address each time this is done, or first searches the wallet if there is an empty address there already?" I am specifically interested in whether externally imported keys will be eventually used for the change (if unused before) or if the change always comes to an address previously non-existing in the wallet?
Tibet
CC BY-SA 3.0
2013-04-29T08:56:32.907Z
That "public key" explanation doesn't make much sense: public keys are public, private keys are private, and there's no reason (nor _way_) to "protect" public keys.
o0'.
CC BY-SA 3.0
2013-04-29T15:09:12.793Z
I did not say that public keys ain't public, I said that bitcoin addresses are **hashes** of public keys. And attacking the hash of the key is much harder than attacking the key (i.e. you "protect" the public key by not revealing it). When you spend bitcoins, you need to reveal the public key, but at the same time you move all bitcoins on the address to a new address with a new undisclosed public key. So any attackers will only have a very small timeframe to attack your public key (vs having as much time as a reused address has bitcoins _on it_)
Nicolai
CC BY-SA 3.0
2013-03-07T00:23:16.310Z
2013-03-07T00:23:16.310Z
Nicolai
<p>Yes, if there is change then it is sent to a new address. See <a href="https://en.bitcoin.it/wiki/Change" rel="nofollow">https://en.bitcoin.it/wiki/Change</a> <br/><br/>
Of course if the sum of all output transactions used for the one input address (the receiver) is exactly the correct amount then no change is needed thus nothing is sent to a new address.<br/><br/>
This will not change in future versions of the client because it is part of the Bitcoin design.</p>

CC BY-SA 3.0
2013-03-31T22:51:41.443Z
2013-03-31T22:51:41.443Z
torusJKL
<p>Experimentally, this seems to be the case, but is it always like this or depends on some details?
Also, does it generate a new address each time this is done, or first searches the wallet if there is an empty address there already? (And uses that in that case)
Is it likely that this behaviour will change in a later version of the satoshi client? </p>

CC BY-SA 3.0
2013-04-29T02:50:26.013Z
possible duplicate of [Why does Bitcoin send the "change" to a different address?](http://bitcoin.stackexchange.com/questions/1629/why-does-bitcoin-send-the-change-to-a-different-address)
Stephen Gornick
CC BY-SA 3.0
2013-04-29T08:53:13.517Z
Not a duplicate: he didn't ask "why", he asked "when"(does it do that), and he asked "if"(will it change in future).
o0'.
<transactions><bitcoin-core><address><change>
Does the satoshi client always send the change of a transaction to a newly generated address?
Tibet
# Does the satoshi client always send the change of a transaction to a newly generated address?

(Asked by: username_0 on 2013-03-06)

Experimentally, this seems to be the case, but is it always like this or depends on some details?
Also, does it generate a new address each time this is done, or first searches the wallet if there is an empty address there already? (And uses that in that case)
Is it likely that this behaviour will change in a later version of the satoshi client?

**Tags:** transactions, bitcoin-core, address, change

> **Comments:**
> **username_1**: possible duplicate of [Why does Bitcoin send the "change" to a different address?](http://bitcoin.stackexchange.com/questions/1629/why-does-bitcoin-send-the-change-to-a-different-address)  
> **username_2**: Not a duplicate: he didn't ask "why", he asked "when"(does it do that), and he asked "if"(will it change in future).  

---

## 2 answers

### Answer by username_3 on 2013-03-07. Score: 3

When you generate a wallet, then the wallet contains by default [100 bitcoin addresses](https://en.bitcoin.it/wiki/Key_pool). This is good for many reasons, e.g. old backups of your wallet might be able to recover all loses in case of a harddrive failure, etc.

The "privacy reason" is that someone looking at the blockchain can't see which bitcoin go to the receiver and which is the change of the inputs.

And last but not least, the "security reason" is because every bitcoin addresses is just a hash of a public key, so someone with a working quantum computer can't attack the public key (as he can only see a hash of the key, not the key itself). But whenever you need to spend bitcoins, you need to reveal the public key, so all addresses that have previously spend bitcoins will be "vulnerable" (but new addresses wont).

> **Comments:**
> **username_1**: So the answer to the question in the title is "Yes".  
> **username_0**: How about "does it generate a new address each time this is done, or first searches the wallet if there is an empty address there already?" I am specifically interested in whether externally imported keys will be eventually used for the change (if unused before) or if the change always comes to an address previously non-existing in the wallet?  
> **username_2**: That "public key" explanation doesn't make much sense: public keys are public, private keys are private, and there's no reason (nor _way_) to "protect" public keys.  
> **username_3**: I did not say that public keys ain't public, I said that bitcoin addresses are **hashes** of public keys. And attacking the hash of the key is much harder than attacking the key (i.e. you "protect" the public key by not revealing it). When you spend bitcoins, you need to reveal the public key, but at the same time you move all bitcoins on the address to a new address with a new undisclosed public key. So any attackers will only have a very small timeframe to attack your public key (vs having as much time as a reused address has bitcoins _on it_)  

---

### Answer by username_4 on 2013-03-31. Score: 0

Yes, if there is change then it is sent to a new address. See <https://en.bitcoin.it/wiki/Change>   
  
Of course if the sum of all output transactions used for the one input address (the receiver) is exactly the correct amount then no change is needed thus nothing is sent to a new address.  
  
This will not change in future versions of the client because it is part of the Bitcoin design.


---

