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
0
votes
1answer
24 views

Merkle tree recalculation during transaction lookup

When full-node receives a request from SPV client to check if given transaction exists in the blockchain - does it always re-calculate the merkle tree on the fly in order to return merkle path + block ...
0
votes
0answers
19 views

Ternary Merkle Tree - concatenation and Merkle Proof?

Unlike binary Merkle trees, ternary have 3 leaf nodes. I wanted to understand how do we eventually get to the Root Merkle node -- is it by concatenating in the pair of 3 (considering 3 leaves in every ...
1
vote
1answer
45 views

How can a block validate a merkle-root if it is all hashed?

I am trying to understand how another block validates the transactions through the merkle root. Shouldn't it be impossible to know what hashes the merkle root is hashed from because you can't reverse ...
1
vote
1answer
72 views

Why store Merkle tree of transactions rather than global ledger state?

I'm implementing my own Cryptocurrency similar to Bitcoin from scratch in C++ (just for learning and deeper understanding) and had an interesting design question. My understanding is that the Merkle ...
0
votes
1answer
36 views

Can taproot script trees have nodes with a single child?

I am writing some code implementing taproot address creation where a script path is present and I have a quick question surrounding the reference code. The BIP-341 reference method taproot_tree_helper(...
1
vote
1answer
81 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
55 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
73 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
42 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
119 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
98 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
122 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
37 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
131 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
26 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
27 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
73 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
110 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
32 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
86 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
25 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
217 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
137 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
90 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
128 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
159 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
121 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
149 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
72 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
70 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
95 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
321 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
66 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
69 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
307 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
322 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
31 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
46 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
517 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
47 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
50 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
77 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
290 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
490 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, ...