<p>If a P2SH address is already in your wallet, you can use the <code>addwitnessaddress</code> RPC command to get the P2SH-P2WSH version of that address and have it added to your wallet for tracking.</p>

CC BY-SA 3.0
2017-07-05T18:04:08.100Z
2017-07-05T18:04:08.100Z
Ava Chow
<p>With the impending adoption of segregated witness, users reliant on the bitcoin-cli API would require to reconstruct new methods to re-produce more efficient transactions. Is there some guide out there to learn how to produce a p2wsh transaction based off a conventional p2sh transaction?</p>

CC BY-SA 3.0
2017-07-05T18:14:22.393Z
Only outputs sent to a SegWit address/script can be spent using SegWit inputs. So the real question is how to establish that address (see Andrew's answer below).
Pieter Wuille
CC BY-SA 3.0
2016-11-15T13:11:48.590Z
related: [Segregated Witness Development Guide](https://bitcoincore.org/en/segwit_wallet_dev/)
Murch
<transactions><segregated-witness>
How to produce a p2wsh transaction with bitcoin-cli?
rny
# How to produce a p2wsh transaction with bitcoin-cli?

(Asked by: username_0 on 2016-11-15)

With the impending adoption of segregated witness, users reliant on the bitcoin-cli API would require to reconstruct new methods to re-produce more efficient transactions. Is there some guide out there to learn how to produce a p2wsh transaction based off a conventional p2sh transaction?

**Tags:** transactions, segregated-witness

> **Comments:**
> **username_2**: related: [Segregated Witness Development Guide](https://bitcoincore.org/en/segwit_wallet_dev/)  
> **username_1**: Only outputs sent to a SegWit address/script can be spent using SegWit inputs. So the real question is how to establish that address (see Andrew's answer below).  

---

## 1 answers

### Answer by username_3 on 2017-07-05. Score: 2

If a P2SH address is already in your wallet, you can use the `addwitnessaddress` RPC command to get the P2SH-P2WSH version of that address and have it added to your wallet for tracking.


---

