<blockquote>
  <p>But the Merkle Root is not enough to prove a transaction is in a block. All the sibling-values up the Merkle Tree are needed. Where do these values come from if they aren't already stored?</p>
</blockquote>

<p>Any full node that has a complete copy of the block can construct a <em>merkle proof</em> that proves a requested transaction identifier (txid) connects to the merkle root in a block header.  Here's an animated graphic showing how Bitcoin Core constructs a merkle proof:</p>

<p><img src="https://btcinformation.org/img/dev/animated-en-merkleblock-creation.gif" alt=""></p>

<p>For the txid (H5) for transaction 5, a list of hashes necessary to make the proof plus is created along with a list of flags telling the software evaluating the proof which side of each branch the would find the hash.</p>

<p>The lightweight client evaluating the proof uses those flags and hashes to prove the txid connects to the merkle root like this:</p>

<p><img src="https://btcinformation.org/img/dev/animated-en-merkleblock-parsing.gif" alt=""></p>

<p>For more information, you may wish to read about the peer-to-peer network protocol message <code>merkleblock</code> in the <a href="https://btcinformation.org/en/developer-reference#merkleblock" rel="nofollow noreferrer">BtcInformation.org Developer Reference</a>, which includes these illustrations.</p>

CC BY-SA 4.0
2018-08-16T20:29:15.507Z
2018-08-16T20:29:15.507Z
David A. Harding
<p>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 practically.</p>

<p>Given that Lightweight Nodes only store Block Headers to limit the storage needed for their copies of the BlockChain, Nodes don't have access to the transactions in a Block; by definition of a Block Header, the only info they have about transactions is the Merkle Root. </p>

<p>But the Merkle Root is not enough to prove a transaction is in a block. All the sibling-values up the Merkle Tree are needed. Where do these values come from if they aren't already stored?</p>

<p>Example. Node 1 has a Block on its Blockchain with Merkle Root = <code>H_ABC...P</code>. It wishes to see if <code>H_K</code> is in the block. To do so, it needs the values <code>H_L; H_IJK; H_MNOP; H_ABC..H</code>. Where and how does it get these?</p>

<p><a href="https://i.sstatic.net/3oMQE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3oMQE.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2018-08-16T19:34:01.233Z
`Given that Nodes only store Block Headers to limit the storage needed for their copies of the BlockChain` This is incorrect. Nodes store the entire block.
Raghav Sood
CC BY-SA 4.0
2018-08-16T20:04:39.573Z
Corrected the question to specify `Lightweight Nodes`
3mrsh
CC BY-SA 4.0
2018-08-16T20:12:48.953Z
They will ask a full node
Raghav Sood
<transaction-verification><thin-clients><block-validity><merkleblock>
How do you get Sibling Hashed Values in a Merkle Proof?
3mrsh
# How do you get Sibling Hashed Values in a Merkle Proof?

(Asked by: username_0 on 2018-08-16)

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 practically.

Given that Lightweight Nodes only store Block Headers to limit the storage needed for their copies of the BlockChain, Nodes don't have access to the transactions in a Block; by definition of a Block Header, the only info they have about transactions is the Merkle Root.

But the Merkle Root is not enough to prove a transaction is in a block. All the sibling-values up the Merkle Tree are needed. Where do these values come from if they aren't already stored?

Example. Node 1 has a Block on its Blockchain with Merkle Root = `H_ABC...P`. It wishes to see if `H_K` is in the block. To do so, it needs the values `H_L; H_IJK; H_MNOP; H_ABC..H`. Where and how does it get these?

[![enter image description here](https://i.sstatic.net/3oMQE.png)](https://i.sstatic.net/3oMQE.png)

**Tags:** transaction-verification, thin-clients, block-validity, merkleblock

> **Comments:**
> **username_1**: `Given that Nodes only store Block Headers to limit the storage needed for their copies of the BlockChain` This is incorrect. Nodes store the entire block.  
> **username_0**: Corrected the question to specify `Lightweight Nodes`  
> **username_1**: They will ask a full node  

---

## 1 answers

### Answer by username_2 on 2018-08-16. Score: 2

> But the Merkle Root is not enough to prove a transaction is in a block. All the sibling-values up the Merkle Tree are needed. Where do these values come from if they aren't already stored?

Any full node that has a complete copy of the block can construct a *merkle proof* that proves a requested transaction identifier (txid) connects to the merkle root in a block header. Here's an animated graphic showing how Bitcoin Core constructs a merkle proof:

![](https://btcinformation.org/img/dev/animated-en-merkleblock-creation.gif)

For the txid (H5) for transaction 5, a list of hashes necessary to make the proof plus is created along with a list of flags telling the software evaluating the proof which side of each branch the would find the hash.

The lightweight client evaluating the proof uses those flags and hashes to prove the txid connects to the merkle root like this:

![](https://btcinformation.org/img/dev/animated-en-merkleblock-parsing.gif)

For more information, you may wish to read about the peer-to-peer network protocol message `merkleblock` in the [BtcInformation.org Developer Reference](https://btcinformation.org/en/developer-reference#merkleblock), which includes these illustrations.


---

