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.

1 Answer 1


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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.