Provides a Nix dev shell and Docker shell image for generating Zisk proofs of Rust programs
8+ CPU cores and 64+ GB RAM
- Make sure Nix is installed with flakes support
- Run the dev shell with
nix developor direnv, optionally with Garnix cache - Check you have
cargo,cargo-zisk, andziskemuavailable, and that$ZISK_DIRis set to~/.zisk - Run the commands from
https://0xpolygonhermez.github.io/zisk/getting_started/quickstart.html
- Total proving time is about 5 minutes for the
sha_hasherexample on my machine, YMMV
- Total proving time is about 5 minutes for the
Alternatively, the provided Ubuntu Docker container can be used:
- Build with
nix run .#build-image. This will take a few minutes to installziskupand download the proving key - Run the container shell with
nix run .#zisk-shell - Build and run per the dev shell instructions
- Exit the container with
exit
- Run commands with
-vto get better error messages - On NixOS, proof gen in the dev shell may cause unexpected errors or warnings. These can often be ignored if they don't affect proof generation
- Add
-lor-uto the proof gen command if you getERROR: Failed calling mmap(rom) errno=11=Resource temporarily unavailable(logs shown with-v) - Try setting
ulimit -l unlimitedper https://0xpolygonhermez.github.io/zisk/getting_started/installation.html#installing-dependencies
- Pure Nix builds are not currently supported, only the dev shell with
cargo/cargo-ziskCLI - For best performance use the Docker container, especially when compiling Zisk from source for GPU proving
- Improve Dockerfile build efficiency with minimal dependencies (see https://github.com/0xPolygonHermez/zisk/blob/main/distributed/Dockerfile)
- Add GPU proving to the Nix dev shell
- Test for any Nix-related performance regressions