How are taproot scripts represented normally?


I am fairly accustomed to the opcode fashion of writing down scripts. I can perceive the stack-based language nature of bitcoin script the place you’ll be able to write down totally different script spend paths through ifs like this:

   <3, publicKey1, publicKey2, publicKey3, 2, ...> OP_CHECKMULTISIGVERIFY
   <3, publicKey1, publicKey2, publicKey3, 1, ...> OP_CHECKMULTISIGVERIFY

which might then be executed with a scriptSig like "ignored" key1Sig 1 or "ignored" key2Sig 0.

Nevertheless, I do not know a great way to write down down spend paths for taproot. Eg, if I wish to say have a key spend-path utilizing a threshold signature, and I would like 3 script spend-paths, one in all which has two nested script spend-paths, what’s a great way to signify that. Or fairly, how has that been represented previously? And the way does a transaction spending an output choose which taproot script spend-path it needs to make use of? Within the present script, one of many if branches is chosen with both 1 or 0 pushed onto the stack through the scriptSig. In Taproot, how is the spend path chosen?

Supply hyperlink

Leave a reply