Skip to main content

Toolchain

Manages the cargo-zisk Rust toolchain, the patched compiler that targets the ZisK zkVM. Documents the build subcommand for compiling the toolchain from source and the install subcommand for fetching a prebuilt release.

Manage the cargo-zisk Rust toolchain, the patched compiler that targets the ZisK zkVM. toolchain exposes two subcommands: build to compile the toolchain from source, and install to fetch a prebuilt release.

cargo-zisk toolchain <COMMAND>
CommandPurpose
buildBuild the toolchain from source. Useful when targeting a custom branch or tag.
installInstall a prebuilt toolchain. The fast path for most users.

build​

Compile the cargo-zisk toolchain from source and register it with rustup. Useful for development against a custom branch or tag, or when no prebuilt release matches your platform.

cargo-zisk toolchain build [OPTIONS]

Flags​

FlagShortDefaultDescription
--name <NAME>-nziskName registered with rustup toolchain for the built toolchain.
--branch <BRANCH>-bziskGit branch to check out before building.
--tag <TAG>-tGit tag to check out before building. Takes precedence over --branch when both are set.

Set ZISK_BUILD_DIR to build from an existing checkout at $ZISK_BUILD_DIR/rust instead of cloning 0xPolygonHermez/rust into a temporary directory.

Examples​

Build the default zisk branch and register it with rustup under a custom name:

cargo-zisk toolchain build --name zisk-dev

Build from a specific tag, pinning the toolchain to a release:

cargo-zisk toolchain build --tag zisk-4.1.0 --name zisk-4.1.0

Build from a feature branch:

cargo-zisk toolchain build --branch experimental --name zisk-exp

install​

Download and install a prebuilt cargo-zisk toolchain. This is the fast path — no source checkout, no compile time.

cargo-zisk toolchain install [OPTIONS]
install wipes part of $ZISK_HOME first

Before downloading, toolchain install deletes every file and directory directly under $ZISK_HOME (~/.zisk) except bin/, toolchains/, provingKey/, verifyKey/, cache/ and zisk/. This removes, for example, provingKeySnark/ and recurser/, and it happens even if the download then fails. Back them up before running the command.

Flags​

FlagShortDefaultDescription
--toolchain-version <TOOLCHAIN_VERSION>-tlatestRelease tag of the toolchain to install, zisk-<major>.<minor>.<patch> (for example zisk-4.1.0). The default is the highest zisk-4.x.y release.
--name <NAME>-nziskName assigned to the installed toolchain in rustup.

Examples​

Install the latest toolchain under the default zisk rustup name:

cargo-zisk toolchain install

Install a specific toolchain version:

cargo-zisk toolchain install --toolchain-version zisk-4.1.0

Install under a custom rustup name (useful when keeping multiple versions side-by-side):

cargo-zisk toolchain install --toolchain-version zisk-4.1.0 --name zisk-4.1.0
note

cargo-zisk build and cargo-zisk run always compile with the toolchain named zisk (cargo +zisk). A toolchain installed or built under another --name is only used when you invoke it yourself, for example cargo +zisk-4.1.0 build.