Can I get the wallet in bitcoind to use P2SH segwit (on testnet)?

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.

Karel Bílek

Posted 2017-04-25T08:24:29.117

Reputation: 2 197

Answers

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

amaclin

Posted 2017-04-25T08:24:29.117

Reputation: 5 763

1When I try to use addwitnessaddress, it wants another argument with an address. I don't understand what that argument means.Karel Bílek 2017-04-25T13:30:37.317

private key generates address. then addwitnessaddress adds segwit address generated from your address which can be redeemed with that private keyamaclin 2017-04-25T13:45:42.833

1Call 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 2017-04-26T04:28:59.490

Ooooh. This is a little confusing, IMO, but yeah it worksKarel Bílek 2017-04-27T14:08:59.530