> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-whitepaper-series/section-7-reclaiming-disk-space-bitcoin-whitepaper/merkle-tree-and-transaction-hashing.md).

# Merkle Tree and Transaction Hashing

<figure><img src="https://3421145409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRTEKu4E7Fvtss3GI9CYU%2Fuploads%2FmpWK3nVDaRNcxW29HQOp%2FMerkle%20tree.gif?alt=media&amp;token=88fe4cec-5bfd-416b-98d8-7899cf967d8b" alt=""><figcaption></figcaption></figure>

*To facilitate this without breaking the block's hash, transactions are hashed in a Merkle Tree, with only the root included in the block's hash.*

Satoshi Nakamoto, Bitcoin Whitepaper

To facilitate the removal of individual transactions without compromising the integrity of the block's hash, a **Merkle Tree** is employed. This data structure allows for the efficient organization and verification of transactions.

Each transaction is hashed, and **these hashes are combined (concatenated) in pairs to create parent hashe**s, ultimately leading to a single **Merkle Root** that represents all transactions in the block.

This hierarchical structure **resembles an inverted family tree**, where each level reduces the number of data items until reaching the root.

The **Merkle root is embedded in the block header**, ensuring that any alteration to a transaction would result in a different root hash, thus maintaining the integrity of the blockchain.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-whitepaper-series/section-7-reclaiming-disk-space-bitcoin-whitepaper/merkle-tree-and-transaction-hashing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
