P2WSH (Pay to Witness Script Hash)
As with P2PKH/P2WPKH, the only difference between P2SH and P2WSH is about the location of what was previously in the
scriptSig, and the
scriptPubKeyis changed from something like:
OP_HASH160 10f400e996c34410d02ae76639cbf64f4bdf2def OP_EQUAL
That you can print with the following code:
var key = new Key();
With what was previously in the
scriptSig(signature + redeem script), moved to the
"witness": "304402203a4d9f42c190682826ead3f88d9d87e8c47db57f5c272637441bafe11d5ad8a302206ac21b2bfe831216059ac4c91ec3e4458c78190613802975f5da5d11b55a69c601 210243b3760ce117a85540d88fa9d3d605338d4689bed1217e1fa84c78c22999fe08ac"
As the P2SH payment explained previously, P2WSH uses
ScriptCoinin exactly the same way to be signed.