Stack Exchange Network

Stack Exchange network consists of 175 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.

1
vote
1answer
31 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
31 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
51 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 ...
2
votes
2answers
88 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, ...
0
votes
0answers
18 views

Merkle hash tree

Does the Merkle hash tree always have to be a binary tree? If not then what will be the advantages if it is ternary, tertiary…or anything else?
0
votes
0answers
19 views

SPV node in local machine [duplicate]

I have fullnode in my local machine, I'd like to have SPV node to understand how SPV works with merkle tree. With Bitcoin Core 0.17.1 I can have only full node?
4
votes
1answer
375 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 ...
2
votes
1answer
135 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
134 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
210 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
56 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
25 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
29 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
57 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
38 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
145 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
150 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
125 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
472 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
42 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 ...
4
votes
2answers
134 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
55 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
93 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
242 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
143 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
30 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
30 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
231 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
32 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
88 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
145 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
225 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
828 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 ...
2
votes
1answer
360 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
119 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
128 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
912 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
91 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
119 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) ...
10
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
146 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
519 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
376 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
308 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
75 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
80 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
272 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
589 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 ...
3
votes
1answer
214 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 ...