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.

Filter by
Sorted by
Tagged with
2
votes
2answers
106 views

Merkle root with one transaction

I am trying to build a merkle root which contains only the coinbase transaction from bitcoind. After creating the coinbase transaction, do I need to convert it to little endian, hash it twice and then ...
1
vote
1answer
67 views

Merkle root of empty block

Based on https://en.bitcoin.it/wiki/Getblocktemplate : Collect your coinbase transaction (modified or not) at the front of the "transactions" list provided by the server. Apply a double-...
0
votes
1answer
46 views

Questions on Merkle root hashing for Stratum pools

These questions are partially inspired from this post on Merkle root hashing by pool operators. My understanding is that for Stratum mining the only hashing the pool has to do is produce the Merkle ...
2
votes
1answer
65 views

What hardware do pool operators use for calculating the hashmerkleroot?

I've reviewed the response here: How do pool operators do their hashing? and acknowledge that the ratio of hashing required by pool operators is incomparable to the miners. I still wonder what ...
0
votes
1answer
38 views

For a block containing 'x' number of unverified transactions, how many SHA256d hashes are performed to obtain the hashmerkleroot?

I've been trying to understand this for a few days now. I understand that the hashmerkleroot is the root node of a fully perfect binary tree. I also understand that the sha256d hashes would be the non-...
7
votes
1answer
152 views

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 ...
0
votes
2answers
79 views

Merkle tree hash - Computing hash manually doesnt match the one computed by SHA256D64

I am trying to go through the code to check the merkle tree hash computation done by BlockMerkleRoot in bitcoin core. The hash computed using online tools by appending transaction hashes is different ...
4
votes
1answer
136 views

Is Merkle tree pruning described in the whitepaper feasible/useful? If not, would there be any alternative?

When I was reading bitcoin-paper-errata-and-details.md written by David A. Harding, I realized that there's probably a common misunderstanding or over-simplification about Merkle tree pruning. What ...
5
votes
1answer
452 views

How to build Merkle root from merkle branches?

Is there any help/tutorial on how to build the Merkle root from stratum data? The Slushpool's stratum protocol has an example of a mining job but it does not contain any Merkle branches and I don't ...
0
votes
0answers
99 views

Bitcoin Merkle/Hash Tree implementation in Java

I'm learning about how full nodes can send a Merkle root + a list of hashes, so that a light client can verify a transaction. I couldn't find any good resources on how to implement it. I just knew ...
1
vote
3answers
84 views

How/where is the mapping of a transaction to a particular block stored?

According to the Bitcoin white paper, a block contains the fields "Previous Hash", "Nonce", and "Root Hash". The root hash is a merkle tree root node of all the ...
4
votes
1answer
157 views

How big would the transaction history be if all spent transactions were pruned?

If the transaction history's Merkle tree were pruned to remove all transactions that have been completely spent, what would be the size of the transaction history in comparison to its current size? (...
0
votes
2answers
112 views

Proof-of-inclusion: Merkle Tress, derivation paths

