Axiom for Developers

Learn how to use Axiom in your smart contract

The alpha release of Axiom allows developers to trustlessly access block headers, accounts, and storage values from any block in the history of Ethereum.

There are three components that developers will leverage:

Overview

Imagine a project that allows projects to effectively do airdrops based on the age of the account. In this example, the Airdrop Contract is the contract written by the developer, and the AxiomV1QueryContract is written by Axiom.

To query this data from Axiom and use it in your application, you can follow the following three steps:

  1. Send an on-chain query: Build a query using the Axiom SDK and submit it on-chain to the AxiomV1Query smart contract.

  2. Wait for query fulfillment: An off-chain prover will index the query, produce the query result, and proves its validity in ZK. The proof is verified on-chain, and the resulting keccakQueryResponse is written to AxiomV1Query contract storage in a Merkle-ized form.

  3. Read query results: Once a result has been verified on-chain, use our SDK to verify query results against our contract storage and use them trustlessly in your smart contract application.

The remainder of this section gives more details about the Axiom query format, using our SDK to submit queries, and reading the end result. You can also check out our starter repo at axiom-quickstart which helps you submit your first test query as quickly as possible.

Last updated