# Storage Proofs

At their core, blockchains are databases where data is cryptographically secured using data structures such as Merkle trees, Merkle Patricia trees, and more. The unique characteristic of these data structures is that once data is securely committed to them, it is possible to produce proofs to confirm the inclusion of data inside the structure.

<figure><img src="https://1694265157-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3TBwtPMEVIGQI1B6u4Ii%2Fuploads%2Fle9BF5OcR5Mwty0YgcaM%2FGraphs%20for%20Documentation%20w%20logo-34.png?alt=media&#x26;token=0d0ee25f-6c00-4912-abda-a57a19189e2c" alt="" width="563"><figcaption><p>Ethereum Block</p></figcaption></figure>

Ethereum utilizes a specific variant called the Merkle Patricia tree. This structure is used in the State Trie, Receipts Trie, and Transactions Trie. Using these data structures provides multiple benefits.

First and foremost, the use of Merkle trees and Merkle Patricia trees enhances the security of the Ethereum blockchain. By cryptographically hashing data at every level of the tree, it becomes virtually impossible to alter the data without detection. Any change to a data point would necessitate changes to its corresponding hashes up the tree to the root hash, which is publicly visible in the blockchain header. This fundamental feature of blockchain provides a high level of data integrity and immutability.

Secondly, these trees allow for efficient data verification with inclusion proofs. For example, when verifying the inclusion of a transaction or the state of a contract, instead of having to search through the entire Ethereum blockchain, one only needs to verify a path within the relevant Merkle tree.

## **Herodotus Storage Proofs**

Building on these blockchain properties, Herodotus has built a system that enables on-chain data access, all the while preserving the inherent security of the blockchain base layer. We call this system - Storage Proofs.

A Herodotus-defined storage proof is a fusion of:

* **Inclusion Proofs:** These confirm the presence of specific data within cryptographic data structures, like Merkle trees or Merkle Patricia trees, ensuring that the data in question genuinely exists within a dataset.
* **Proofs of Computation:** Validate the execution of a multi-step workflow, attesting to the validity of one or multiple elements in extensive datasets, such as the entire Ethereum blockchain or a rollup. Beyond indicating data's presence, they authenticate the transformations or operations applied to that data.
* **Zero-Knowledge Proofs:** Streamline the amount of data a smart contract needs to interact with. Zero-knowledge proofs allow smart contracts to confirm a claim's validity without processing all of the underlying data.

## **Significance of Storage Proofs**

* **Data Integrity and Security:** Even though storage proofs are generated off-chain, there's no need to trust external parties. A malicious or inaccurate storage proof would be rejected during the on-chain verification.
* **Efficiency and Scalability:** Since storage proofs are generated off-chain, there's a significant reduction in on-chain network resource consumption. Moreover, storage proofs minimize the amount of data transferred between Ethereum layers. Instead of forwarding data to a destination chain, only the originating chain block hash or accumulator root is sent, against which storage proofs can be verified.
* **Flexibility:** Storage proofs give smart contracts the ability to access and verify a broader spectrum of on-chain data that they might not typically be able to access. For instance, a smart contract can verify historical gas prices of past transactions, a data point that was previously inaccessible.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.herodotus.dev/herodotus-docs/developers/storage-proofs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
