<p>Since Bitcoin Core 0.16, every private key gives rise to a supported P2PKH (1...), P2SH-P2WPKH (3...), and P2WPKH (bc1...) address.</p>

<p>All you need to do is import the private key with <code>importprivkey</code>; the corresponding segwit address will automatically be supported.</p>

<p>A more reliable method is using <code>importmulti</code>, where you specify the address you want together with the private key; if they mismatch, or information is missing, it will complain (since 0.18).</p>

CC BY-SA 4.0
2019-05-09T16:43:17.147Z
2019-05-09T16:43:17.147Z
Pieter Wuille
<p>I have a privkey of a P2SH-P2PKH address, how to import it to Bitcoin core 0.18.0? In previous versions, I could call <code>importprivatekey</code> and then <code>addwitnessaddress</code> but the <code>addwitnessaddress</code> was removed.</p>

<p>Edit: seems like Bitcoin core 0.18.0 auto calls <code>addwitnessaddress</code> when I use 'importprivatekey' but I found no official documentation of that.</p>

<bitcoin-core>
How to import private key of a P2SH-P2PKH address to Bitcoincore 0.18.0?
Luong Nguyen
# How to import private key of a P2SH-P2PKH address to Bitcoincore 0.18.0?

(Asked by: username_0 on 2019-05-08)

I have a privkey of a P2SH-P2PKH address, how to import it to Bitcoin core 0.18.0? In previous versions, I could call `importprivatekey` and then `addwitnessaddress` but the `addwitnessaddress` was removed.

Edit: seems like Bitcoin core 0.18.0 auto calls `addwitnessaddress` when I use 'importprivatekey' but I found no official documentation of that.

**Tags:** bitcoin-core


---

## 1 answers

### Answer by username_1 on 2019-05-09. Score: 0 | Accepted answer

Since Bitcoin Core 0.16, every private key gives rise to a supported P2PKH (1...), P2SH-P2WPKH (3...), and P2WPKH (bc1...) address.

All you need to do is import the private key with `importprivkey`; the corresponding segwit address will automatically be supported.

A more reliable method is using `importmulti`, where you specify the address you want together with the private key; if they mismatch, or information is missing, it will complain (since 0.18).


---

