<p>There are many types of addresses, see <a href="https://en.bitcoin.it/wiki/Transaction" rel="nofollow noreferrer">Bitcoin Transaction</a>, each can be created for the same recipient (key pair). For example:</p>

<ul>
<li>Pay to PubKey Hash (P2PKH) - These start with 1. This is basically just a hash of your public key. If you can prove you own the public key, you can spend it.</li>
<li>Pay to Script Hash (P2SH) - These start with 3. This is a script that you must prove you can satisfy using your private key. There are many types of scripts as well.</li>
</ul>

<p>They are just different ways of locking Bitcoin for a recipient, but in all of them the recipient must use the private key to satisfy the lock to spend the Bitcoin.</p>

CC BY-SA 4.0
2018-07-07T13:45:42.120Z
2018-07-07T14:03:40.830Z
2018-07-07T14:03:40.830Z
JBaczuk
<p>An overview of the address types, check out: 
<a href="https://en.bitcoin.it/wiki/Address" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Address</a></p>

<p>You are looking for P2SH, <a href="https://segwitaddress.org/" rel="nofollow noreferrer">https://segwitaddress.org/</a> just scroll down and put in your compressed WIF key at the 'Details' section. </p>

<p>Further check out <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">https://iancoleman.io/bip39/</a> </p>

<p>BIP44, BIP49 and BIP 85 are also implemented in the Coinomi Wallet. </p>

<p><a href="https://coinomi.freshdesk.com/support/solutions/articles/29000009746-what-are-default-compatibility-and-legacy-addresses-all-about-segwit-" rel="nofollow noreferrer">https://coinomi.freshdesk.com/support/solutions/articles/29000009746-what-are-default-compatibility-and-legacy-addresses-all-about-segwit-</a></p>

CC BY-SA 4.0
2022-08-11T01:30:50.337Z
You meant BIP84 there. BIP85 is very different
HansBKK
CC BY-SA 4.0
2018-07-07T19:12:06.313Z
2018-07-07T19:12:06.313Z
Querzel
<p>First a private key is created. Then a public key is generated from it. Finally it is encoded into a format.</p>

<p>See <a href="https://coinb.in/?verify=037fa484e4b870082298d6acca0702a48714323664c647604e6461d4739feb0d9b#verify" rel="nofollow noreferrer">https://coinb.in/?verify=037fa484e4b870082298d6acca0702a48714323664c647604e6461d4739feb0d9b#verify</a></p>

CC BY-SA 4.0
2018-07-09T12:01:46.333Z
2018-07-09T12:01:46.333Z
Anonymous
<p>The same private key can be used to derive a couple of different addresses. For example, there will be a different address generated depending on whether you use a compressed or uncompressed public key in the derivation. </p>

<p>More relevant to your question, you can use a private key to derive a P2SH-wrapped segwit address (<code>3ASaGJ..</code> in your example), or just a plain old P2PKH address (<code>1C8ju3..</code> in your example). Both addresses are spendable using the same private key, since they are both derived from the same private key. </p>

<p>Note that you should <strong>not</strong> design a wallet to create segwit addresses using an uncompressed public key (use the compressed key only!), due to potential backwards-compatibility issues in the future.</p>

<p>This image from the <a href="https://en.bitcoin.it/wiki/Address" rel="noreferrer">bitcoin wiki Address page</a> helps to illustrate this point:</p>

<p><a href="https://i.sstatic.net/YgJUD.jpg" rel="noreferrer"><img src="https://i.sstatic.net/YgJUD.jpg" alt="Bitcoin Address Derivation Map"></a></p>

CC BY-SA 4.0
2018-07-08T11:03:23.760Z
Thanks for all answers, I think this one is the most detailed.
Robert
CC BY-SA 4.0
2018-07-07T21:21:54.417Z
2018-07-07T21:21:54.417Z
chytrik
<p>I am wondering if you can explain this.</p>
<p>I went here:
<a href="https://coinb.in/#newSegWit" rel="nofollow noreferrer">https://coinb.in/#newSegWit</a></p>
<p>Created the SegWit Address below:</p>
<pre><code>3ASaGJ8h2bLn6Jha3hncBzXUKRCLyfv9bk
</code></pre>
<p>RedeemScript</p>
<pre><code>037fa484e4b870082298d6acca0702a48714323664c647604e6461d4739feb0d9b
</code></pre>
<p>Public key</p>
<pre><code>00147a201aa7e1cfb799dcfc2b447a0238421ae2fa60
</code></pre>
<p>Private key (WIF key)</p>
<pre><code>KzVonapu3Cf7DaMpaqkUQ9tpsBQPBH7Yk6tXJdvMwuJSy97GK7dc
</code></pre>
<p>Then I opened Electrum  v3.1.3 and Imported WIF Pkey above.</p>
<p>And I got this address instead:</p>
<pre><code>1C8ju39MFSPXNqtYDhsuB3Ek45L46dBr3G
</code></pre>
<p>So now there are two addresses,  one SegWit (or I think P2SH) starting with 3... and the legacy address from Electrum starting with 1...</p>
<p>Appreciate an explanation of this.</p>

