rundown of different scripts and what is what and what goes where.
- the
prevoutScriptis the script of the output being spend - the
redeemScriptis the script that is used to solve the P2SH - the
signatureScriptis the script that is taken into thesignatureHashfor signing - the
witnessRedeemScriptis the script that is used to solve the P2WSH - the
scriptSigis what goes into theinput.scriptSigwhen serializing the TX - the
witnessScriptis what goes into theinput.witnesswhen serializing the TX
prevoutScript= OP_DUP OP_HASH160 <{20byte}pubkeyHash> OP_EQUALVERIFY OP_CHECKSIGsignatureScript= OP_DUP OP_HASH160 <{20byte}pubkeyHash> OP_EQUALVERIFY OP_CHECKSIGscriptSig= <sig> <pubkey>
prevoutScript= OP_HASH160 <{20byte}scriptHash> OP_EQUALredeemScript= OP_1 <pubkey1> <pubkey2> OP_2 OP_CHECKMULTISIGsignatureScript= OP_1 <pubkey1> <pubkey2> OP_2 OP_CHECKMULTISIGscriptSig= <sigs> <redeemScript>
prevoutScript= OP_0 PUSH[<{20byte}pubkeyHash>]signatureScript= OP_DUP OP_HASH160 <{20byte}pubkeyHash> OP_EQUALVERIFY OP_CHECKSIGscriptSig= ''witnessScript= <sig> <pubkey>
prevoutScript= OP_HASH160 <{20byte}scriptHash> OP_EQUALredeemScript= OP_0 PUSH[<{20byte}pubkeyHash>]signatureScript= OP_DUP OP_HASH160 <pubkeyHash> OP_EQUALVERIFY OP_CHECKSIGscriptSig= <redeemScript>witnessScript= <sig> <pubkey>
prevoutScript= OP_0 PUSH[<{32byte}pubkeyHash>]redeemScript= OP_1 <pubkey1> <pubkey2> OP_2 OP_CHECKMULTISIGsignatureScript= OP_1 <pubkey1> <pubkey2> OP_2 OP_CHECKMULTISIGscriptSig= ''witnessScript= <sigs> <redeemScript>
prevoutScript= OP_HASH160 <{20byte}scriptHash> OP_EQUALredeemScript= OP_0 PUSH[<{32byte}scriptHash>]witnessRedeemScript= OP_1 <pubkey1> <pubkey2> OP_2 OP_CHECKMULTISIGsignatureScript= OP_1 <pubkey1> <pubkey2> OP_2 OP_CHECKMULTISIGscriptSig= <redeemScript>witnessScript= <sigs> <witnessRedeemScript>
prevoutScript= OP_HASH160 <{20byte}scriptHash> OP_EQUALredeemScript= OP_0 PUSH[<{32byte}scriptHash>]witnessRedeemScript= OP_DUP OP_HASH160 <pubkeyHash> OP_EQUALVERIFY OP_CHECKSIGsignatureScript= OP_DUP OP_HASH160 <pubkeyHash> OP_EQUALVERIFY OP_CHECKSIGscriptSig= <redeemScript>witnessScript= <sig> <pubkey> <witnessRedeemScript>
Very helpful. Thanks