# Axiom for Developers

Axiom provides smart contracts trustless access to all on-chain data and arbitrary expressive compute over it. To integrate Axiom into your on-chain application, follow the following steps:

* Specify a **query** into Axiom which computes over the history of Ethereum through our Javascript frontend for ZK circuits (see [AxiomREPL](https://repl.axiom.xyz/) to get started right in your web browser).
* Export a **client-side ZK prover** for your dapp frontend that enables your users to verify the computation locally and send **queries** to the **AxiomV2Query** contract on-chain to verify the authenticity of the on-chain data inputs.
* Implement a **callback** on your dapp smart contract to receive ZK-verified results from the AxiomV2Query contract.

{% hint style="info" %}
Axiom is not an indexer or data aggregation service like The Graph or Covalent. Instead, dapps built with Axiom may use one of these services to find the data they want to prove with Axiom.&#x20;
{% endhint %}

### Where Axiom fits in

Here is a simplified stack diagram of where Axiom would fit into your on-chain application:

<figure><img src="/files/tcDerWNFTuVMhdkBXD0E" alt="" width="557"><figcaption><p>Simplified stack diagram of where various pieces of the stack sit</p></figcaption></figure>

### How to use Axiom

We've provided a general flow for a common way your app, third-party services, and Axiom can fit together. The user flow for Axiom involves the following steps:

* Construct an Axiom query on your app frontend using the Axiom SDK. This will involve fetching inputs from a JSON-RPC node or indexer and generating a **client-side ZK proof** using our exported prover. Once constructed, users send the query on-chain to the AxiomV2Query contract.&#x20;
* Axiom will index the query, compute the result, and generate a ZK proof of validity. The result and proof are sent on-chain and verified in the AxiomV2Query contract.&#x20;
* Finally, Axiom will atomically call the **user-specified callback** on your smart contract with the ZK-verified results of the computation over the history of Ethereum. Your smart contract can then use these results trustlessly for your application.

A visual illustration of this flow is in the diagram below:

<figure><img src="/files/0g0MVMprQ5I4sZ8yx7a3" alt=""><figcaption><p>One common system diagram of a on-chain application using Axiom to generate ZK proofs of historical data</p></figcaption></figure>

For more information, you can go through the [Autonomous Airdrop example](/axiomv2-sdk/examples/autonomous-airdrop.md) to see how all of the different parts fit together.


---

# 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://intrinsic-1.gitbook.io/axiomv2-sdk/developers/axiom-for-developers.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.
