Installation Guide
ZisK can be installed from prebuilt binaries (recommended) or by building the ZisK tools, toolchain and setup files from source.
System Requirements
ZisK currently supports Linux x86_64 and macOS platforms (see note below).
Note: On macOS, proof generation is not yet optimized, so some proofs may take longer to generate.
Required Tools
Ensure the following tools are installed:
- Rust
- Git
- To enable GPU support in ZisK, you must have NVIDIA Driver version 525.60.13 or later installed.
- If you use
zisk-sdkcrate, you must also have CUDA Toolkit version 12.9 or later installed.
Installing Dependencies
Ubuntu
Ubuntu 22.04 or higher is required.
Install all required dependencies with:
sudo apt-get install -y xz-utils jq curl build-essential qemu-system libomp-dev libgmp-dev nlohmann-json3-dev protobuf-compiler uuid-dev libgrpc++-dev libsecp256k1-dev libsodium-dev libpqxx-dev nasm libopenmpi-dev openmpi-bin openmpi-common libclang-dev clang gcc-riscv64-unknown-elf
ZisK uses shared memory to exchange data between processes. The system must be configured to allow enough locked memory per process:
$ ulimit -l
unlimited
A way to achieve it is to edit the file /etc/systemd/system.conf and add the line DefaultLimitMEMLOCK=infinity. Reboot for changes to take effect.
macOS
macOS 14 or higher is required.
You must have Homebrew and Xcode installed.
Install all required dependencies with:
brew reinstall jq curl libomp protobuf openssl nasm pkgconf open-mpi libffi nlohmann-json libsodium riscv-tools
Installing ZisK
Option 1: Prebuilt Binaries (Recommended)
-
To install ZisK using ziskup, run the following command in your terminal:
curl https://raw.githubusercontent.com/0xPolygonHermez/zisk/main/ziskup/install.sh | bash -
During installation, ziskup will detect whether CUDA is available on your machine. If so, it will install ZisK binaries with GPU support. Otherwise, you will be prompted to choose between CPU binaries (default) or GPU binaries.
-
Also during the installation, you will be prompted to select a setup option. You can choose from the following:
- Install proving key (default) – Required for generating and verifying proofs.
- Install proving key (no constant tree files) – Install proving key but without constant tree files generation.
- Install verify key – Needed only if you want to verify proofs.
- None – Choose this if you only want to compile programs and execute them using the ZisK emulator.
-
Verify the Rust toolchain: (which includes support for the
riscv64ima-zisk-zkvmcompilation target):rustup toolchain listThe output should include an entry for
zisk, similar to this:stable-x86_64-unknown-linux-gnu (default) nightly-x86_64-unknown-linux-gnu zisk -
Verify the
cargo-ziskCLI tool:cargo-zisk --versionIt should show
cargo-zisk X.X.X [gpu]if the GPU version is installed, orcargo-zisk X.X.X [cpu]otherwise
Updating ZisK
To update ZisK to the latest version, simply run:
bash ziskup
You can use the flags --provingkey, --verifykey or --nokey to specify the installation setup and skip the selection prompt.
To install the PLONK proving key (provingKeySnark), run:
bash ziskup setup_snark
Option 2: Building from Source
Build ZisK
-
Clone the ZisK repository:
git clone https://github.com/0xPolygonHermez/zisk.git cd zisk -
Build ZisK tools:
cargo build --releaseNote: The build process will automatically detect whether CUDA is available on your machine. If so, it will build the GPU-enabled binaries; otherwise, it will build the CPU version. To force the CPU version, use the
--features cpu-onlyflag.Note: By default, the build process auto-detects the GPU architecture of the host machine. Use the
CUDA_ARCHSenvironment variable to control which architectures are compiled:# Single architecture (faster build — e.g. Ada Lovelace sm_89 / RTX 4090) CUDA_ARCHS="89" cargo build --release # Multiple architectures (e.g. Ada + Hopper) CUDA_ARCHS="89,90" cargo build --release # All major architectures — portable binary for distribution # (sm_80, sm_86, sm_89, sm_90, sm_100, sm_120 + PTX forward compatibility) # Note: this takes significantly longer to compile CUDA_ARCHS="major" cargo build --release -
Copy the tools to
~/.zisk/bindirectory:mkdir -p $HOME/.zisk/bin cp target/release/cargo-zisk target/release/ziskemu target/release/riscv2zisk target/release/zisk-coordinator target/release/zisk-worker target/release/libziskclib.a $HOME/.zisk/bin -
Copy required files for assembly rom setup:
Note: This is only needed on Linux x86_64, since assembly execution is not supported on macOS
mkdir -p $HOME/.zisk/zisk/emulator-asm cp -r ./emulator-asm/src $HOME/.zisk/zisk/emulator-asm cp ./emulator-asm/Makefile $HOME/.zisk/zisk/emulator-asm cp -r ./lib-c $HOME/.zisk/zisk -
Add
~/.zisk/binto your system PATH:If you are using
bashorzsh:PROFILE=$([[ "$(uname)" == "Darwin" ]] && echo ".zshenv" || echo ".bashrc") echo >>$HOME/$PROFILE && echo "export PATH=\"\$PATH:$HOME/.zisk/bin\"" >> $HOME/$PROFILE source $HOME/$PROFILE -
Install the ZisK Rust toolchain:
cargo-zisk toolchain installNote: This command installs the ZisK Rust toolchain from prebuilt binaries. If you prefer to build the toolchain from source, follow these steps:
-
Ensure all dependencies required to build the Rust toolchain from source are installed.
-
Build and install the Rust ZisK toolchain:
cargo-zisk toolchain build -
-
Verify the installation:
rustup toolchain listConfirm that
ziskappears in the list of installed toolchains. -
Verify the
cargo-ziskCLI tool:cargo-zisk --versionIt should show
cargo-zisk X.X.X [gpu]if the GPU version is built, orcargo-zisk X.X.X [cpu]otherwise.
Build Setup
Please note that the process can be long, taking approximately 45-60 minutes depending on the machine used.
NodeJS version 20.x or higher is required to build the setup files.
-
Clone the following repositories in the parent folder of the
ziskfolder created in the previous section:git clone https://github.com/0xPolygonHermez/pil2-compiler.git git clone https://github.com/0xPolygonHermez/pil2-proofman.git git clone https://github.com/0xPolygonHermez/pil2-proofman-js -
Install packages:
(cd pil2-compiler && npm i) (cd pil2-proofman-js && npm i) -
All subsequent commands must be executed from the
ziskfolder created in the previous section:cd zisk -
Generate fixed data:
cargo run --release --bin arith_frops_fixed_gen cargo run --release --bin binary_basic_frops_fixed_gen cargo run --release --bin binary_extension_frops_fixed_gen -
Compile ZisK PIL:
node --max-old-space-size=16384 ../pil2-compiler/src/pil.js pil/zisk.pil -I pil,../pil2-proofman/pil2-components/lib/std/pil,state-machines,precompiles -o pil/zisk.pilout -u tmp/fixed -O fixed-to-fileThis command will create the
pil/zisk.piloutfile -
Generate setup data: (this step may take 30-45 minutes):
node --max-old-space-size=16384 --stack-size=8192 ../pil2-proofman-js/src/main_setup.js -a ./pil/zisk.pilout -b build -t ../pil2-proofman/pil2-components/lib/std/pil -u tmp/fixed -r -s ./state-machines/starkstructs.jsonThis command generates the
build/provingKeydirectory.Additionally, to generate the snark wrapper:
node ../pil2-proofman-js/src/main_setup_snark.js -b build -t ../pil2-proofman/pil2-components/lib/std/pil -f -w ../powersOfTau28_hez_final_27.ptau -p ./state-machines/publics.json -n plonkIt is stored under the
build/provingKeySnarkdirectory. -
Copy (or move) the
build/provingKeydirectory to$HOME/.ziskdirectory:cp -R build/provingKey $HOME/.zisk
Uninstall Zisk
-
Uninstall ZisK toolchain:
rustup uninstall zisk -
Delete ZisK folder
rm -rf $HOME/.zisk