0

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

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. – Karel Bílek Apr 25 '17 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 '17 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). – Pieter Wuille Apr 26 '17 at 4:28
  • Ooooh. This is a little confusing, IMO, but yeah it works – Karel Bílek Apr 27 '17 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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