2

getnewaddress "" bech32 generates a P2WPKH address (e.g. tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx).

How can I generate a P2WSH address (e.g. tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7)?

1 Answer 1

3

To generate a P2WSH address, you need to have some script. The easiest one you can use is a multisig script. You can do this with the command addmultisigaddress. If you do something like

addmultisigaddress 1 '["37Ju7oTbPfe5qNAHYiAKfdTtVvCSP3TTdL"]' "" "bech32"

you should get a P2WSH address.

2
  • Works great! I just used getnewaddress "" "bech32" to get the address to use with addmultisigaddress 1 '["<address>"]' "" "bech32"
    – toddmo
    Commented Apr 22, 2018 at 23:12
  • This question can really use an updated answer for descriptor wallets (where you can actually construct meaningful multisig P2WSH wallets). Commented Nov 2, 2021 at 21:54

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.