Announcing Axiom V2 on Mainnet

Compute over the entire history of Ethereum from your smart contract.

Announcing Axiom V2 on Mainnet

We are excited to announce that Axiom V2 is now live on Ethereum mainnet. Axiom allows smart contracts to compute over more data in a trustless way, starting with the entire history of Ethereum. We believe the high cost of data access is a key bottleneck for smart contracts. By using ZK to remove this bottleneck, our goal is to empower developers to build data-rich on-chain applications.

Our V2 release adds support for transactions, receipts, and Solidity mappings to the previously available accounts, contract storage, and block headers, meaning the full history of Ethereum is now available on-chain through Axiom. Developers query this history in Typescript with the Axiom SDK, which now supports custom user-specified computations over any combination of data types and blocks. With our new universal verifier, receiving ZK-verified results on-chain from Axiom only requires implementing a single callback in your smart contract. 

We’ve made it easy to use Axiom in your smart contracts – it only requires Solidity and Typescript – and you can query Axiom by directly sending a transaction on-chain. To try it out, run npx create-axiom-client to spin up a starter repo or check out our developer docs at docs.axiom.xyz. You can see our contracts on Ethereum mainnet and Sepolia here and view queries to Axiom at explorer.axiom.xyz. If you’d like to discuss an idea, come chat with us on Telegram or fill out our early partner form

In conjunction with our V2 release, we are migrating the Axiom V2 testnet from Goerli to Sepolia and deprecating Axiom V1 as of January 22, 2024.

Use Axiom V2 on Mainnet Today

Axiom V2 is now deployed on Ethereum mainnet and ready for production use. Using Axiom in your application requires two steps:

  1. Write an Axiom circuit using the Axiom Typescript SDK which requests ZK-verified compute over historic data from Ethereum.
  2. Implement an Axiom client contract using the Axiom Smart Contract SDK which receives ZK-verified results from Axiom via an on-chain callback.

To get started, run:

npx create-axiom-client 

This will create a starter repo with a default circuit and contract as well as a default Next.js web frontend which can be used to initiate queries into Axiom for your dapp. 

Building an Axiom Circuit

You can customize the circuit for your application using the Axiom SDK, which provides:

  • Axiom subqueries to make requests to Axiom for ZK-verified transactions, receipts, and historic block headers, accounts, and contract storage
  • ZK primitives to compute over data from Axiom subqueries with arithmetic, logical, comparison, and array operations.
An example Axiom circuit computing the average historic balance of an Ethereum account.

Writing an Axiom circuit can be done entirely in Typescript as shown in the example above. To integrate into your application, compiling an Axiom circuit creates a ZK prover which can be used to used to create an Axiom query in your webapp or on the server.

Integrating Into Your Smart Contract

To use results from Axiom in your application, simply implement the _validateAxiomV2Call and _axiomV2Callback functions to validate and execute Axiom-provided callbacks with your query results.

An Axiom client contract accepting a callback with ZK-proven Axiom results.

For testing, we’ve written an extension to the Foundry test library which provides cheatcodes to test Axiom circuits against your smart contract locally. This allows an Axiom-powered app to be tested in a standard smart contract workflow.

Testing sending of queries and pranking callbacks with our Foundry cheatcodes.

The smart contracts and ZK circuits behind Axiom V2 are fully open-source at our Github and have been audited by Spearbit, Zellic, and Trail of Bits. You can query Axiom by simply sending an on-chain transaction to the AxiomV2Query smart contract deployed on Ethereum mainnet and Sepolia testnet. To get started with your own project, check out our developer docs for a detailed tutorial, starter repos, and examples.

What You Can Do With Axiom 

Axiom allows smart contract developers to access new types of data on-chain. We are starting with the history of Ethereum, including transactions, receipts, and historic state. This holds critical information about on-chain reputation and identity, DeFi transactions, and governance participation, but surprisingly was previously inaccessible to smart contracts without relying on centralized off-chain oracles.

Developers can access a world of newly available on-chain quantities to incorporate into their contracts through Axiom, including:

  • Protocol usage: Transaction and event logs encapsulating all previous interactions a user has had with any on-chain protocol.
  • Historical balances: Which tokens and NFTs a user has held, and in what amounts.
  • Ethereum-native data: Gas usage, base fees, and RANDAO values from block headers and transaction inclusion and ordering information from the transactions trie. 

Axiom query results are verified on-chain by ZK proofs, meaning their correctness is cryptographically equivalent to data accessed through the EVM. This allows Axiom to compose different types of on-chain information in a single query and permissionlessly interoperate with existing protocols. This enables new classes of trust-minimized applications incorporating:

  • On-chain loyalty and incentives:
    • Reward your most loyal users based on their provable record of on-chain activity with Axiom, without modifying your deployed contracts. 
    • Vampire attack your competitors by rewarding users who can prove they were the most engaged and valuable.
  • On-chain accountability:
    • Reward users for protocol contributions based on the full record of their on-chain behavior, including interactions with external protocols and actions over time.
    • Slash users for violating ZK-verified protocol rules which can involve arbitrary combinations of on-chain data, including transaction ordering, actions across multiple blocks, and actions taken outside your protocol. 
  • Custom oracles for identity, governance, and settlement:
    • Settle gas and transaction fee derivatives or on-chain structured products without requiring support from an off-chain oracle provider.
    • Customize your governance by tailoring user voting power to their on-chain activity by rewarding past participation and good behavior with more votes.

We’re excited to support developers using these primitives and others enabled by the rich history of Ethereum to build compelling new on-chain experiences. If you have ideas for what to build or how we could help your protocol, come discuss in our Telegram dev chat or get in touch!

What’s Next?

In the next few weeks, we will share more about early partners already integrating Axiom, accessing Axiom queries about Ethereum L1 on rollups and across bridges, and our roadmap for future upgrades. Reach out on Telegram or our early partner form if you are interested in L2 or cross-chain support, and follow us on Twitter to stay updated.

Build your first Axiom-powered app with the Axiom Quickstart, Axiom SDK, and our developer docs, and deploy with our live system on Ethereum mainnet. If you’d like to chat about an idea, join our technical dev chat on Telegram or fill out our early partner form. We’re excited to see what you build!