<p>In order to validate a block nodes must have the actual transactions themselves, even a list is insufficient.</p>

<p>But the question "Does a block contain X" is a bit like asking "What is the sound of one hand clapping?".  It would be valid to say that a "block" is nothing more than its block header or even that that hash of a block is "the block".   You couldn't validate a block from its hash or its header alone, just like you can't validate a block without data you learned from the blocks before it-- but how you get that data is up to you and the part(ies) that are telling you about the block.</p>

<p>This is relevant because today in the Bitcoin network, blocks are usually relayed without sending the transactions according to BIP152-- instead we assume that the regular transaction relay process has already given each node most or all of the transactions and send our peers a compact representation that lets them use their mempools to figure out what was in the block.  If they're missing some of the data they need, they can request it.</p>

CC BY-SA 4.0
2018-07-23T01:11:28.607Z
2018-07-23T19:58:59.053Z
2018-07-23T19:58:59.053Z
G. Maxwell
<p>You cannot obtain a list of transactions from the merkle tree.</p>

<p>The merkle tree root is part of the block header, which as you said, allows quick verification of the proof-of-work.</p>

<p>After the block header, each block contains a list of serialized transactions in the order they appear in the merkle tree. A complete block is a block header + list of transactions.</p>

<p>When validating a block, nodes will check:</p>

<ol>
<li>The proof of work (this can be done with just the block header. However, just because the block header validates, it does not mean the block is valid)</li>
<li>The merkle tree - Nodes will take the list of transactions and reconstruct the merkle tree to ensure the root matches what is in the header</li>
<li>Each individual transaction - Individual inputs and outputs are validates to ensure they meet network rules, and that no double spends exist.</li>
</ol>

CC BY-SA 4.0
2018-07-22T18:49:39.803Z
Answers my question perfectly.
3mrsh
CC BY-SA 4.0
2018-07-22T18:31:11.427Z
2018-07-22T18:31:11.427Z
Raghav Sood
<p>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 that gets sent to the other nodes for validation?  Is there a list of transactions that it also sent? </p>

<p>In my understanding, when a Node wishes to 'Mine', they will:  </p>

<ol>
<li>Generate a new block    </li>
<li>Create a coinbase transaction  </li>
<li>Gather a subset of the other incomplete transactions (those that have not yet been put into a block) from its copy of the blockchain.  </li>
<li>Generate a Merkle Tree using the transactions from steps 2 &amp; 3  </li>
<li>Increment a Nonce repeatedly until the Hash of the <code>&lt;Previous Hash, Nonce, Transactions from 4&gt;</code> begin with a certain number of 0s.</li>
</ol>

<p>It seems that to validate each individual transaction (to ensure money is not double-spent), it would be good to include a list of transactions. But to check that the proof-of-work has actually been completed, the other nodes need the merkle tree to quickly hash.</p>

<p>It is very possible that there is also a way to obtain the list of transactions from a merkle tree, but I just don't understand what that process looks like.</p>

<p>P.S. I am building my own Python demo implementation of a blockchain currency, hence the more-theoretical/less-practical questions.</p>

<p>Thanks.</p>

<transactions><mining-theory><merkle-tree><block>
Does a Block contain the list of transactions? Or only the Merkle Tree?
3mrsh
# Does a Block contain the list of transactions? Or only the Merkle Tree?

(Asked by: username_0 on 2018-07-22)

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 that gets sent to the other nodes for validation? Is there a list of transactions that it also sent?

In my understanding, when a Node wishes to 'Mine', they will:

1. Generate a new block
2. Create a coinbase transaction
3. Gather a subset of the other incomplete transactions (those that have not yet been put into a block) from its copy of the blockchain.
4. Generate a Merkle Tree using the transactions from steps 2 & 3
5. Increment a Nonce repeatedly until the Hash of the  begin with a certain number of 0s.

It seems that to validate each individual transaction (to ensure money is not double-spent), it would be good to include a list of transactions. But to check that the proof-of-work has actually been completed, the other nodes need the merkle tree to quickly hash.

It is very possible that there is also a way to obtain the list of transactions from a merkle tree, but I just don't understand what that process looks like.

P.S. I am building my own Python demo implementation of a blockchain currency, hence the more-theoretical/less-practical questions.

Thanks.

**Tags:** transactions, mining-theory, merkle-tree, block


---

## 2 answers

### Answer by username_2 on 2018-07-22. Score: 9 | Accepted answer

You cannot obtain a list of transactions from the merkle tree.

The merkle tree root is part of the block header, which as you said, allows quick verification of the proof-of-work.

After the block header, each block contains a list of serialized transactions in the order they appear in the merkle tree. A complete block is a block header + list of transactions.

When validating a block, nodes will check:

1. The proof of work (this can be done with just the block header. However, just because the block header validates, it does not mean the block is valid)
2. The merkle tree - Nodes will take the list of transactions and reconstruct the merkle tree to ensure the root matches what is in the header
3. Each individual transaction - Individual inputs and outputs are validates to ensure they meet network rules, and that no double spends exist.

> **Comments:**
> **username_0**: Answers my question perfectly.  

---

### Answer by username_1 on 2018-07-23. Score: 3

In order to validate a block nodes must have the actual transactions themselves, even a list is insufficient.

But the question "Does a block contain X" is a bit like asking "What is the sound of one hand clapping?". It would be valid to say that a "block" is nothing more than its block header or even that that hash of a block is "the block". You couldn't validate a block from its hash or its header alone, just like you can't validate a block without data you learned from the blocks before it-- but how you get that data is up to you and the part(ies) that are telling you about the block.

This is relevant because today in the Bitcoin network, blocks are usually relayed without sending the transactions according to BIP152-- instead we assume that the regular transaction relay process has already given each node most or all of the transactions and send our peers a compact representation that lets them use their mempools to figure out what was in the block. If they're missing some of the data they need, they can request it.


---

