<p>You cannot tell just by looking at the root hash. If you have the entire tree, you would have to look through the leaf nodes and see if one of them is A. Each step up the tree involves hashing which is a one-way function, there is no way to see which two things made up the hash. </p>

CC BY-SA 3.0
2017-10-26T11:44:30.597Z
2017-10-26T11:44:30.597Z
meshcollider
<p>A Merkle tree is just a particular way of hashing a list of elements. In this application, the elements are transactions.</p>

<p>Finding something in a Merkle tree is just looking through the list. The Merkle structure does not help you.</p>

<p>However, what you can do with a Merkle tree is create a compact proof that a particular element is included (by giving the hashes higher up in the tree it is combined with).</p>

<p>So to summarize: you don't use a Merkle tree for searching. You use it to prove things are in it. This means the searching can be outsourced: if some (software) party tells you about a piece of data that allegedly belongs to a tree, instead of checking it for yourself (which requires having the tree), you can ask for a proof (which can be verified by only having the root).</p>

CC BY-SA 3.0
2017-10-26T12:00:31.647Z
2017-10-26T12:00:31.647Z
Pieter Wuille
<p>Suppose I have Merkle Tree with Transactions 'A','B','C','D','E','F' and I want to know how to check if particular transaction i.e 'A' exists in a Tree or not ?.
And if it is present then how to traverse using root hash to the node with transaction 'A' ?</p>

<merkle-tree>
How particular node is searched in Merkle tree?
Vijesh
# How particular node is searched in Merkle tree?

(Asked by: username_0 on 2017-10-26)

Suppose I have Merkle Tree with Transactions 'A','B','C','D','E','F' and I want to know how to check if particular transaction i.e 'A' exists in a Tree or not ?.
And if it is present then how to traverse using root hash to the node with transaction 'A' ?

**Tags:** merkle-tree


---

## 2 answers

### Answer by username_2 on 2017-10-26. Score: 5 | Accepted answer

A Merkle tree is just a particular way of hashing a list of elements. In this application, the elements are transactions.

Finding something in a Merkle tree is just looking through the list. The Merkle structure does not help you.

However, what you can do with a Merkle tree is create a compact proof that a particular element is included (by giving the hashes higher up in the tree it is combined with).

So to summarize: you don't use a Merkle tree for searching. You use it to prove things are in it. This means the searching can be outsourced: if some (software) party tells you about a piece of data that allegedly belongs to a tree, instead of checking it for yourself (which requires having the tree), you can ask for a proof (which can be verified by only having the root).


---

### Answer by username_1 on 2017-10-26. Score: 1

You cannot tell just by looking at the root hash. If you have the entire tree, you would have to look through the leaf nodes and see if one of them is A. Each step up the tree involves hashing which is a one-way function, there is no way to see which two things made up the hash.


---

