Questions tagged [merkle-tree]

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.

168 questions
62
votes
6 answers

What is the Merkle root?

The Bitcoin wiki Vocabulary article explains why the Merkle root exists: Every transaction has a hash associated with it. In a block, all of the transaction hashes in the block are themselves hashed (sometimes several times -- the exact process…
Steven Roose
  • 11,473
  • 8
  • 44
  • 71
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
  • 3
  • 8
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
18
votes
4 answers

Why does each block store a Merkle root?

I understand how a Merkle root is calculated and stored in the block. But how do miners verify a transaction using the Merkle root? Here are 18 conditions that verify a transaction. None of them uses Merkle root.
Mohit Munjani
  • 181
  • 1
  • 1
  • 3
13
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
  • 263
  • 1
  • 2
  • 6
8
votes
1 answer

CVE-2012-2459 , possible code and performance improvement, is my logic correct?

ok so, in my effort to create a fullnode from scratch both for learning purpose and need (not a topic for discussion, thanks), I was looking at the code that check Merkle Root to not be vulnerable to CVE-2012-2459. That vulnerability basically…
8
votes
1 answer

Adding instead of concatenating hashes in Merkle trees

Why aren't the hashes combined using a commutative operation such as addition instead of concatenating them? Any possible vulnerabilities or security flaws? thanks for your time and efforts.
Ayush
  • 127
  • 4
7
votes
1 answer

How do merkle trees ensure credibility to blockchain, when full node wrongly denies a presence of a txn in a block?

How can Merkle Trees ensure that a full node doesn't lie to a thin node that a txn t is not present in a block B if infact B contains t? How can a thin node tell if the full node is lying if the full node denies the presence of a txn t in a block B…
7
votes
4 answers

How is it possible that transactions can be added to a block currently being mined?

It seems counter-intuitive that the current block can be hashed and transactions can be added to it, however that is what this thread indicates. Can someone help me connect the dots (not necessarily regarding that linked network attack) and…
makerofthings7
  • 12,656
  • 11
  • 60
  • 129
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,184
  • 11
  • 69
  • 129
7
votes
1 answer

Are bitcoin Merkle trees always binary?

I've been doing a lot of research about bitcoin, trying to understand it at the bit & byte level. I was wondering about the lookup efficiency of the Merkle tree. I haven't found any evidence that Merkle trees are mandatory binary, which would allow…
7
votes
1 answer

What is the canonical way of creating merkle tree branches?

I'm currently looking into creating some compact merkle tree branches to prove that a given hash was included in a given merkle root. My initial thought was to list the leaf, the merkle root and all of the hashes that the given leaf was combined…
ThePiachu
  • 42,931
  • 25
  • 138
  • 347
6
votes
2 answers

Does a Block contain the list of transactions? Or only the Merkle Tree?

I was wondering how a block encodes its set of transactions. I know a Merkle Tree is generated, and that it encodes a Hashed version of the transactions. But is the Merkle Tree included in the Block that gets sent to the other nodes for validation? …
3mrsh
  • 65
  • 5
6
votes
2 answers

Mining Block header bit reversing

While trying to understand the mining process and checking in python..... i am puzzled with which info from/to pool are in Little Endian, which one needs reversing in building the block header + hashing and which one not. ?? For example ... Let's…
Santan
  • 75
  • 4
6
votes
1 answer

Algorithm of checking whether an element is present in a merkle tree

I've read and watch about merkle trees but can't figure out how to implement is_present(element) method. Explainations and links are accepted.
ka4eli
  • 163
  • 5
1
2 3
11 12