Quickstart
Get started with Axiom V2 on Goerli Testnet
Last updated
Get started with Axiom V2 on Goerli Testnet
Last updated
In this Quickstart documentation, we'll be building an basic Next.js web app that implements an Axiom client-side prover to generate a ZK proof of a user's average account balance over the past
Start by cloning this Quickstart repository:
You'll need a key from and a to place in your environmental variables. You can make a copy of and rename .env.local.example
to .env.local
:
Install required node.js packages with the following command:
We'll first build a circuit in AxiomREPL. AxiomREPL allows developers to specify data fetching and computation for their specific use cases. This circuit will be exported as a client-side prover that will run in the user's browser, with the values in the inputs panel (bottom) that will be overridden by values provided by the Next.js web app. We've included this AxiomREPL link with the code:
The same code in the above link is below:
We want to export the TypeScript circuit.ts
file, which we'll place into the cloned Quickstart repo:
Copy the exported circuit.ts
file into the following directory inside the Quickstart, overriding the current file that's there:
Now, you have everything that you need to send a Query into the AxiomV2Query contract.
In order to send a Query, you can start the Next.js dev server and go through a potential user flow:
Run the development server
Connect your wallet
Click the Build and Send Query button (query will require 0.0205 Goerli ETH)
The callback transaction contains an event that has the axiomResults
data (the average balance of the account):
The callback will output the results of the addToCallback
calls (in the order that you called addToCallback
) as an array of bytes32[]
values.
See Contract Addresses.
The development server will start at the default address of . which you can open in your web browser.
All Queries and their statuses are visible in (V2 Goerli w/ mock proofs).
See the section for more information.
axiomResults
data is just directly emitted from the deployed ExampleClient contract