Setup API Access

Get an API Key

The Axiom Proving API is currently in private beta. At present, access to the API is only available upon invitation from the Axiom team for early beta users.

Install the Axiom CLI and Initialize with your API Key

Installing the Axiom Proving API currently requires building from source using the following commands:

cargo install --locked --git https://github.com/axiom-crypto/axiom-api-cli.git --tag v0.3.0 cargo-axiom

To authenticate with the Axiom Proving API, run

cargo axiom init --api-key <API_KEY>

The API key can be passed in directly or by setting the AXIOM_API_KEY environment variable in a .env file.

AXIOM_API_KEY=<API_KEY>

Note that cargo axiom init should be run in the directory containing the .env file.

Register a Program

We will now walk through an example of generating a proof on the Axiom Proving API for an example Fibonacci guest program. First, clone the example repo:

git clone https://github.com/openvm-org/openvm-example-fibonacci
cd openvm-example-fibonacci

Next, register your program with the Axiom Proving API to be reproducibly built with the default VM configuration ID with config-id = 8700ea25-f3b2-4ac2-a745-3e26d754d7a5.

cargo axiom build --config-id 8700ea25-f3b2-4ac2-a745-3e26d754d7a5

This will return a program-id. You can check the build status with:

cargo axiom build status --program-id [program-id]

Generate a Proof

Next, request a proof from the Axiom Proving API:

cargo axiom prove --program-id [program-id] --input 0x10

This will return a proof-id. You can check the status of the proving job with:

cargo axiom prove status --proof-id [proof-id]

Once the proving job is done, you can download the proof using:

cargo axiom prove download --proof-id [proof-id] --type evm --output proof.json

Finally, verify the proof is valid using:

cargo axiom verify --config-id 8700ea25-f3b2-4ac2-a745-3e26d754d7a5 --proof proof.json