<p>It seems to me that the text should read &quot;we could also have four <em>conditions</em> for the same cost&quot;.</p>
<p>MAST is a <a href="https://en.wikipedia.org/wiki/Binary_tree" rel="nofollow noreferrer">binary tree</a>, which means the number of possible scripts (conditions) grows exponentially with the size of the inclusion proof, or equivalently, the size of the inclusion proof grows logarithmically with the number of possible scripts. For example, in a balanced tree:</p>
<ul>
<li>1 commitment (merkle root) gives you 1 possible script</li>
<li>2 commitments (merkle root and 1 branch step) give you 2 possible scripts</li>
<li>3 commitments (merkle root and 2 branch steps) give you 4 possible scripts</li>
<li>4 commitments (merkle root and 3 branch steps) give you 8 possible scripts</li>
</ul>
<p>What the original text is saying that 3 and 4 possible scripts both require 3 commitments.</p>
<p>It's important to note (and the very next section in the book goes over this) that using an imperfect/unbalanced binary tree can be beneficial if you expect some of the conditions to be used more often. By putting these shallower in the tree you use less block space on average.</p>

CC BY-SA 4.0
2024-03-02T02:23:31.933Z
thanks. according to your answer, four commitments means four commitments to conditions(4 possible scripts)?
fa william
CC BY-SA 4.0
2024-03-02T02:42:29.387Z
No, "commitments" refers to the parts of the inclusion proof. The number of possible conditions is then 2^(commitments - 1).
Vojtěch Strnad
CC BY-SA 4.0
2024-03-02T01:52:10.507Z
2024-03-02T02:05:37.193Z
2024-03-02T02:05:37.193Z
Vojtěch Strnad
<p>On page 174, 3th edition, book &quot;mastering bitcoin&quot;, what does the following statement means? thanks</p>
<p><em>&quot;we could also have four commitments for the same cost.&quot;</em></p>
<p>Do the four commitments means commitments we need to prove which condition we choose? or commitments to four conditions?</p>

<taproot><mastering-bitcoin><mast>
Question about MAST tree in book "mastering bitcoin"
fa william
# Question about MAST tree in book "mastering bitcoin"

(Asked by: username_0 on 2024-03-02)

On page 174, 3th edition, book "mastering bitcoin", what does the following statement means? thanks

*"we could also have four commitments for the same cost."*

Do the four commitments means commitments we need to prove which condition we choose? or commitments to four conditions?

**Tags:** taproot, mastering-bitcoin, mast


---

## 1 answers

### Answer by username_1 on 2024-03-02. Score: 2 | Accepted answer

It seems to me that the text should read "we could also have four *conditions* for the same cost".

MAST is a [binary tree](https://en.wikipedia.org/wiki/Binary_tree), which means the number of possible scripts (conditions) grows exponentially with the size of the inclusion proof, or equivalently, the size of the inclusion proof grows logarithmically with the number of possible scripts. For example, in a balanced tree:

* 1 commitment (merkle root) gives you 1 possible script
* 2 commitments (merkle root and 1 branch step) give you 2 possible scripts
* 3 commitments (merkle root and 2 branch steps) give you 4 possible scripts
* 4 commitments (merkle root and 3 branch steps) give you 8 possible scripts

What the original text is saying that 3 and 4 possible scripts both require 3 commitments.

It's important to note (and the very next section in the book goes over this) that using an imperfect/unbalanced binary tree can be beneficial if you expect some of the conditions to be used more often. By putting these shallower in the tree you use less block space on average.

> **Comments:**
> **username_0**: thanks. according to your answer, four commitments means four commitments to conditions(4 possible scripts)?  
> **username_1**: No, "commitments" refers to the parts of the inclusion proof. The number of possible conditions is then 2^(commitments - 1).  

---

