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
2 answers
77 views

What is TXID?Is it used to calculate merkleroot [duplicate]

I downloaded the block template where each transaction contains 'data', 'txid', 'hash'. I read in some articles that the Merkelroot is calculated using 'txid'. Is true? Why txid not hash, and what's ...
Jack Green's user avatar
0 votes
1 answer
57 views

How to calculate Merkle Root? Need to reverse?

I downloaded the necessary information and made the coinbase. Then I calculated the merkle root... But I always get an error message when I submit a block: "bad-txnmerkleroot". Tere is my ...
Jack Green's user avatar
3 votes
1 answer
143 views

Are all transactions, whether SegWit or non-SegWit, part of the commitment in a coinbase transaction?

A merkle root in a block header is a way to commit all transactions in that block. However, since it does not cover transaction witness data, another commitment needs to be made in a coinbase ...
LeaBit's user avatar
  • 920
0 votes
1 answer
67 views

What am I doing wrong in calculating Merkle root of the block with only 2 transactions (block #99997)?

I want to learn how to calculate the Merkle root so I started from a simple example, a block with only 2 transactions (block #99997). However, I ran into a problem. Mempool online block explorer says ...
Cosmos's user avatar
  • 199
2 votes
1 answer
129 views

Legitimate merkle paths for SPV

How does a light client via SPV make sure that the requested merkle path is not fake? I know that the client has its own copy of the block headers, so it can trust the merkle root from there. It then ...
ieggel's user avatar
  • 123
1 vote
1 answer
77 views

Understanding Bitcoin - Usage of Merkle Trees

I'm currently learning about the Bitcoin blockchain. I've come across the concept of Merkle trees in the context of Bitcoin. I understand that Merkle trees are used to verify the integrity of the data,...
mlibre's user avatar
  • 133
3 votes
3 answers
615 views

What are MATT opcodes?

There is plenty of discussion in the Bitcoin-dev mailing list about MATT opcodes, and I would like to know what these are.
Eoin McQuinn's user avatar
0 votes
1 answer
88 views

Who's exploiting Merkle Root?

What kind of software is going to use a merkle root to know if a transaction is in a block ? I know Thin nodes are doing this but this is a little bit useless since major branches are required. Why ...
Loopite's user avatar
  • 301
0 votes
0 answers
51 views

Bulletproofs vs Merkle paths for inclusion proofs

In this blog post, Andrew Poelstra comments that bulletproofs can be used for efficient merkle inclusion proofs. How would these proofs compare in size and verifying time to simple merkle paths? Take ...
Son Kaos999's user avatar
0 votes
0 answers
61 views

How do I retrieve address balances to build a Merkle sum tree?

Curious about building my own proof of solvency program. I understand how the Merkle sum tree works in theory but I am having issues understanding the practical ways of getting the information I need. ...
madamepresident's user avatar
2 votes
1 answer
55 views

Are pool provided merkle branches trustable?

I'm a beginner is this field. Can someone explain to me how mining pool provided merkle branches are valid? Normally, when we make the root, it starts from top to bottom, a single change in order can ...
chronus's user avatar
  • 23
1 vote
2 answers
159 views

How is the merkle root verified if the mempools may be different?

How is the merkle root verified if the mempools are different? I already understand how its calculated. If a node has a mempool of transactions, and a miner has only some of those transactions and ...
CJ-Programmer's user avatar
1 vote
0 answers
22 views

Speed of Merkle Root proofs in SPV

Is it really more efficient to use the Merkle Root proofs system to verify that a transaction is included in a block for SPV clients compared to Download the block and check if the transaction is ...
SadPepo's user avatar
  • 71
1 vote
1 answer
91 views

Merkle root for Taproot key path spending?

I'm referring to a page of Taproot test vectors provided in BIP 341. In the section called keyPathSpending and then inputSpending under that, there are 7 JSON objects that provide parameters to test ...
Zephyrus's user avatar
  • 772
0 votes
1 answer
32 views

How do Bitcoin miners/nodes access previous transactions?

I started reading about how bitcoin transactions are processed and I came across the Merkle Tree. I learned that one of its purposes is to prevent nodes from storing the entire bitcoin transaction ...
bubblyducks95's user avatar
1 vote
1 answer
124 views

The true reason bitcoin needs merkle proof for SPV wallet?

I know exactly what merkle tree is, and I know it is used to verify a transaction is in a block with just a hundred of bytes flowing through my network cable (btw do I really lack that megabytes ...
cifer's user avatar
  • 151
1 vote
0 answers
62 views

Understanding bitcoin merkle tree construction at code level

I have a high level understanding of how merkle trees are constructed for a Bitcoin block, but I am interested in building a little CLI tool in golang that actually takes a list of transactions for a ...
Andrew Dawson's user avatar
0 votes
1 answer
40 views

Is merkle hash tree also at network level?

From my understanding of the Bitcoin network, Merkle Hash Tree is used on a block level, where each transaction is a leaf of the tree (except the situation that if transaction count is odd, the last ...
Hang Chen's user avatar
  • 103
0 votes
1 answer
68 views

What are the detailed rules for Merkle tree generation? Specifically the order of the leaf nodes

As far as I know, the first one is the coinbase transaction
KHJUAF403456ZS3K564WAEF's user avatar
1 vote
1 answer
141 views

What guarantees the validity of merkle root used in the merkle inclusion proof?

I understand Merkle roots can be used for Merkle inclusion proofs, where a client/validator can quickly check if a transaction is part of the block without requesting all the transactions in the block....
Finlay Weber's user avatar
0 votes
2 answers
220 views

MerkleRoot requires transaction hash to build a merkle tree.... Is that the "hash" key/value within the getblocktemplate response or the "data"?

I've created a function for parsing Json Objects and values and just when I think nothing can stop me, just when I feel like I'm the king of the blockchain and I can finally join in on the mining race ...
AncientTides's user avatar
0 votes
1 answer
118 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 ...
user1453428's user avatar
0 votes
0 answers
423 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 ...
user128829's user avatar
1 vote
1 answer
104 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 ...
lodeboon's user avatar
1 vote
1 answer
155 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 ...
user491880's user avatar
0 votes
1 answer
89 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(...
Keijyu's user avatar
  • 95
2 votes
1 answer
320 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-...
user6668201's user avatar
0 votes
1 answer
259 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 ...
jatroy's user avatar
  • 3
2 votes
1 answer
125 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 ...
arikachimoaririki's user avatar
0 votes
1 answer
53 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-...
arikachimoaririki's user avatar
0 votes
2 answers
186 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 ...
explore's user avatar
0 votes
2 answers
361 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 ...
Matt Tainsh's user avatar
0 votes
1 answer
60 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 ...
Matt Tainsh's user avatar
1 vote
1 answer
455 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 ...
Matt Tainsh's user avatar
1 vote
1 answer
52 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 ...
Jesse de gans's user avatar
1 vote
1 answer
37 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?
user avatar
1 vote
1 answer
121 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 ...
L M 's user avatar
  • 79
1 vote
0 answers
225 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 ...
Jay's user avatar
  • 13
0 votes
0 answers
55 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 ...
OBL 's user avatar
  • 1
8 votes
1 answer
2k 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.
Ayush's user avatar
  • 127
1 vote
1 answer
211 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 ...
yujaiyu's user avatar
  • 139
1 vote
1 answer
397 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 ...
Expectator's user avatar
1 vote
1 answer
56 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 ...
confused_bitcoin_learner's user avatar
3 votes
1 answer
616 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 ...
Nika Kurashvili's user avatar
1 vote
1 answer
210 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, ...
Marcus's user avatar
  • 115
1 vote
3 answers
143 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 ...
Bittu's user avatar
  • 23
2 votes
1 answer
264 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 ...
user19283043's user avatar
7 votes
1 answer
309 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 ...
NIKHIL KOMMINENI's user avatar
8 votes
1 answer
257 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 ...
Not Important's user avatar
2 votes
2 answers
323 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 ...
Hamita's user avatar
  • 174