Submitting proofs
Make sure you have Aligned installed as specified here.
If you run the examples below, make sure you are in Aligned's repository root.
Supported Verifiers
The following is the list of the verifiers currently supported by Aligned:
✅ gnark - Groth16 (with BN254)
✅ gnark - Plonk (with BN254 and BLS12-381)
✅ SP1 (v3.0.0)
✅ Risc0 (v1.1.2)
Learn more about future verifiers here.
1. Import/Create Keystore file
If you already have a keystore file, you can ignore this section and start sending proofs. We give two examples of how to generate one. The first one using Foundry, and the second one using EigenLayer CLI
Alternative 1: With foundry
You need to have installed Foundry.
When creating a new wallet keystore and private key please use strong passwords for your own protection.
If you are creating a new account, create a private key with:
It will show you a new mnemonic phrase and a public-private key pair, similar to the following example:
Import the wallet using the private key previously generated, or whichever you want to use, and write a password to use it.
You have to paste your private key and set a password for the keystore file.
This will create the ECDSA keystore file in ~/.aligned_keystore/keystore0
Alternative 2: With EigenLayer CLI
If you have the EigenLayer CLI installed, the keystore can be generated following these instructions. The key will be stored into
~/.eigenlayer/operator_keys
.
2. Send funds to Aligned
To send proofs to Aligned using the Batcher, the user must first deposit some funds in Aligned to pay for the verification of his proofs.
To use it, you can use the aligned
CLI, as shown with the following example:
This command allows the usage of the following flags:
--rpc_url
to specify the rpc url to be used.--network
to specify the netowrk to be used. Can bedevnet
,holesky-stage
orholesky
.--keystore_path
the path to the keystore.--amount
the number of ethers to transfer to the Batcher.Note:
--amount
flag parameter must be with the shown format,XX.XXether
.
After depositing funds, you can verify the Service has correctly received them by executing the following command:
These commands allow the usage of the following flags:
--rpc_url
to specify the rpc url to be used.--network
to specify the netowrk to be used. Can bedevnet
,holesky-stage
orholesky
.--user_addr
the address of the user that funded the Batcher.
3. Submit your proof to the batcher
This guide will focus on how to submit proofs using the Aligned CLI. To integrate the proof submission process into your application, check the First Aligned Application tutorial where we explain how to generate and submit a proof using the Aligned SDK.
Proof submission is done via the submit
command of the Aligned CLI. The arguments for the submit command are:
proving_system
: The proving system corresponding to the proof you want to submit.proof
: The path of the proof associated to the computation to be verified.vm_program
: When the proving system involves the execution of a program in a zkVM, this argument is associated with the compiled program or some other identifier of the program.pub_input
: The path to the file with the public input associated with the proof.batcher_url
: The batcher websocket URL.network
to specify the netowrk to be used. Can bedevnet
,holesky-stage
orholesky
.rpc_url
: The RPC Ethereum node URL.proof_generator_addr
: An optional parameter that can be used in some applications to avoid front-running.batch_inclusion_data_directory_path
: An optional parameter indicating the directory where to store the batcher response data. If not provided, the folder with the responses will be created in the current directory.
SP1 proof
The current SP1 version used in Aligned is v3.0.0
.
The SP1 proof needs the proof file and the vm program file.
Example
Risc0 proof
The current Risc0 version used in Aligned is v1.1.2
.
The Risc0 proof needs the proof file and the vm program file (vm program file is the image id).
NOTE: As said above, Aligned currently supports Risc0 proofs from risc0-zkvm
version v1.1.2
. For generating proofs using cargo risc-zero
please ensure you are using v1.1.2
or your proof will not be verified.
If you can't install cargo-risczero
v1.1.2
, you can manually modify your cargo.toml
on the host project to point to v1.1.2
:
Note: In Risc0 verification
--pub_input
contains the bytes of thereceipt.journal.bytes
which contains both the public input (env::read()
) and public output (env::commit()
) values of a program executed in the Risc0 VM. If your Risc0 program contains public outputs, but no public inputs you still need to submit the serializedreceipt.journal.bytes
with your proof using the Aligned CLI for your proof to be verified.
Example
GnarkPlonkBn254, GnarkPlonkBls12_381 and Groth16Bn254
The GnarkPlonkBn254, GnarkPlonkBls12_381 and Groth16Bn254 proofs need the proof file, the public input file and the verification key file.
Examples:
Last updated