<p>You can do either. Putting the hash of the single script (<code>hash_TapLeaf</code>) instead of the Merkle root makes it cheaper to spend as you don't need to reveal other hashes to prove that script is present in the Merkle tree. However, if you want to obscure the fact that there was only a single script path in the Merkle tree on spending (and are willing to pay a higher transaction fee on spending) you may include it on a branch at level 1 (or even a higher level) of the Merkle tree. To use <code>hash_TapBranch</code> you need at least two branches and so you need to place arbitrary hash(es) on whatever branch(es) you aren't using.</p>
<p>Thanks to Russell O'Connor for answering this on IRC.</p>

CC BY-SA 4.0
2021-06-10T17:52:07.093Z
2021-06-10T17:58:32.430Z
2021-06-10T17:58:32.430Z
Michael Folkson
<p>If I only have a single script for the script path does the hash of the script get placed at the top of the Merkle tree (instead of the effective Merkle root) or does it get placed in level 1 of the Merkle tree and get hashed up to the Merkle root with another arbitrary hash?</p>

<bitcoin-core-development><privacy><taproot><mast>
Where does a single script go in the Taproot tree of a script path spend?
Michael Folkson
# Where does a single script go in the Taproot tree of a script path spend?

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

If I only have a single script for the script path does the hash of the script get placed at the top of the Merkle tree (instead of the effective Merkle root) or does it get placed in level 1 of the Merkle tree and get hashed up to the Merkle root with another arbitrary hash?

**Tags:** bitcoin-core-development, privacy, taproot, mast


---

## 1 answers

### Answer by username_0 on 2021-06-10. Score: 1 | Accepted answer

You can do either. Putting the hash of the single script (`hash_TapLeaf`) instead of the Merkle root makes it cheaper to spend as you don't need to reveal other hashes to prove that script is present in the Merkle tree. However, if you want to obscure the fact that there was only a single script path in the Merkle tree on spending (and are willing to pay a higher transaction fee on spending) you may include it on a branch at level 1 (or even a higher level) of the Merkle tree. To use `hash_TapBranch` you need at least two branches and so you need to place arbitrary hash(es) on whatever branch(es) you aren't using.

Thanks to Russell O'Connor for answering this on IRC.


---

