Static library builds of ziskos for RISC-V 64-bit architecture with IMA extensions, suitable for Nethermind's bflat compiler. The repository also ships the Nethermind.ZiskOS.Runtime NuGet package, which embeds the static library for use from .NET projects targeting the Zisk zkVM.
This project provides pre-built static libraries for the zisk zkVM runtime, compiled for RISC-V 64-bit targets. The builds are specifically configured for:
- ISA: RV64IMAD (Integer, Multiplication, Atomic, Double-precision FP)
- ABI: LP64D
- Target OS: zkvm
- Vendor: zisk
The reason for choosing this target over rv64im is pretty simple. It is much more compatible with dotnet-riscv images already used in bflat. Still, these binaries are normally guaranteed to have no C, A, D instructions.
Each release includes:
libziskos.a- static library with ziskos functionality (precompiles) and direct system call wrappers (zisk_syscalls.Sassembled for rv64ima).libziskos.bflat.manifest- bflat manifest describing the library, its target triple, and the resolved zisk commit hash. It also instructs bflat to wrapmemcpy,memset,memmove, andmemcmp.Nethermind.ZiskOS.RuntimeNuGet package - .NET runtime package that bundleslibziskos.aand the manifest for consumption from managed projects.
Use bflat's ability to link to external libraries and provide the link to this repository, or reference the Nethermind.ZiskOS.Runtime NuGet package from a .NET project.
- Docker
- Git
- Bash
- Clone this repository:
git clone https://github.com/nethermindeth/bflat-libziskos.git
cd bflat-libziskos- Set the zisk version tag you want to build:
export ZISK_REF=v0.17.0- Run the build script:
./build/build.sh- Find the built artifacts in the
output/directory:
ls -lh output/The build process:
- Clones the zisk repository at the specified tag.
- Builds a Docker image based on
rustlang/rust:nightlywith the RISC-V cross-compilation toolchain (gcc-riscv64-linux-gnu,binutils-riscv64-linux-gnu) and therust-srccomponent for-Z build-std. - Applies
entrypoint.patchto the clonedziskos/entrypointcrate. The patch wraps_start,_zisk_main,memcpy,memmove, andmemcmpfor bflat-side wrap linkage, builds the unmangled_start/_zisk_mainentrypoints, replacessys_alloc_aligned, and exposesinline_bump_alloc_aligned. It also patcheslib-c/build.rsto skip the C++ library compilation for thezkvmtarget. - Adds the
no_entrypointfeature to the entrypoint crate so the static library can be linked into a host-provided entrypoint. - Builds the Rust library with Rust nightly using a custom RISC-V target specification (
riscv64imad-zisk-zkvm-elf) and-Z build-std=std,panic_abort. - Assembles system call wrappers from
src/zisk_syscalls/zisk_syscalls.Swithriscv64-linux-gnu-as --march=rv64ima --mabi=lp64. - Merges syscalls into
libziskos.ausingriscv64-linux-gnu-arandriscv64-linux-gnu-ranlib. - Emits the bflat manifest (
libziskos.bflat.manifest), injecting the resolved zisk commit hash aszisk_ref_hashwhenjqis available.
The final libziskos.a contains:
- ziskos core functionality (precompiles, runtime)
- Direct system call wrappers for zkVM syscalls
Contributions are welcome! Please feel free to submit issues or pull requests.