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
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
45 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
64 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-...
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 ...
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 ...
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
35 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?
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
93 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.
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
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 ...
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 ...
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 ...
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 ...
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 ...
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.
-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 ...
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 ...
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
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 ...
0
votes
1answer
45 views

How and why we need to validate a transaction?

I've starting doing some researches about the Bitcoin protocol and the blockchain. I'm trying to understand all the sections in the Bitcoin white-paper. So far, i couldn't understand what is the ...
1
vote
1answer
46 views

How chaining the blocks protect against altering data?

I am confused with the block chaining, as i know a block header contains a reference to the previous block header hash with the merkle root and other fields. This header hash is related (computed) to ...
0
votes
1answer
71 views

When you need to validate a transaction is in a block

So after getting here, I have forgotten why you even want to validate a transaction is in a block, and how exactly this works. Wondering if one could explain In what situation you want to validate a ...
0
votes
1answer
283 views

Why the blockchain isn't just a Merkle tree

I am reading this and now wondering why the blockchain isn't just implemented as a Merkle tree, or the reverse, why you can't just have a single data structure (i.e. a transaction chain) instead of ...
3
votes
2answers
463 views

Example of data that is hashed in the merkle tree for a transaction

So I am reading this (excellent resource) on the Bitcoin merkle tree for a transaction. The merkle tree is constructed bottom-up. In the following example, we start with four transactions, A, B, C, ...
4
votes
1answer
425 views

Why was an insecure merkle tree implementation chosen?

At risk of creating a "lets discuss politics" question, let me clarify that what I want to know is whether there is a known benefit to Satoshi's "duplicate the last hash" merkle tree implementation ...
4
votes
1answer
755 views

How do I calculate the witness commitment hash for a given block?

From my understanding, every SegWit enabled block has an added output script which is used as a place to store the "Witness commitment" specified in BIP 141. One issue I've stumbled upon was ...
1
vote
1answer
710 views

How is Merkle path derived or calculated? [duplicate]

How is Merkle path calculated? I am looking for a detailed algorithm rather than a quick one liner for this so I can implement it. Note that this is not the same as computing Merkle root or building ...
3
votes
1answer
1k views

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

How come Merkle tree is more efficient when tree branches are not stored in blockchain?

Suppose we have 8 transactions in a block X as follows and we know every node's hash value of the whole Merkle tree (that is, including intermediary nodes such as 45). Then if someone claims ...