# Smart Contracts

### Key Components of the Hemera Protocol

#### Indexer registry

Indexers stake and register to the network. After registration, validators will distribute queries to the indexer. Indexers should also submit proof of indexing records periodically and broadcast them to the whole network.&#x20;

Indexers capable of real-time indexing should set a flag in their metadata. The flag status is broadcasted to indicate real-time indexing capability and should be updated regularly.

#### Query book

Validators upload all the queries from end users. Validators submit records of any indexer failures, including inactive indexers and incorrect query results.

The query book should run settlements regularly. Following settlement, the balances for indexers and end users should be updated accordingly.

#### User account

End users must deposit a specified amount of $DAY tokens as a stake. A key will be generated for the user. Users should be able to check overall usage and manage account balances (deposit or withdraw $DAY tokens).

### Key Functions for Protocol Participants

#### Indexers&#x20;

* Stake $DAY token to the smart contract and register to the network
* Submit "proof of indexing" to the smart contract
* Broadcast real-time indexing status

#### Validators

* Check the indexing status through the smart contract
* Record usage history by batch (usage from end users & query served by indexers)
* Submit indexer failure (including inactive indexer and wrong query result) records

#### Administrator

* &#x20;Triggers settlement for indexer/validator/end user

#### End users/developers&#x20;

* Stake $DAY tokens and get valid keys to access the data API


---

# 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.thehemera.com/welcome/account-centric-indexing-protocol/the-hemera-network/smart-contracts.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.
