Skip to content

tsinghua-ideal/UniZK

Repository files navigation

This is the simulator for UniZK, an accelerator for Zero-Knowledge Proof with unified hardware and flexible kernel mapping.

Thirdparty

The codes of the following third-party libraries are sourced from:

We appreciate the contributions of these open-source authors.

How to get started

Prerequiste

  • A recent Linux distribution (recommended: Ubuntu 22.04)
  • rust 1.80
  • g++ 11.4
  • cmake 3.22

Configure the environment

The dependency.sh script will install the necessary tools: g++, cmake, and Rust. To run it, use the following command:

./dependency.sh

If you want to run UniZK in a Docker container, the docker.sh script will automatically create and start a new container and configure the requirements. Use this command:

./docker.sh

The files of the project will be copied into /UniZK within the container.

Use a nightly toolchain for Plonky2

rustup override set nightly

Build RamSim

cd thirdparty/ramsim
mkdir build
cd build
cmake ..
make -j

Run tests on CPU

./run_cpu_test.sh

Run tests for plonky2

./run_plonky2_test.sh

Run tests for starky and recursive proof

./run_starky_test.sh

A log file with the name of the application, such as “sha256.log”, will appear in the folder with the simulation results.

Notes

Disk space

Trace files can take up a lot of disk space. Ensure you have enough space when testing large applications and remember to clean up the files after testing!

GPU

The GPU performance can be evaluated using the GPU implementation of Plonky2 (available at https://github.com/sideprotocol/plonky2-gpu/tree/d6430874ae76e6cfc45d995fa3cf8b84fad70404) with our CPU-based application code located in the examples directory.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages