<p>There is no standard for specifying whether a private key should correspond to a bech32 address, P2SH nested segwit address, or P2PKH address (1... address). The WIF format has traditionally been used for P2PKH addresses. However some wallets now will decide to instead create a P2SH nested segwit address or even a bech32 address instead. But because there is no standard for private keys that correspond to segwit addresses, it is entirely up to the wallet to determine what kind of address to give you for a private key.</p>

<p>In your case, the wallet gave you a P2SH nested segwit address. But it could have just as easily given you the P2PKH address or the bech32 address since the private key can be used to produce all 3 types of addresses.</p>

CC BY-SA 3.0
2018-02-03T22:42:47.593Z
So any btc **private key** can generate 3 different types of addresses: 1xxx (legacy), 3xxxx (P2SH), and bc1 (Segwit)? My question now is how can I extract all 3 of these addresses from a single private key? My main goal is to see if the bc1 address matches my private key as I can't figure out any way of **verifying** if they match.
Patoshi パトシ
CC BY-SA 3.0
2018-02-03T22:46:12.713Z
Yes, any private key can be used to generate those 3 types of addresses. In theory, it could actually be used to generate an infinite amount of P2SH addresses as the scripts can include basically any arbitrary data in addition to the public key. The only to check the addresses is to find a software that will generate each one for you.
Ava Chow
CC BY-SA 3.0
2018-02-05T20:20:14.317Z
Which software would do this?
Patoshi パトシ
CC BY-SA 3.0
2018-02-03T04:43:02.293Z
2018-02-03T04:43:02.293Z
Ava Chow
<p>Yes. this is normal, it's simply a matter of how it is derived.</p>

<p>I can even import your private key with a legacy wallet (in Electrum), which gives me 1QGFb7AUSFFnXEfBMUEf79NGKXqXMf9TQ7</p>

<p>You can then do a base58 check to see if it is valid.</p>

<p>See <a href="http://lenschulwitz.com/base58" rel="nofollow noreferrer">http://lenschulwitz.com/base58</a> and validate for yourself.</p>

CC BY-SA 3.0
2018-02-02T22:03:27.023Z
Yeah but how do I check if the bc1xxxxx address corresponds to the same private key?
Patoshi パトシ
CC BY-SA 3.0
2018-02-02T22:47:39.930Z
You will need to find a wallet/service that supports the importing of a private key, and then the derivation to a bc1 adress. I'm not sure if Electrum allows you to import keys in their bc1 compatible wallets, but i guess you could try.
Jan Janssen
CC BY-SA 3.0
2018-02-02T21:55:52.533Z
2018-02-02T21:55:52.533Z
Jan Janssen
<p>I have the following btc private key that I generated from another application: </p>

<p>5KCPzu4tEAnFqwLrXUbW3GKMDSnUYY8CMie2HMRuHouSvrFhXA9</p>

<p>That application gives me the following segwit address:</p>

<p>bc1qluk574lw9t536u72n0z2ya0ksx3s0kg0evkrme</p>

<p>But when I goto <a href="https://segwitaddress.org" rel="nofollow noreferrer">https://segwitaddress.org</a> and scroll down and enter in my private key at <strong>Enter a WIF private key to generate its corresponding segwit address.</strong> I get a totally different address:</p>

<p><strong>37wArHq69dxRwLkHt6MY8PpmbB6qjErrbK</strong></p>

<p>So do these 2 public keys actually have the same private key? How do I verify if my private key does indeed output the same public keys? I couldn't find any program to do this verification. </p>

<address><private-key><segregated-witness><public-key><address-generation>
Why is my segwit private key generating a 3 address vs a bc1 address like how I originally generated?
Patoshi パトシ
# Why is my segwit private key generating a 3 address vs a bc1 address like how I originally generated?

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

I have the following btc private key that I generated from another application:

5KCPzu4tEAnFqwLrXUbW3GKMDSnUYY8CMie2HMRuHouSvrFhXA9

That application gives me the following segwit address:

bc1qluk574lw9t536u72n0z2ya0ksx3s0kg0evkrme

But when I goto <https://segwitaddress.org> and scroll down and enter in my private key at **Enter a WIF private key to generate its corresponding segwit address.** I get a totally different address:

**37wArHq69dxRwLkHt6MY8PpmbB6qjErrbK**

So do these 2 public keys actually have the same private key? How do I verify if my private key does indeed output the same public keys? I couldn't find any program to do this verification.

**Tags:** address, private-key, segregated-witness, public-key, address-generation


---

## 2 answers

### Answer by username_1 on 2018-02-03. Score: 2 | Accepted answer

There is no standard for specifying whether a private key should correspond to a bech32 address, P2SH nested segwit address, or P2PKH address (1... address). The WIF format has traditionally been used for P2PKH addresses. However some wallets now will decide to instead create a P2SH nested segwit address or even a bech32 address instead. But because there is no standard for private keys that correspond to segwit addresses, it is entirely up to the wallet to determine what kind of address to give you for a private key.

In your case, the wallet gave you a P2SH nested segwit address. But it could have just as easily given you the P2PKH address or the bech32 address since the private key can be used to produce all 3 types of addresses.

> **Comments:**
> **username_0**: So any btc **private key** can generate 3 different types of addresses: 1xxx (legacy), 3xxxx (P2SH), and bc1 (Segwit)? My question now is how can I extract all 3 of these addresses from a single private key? My main goal is to see if the bc1 address matches my private key as I can't figure out any way of **verifying** if they match.  
> **username_1**: Yes, any private key can be used to generate those 3 types of addresses. In theory, it could actually be used to generate an infinite amount of P2SH addresses as the scripts can include basically any arbitrary data in addition to the public key. The only to check the addresses is to find a software that will generate each one for you.  
> **username_0**: Which software would do this?  

---

### Answer by username_2 on 2018-02-02. Score: 1

Yes. this is normal, it's simply a matter of how it is derived.

I can even import your private key with a legacy wallet (in Electrum), which gives me 1QGFb7AUSFFnXEfBMUEf79NGKXqXMf9TQ7

You can then do a base58 check to see if it is valid.

See <http://lenschulwitz.com/base58> and validate for yourself.

> **Comments:**
> **username_0**: Yeah but how do I check if the bc1xxxxx address corresponds to the same private key?  
> **username_2**: You will need to find a wallet/service that supports the importing of a private key, and then the derivation to a bc1 adress. I'm not sure if Electrum allows you to import keys in their bc1 compatible wallets, but i guess you could try.  

---

