CLI tool to prove your rust code easily using either SP1 or Risc0.
zkRust supports generating proofs for executable scripts. Specifically, zkRust supports generating proofs for executable programs with inputs, code, and outputs known at compile time and defined within a main()
function and main.rs
file.
To use zkRust, define the code you would like to generate a proof for in a main.rs
in a directory with the following structure:
.
└── <PROGRAM_DIRECTORY>
├── Cargo.toml
└── src
└── main.rs
To generate a proof of the execution of your code run the following:
- Sp1:
cargo run --release -- prove-sp1 <PROGRAM_DIRECTORY_PATH> .
- Risc0:
cargo run --release -- prove-risc0 <PROGRAM_DIRECTORY_PATH> .
To generate your proof and send it to Aligned Layer. First generate a local wallet keystore using `cast.
cast wallet new-mnemonic
Then you can import your created keystore using:
cast wallet import --interactive <PATH_TO_KEYSTORE.json>
Finally, to generate and send your proof of your programs execution to aligned use the zkRust CLI with the --submit-to-aligned-with-keystore
flag.
cargo run --release -- prove-sp1 --submit-to-aligned-with-keystore <PATH_TO_KEYSTORE> <PROGRAM_DIRECTORY_PATH .
Currently zkRust does not support fully support the following:
- Programs with a library structure.
- VM user Input and Output
- VM Precompiles
These are features are planned to be added in later editions.