cargo nexus
CLI is minimal, providing just a cargo nexus host
command to setup an SDK based project.
./src/main.rs
is our host program, while ./src/guest/src/main.rs
is our guest program.
As a slightly more interesting example than the default Hello, World! program, you can change the content of ./src/guest/src/main.rs
to:
./src/main.rs
to:
x = 5
and private input y = 3
.
The zkVM will then run the guest program, return a view containing the output (z = 15
) and logs, and produce a proof of its correct execution.
After the proving completes, the host program then reads the output out of the view, checks it and prints it along with any logs, and then verifies the proof.
nexus-sdk
dependency in the host program: legacy-nova
, legacy-hypernova
, or legacy-jolt
. Examples of using legacy mode to prove legacy guest programs are provided in the examples folder on Github.
To review the code used in the legacy mode, it corresponds to the Nexus zkVM v0.2.4 release.