My assumption is that when transaction proof of inclusion occurs, it takes place only at full nodes, since this may happen when a block is mined (as a node has to evict transactions from its mempool ...
0
votes
1answer
36 views

Appending txns to merkle tree on PoW efficiency, true hash rate

As I understand, when miners add transactions to their candidate block from their mempool, they append the txn to the merkle tree, which requires more hashing, as well as the hashing/maths involved ...
1
vote
1answer
104 views

How are txns sorted correctly in Merkle trees between nodes and validated via Proof of Work

I am interested in exactly what happens to transactions in the pending block (block that is being mined at the time). From what I understand, transactions are the stored as a Merkle tree hash inside ...
1
vote
1answer
25 views

Is the hash of ZMQ channel blockhash a merkleroot hash?

I am using the ZMQ interface of my node to keep track of wallet activity like incoming transactions. I want to know the number of confirmations of my transaction but, to do that, I would need to know ...
1
vote
1answer
26 views

What exactly happens to leaves when forming nodes?

If you hash TXIDs with sha256 twice, you get the leaves of the merkle tree. As far as I understand the two outputs of the TXIDs are concatenated / paired. What does that mean? Are they added together?
6
votes
2answers
400 views

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 ...
1
vote
1answer
70 views

Does the Merkle Root get constantly updated inside the block or does it only get added once the block is completed?

So, pretty much just the title. I'm just wondering how the Merkle Root works exactly. I know it's the result of pairing transactions and then hashing them until the last transaction in the block, but ...
1
vote
0answers
94 views

Endianess of txids when calculating Merkle Root from getblocktemplate

I am trying to solve a merkle root from a previously mined block. Specifically this block... https://www.blockchain.com/en/btc/block/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506 ...
0
votes
0answers
26 views

How Can i Extract a Z value of a specific Bitcoin Transaction that Belongs to a merkel tree/root transaction?

am trying to find a z value of a transaction that is signed in a merkle tree/root block , i coudn't find a raw tx id in hex of that specific transaction that signed with specific address while a raw ...
8
votes
1answer
1k views

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.
2
votes
1answer
1k views

How To Calculate Merkle Root?

I found this example: Current merkle hash list: 32650049a0418e4380db0af81788635d8b65424d397170b8499cdc28c4d27006 30861db96905c8dc8b99398ca1cd5bd5b84ac3264a4e1b3e65afa1bcee7540c4 Current merkle ...
13
votes
3answers
11k views

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 ...
1
vote
1answer
144 views

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 ...
1
vote
1answer
68 views

Why binary trees? Is there any particular benefit to using binary trees instead of some higher radix?

Bitcoin stores transactions in binary Merkle trees. They take O(log2 n) to traverse. If I used something like a ternary tree, where each node (including the root) references three branches/leaves ...
1
vote
1answer
22 views

Question about Merkle path verification

I think I understand Merkle verification, but I just want to make sure. Consider this following picture where all the blue nodes were sent to me My question : if the document that I want to verify is ...
2
votes
1answer
184 views

Do full nodes store the complete merkle tree or do they regenerate it when creating a merkle proof?

I understand what the merkle root is for. And I understand that blocks don't store the merkle tree. Question 1) Is there any place that the complete merkle trees get stored? I don't mean the merkle ...
1
vote
1answer
126 views

Is this Merkle hash root problem existent in Bitcoin?

In the Wikipedia article about Merkle trees, I was just reading this, unable to understand where the problem lies: Second preimage attack The Merkle hash root does not indicate the tree depth, ...
1
vote
1answer
115 views

How does a Merkle proof differ from the Merkle tree?

I'm not sure how Merkle tree and Merkle proof are different. I thought Merkle proof is the same as the Merkle root in each block. However, it seems like Merkle proof contains all Merkle roots of all ...
7
votes
1answer
281 views

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 ...
23
votes
6answers
8k views

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 ...
-1
votes
1answer
91 views

Is it possible to dynamically add transactions to a merkle tree? [closed]

When i read about merkle trees.. I saw we shall build a system wherein we could club all the transactions that happend in like 10 minutes to stay in a block. I mean.. whatever is known.. the known ...
1
vote
1answer
70 views

A Bitcoin soft fork idea to help compress the blockchain

I've thought about a soft fork that can help storage costs. Why don't we force miners to embed the height of the TX Merkle tree in the first two bytes of the 4-byte block header version? It would ...
1
vote
1answer
65 views

How to find my transaction from root of Merkle Tree [closed]

How could I verify my transaction from the root of Merkle Tree.
2
votes
2answers
1k views

Understanding SPV, pruning and its downsides, as well

First of all, sorry by not asking an objective question, it's because I can't resume this one and I didn't find information even in the "mastering bitcoin" book. The large texts in this question are ...
2
votes
1answer
267 views

RSA accumulator vs Merkle Proofs

For proof of inclusion (used by SPV nodes) Bitcoin relies on Merkle proofs. Why Merkle trees were chosen and not RSA accumulators, as they can be used to provide a shorter proof? What are the ...
58
votes
6answers
63k views

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 ...
1
vote
1answer
51 views

Intuition for Simplicity's CheckSigHashAll

So, I downloaded Simplicity and started a REPL using cabal new-repl Simplicity. Then I enabled type applications using :set -XTypeApplications. Consider these invocations: > (pkwCheckSigHashAll @...
0
votes
0answers
64 views

Bitcoin merkle tree

I am sorry can someone help ... Does bitcoin account for forgery attack as a second pre-image attack and how is it implemented? Plus how does bitcoin avoid unbalanced merkle tree. Regards
17
votes
4answers
17k views

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 ...
3
votes
2answers
1k views

Checking the Merkle Root for Block #100000

The below text is copied from the Bitcoin Developer Reference at bitcoin.org: If a block has three or more transactions, intermediate merkle tree rows are formed. The TXIDs are placed in order and ...
0
votes
0answers
67 views

How to create "Merkle Path"?

Merkle path is always appeared in many examples relevant with verification of transaction. but they never explain how merkle path is generated. So, I was wondering that how merkle path is generated. ...
2
votes
3answers
289 views

Does merkle root contain hashes of transactions from previous blocks?

Every block in a blockchain contains merkle root value. So for any block, there is some list of transactions and you create a merkle tree based on these transaction. For other blocks, same process ...
0
votes
4answers
304 views

A question about full nodes, lightweight nodes and merkle trees

What is the purpose of full nodes storing merkle roots? Why don't they save the transactions only? The hashes could be calculated only when a lightnode asks for them and the merkle roots could be ...
0
votes
0answers
30 views

What is the complete process and purpose of a block validation using merkle trees?

I need the whole details please. Like does that happen only in the current block? Or at past blocks do? And how exactly does this happen? Do full nodes send the proper hashes and then a local ...
0
votes
1answer
23 views

Question about Merkle trees and blocks

There is something I cannot understand about Merkle trees. I understand how they are calculated and etc., but I cannot understand how they are used on a blockchain. If a block stores only the Merkle ...
-1
votes
1answer
45 views

Merkle Audit Proofs of Certification vs. Bitcoin Merkle Proofs [closed]

The following article explains the process of "Merkle Audit Proofs of Certification". (Link to the article) Is the process the same as "Merkle Proofs in Bitcoin" ? If their process is not the same, ...
5
votes
1answer
510 views

Is Bitcoin PoW actually SHA256 + Merkle generation? Or have I misunderstood coinbase/append?

Miners can mutate nonce (32 bits) + time (mutates once a second). This allows for 232 (~4 billion) hashes per second. That's not enough anymore for our ASICs as they perform in the TH/s now rather ...
1
vote
1answer
30 views

Doubt regarding hashing function in Merkle trees

From what I read, say in a block, there are 4 transactions. The hash value of transactions A and B are combined together to get the hash AB. Same goes for transactions C and D to get hash CD. Later AB ...