zkVM
Configuring the Prover

Prove custom profiles

cargo nexus prove accepts --profile argument to build and prove artifact in specified profile. The default is release. You can define your own profile in Cargo.toml of your Nexus project according to cargo docs (opens in a new tab). As an example, try proving debug build:

cargo nexus prove --profile=dev

Switching Nova implementation

nexus-nova provides two implementations of the prover: sequential and proof-carrying data. The second one is also aliased as parallel or distributed. It enables multiple provers to work on the same program in parallel, at the cost of bigger recursion overhead (see module docs (opens in a new tab) for details). The default one you have tried in the quick start is sequential, to switch to parallel you can either pass it as a cli argument:

cargo nexus prove --impl=par
cargo nexus verify --impl=par # don't forget to specify it for the verifier!

Or simply set the environment variable:

export NEXUS_VM_NOVAIMPL=par # default is seq
 
cargo nexus prove
cargo nexus verify

Changing this value requires generating new public parameters!

Configuring k

The k number denotes how many NexusVM instructions are batched into each prover step. Increasing this number reduces the overall number of proving steps, while also increases the overhead of computing one, as well as the size of the final proof. Similarly to the previous section, you can either pass it through cli or environment:

cargo nexus prove -k=32
cargo nexus verify -k=32 # don't forget to specify it for the verifier!

or

export NEXUS_VM_K=32
 
cargo nexus prove
cargo nexus verify

Changing this value requires generating new public parameters!

Caching public parameters

The first time you prove a new project, cargo nexus sets up public parameters and stores them into ./target/nexus-cache directory. If you want to re-use it or replace this path with something else, set the environment variable:

export NEXUS_CACHE=/tmp/nexus
 
cargo nexus prove