<p>In 0.15.1 you'll need to find the P2PKH address corresponding to the key (it's the argument to <code>addwitnessaddress</code> you used for creating the address in the first place), and pass that to <code>dumpprivkey</code>.</p>

<p>In 0.16, things will likely just work.</p>

CC BY-SA 3.0
2017-12-12T04:42:03.373Z
using `listreceivedbyaddress` makes it possible! Thanks
DjangoSi
CC BY-SA 3.0
2017-12-12T07:03:25.127Z
I'm confused! How does that RPC help you?
Pieter Wuille
CC BY-SA 3.0
2017-12-12T03:45:00.950Z
2017-12-12T03:45:00.950Z
Pieter Wuille
<p>Is there a way to get the private key out of an <code>P2SH-P2WPKH</code> address, using Bitcoin Core 0.15.1?
If not, is there a way to get the origin <code>P2WPKH</code> address to get the private key out of this address?</p>

CC BY-SA 3.0
2017-12-12T03:08:07.040Z
You can't go from a public key to a private key, segwit or no.
Claris
CC BY-SA 3.0
2017-12-12T03:11:52.580Z
I have the addresses in my wallet. It's not from a public key.
DjangoSi
CC BY-SA 3.0
2017-12-12T03:30:35.437Z
What wallet software are you using?
meshcollider
CC BY-SA 3.0
2017-12-12T03:34:59.437Z
0.15.1 bitcoin core
DjangoSi
<bitcoin-core><segregated-witness><p2sh><private-key-export><p2wpkh>
P2SH-P2WPKH private key or revert to P2WPKH
DjangoSi
# P2SH-P2WPKH private key or revert to P2WPKH

(Asked by: username_0 on 2017-12-12)

Is there a way to get the private key out of an `P2SH-P2WPKH` address, using Bitcoin Core 0.15.1?
If not, is there a way to get the origin `P2WPKH` address to get the private key out of this address?

**Tags:** bitcoin-core, segregated-witness, p2sh, private-key-export, p2wpkh

> **Comments:**
> **username_1**: You can't go from a public key to a private key, segwit or no.  
> **username_0**: I have the addresses in my wallet. It's not from a public key.  
> **username_2**: What wallet software are you using?  
> **username_0**: 0.15.1 bitcoin core  

---

## 1 answers

### Answer by username_3 on 2017-12-12. Score: 1 | Accepted answer

In 0.15.1 you'll need to find the P2PKH address corresponding to the key (it's the argument to `addwitnessaddress` you used for creating the address in the first place), and pass that to `dumpprivkey`.

In 0.16, things will likely just work.

> **Comments:**
> **username_0**: using `listreceivedbyaddress` makes it possible! Thanks  
> **username_3**: I'm confused! How does that RPC help you?  

---

