<p>There is no merkle tree structure inside of blocks. Transactions are just concatenated with each other. The order of concatenation does matter though. It is necessary to verify the merkle root, which is the root node of a merkle tree. The merkle tree is not encoded in the block, rather it is generated on-the-fly using the data in a block in order to verify that the provided merkle root is correct. SPV wallets will often request for a transaction and proof that that transaction is in the block, so a node will provide part of the merkle tree to prove that the transaction is in the block.</p>

CC BY-SA 3.0
2017-08-16T21:56:50.870Z
That particular use case is significantly less narrow than the use case suggested by the question and an excellent justification for using a Merkle tree.
Eric Hopper
CC BY-SA 3.0
2017-08-16T16:48:13.733Z
2017-08-16T16:48:13.733Z
Ava Chow
<p>I'd like to check if my understanding is correct. This is regarding the purpose of having the Merkle tree structure for all transactions inside a block. Is the only reason it exists so that thin clients can verify that a transaction exists in a block without being told about all the other transactions of that block? </p>

<p>Seems quite complicated to implement that (instead of just concatenation of transactions) for a rather special case. Particularly since the maximum size of a block is not very large - so there isn't really a problem with verifying all the transactions and ensuring that the hash of the block matches up to those.</p>

<merkle-tree>
Merkle tree structure inside blocks - what are they for?
user1936752
# Merkle tree structure inside blocks - what are they for?

(Asked by: username_0 on 2017-08-16)

I'd like to check if my understanding is correct. This is regarding the purpose of having the Merkle tree structure for all transactions inside a block. Is the only reason it exists so that thin clients can verify that a transaction exists in a block without being told about all the other transactions of that block?

Seems quite complicated to implement that (instead of just concatenation of transactions) for a rather special case. Particularly since the maximum size of a block is not very large - so there isn't really a problem with verifying all the transactions and ensuring that the hash of the block matches up to those.

**Tags:** merkle-tree


---

## 1 answers

### Answer by username_1 on 2017-08-16. Score: 2 | Accepted answer

There is no merkle tree structure inside of blocks. Transactions are just concatenated with each other. The order of concatenation does matter though. It is necessary to verify the merkle root, which is the root node of a merkle tree. The merkle tree is not encoded in the block, rather it is generated on-the-fly using the data in a block in order to verify that the provided merkle root is correct. SPV wallets will often request for a transaction and proof that that transaction is in the block, so a node will provide part of the merkle tree to prove that the transaction is in the block.

> **Comments:**
> **username_2**: That particular use case is significantly less narrow than the use case suggested by the question and an excellent justification for using a Merkle tree.  

---

