<p>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 <code>addmultisigaddress</code>. If you do something like</p>
<pre><code>addmultisigaddress 1 '[&quot;37Ju7oTbPfe5qNAHYiAKfdTtVvCSP3TTdL&quot;]' &quot;&quot; &quot;bech32&quot;
</code></pre>
<p>you should get a P2WSH address.</p>

CC BY-SA 3.0
2018-04-22T23:12:17.247Z
Works great! I just used `getnewaddress "" "bech32"` to get the address to use with `addmultisigaddress 1 '["<address>"]' "" "bech32"`
toddmo
CC BY-SA 4.0
2021-11-02T21:54:14.143Z
This question can really use an updated answer for descriptor wallets (where you can actually construct meaningful multisig P2WSH wallets).
Pieter Wuille
CC BY-SA 4.0
2018-04-22T21:50:31.660Z
2021-11-02T21:04:00.830Z
2021-11-02T21:04:00.830Z
Ava Chow
<p><code>getnewaddress "" bech32</code> generates a <code>P2WPKH</code> address (e.g. <code>tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx</code>).</p>

<p>How can I generate a <code>P2WSH</code> address (e.g. <code>tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7</code>)?</p>

<json-rpc><bech32-address><p2wsh>
How to generate a P2WSH address
toddmo
# How to generate a P2WSH address

(Asked by: username_0 on 2018-04-22)

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

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

**Tags:** json-rpc, bech32-address, p2wsh


---

## 1 answers

### Answer by username_1 on 2018-04-22. Score: 3 | Accepted answer

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.

> **Comments:**
> **username_0**: Works great! I just used `getnewaddress "" "bech32"` to get the address to use with `addmultisigaddress 1 '["<address>"]' "" "bech32"`  
> **username_2**: This question can really use an updated answer for descriptor wallets (where you can actually construct meaningful multisig P2WSH wallets).  

---

