<h2>You have many private keys</h2>

<p>Quintessentially, <strong>a wallet is a key chain for your private keys</strong> plus optional convenience and usability functions. When you create a wallet, at least one but usually lots of private keys are generated. E.g. <code>Bitcoin Core</code> keeps 100 unused private keys in store at all times by default, and whenever you use a new address, this pool of unused keys get topped up again.</p>

<h2>You have a different private key for each address</h2>

<ol>
<li>From a private key, you can easily derive the corresponding public key: Together they form an ECDSA key pair on the <code>secp256k1</code> curve. You cannot easily derive the private key from the public key.</li>
<li>The address is then derived from the public key: First you hash the public key with <code>SHA-256</code>, then you hash the result with <code>RIPEMD-160</code>. The result is then formatted in Base 58 including a checksum.</li>
</ol>

<p>Therefore, each private-key only corresponds to one address.
(Vice versa, each address corresponds to 2^96 private keys, of which any one is sufficient to spend any funds associated with the address, but that doesn't concern us here.) </p>

<p>The above is true for any wallet that uses unrelated private keys. There is also another scheme which is called <strong>hierarchical deterministic wallet</strong>: There, you create one "master key" from which you can recreate all following keys deterministically.<br>
Simplified:</p>

<pre><code>    Master key:     12378925612143
    key + 1:        12378925612144
    key + 3:        12378925612146
    key + 6:        12378925612149
    key + 10:       12378925612153
    key + 15:       12378925612168
    key + 21:       12378925612174
    key + 28:       12378925612181
    …
</code></pre>

<p>As you can see, if you have the master key, and know the derivation rule, you can recreate the same keys again.</p>

<p>This is safe, because even when providing a signature, your private key is never revealed, or even when you reveal one out of your chain of private keys, your derivation rule is still unknown.</p>

<h2>Different addresses are for privacy</h2>

<p>Why should you actually use a different address every time?  Actually, it is fine to use an address for multiple transactions. Most wallets do not do it, to increase privacy: If you use the same address over and over again, it is obvious that all these transactions are related to the same person. By using a new address for every transaction, transactions may still be linked by clever blockchain analysis but it isn't immediately obvious, may be plausibly deniable, or (with some effort) transactions can even appear completely unrelated.</p>

CC BY-SA 3.0
2016-04-01T13:40:25.320Z
2016-04-01T13:40:25.320Z
Murch
<p>If you are posting different questions I suggest, posting them up in different threads. But I'll try to answer all of them.</p>

<p>1) It doesn't work like that. Every address is a pair (private key, public key), the address is made after hashing the public key twice.</p>

<p>So, each address has one private key and private keys are not shared.</p>

<p>So if in one address you have 1 btc, and you want to send 0.5 btc to some other address, usually the wallet software creates a new address that receives the difference minus the tx fee, that's your change address and any further transaction that spends the funds will spend from that address (the change address).</p>

<p>To clarify, address A has 1 btc. You want to send 0.5 btc to some address B.</p>

<p>What happens is, the balance of address A is fully spent into </p>

<pre><code>B          (0.5)    &lt;--- amount you want to spend
C          (0.4999) &lt;--- amount you are left with after spending
fee        (0.0001) &lt;--- transaction fee on spending B
A (total)  (1)      &lt;--- original balance. fully spent
</code></pre>

<p><strong>C</strong> is your change address, and when you spend your coins again you will spend from C and not from A.</p>

<p>2) The Public Key is obtained with one method related to how the way ECDSA works and the address is obtained by another method, mainly it is double hash of the public key that is encoded in a format called base58check as it includes a checksum to ensure that you didn't type the wrong address, also base 58 is designed to eliminate similarly looking characters, like 0 and O or l and I.</p>

<p>3) For the last question I'd like to refer you to <a href="https://bitcoin.stackexchange.com/questions/43435/how-are-bitcoins-reassigned/43436#43436">How are bitcoins reassigned</a></p>

