> For the complete documentation index, see [llms.txt](https://docs.energyweb.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.energyweb.org/ewx-ecosystem/pallets/preimages-pallet.md).

# Preimages Pallet

The **Preimages Pallet** is a specialized component in the Substrate runtime that facilitates the storage, retrieval, and management of large data blobs (preimages) on-chain. It is particularly useful for governance and other modules requiring access to detailed proposals or large datasets while minimizing storage costs.

Key functionalities:

* **Efficient Storage of Preimages**: Allows users to submit and store large preimage data off-chain initially, ensuring cost-effective on-chain storage.
* **On-Demand Retrieval**: Enables on-chain modules, such as governance proposals, to reference and retrieve preimages only when they need to be executed or evaluated.
* **Preimage Validation**: Includes a framework to validate and verify the integrity of preimages against hashes before use and ensures that the preimage data corresponds accurately to its referenced hash.
* **Access and Ownership Control**: Supports fine-grained access controls, ensuring only authorized entities can submit or clear preimages and allows multiple modules and users to leverage preimages securely without conflict.


---

# 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://docs.energyweb.org/ewx-ecosystem/pallets/preimages-pallet.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.
