tapscript icon indicating copy to clipboard operation
tapscript copied to clipboard

2-2 example

Open defconradio opened this issue 7 months ago • 4 comments

following this reference example , can you provide an example for this 2-2 simple script <pk_1> OP_CHECKSIGVERIFY <pk_2> OP_CHECKSIG

defconradio avatar May 03 '25 00:05 defconradio

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

cmdruid avatar May 05 '25 19:05 cmdruid

thanks for your time, i mean the script path spending side of the example by a 2-2 tapleaf

defconradio avatar May 05 '25 20:05 defconradio

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.

cmdruid avatar May 05 '25 20:05 cmdruid

great thanks

defconradio avatar May 05 '25 20:05 defconradio