CC BY-SA 4.0
2018-07-07T12:56:49.120Z
are you asking how addresses are generated or do you not understand why there are different types of addresses?
JBaczuk
CC BY-SA 4.0
2018-07-07T13:37:15.887Z
I want to understand how is it possible that the same WIF Private Key generates two different addresses? I knew that each address has its unique private key.
Robert
CC BY-SA 4.0
2018-07-09T10:17:00.137Z
There was a longer thread here: https://bitcoin.stackexchange.com/questions/69315/how-are-compressed-pubkeys-generated, which looks at the WIF keys and corresponding priv and pubkeys (though there is no P2SH involved).
pebwindkraft
<address><private-key><address-generation><p2sh>
How is it possible that the same WIF Private Key generates two different addresses?
Robert
# How is it possible that the same WIF Private Key generates two different addresses?

(Asked by: username_0 on 2018-07-07)

I am wondering if you can explain this.
I went here:
https://coinb.in/#newSegWit
Created the SegWit Address below:
3ASaGJ8h2bLn6Jha3hncBzXUKRCLyfv9bk

RedeemScript
037fa484e4b870082298d6acca0702a48714323664c647604e6461d4739feb0d9b

Public key
00147a201aa7e1cfb799dcfc2b447a0238421ae2fa60

Private key (WIF key)
KzVonapu3Cf7DaMpaqkUQ9tpsBQPBH7Yk6tXJdvMwuJSy97GK7dc

Then I opened Electrum  v3.1.3 and Imported WIF Pkey above.
And I got this address instead:
1C8ju39MFSPXNqtYDhsuB3Ek45L46dBr3G

So now there are two addresses,  one SegWit (or I think P2SH) starting with 3... and the legacy address from Electrum starting with 1...
Appreciate an explanation of this.

**Tags:** address, private-key, address-generation, p2sh

> **Comments:**
> **username_1**: are you asking how addresses are generated or do you not understand why there are different types of addresses?  
> **username_0**: I want to understand how is it possible that the same WIF Private Key generates two different addresses? I knew that each address has its unique private key.  
> **username_2**: There was a longer thread here: https://bitcoin.stackexchange.com/questions/69315/how-are-compressed-pubkeys-generated, which looks at the WIF keys and corresponding priv and pubkeys (though there is no P2SH involved).  

---

## 4 answers

### Answer by username_6 on 2018-07-07. Score: 6 | Accepted answer

The same private key can be used to derive a couple of different addresses. For example, there will be a different address generated depending on whether you use a compressed or uncompressed public key in the derivation.

More relevant to your question, you can use a private key to derive a P2SH-wrapped segwit address (`3ASaGJ..` in your example), or just a plain old P2PKH address (`1C8ju3..` in your example). Both addresses are spendable using the same private key, since they are both derived from the same private key.

Note that you should **not** design a wallet to create segwit addresses using an uncompressed public key (use the compressed key only!), due to potential backwards-compatibility issues in the future.

This image from the [bitcoin wiki Address page](https://en.bitcoin.it/wiki/Address) helps to illustrate this point:

[![Bitcoin Address Derivation Map](https://i.sstatic.net/YgJUD.jpg)](https://i.sstatic.net/YgJUD.jpg)

> **Comments:**
> **username_0**: Thanks for all answers, I think this one is the most detailed.  

---

### Answer by username_1 on 2018-07-07. Score: 2

There are many types of addresses, see [Bitcoin Transaction](https://en.bitcoin.it/wiki/Transaction), each can be created for the same recipient (key pair). For example:

* Pay to PubKey Hash (P2PKH) - These start with 1. This is basically just a hash of your public key. If you can prove you own the public key, you can spend it.
* Pay to Script Hash (P2SH) - These start with 3. This is a script that you must prove you can satisfy using your private key. There are many types of scripts as well.

They are just different ways of locking Bitcoin for a recipient, but in all of them the recipient must use the private key to satisfy the lock to spend the Bitcoin.


---

### Answer by username_3 on 2018-07-07. Score: 2

An overview of the address types, check out:
<https://en.bitcoin.it/wiki/Address>

You are looking for P2SH, <https://segwitaddress.org/> just scroll down and put in your compressed WIF key at the 'Details' section.

Further check out <https://iancoleman.io/bip39/>

BIP44, BIP49 and BIP 85 are also implemented in the Coinomi Wallet.

<https://coinomi.freshdesk.com/support/solutions/articles/29000009746-what-are-default-compatibility-and-legacy-addresses-all-about-segwit->

> **Comments:**
> **username_4**: You meant BIP84 there. BIP85 is very different  

---

### Answer by username_5 on 2018-07-09. Score: 0

First a private key is created. Then a public key is generated from it. Finally it is encoded into a format.

See <https://coinb.in/?verify=037fa484e4b870082298d6acca0702a48714323664c647604e6461d4739feb0d9b#verify>


---

