tapscript
tapscript copied to clipboard
2-2 example
following this reference example , can you provide an example for this 2-2 simple script <pk_1> OP_CHECKSIGVERIFY <pk_2> OP_CHECKSIG
you can change this line: https://github.com/cmdruid/tapscript/blob/10459abc7d50e03c61a10c2d7b5416a36087232b/test/example/taproot/tapscript.test.ts#L20C5-L20C45
and just replace the script there with your own
thanks for your time, i mean the script path spending side of the example by a 2-2 tapleaf
You can follow this example here: https://github.com/cmdruid/tapscript/blob/10459abc7d50e03c61a10c2d7b5416a36087232b/test/example/taproot/tapscript.test.ts#L61
But the witness would look more like this:
[ sig_2, sig_1, script, cblock ]
After the script, arguments are processed right-to-left, so you need to reverse the order of the signatures versus what is in the script.
great thanks