Skip to content
/ icicle Public
forked from ingonyama-zk/icicle

a GPU Library for Zero-Knowledge Acceleration

License

Notifications You must be signed in to change notification settings

Obaid51/icicle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ICICLE

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

image (4)

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.

If we want ZK hardware today we have FPGAs or GPUs which are relatively inexpensive. However, the biggest selling point of GPUs is the software; we talk in particular about CUDA, which makes it easy to write code running on Nvidia GPUs, taking advantage of their highly parallel architecture. Together with the widespread availability of these devices, if we can get GPUs to work on ZK workloads, then we have made a giant step towards accessible and efficient ZK provers.

Zero Knowledge on GPU

ICICLE is a CUDA implementation of general functions widely used in ZKP. ICICLE currently provides support for MSM, NTT, and ECNTT, with plans to support Hash functions soon.

Supported primitives

  • Fields
    • Scalars
    • Points
      • Projective: {x, y, z}
      • Affine: {x, y}
  • Curves

NOTE: Support for BN254 and BLS12-377 are planned

Build and usage

NOTE: NVCC is a prerequisite for building.

  1. Define or select a curve for your application; we've provided a template for defining a curve
  2. Include the curve in curve_config.cuh
  3. Now you can build the ICICLE library using nvcc
mkdir -p build
nvcc -o build/<ENTER_DIR_NAME> icicle/lib.cu

Rust Bindings

For convenience, we also provide rust bindings to the ICICLE library for the following primitives:

  • MSM
  • NTT
    • Forward NTT
    • Inverse NTT
  • ECNTT
    • Forward ECNTT
    • Inverse NTT
  • Scalar Vector Multiplication
  • Point Vector Multiplication

A custom build script is used to compile and link the ICICLE library. Make sure to change the arch flag depending on your GPU type or leave it as native for the compiler to detect the installed GPU type.

Once you have your parameters set, run:

cargo build --release

You'll find a release ready library at target/release/libicicle_utils.rlib.

Example Usage

An example of using the Rust bindings library can be found in our fast-danksharding implementation

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.

License

ICICLE is distributed under the terms of the MIT License.

See LICENSE-MIT for details.

About

a GPU Library for Zero-Knowledge Acceleration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 72.4%
  • Cuda 12.5%
  • Go 8.1%
  • Rust 4.7%
  • C 1.6%
  • Sage 0.4%
  • Other 0.3%