> 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/rules-and-owners.md).

# Rules and Owners

Rule configs are used to determine the validity of transactions before they are executed. Rule configs are also used to control which users are able to make certain types of transactions. Rule values are javascript boolean statements which will be invoked whenever a user tries to write data to the blockchain-database via a transaction. These statements will evaluate to either true or false depending on - the user, the current state of the blockchain database, and the current time - to name just a couple of examples. Common rule config use cases are:

* Enforcing the terms of an agreed contract between peers on the AI Network
* Ensuring automatic payment to relevant peers once the terms of a contract have been fulfilled and all relevant transactions to that contract have been added to the blockchain
* Determining who has permission to build and validate a block at any given height of the blockchain
* Enforcing punishments for validator peers who attempt to compromise the integrity of the blockchain

To control write permissions on rule configs, we use owner configs. Owner configs are also used to control the write permissions on the owner configs themselves.


---

# 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/rules-and-owners.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.
