<p>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:</p>
<pre><code>OP_IF
   &lt;3, publicKey1, publicKey2, publicKey3, 2, ...&gt; OP_CHECKMULTISIGVERIFY
OP_ELSE
   &lt;7 days&gt; OP_CHECKSEQUENCEVERIFY
   &lt;3, publicKey1, publicKey2, publicKey3, 1, ...&gt; OP_CHECKMULTISIGVERIFY
OP_ENDIF
</code></pre>
<p>which can then be executed with a scriptSig like <code>&quot;ignored&quot; key1Sig 1</code> or <code>&quot;ignored&quot; key2Sig 0</code>.</p>
<p>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?</p>

CC BY-SA 4.0
2022-06-17T13:30:32.690Z
Does this perhaps answer your question: https://bitcoin.stackexchange.com/a/91569/5406?
Murch
CC BY-SA 4.0
2022-06-25T17:30:59.267Z
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
CC BY-SA 4.0
2022-06-26T03:10:36.843Z
It's the miniscript policy language. Check out e.g. https://bitcoin.sipa.be/miniscript/. Regarding how are taproot trees expressed, I'd say that would be a question about wallet descriptors?
Murch
<taproot><p2tr>
How are taproot scripts represented in general?
B T
# How are taproot scripts represented in general?

(Asked by: username_0 on 2021-04-10)

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:

```
OP_IF
   <3, publicKey1, publicKey2, publicKey3, 2, ...> OP_CHECKMULTISIGVERIFY
OP_ELSE
   <7 days> OP_CHECKSEQUENCEVERIFY
   <3, publicKey1, publicKey2, publicKey3, 1, ...> OP_CHECKMULTISIGVERIFY
OP_ENDIF

```

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?

**Tags:** taproot, p2tr

> **Comments:**
> **username_1**: Does this perhaps answer your question: https://bitcoin.stackexchange.com/a/91569/5406?  
> **username_0**: 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?"  
> **username_1**: It's the miniscript policy language. Check out e.g. https://bitcoin.sipa.be/miniscript/. Regarding how are taproot trees expressed, I'd say that would be a question about wallet descriptors?  

---

## 0 answers

