> For the complete documentation index, see [llms.txt](https://docs.ainetwork.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ainetwork.ai/ain-blockchain/ai-network-design/blockchain-database.md).

# Blockchain Database

Ethereum is a global singleton state machine, transactions trigger a change of state or cause a contract to execute in the EVM. The contract execution part is the heavy part which requires both virtual machine and storage structure. The smart contract transaction can be divided into three functionalities: changing state, defining rules for changing state, and defining actions when changing state. While Ethereum handles all three functionalities through blockchain transactions, AIN network aims to provide this functionality through states, rules, and triggers.

Transactions in AI Network trigger a change of state or defines the rules for changing state. The difference is it does not contain the code and the node does not need extra storage or memory for running the code on-chain. Rules are a small amount of the expression to dictate which transactions are valid and accepted for the specified subset of the state. In this regard, rules provide integrity to data written to the blockchain, ensuring invalid transactions are not allowed. Finally, triggers are off-chain workers which may generate additional transactions in response to transactions that have already been processed by the blockchain.

AI Network's state manipulation module is often refer to as *blockchain database* as it's very similar to traditional NOSQL database in the ways they read and write data.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.ainetwork.ai/ain-blockchain/ai-network-design/blockchain-database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
