Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
1answer
330 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 ...
-1
votes
0answers
14 views

Where are Merkle trees used in Bitcoin and why are they important?

I've been trying to understand how Merkle trees are used in bitcoin and why they are important. There's a very nice explanation in the answer provided here: Why is the full Merkle path needed to ...
2
votes
1answer
52 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
46 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
91 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 ...
1
vote
1answer
30 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 ...
0
votes
1answer
22 views

How to determine what's mine?

I for example own 10 BTC does that mean, in some Blocks in the valid part of the blockchain is written, that I received at some point in time a certain amount of BTC? How do I prove that the ...
0
votes
1answer
20 views

Bitcoin and Merkle Tree - is in Bitcoin the Merkle Tree actually a List (which of course is a special form of a tree)?

When I get it right, each block in Bitcoins block chain contains a prev hash and a new block hash that includes this prev hash. So the genesis block only has itself and from there on each hash of the ...
3
votes
3answers
50 views

If SPV clients didn't exist, would Bitcoin still use Merkle trees?

I understand how full nodes use Merkle proofs to convince SPV clients that certain transactions are valid / invalid. Does the Bitcoin software use Merkle trees in any other way?
3
votes
1answer
32 views

Question about identical txids/merkle tree in Developer guide

I am new to the technical details about Bitcoin and has been reading Developer guide on bitcoin.org. I have a question about below contents mentioning merkle tree, identical txids. I googled and ...
0
votes
1answer
58 views

How do you get Sibling Hashed Values in a Merkle Proof?

Merkle Proofs are one of the main reasons that people attribute Bitcoin's use of Merkle Trees. But I'm struggling to understand how these work in practice. Please explain theoretically as well as ...
2
votes
2answers
50 views

While calculating merkle proof, where are the other hashes being stored?

Consider that I have a merkle root made up of transactions a,b,c,d,e,f,g,h. The root is H( H(H(a)+H(b)) + H(H(b)+H(b)) ) + H( H(H(b)+H(b)) + H(H(b)+H(h)) ). Now, I have to verify whether transaction ...
2
votes
2answers
104 views

Can SPV clients offer “proof of absence” of a transaction?

So light SPV clients give the user the ability to obtain merkle proofs (from a full node) that a given transaction is included in a block. Is there some cryptographic mechanism by which an SPV client ...
0
votes
1answer
172 views

Why A Block have a Merkle root hash? [duplicate]

That is the question, why a block needs to have a Merkle root hash, as Iundestand, once a block is mined the hash value of this block is stored at the header of the next one so, it generates the chain....
0
votes
2answers
36 views

I want to know how I can express a phenomenon found in Merkle Trees mathematically

I want to know how I can express a phenomenon found in Merkle Trees mathematically. If I want to figure out which leaf node in a Merkle Tree has changed I can look at the authentication path to figure ...
3
votes
2answers
81 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 ...
0
votes
1answer
26 views

Merkle tree and data validation

If we want to check that data is member of it or not we will take the root, data block, and all the blocks in path between data and root. According to this picture if i want to check that data block, ...
0
votes
2answers
57 views

How would you find the Merkle Root with a Block that contains 6 transactions?

Let's use block #100205 https://www.blockchain.com/en/btc/block/0000000000033d0de6f4ebe93b3b142424cdbecf4bd98b948e856c4a55f09f76 This block contains 6 transactions. After the second level of hashing ...
0
votes
2answers
81 views

I'm trying to hash transactions together to find the Merkle Root!

Transaction #59500 has 045c670f1c02c919 as its coinbase. Transaction 1 is 6653ad77d695752cff9fe63bbb5702a53807be534c537251d53de06aac5ca093. Transaction 2 is ...
0
votes
1answer
61 views

Why use Merkle Root (and not just concatonation of all hashes?) [duplicate]

I am studying the bitcoin protocol and do not exactly understand why a Merkle root is used to register all the transactions. What is the point of using a tree-wise structure when you can also just ...
1
vote
0answers
28 views

Why do Merkle trees have a structure such that everything is in pairs? [duplicate]

From the leaves all the way to the root, it is always a pair that is hashed together as it goes up the tree. Why is it a pair, and not three or more?
1
vote
0answers
26 views

Lightning Network: are all keys pre-generated in the base row of the merkle tree?

From the whitepaper, page 41: Keys are generated in a merkle tree and are very deep within the tree. For instance, Alice pre-generates one million keys, each key being a child of the previous ...
3
votes
1answer
167 views

How is the Leaf node weakness in Merkle Trees exploitable?

Recently a weakness in leaf nodes of merkle trees was disclosed and it is claimed that this issue is exploitable to trick SPV nodes. How does the weakness make SPV nodes vulnerable to attack? What ...
1
vote
1answer
27 views

Lite-wallet transaction confirmation procedure

BTC lite-wallet sends a bloom-filer request to bitcoin node about what is the current balance of the particular address. After that wallet will have a Merkle-tree prove that transaction is indeed on a ...
0
votes
0answers
26 views

How are transactions hashed together to form a Merkle Root? [duplicate]

In block #59,500 there are 2 transactions Transaction 1. 6653ad77d695752cff9fe63bbb5702a53807be534c537251d53de06aac5ca093 and Transaction 2. ...
1
vote
1answer
57 views

Merkle Tree computations

Assume I am running a mini-blockchain that is I only have blocks' headers but no transactions. I wish to verify a transaction of a third party. For that I need the transaction's path to the Merkle ...
1
vote
2answers
96 views