CC BY-SA 3.0
2016-03-30T02:31:11.030Z
2017-06-26T18:23:28.860Z
2017-06-26T18:23:28.860Z
galileopy
<p>I have read from many sites that an address should change every time a Bitcoin transaction is made. Does the private key change along with the Bitcoin address. How is the address obtained from the public key? Is it the same method of deriving the public key from the private key?</p>

<address><private-key><public-key>
Does the private key of Bitcoin change everytime the address changes?
I'm Curious
# Does the private key of Bitcoin change everytime the address changes?

(Asked by: username_0 on 2016-03-30)

I have read from many sites that an address should change every time a Bitcoin transaction is made. Does the private key change along with the Bitcoin address. How is the address obtained from the public key? Is it the same method of deriving the public key from the private key?

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


---

## 2 answers

### Answer by username_1 on 2016-04-01. Score: 9

## You have many private keys

Quintessentially, **a wallet is a key chain for your private keys** plus optional convenience and usability functions. When you create a wallet, at least one but usually lots of private keys are generated. E.g. `Bitcoin Core` keeps 100 unused private keys in store at all times by default, and whenever you use a new address, this pool of unused keys get topped up again.

## You have a different private key for each address

1. From a private key, you can easily derive the corresponding public key: Together they form an ECDSA key pair on the `secp256k1` curve. You cannot easily derive the private key from the public key.
2. The address is then derived from the public key: First you hash the public key with `SHA-256`, then you hash the result with `RIPEMD-160`. The result is then formatted in Base 58 including a checksum.

Therefore, each private-key only corresponds to one address.
(Vice versa, each address corresponds to 2^96 private keys, of which any one is sufficient to spend any funds associated with the address, but that doesn't concern us here.)

The above is true for any wallet that uses unrelated private keys. There is also another scheme which is called **hierarchical deterministic wallet**: There, you create one "master key" from which you can recreate all following keys deterministically.  
Simplified:

```
    Master key:     12378925612143
    key + 1:        12378925612144
    key + 3:        12378925612146
    key + 6:        12378925612149
    key + 10:       12378925612153
    key + 15:       12378925612168
    key + 21:       12378925612174
    key + 28:       12378925612181
    …

```

As you can see, if you have the master key, and know the derivation rule, you can recreate the same keys again.

This is safe, because even when providing a signature, your private key is never revealed, or even when you reveal one out of your chain of private keys, your derivation rule is still unknown.

## Different addresses are for privacy

Why should you actually use a different address every time? Actually, it is fine to use an address for multiple transactions. Most wallets do not do it, to increase privacy: If you use the same address over and over again, it is obvious that all these transactions are related to the same person. By using a new address for every transaction, transactions may still be linked by clever blockchain analysis but it isn't immediately obvious, may be plausibly deniable, or (with some effort) transactions can even appear completely unrelated.


---

### Answer by username_2 on 2016-03-30. Score: 8

If you are posting different questions I suggest, posting them up in different threads. But I'll try to answer all of them.

1) It doesn't work like that. Every address is a pair (private key, public key), the address is made after hashing the public key twice.

So, each address has one private key and private keys are not shared.

So if in one address you have 1 btc, and you want to send 0.5 btc to some other address, usually the wallet software creates a new address that receives the difference minus the tx fee, that's your change address and any further transaction that spends the funds will spend from that address (the change address).

To clarify, address A has 1 btc. You want to send 0.5 btc to some address B.

What happens is, the balance of address A is fully spent into

```
B          (0.5)    <--- amount you want to spend
C          (0.4999) <--- amount you are left with after spending
fee        (0.0001) <--- transaction fee on spending B
A (total)  (1)      <--- original balance. fully spent

```

**C** is your change address, and when you spend your coins again you will spend from C and not from A.

2) The Public Key is obtained with one method related to how the way ECDSA works and the address is obtained by another method, mainly it is double hash of the public key that is encoded in a format called base58check as it includes a checksum to ensure that you didn't type the wrong address, also base 58 is designed to eliminate similarly looking characters, like 0 and O or l and I.

3) For the last question I'd like to refer you to [How are bitcoins reassigned](https://bitcoin.stackexchange.com/questions/43435/how-are-bitcoins-reassigned/43436#43436)


---

