Can I use the wallet functionality in bitcoin cli daemon with P2SH segwit on testnet/regtest? Meaning, can I receive on these addresses and send from them?

And if I can, how?

I cannot find it anywhere in the help. The only one that gets close is addwitnessaddress, but that does something else, too.

1 Answer 1


addwitnessaddress is what you want

create it, fund it and spend coins from it - then check your transactions on any blockexplorer that they are in segwit format

  • 1
    When I try to use addwitnessaddress, it wants another argument with an address. I don't understand what that argument means. Apr 25, 2017 at 13:30
  • private key generates address. then addwitnessaddress adds segwit address generated from your address which can be redeemed with that private key
    – amaclin
    Apr 25, 2017 at 13:45
  • 1
    Call getnewaddress first, and then pass the result to addwitnessaddress to convert it to P2SH-embedded P2WPKH. addwitnessaddress also works on P2SH multisig addresses (in which case it will produce a P2SH-embedded P2WSH). Apr 26, 2017 at 4:28
  • Ooooh. This is a little confusing, IMO, but yeah it works Apr 27, 2017 at 14:08

Your Answer

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

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