Merkle root Vs transaction hashes

It is not clear to me, why not we can simply store transaction hashes in a block header instead of storing the Merkle root. I understand that storing transactions' hashes will slightly increase size ...
2
votes
2answers
150 views

Who gives SPV nodes merkle path to do validation for small subset of transaction?

From Mastering bitcoin: Merkle trees are used extensively by SPV nodes. SPV nodes don’t have all transactions and do not download full blocks, just block headers. In order to verify that a transaction ...
0
votes
1answer
560 views

How to solve error: Incorrect or no genesis block found. Wrong datadir for network?

I am making my own alt-coin, and I have mined the first genesis block hash(after some time), Merkle hash, nnonce and time. I am running on Ubuntu14.04. But when I run ./bitcoind I get this error ...
0
votes
0answers
51 views

Merkle Tree and block validation [duplicate]

I have managed to understand the advantages of using a tree to hash transaction in a block. However, I still have one doubt to be clarified... I understand the time it takes to validate transactions ...
2
votes
1answer
258 views

Is the hash of the coinbase transaction needed for the merkle root?

first time posting here. I was interested on how mining software works down to the bytes. I came across this well written article right here: http://www.righto.com/2014/02/bitcoin-mining-hard-way-...
0
votes
1answer
86 views

Confirming transactions in the Merkle root and SegWit

I'm trying to find out how exactly transactions are confirmed in a block. I understand that to confirm a transaction, you hash it with its associated transaction and then the associated hashes until ...
1
vote
2answers
107 views

Deserializing merkleblock message

I've been struggling the past couple of days to deserialize a merkleblock message. I'm writing a go app that uses the bitcoin rpc client to call gettxoutproof, but only need the merkle proof (array of ...
3
votes
2answers
655 views

What is the difference between Root Hash and Block Hash?

I was reading about how Bitcoin works from Satoshi's original paper. I had a query while going through the 7th paragraph. What is the difference between Root Hash and Block Hash? Isn't the block hash ...
1
vote
1answer
58 views

Merkle root vs message digest? [duplicate]

My question is in relation to the operational difference between a merkle root and a plain old message digest. To calculate a merkle root I need to complete the following steps : hash each ...
0
votes
2answers
108 views

How does mining work on the moving target (variables change every second)?

In bitcoin, miners hash the header twice with the SHA256 function. This header consists of the fields listed below: version (v) previousHashBlock (p) merkleRoot (m) time (t) difficulty (d) nonce (n) ...
0
votes
0answers
61 views

How many merckle branches can exist in Stratum mining.notify reply

The reply of mining.notify (Stratum protocol) includes the field of "List of Merkle branches" that may include 1 or more Merkle branches. I have looked everywhere, but I haven't found what the min/max ...
0
votes
0answers
42 views

How does a Merkle tree differ to a binary tree [duplicate]

how does a Merkle tree differ to a binary/redblack tree with strings of hashes ? Is there anything I am missing ?
9
votes
5answers
2k 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 ...
0
votes
2answers
139 views

Why have proof of work?

As far as I can tell, PoW allows multiple parties who don't trust each other to agree on an order of transactions. The fact that every transaction has a hash of the previous block means that you can ...
3
votes
1answer
268 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 ...
2
votes
1answer
315 views

Using the Merkle Root to prove the integrity of a block's transactions

I understand that a Merkle Root is the hash of hashes of hashes (etc.) of transaction pairings within a block that ultimately results in one 'Root' hash. Changing anything about any of the original ...
0
votes
2answers
256 views

Understanding the Hash Function

Can someone please explain in detail the components of the final hash that determines the winner of the block? My understanding is that the miners are taking The Merkle Root, The time stamp, The ...
2
votes
0answers
69 views

Blake-256 genesis block generation helpint

I'm making my own coin and get problem to generate genesis for my fork. Genesis need to be blake-256. I was found this git https://github.com/lhartikk/GenesisH0 and tryed to use this script, i also ...
1
vote
1answer
75 views

General Bitcoin questions [closed]

At the moment I'm trying to get a look inside Bitcoin and the Blockchain, but I'm having some general unanswered questions. How does a wallet know how much Bitcoins belongs to a specific address? I ...
0
votes
2answers
227 views

Block hashing algorithm

The block header contains a number of things, among them the Merkle root hash. Wouldn't this mean that every time a new transaction is added to the block (before its mined), that all nonces previously ...
2
votes
2answers
481 views

How could we determine that a particular transaction in which block's Merkle tree?

https://blog.ethereum.org/2015/11/15/merkling-in-ethereum/ : If the light client wants to determine the status of a transaction, it can simply ask for a Merkle proof showing that a particular ...
2
votes
1answer
179 views

Mining Process - Transactions Selection

I started reading about Bitcoin a few weeks ago. Reading most the information and watching videos on the web, I though I understood about the mining process. However, I was shocked when I realized ...
1
vote
2answers
658 views

How particular node is searched in Merkle tree? [duplicate]

Suppose I have Merkle Tree with Transactions 'A','B','C','D','E','F' and I want to know how to check if particular transaction i.e 'A' exists in a Tree or not ?. And if it is present then how to ...
1
vote
1answer
314 views

Merkle Root for 1-transaction block!

I know that merkle hash for one transaction tx is: sha256(sha256(tx)) In this block: https://blockchain.info/block/000000000000000001291219dde8ed705903e8c101f416c68a439e5171ede5bc there is only one ...