<p>You have the private key so you can just derive the address from there. Get the corresponding public key, hash it with SHA256 and then that result with RIPEMD160. Then perform <a href="https://en.bitcoin.it/wiki/Base58Check_encoding" rel="nofollow noreferrer">Base58Check Encoding</a> on it.</p>

CC BY-SA 3.0
2017-11-27T09:34:10.043Z
Thanks, will try. And the result of this is the 1.. legacy address? How do I get the private key for it?
JohnDoe
CC BY-SA 3.0
2017-11-27T15:34:10.673Z
The private key is the same private key for your segwit address.
Ava Chow
CC BY-SA 3.0
2017-12-27T08:41:39.380Z
can i generate the legacy address back from the segwit address?
example :
getlegacyaddress <segwit-addr>
mrtechmaker
CC BY-SA 3.0
2017-12-27T08:45:22.687Z
@KaranAhuja If you need a legacy address, you should create a new legacy address rather than converting an existing one. The 'addwitnessaddress' approach was intended for testing only; over time, Bitcoin Core won't allow you to convert one address type into another anymore.
Pieter Wuille
CC BY-SA 3.0
2017-11-26T17:15:50.110Z
2017-11-26T17:15:50.110Z
Ava Chow
<p>I have a Segwit P2SH address (starting with 3...) with the corresponding private key and need to obtain the legacy address (starting with 1...) and the private key. Is this possible?</p>

<address><segregated-witness><p2sh>
How to get legacy address and private key from Segwit P2SH address?
JohnDoe
# How to get legacy address and private key from Segwit P2SH address?

(Asked by: username_0 on 2017-11-26)

I have a Segwit P2SH address (starting with 3...) with the corresponding private key and need to obtain the legacy address (starting with 1...) and the private key. Is this possible?

**Tags:** address, segregated-witness, p2sh


---

## 1 answers

### Answer by username_1 on 2017-11-26. Score: 2 | Accepted answer

You have the private key so you can just derive the address from there. Get the corresponding public key, hash it with SHA256 and then that result with RIPEMD160. Then perform [Base58Check Encoding](https://en.bitcoin.it/wiki/Base58Check_encoding) on it.

> **Comments:**
> **username_0**: Thanks, will try. And the result of this is the 1.. legacy address? How do I get the private key for it?  
> **username_1**: The private key is the same private key for your segwit address.  
> **username_2**: can i generate the legacy address back from the segwit address? example : getlegacyaddress <segwit-addr>  
> **username_3**: @KaranAhuja If you need a legacy address, you should create a new legacy address rather than converting an existing one. The 'addwitnessaddress' approach was intended for testing only; over time, Bitcoin Core won't allow you to convert one address type into another anymore.  

---

