# Storage

### Optimizing Storage Efficiency

As the ZEKND blockchain continues to grow with the addition of new blocks, the accumulation of chain data becomes inevitable. These chain data are essential for node operations and are stored in the node storage using a data structure called a trie, which is ultimately stored in a LevelDB database. However, the increase in blocks also results in an increase in chain data stored, leading to higher storage costs.

To address this challenge, opZEKND introduces a feature known as State Migration, specifically designed to reduce the required storage space. State Migration focuses on state tries, which constitute the majority of the chain data. It selectively removes state trie nodes that are no longer necessary for processing new blocks, effectively streamlining the storage requirements.

During the State Migration process, only the state trie nodes that are reachable from the state trie root of a specific block are retained. This means that irrelevant state trie nodes are deleted, leaving behind only the essential data needed for node synchronization. This includes the state trie nodes of the target block as well as any newly added blocks.

By implementing State Migration, opZEKND significantly improves storage efficiency by eliminating redundant and obsolete data, allowing nodes to operate more efficiently. This optimization reduces the overall storage costs associated with the growing chain data, ensuring that the blockchain remains scalable and cost-effective.


---

# 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://documentation.opzeknd.xyz/technology/storage.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.
