I'm pretty familiar with the opcode style of writing down scripts. I can understand the stack-based language nature of bitcoin script where you can write down different script spend paths via ifs like this:

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

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

However, I don't know a good way to write down spend paths for taproot. Eg, if I want to say have a key spend-path using a threshold signature, and I want 3 script spend-paths, one of which has two nested script spend-paths, what's a good way to represent that. Or rather, how has that been represented in the past? And how does a transaction spending an output select which taproot script spend-path it wants to use? In the current script, one of the if branches is selected with either 1 or 0 pushed onto the stack via the scriptSig. In Taproot, how is the spend path selected?

  • 2
    Does this perhaps answer your question: bitcoin.stackexchange.com/a/91569/5406?
    – Murch
    Jun 17, 2022 at 13:30
  • A little. Sounds like the answer is "Bitcoin policy language is the standard way to express scripts". I've never heard of policy langauge before tho, and I'm not finding any material on it other than the link you sent. Is there documentation of the policy langauge somewhere? But it looks like perhaps the policy langauge might not have any ability to express a taproot tree. In which case I guess I'm back to the original question of "how are taproot trees expressed?"
    – B T
    Jun 25, 2022 at 17:30
  • It's the miniscript policy language. Check out e.g. bitcoin.sipa.be/miniscript. Regarding how are taproot trees expressed, I'd say that would be a question about wallet descriptors?
    – Murch
    Jun 26, 2022 at 3:10


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.