A proof generator for cairo programs.
This repository uses stone-prover under the hood to generate proofs and uses cairo-vm to run, compile. The bootloader is taken from bootloader repository. To know more about bootloading check this out
You can generate proofs for cairo programs here. There are 2 ways to genrate proofs:
- First bootloading the program and then proving the execution of the bootloader. This is the recommended way and generates smaller proofs. Check out a simple bootloader here
- Proving the execution of the program directly.
Run the following command to install the dependencies:
./install.sh
cargo build
compiled.json
: The compiled Cairo program.
input.json
: Input data for the Cairo program.
public_input.json
: Public inputs for the proof generation.
private_input.json
: Private inputs for the proof generation.
trace.bin
: Execution trace of the Cairo program.
memory.bin
: Memory dump of the Cairo program execution.
proof.json
: The generated STARK proof.
pie.zip
: Cairo PIE (Program Independent Executable) that can be generated by running the program and can be used re run the file in standardised way without inputs. This is only kept for reference/debugging purposes and not used for proof generation.
cpu_air_prover_config.json
: Configuration file for the CPU AIR prover(stone-prover).
cpu_air_params.json
: Parameters file for the CPU AIR prover(stone-prover).
To checkout an example, check out the examples
directory.
- Create a new cairo program to prove, e.g.
dummy_snos.cairo
. - Create a corresponding input file, e.g.
dummy_snos_input.json
. - Modify the
examples/cpu_air_params.json
andexamples/cpu_air_config.json
to fit your needs. Check out the stone-prover documentation to see how to generate these files.
- If you want to generate a proof after bootloading it, run:
make prove_with_bootloader CAIRO_PROGRAM=<path_to_cairo_file>
- If you want to generate a proof for a program directly, run:
make prove_with_program CAIRO_PROGRAM=<path_to_cairo_file>
- If you want to generate a PIE(Position Independent Executable) program, run:
make generate_pie CAIRO_PROGRAM=<path_to_cairo_file>
- If you want to run the PIE program, run:
make run_pie CAIRO_PROGRAM=<path_to_cairo_file>