# 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: 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.ainetwork.ai/ain-blockchain/ai-network-design/blockchain-database.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.
