# Credit System

Human Network has a credit system that says how many times a user is allowed to query it. Credits may be bought on mainnet for ETH. In testnet, credits are simply equal to the number $testMISHTI tokens someone has.

{% hint style="info" %}
To query the network, a user must to have more credits than they have previously spent by querying the network. Each query spends exactly one credit.
{% endhint %}

Human Network's credit system includes two innovations that allow queries to the network to be processed without requiring consensus (i.e. asynchronous and infinitely scalable in practice). The network keeps both a local state and a global state of credits spent per user. It is able to operate largely asynchronously (and thus practically infinitely scalable) by only updating the global state at each epoch. I.e, nodes need not communicate how many credits a user has spent to other nodes.

It does this by assigning each request to a different subset of nodes, deterministically based on the request number and epoch number. This ensures that it is unlikely a user can "double spend" a request to a disjoint sets of nodes. Even though there is no global state during epochs, the probability of a user being able to successfully attack the network by having consecutive requests go different *t* nodes is&#x20;

\<TODO>

### Decryption credits

Decryption requests require decryption credits as well as regular Human Network credits. Each ciphertext encrypted to Human Network is accompanied by a smart contract. This smart contract has a function, `decryptionCredits(address decryptor)`, which returns how many decryption credits an address has. When Human Network receives a request for decryption, it checks the associated contract to see if the user has sufficient decryption credits. Human Network takes the minimum of decryption credits or Human Network credits to determine whether the user has sufficient credits for the request.


---

# 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.network.human.tech/decentralization/architecture/credit-system.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.
