1 stable release

1.3.0 Feb 14, 2024

#286 in Cryptography

MIT license

105KB
2.5K SLoC

ICICLE

ICICLE is a library for ZK acceleration using CUDA-enabled GPUs.

ICICLE

Chat with us on Discord Follow us on Twitter GitHub Release

Background

Zero Knowledge Proofs (ZKPs) are considered one of the greatest achievements of modern cryptography. Accordingly, ZKPs are expected to disrupt a number of industries and will usher in an era of trustless and privacy preserving services and infrastructure.

We believe GPUs are as important for ZK as for AI.

  • GPUs are a perfect match for ZK compute - around 97% of ZK protocol runtime is parallel by nature.
  • GPUs are simple for developers to use and scale compared to other hardware platforms.
  • GPUs are extremely competitive in terms of power / performance and price (3x cheaper).
  • GPUs are popular and readily available.

Getting Started

ICICLE is a CUDA implementation of general functions widely used in ZKP.

[!NOTE] Developers: We highly recommend reading our documentation

[!TIP] Try out ICICLE by running some examples using ICICLE in C++ and our Rust bindings

Prerequisites

  • CUDA Toolkit version 12.0 or newer.
  • CMake, version 3.18 and above. Latest version is recommended.
  • GCC version 9, latest version is recommended.
  • Any Nvidia GPU (which supports CUDA Toolkit version 12.0 or above).

[!NOTE] It is possible to use CUDA 11 for cards which don't support CUDA 12, however we don't officially support this version and in the future there may be issues.

Accessing Hardware

If you don't have access to an Nvidia GPU we have some options for you.

Checkout Google Colab. Google Colab offers a free T4 GPU instance and ICICLE can be used with it, reference this guide for setting up your Google Colab workplace.

If you require more compute and have an interesting research project, we have bounty and grant programs.

Build systems

ICICLE has three build systems.

ICICLE core always needs to be built as part of the other build systems as it contains the core ICICLE primitives implemented in CUDA. Reference these guides for the different build systems, ICICLE core guide, ICICLE Rust guide and ICICLE Golang guide.

Compiling ICICLE

Running ICICLE via Rust bindings is highly recommended and simple:

  • Clone this repo
    • go to our Rust bindings
    • Enter a curve implementation
    • run cargo build --release to build or cargo test to build and execute tests

In any case you would want to compile and run core icicle c++ tests, just follow these setps:

  • Clone this repo
    • go to ICICLE core
    • execute the small script to compile via cmake and run c++ and cuda tests

Docker

We offer a simple Docker container so you can simply run ICICLE without setting everything up locally.

docker build -t <name_of_your_choice> .
docker run --gpus all -it <name_of_your_choice> /bin/bash

Contributions

Join our Discord Server and find us on the icicle channel. We will be happy to work together to support your use case and talk features, bugs and design.

Development Contributions

If you are changing code, please make sure to change your git hooks path to the repo's hooks directory by running the following command:

git config core.hooksPath ./scripts/hooks

In case clang-format is missing on your system, you can install it using the following command:

sudo apt install clang-format

You will also need to install codespell to check for typos.

This will ensure our custom hooks are run and will make it easier to follow our coding guidelines.

Hall of Fame

  • Robik, for his ongoing support and mentorship
  • liuxiao, for being a top notch bug smasher
  • gkigiermo, for making it intuitive to use ICICLE in Google Colab
  • nonam3e, for adding Grumpkin curve support into ICICLE
  • alxiong, for adding warmup for CudaStream
  • cyl19970726, for updating go install source in Dockerfile

Help & Support

For help and support talk to our devs in our discord channel "ICICLE"

License

ICICLE is distributed under the terms of the MIT License.

See LICENSE-MIT for details.

Dependencies

~0.7–4MB
~76K SLoC