A hash-tree used to allow efficient and secure verification of contents of large data structures. Merkle-Trees are employed in Bitcoin to prove existence of transactions in a block.
Questions tagged [merkle-tree]
176 questions
27
votes
6 answers
Merkle Root and Merkle Proofs
This is one of those questions that everyone seems to write about but the same bad explanations are just plagiarized from site to site.
Edit: The heart of my question is why Merkle trees are claimed to be efficient when determining if a leaf node…

Jazimov
- 367
- 1
- 3
- 9
25
votes
3 answers
What is the benefit of using a Merkle Root rather than simply hashing all of the transactions in the block?
I understand what the merkle root is and how it is calculated, but I have not been able to figure out what is the actual purpose behind using this kind of hashing solution?
I mean, I know that the root itself must be there, to identify the exact…

Gigi
- 646
- 5
- 9
14
votes
3 answers
Why is the full Merkle path needed to verify a transaction?
If I have transaction A and wish to verify that it is in the block, and I also have the hash of transaction B and the hash of the hashes of A and B, then can't I just hash A and then see if what I get by hashing A's hash and B's hash is equal to…

Jeff
- 273
- 1
- 2
- 6
8
votes
1 answer
Merkle tree structure for 9 transactions
I've been reading the developers documentation, other sources and the good books about Bitcoin. But none of the resources shows a merkle tree with 5 or more leafs. I'm confused, does the bitcoin core make a merkle tree of transactions…

user39044
- 81
- 2
7
votes
2 answers
How do you create a merkle tree that lets you insert and delete elements without recomputing the whole thing?
I have a merkle tree. The elements of this tree are in sorted order, so that anyone can create a proof that something isn't in the tree. So far, so good.
However, I also want to be able to add and remove elements from the tree. If I use a normal…

Nick ODell
- 29,396
- 11
- 72
- 130
5
votes
1 answer
Where is the Merkle tree located?
I am reading about the Merkle tree, I've read that in a block we store just the root of the tree. To check if a ttransaction is included in the Merkle tree we need to use the transaction's Merkle path. The question is where the Merkle tree is…

katapulte
- 85
- 5
4
votes
1 answer
Are number of transactions in Merkle Tree always "even"?
According to definition and structure of the Merkle Tree, apparently, the number of transactions in a block that inserted in a Merkle Tree structure must be even (and not odd), is not it?
Please see the following figure which shows a Merkle…

Questioner
- 1,151
- 8
- 23
4
votes
3 answers
If SPV clients didn't exist, would Bitcoin still use Merkle trees?
I understand how full nodes use Merkle proofs to convince SPV clients that certain transactions are valid / invalid.
Does the Bitcoin software use Merkle trees in any other way?

justinmoon
- 567
- 2
- 11
3
votes
2 answers
How particular node is searched in Merkle tree?
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…

Vijesh
- 185
- 1
- 2
- 6
3
votes
1 answer
Get confused on the merkle tree algorithm
From page https://en.bitcoin.it/wiki/Protocol_specification , I understand the merkle tree works like
merkle([a,b,c,d]) = h( h(a,b), h(c,d) )
But when I do the stratum protocol http://mining.bitcoin.cz/stratum-mining/ , it works something like…

user11567
- 31
- 4
2
votes
1 answer
How do I compute merkle root for genesis block?
I wanted to help out the community and create a pure C application independent of the reference client, that given a timestamp and a public key, will produce a merkle root for creation of a genesis block.
My knowledge of C++ is very little to none.…

farmdve
- 183
- 1
- 6
2
votes
1 answer
Merkle tree structure inside blocks - what are they for?
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…

user1936752
- 155
- 8
2
votes
1 answer
Why must be the Merkle Tree a full binary?
Bitcoin uses a Merkle tree with hash functions. I mean I do not get it why there must be a full binary tree? A complete could also be possible?

Peter
- 123
- 3
2
votes
1 answer
How is the Merkle Tree sequentially propagated, and are the parts addressed?
When downloading the Merkle Tree, are all branches from the root downloaded in order?
Are the individual pieces of the tree cataloged in such a way so that the position of each piece is known?
In short, how does one know what piece of the tree goes…
user5107
1
vote
1 answer
Are hashes of Merkle tree roots unique throughout whole blockchain?
The "Mastering Bitcoin" book says that each block header contains a 32B long hash of the Merkle root for all the transactions it contains.
If I extract all these Merkle roots from all the blocks in the blockchain (longest branch only) and put them…

yujaiyu
- 139
- 5