icicle-core
A hardware acceleration library for compute intensive cryptography :ice_cube:
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 49 committers (2.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A hardware acceleration library for compute intensive cryptography :ice_cube:
Basic Info
- Host: GitHub
- Owner: ingonyama-zk
- License: mit
- Language: C++
- Default Branch: main
- Homepage: https://dev.ingonyama.com
- Size: 226 MB
Statistics
- Stars: 435
- Watchers: 18
- Forks: 151
- Open Issues: 31
- Releases: 42
Topics
Metadata Files
README.md
ICICLE
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 that ICICLE will be a cornerstone in the acceleration of ZKPs:
- Versatility: Supports multiple hardware platforms, making it adaptable to various computational environments.
- Efficiency: Designed to leverage the parallel nature of ZK computations, whether on GPUs, CPUs, or other accelerators.
- Scalability: Provides an easy-to-use and scalable solution for developers, allowing them to optimize cryptographic operations with minimal effort.
Getting Started
This guide will help you get started with ICICLE in C++, Rust, and Go.
[!NOTE] Developers: We highly recommend reading our documentation for a comprehensive explanation of ICICLEs capabilities.
[!TIP] Try out ICICLE by running some examples available in C++, Rust, and Go bindings. Check out our install-and-use examples in C++, Rust and Go
Prerequisites
- Any compatible hardware: ICICLE supports various hardware, including CPUs, Nvidia GPUs, and other accelerators.
- CMake, Version 3.18 or above. Latest version recommended. Required only if building from source.
- CUDA Toolkit, Required only if using NVIDIA GPUs (version 12.0 or newer).
[!NOTE] For older GPUs that only support CUDA 11, ICICLE may still function, but official support is for CUDA 12 onwards.
Accessing Hardware
If you don't have access to an Nvidia GPU we have some options for you.
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.
Building ICICLE from source
ICICLE provides build systems for C++, Rust, and Go. Each build system incorporates the core ICICLE library, which contains the essential cryptographic primitives. Refer to the Getting started page for full details about building and using ICICLE.
[!WARNING] Ensure ICICLE libraries are installed correctly when building or installing a library/application that depends on ICICLE so that they can be located at runtime.
Rust
In cargo.toml, specify the ICICLE libs to use:
```bash [dependencies] icicle-runtime = { git = "https://github.com/ingonyama-zk/icicle.git", branch="main" } icicle-core = { git = "https://github.com/ingonyama-zk/icicle.git", branch="main" } icicle-babybear = { git = "https://github.com/ingonyama-zk/icicle.git", branch="main" }
add other ICICLE crates here if need additional fields/curves
```
You can specify branch=branch-name, tag=tag-name, or rev=commit-id.
Build the Rust project:
bash
cargo build --release
Go
There are two ways to build from source in Go:
- Clone the repo, update your go.mod to point to the local clone, and build ICICLE within the clone
sh
git clone https://github.com/ingonyama-zk/icicle.git
Add ICICLE v3 to your go.mod file:
```go require github.com/ingonyama-zk/icicle/v3 v3.0.0
replace github.com/ingonyama-zk/icicle/v3 => ../path/to/cloned/icicle ```
Navigate to the cloned repo's golang bindings and build the library using the supplied build script
sh
cd icicle/wrappers/golang
chmod +x build.sh
./build.sh -curve=bn254
- Update your go.mod to include ICICLE as a dependency, navigate to the dependency in your GOMODCACHE and build ICICLE there
sh
go get github.com/ingonyama-zk/icicle/v3
cd $(go env GOMODCACHE)/github.com/ingonyama-zk/icicle/v3@<version>/wrappers/golang
chmod +x build.sh
./build.sh -curve=bn254
[!NOTE] To specify the field, use the flag -field=
, where can be one of the following: babybear, stark252, m31, koalabear. To specify a curve, use the flag -curve= , where can be one of the following: bn254, bls12377, bls12381, bw6_761, grumpkin.
Once ICICLE has been built, you can add specific packages when you need them in your application:
go
import (
runtime "github.com/ingonyama-zk/icicle/v3/wrappers/golang/runtime"
core "github.com/ingonyama-zk/icicle/v3/wrappers/golang/core"
bn254 "github.com/ingonyama-zk/icicle/v3/wrappers/golang/curves/bn254"
bn254MSM "github.com/ingonyama-zk/icicle/v3/wrappers/golang/curves/bn254/msm"
)
C++
ICICLE can be built and tested in C++ using CMake. The build process is straightforward, but there are several flags you can use to customize the build for your needs.
Clone the ICICLE repository:
bash
git clone https://github.com/ingonyama-zk/icicle.git
cd icicle
Configure the build:
bash
mkdir -p build && rm -rf build/*
cmake -S icicle -B build -DFIELD=babybear
[!NOTE] To specify the field, use the flag -DFIELD=field, where field can be one of the following: babybear, stark252, m31, koalabear. To specify a curve, use the flag -DCURVE=curve, where curve can be one of the following: bn254, bls12377, bls12381, bw6_761, grumpkin.
Build the project:
bash
cmake --build build -j # -j is for multi-core compilation
Link your application (or library) to ICICLE:
cmake
target_link_libraries(yourApp PRIVATE icicle_field_babybear icicle_device)
Install (optional):
To install the libs, specify the install prefix -DCMAKE_INSTALL_PREFIX=/install/dir/. Then after building, use cmake to install the libraries:
sh
cmake -S icicle -B build -DFIELD=babybear -DCMAKE_INSTALL_PREFIX=/path/to/install/dir/
cmake --build build -j # build
cmake --install build # install icicle to /path/to/install/dir/
Run tests (optional):
[!CAUTION] Most tests assume a CUDA backend exists and will fail otherwise, if a CUDA device is not found.
Add -DBUILD_TESTS=ON to the cmake command, build and execute tests:
bash
cmake -S icicle -B build -DFIELD=babybear -DBUILD_TESTS=ON
cmake --build build -j
cd build/tests
ctest
or choose the test-suite
```bash ./build/tests/testfieldapi # or another test suite
can specify tests using regex. For example for tests with ntt in the name:
./build/tests/testfieldapi --gtest_filter="ntt" ```
Build Flags:
You can customize your ICICLE build with the following flags:
-DCPU_BACKEND=ON/OFF: Enable or disable built-in CPU backend.default=ON.-DCMAKE_INSTALL_PREFIX=/install/dir: Specify install directory.default=/usr/local.-DBUILD_TESTS=ON/OFF: Enable or disable tests.default=OFF.-DBUILD_BENCHMARKS=ON/OFF: Enable or disable benchmarks.default=OFF.
Install CUDA backend
To install the CUDA backend
- Download the release binaries.
- Install it, by extracting the binaries to
/opt/or any other custom install path. - In your application, load the cuda backend and select a CUDA device.
- All subsequent API will now use the selected device.
Rust:
```rust use icicle_runtime::{runtime, Device};
runtime::loadbackendfromenvordefault().unwrap(); // or load programmatically runtime::loadbackend("/path/to/backend/installdir").unwrap(); // Select CUDA device let device = Device::new("CUDA", 1 /gpu-id/); icicleruntime::setdevice(&device).unwrap();
// Any call will now execute on GPU-1 ```
Go:
```go import( "github.com/ingonyama-zk/icicle/v3/wrappers/golang/runtime" )
result := runtime.LoadBackendFromEnvOrDefault() // or load from custom install dir result := runtime.LoadBackend("/path/to/backend/installdir", true) // Select CUDA device device := runtime.CreateDevice("CUDA", 0) // or other result := runtime.SetDevice(device)
// Any call will now execute on GPU-0 ``` C++:
```cpp
include "icicle/runtime.h"
// Load the installed backend eIcicleError result = icicleloadbackendfromenvordefault(); // or load it programmatically eIcicleError result = icicleloadbackend("/path/to/backend/installdir", true);
// Select CUDA device icicle::Device device = {"CUDA", 0 /gpu-id/}; eIcicleError result = iciclesetdevice(device);
// Any call will now execute on GPU-0 ```
Full details can be found in our getting started docs
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:
sh
git config core.hooksPath ./scripts/hooks
In case clang-format is missing on your system, you can install it using the following command:
sh
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
- PatStiles, for adding Stark252 field
Help & Support
For help and support talk to our devs in our discord channel #ICICLE or contact us at support@ingonyama.com.
License
ICICLE frontend is distributed under the terms of the MIT License.
See LICENSE-MIT for details.
[!NOTE] ICICLE backends, excluding backends exposed in this repository, are distributed under a special license and are not covered by the MIT license. If you want to learn more, check out our developer documentation.
Owner
- Name: Ingonyama
- Login: ingonyama-zk
- Kind: organization
- Email: hi@ingonyama.com
- Website: ingonyama.com
- Twitter: Ingo_zk
- Repositories: 6
- Profile: https://github.com/ingonyama-zk
Shipping the world's fastest provers
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Jeremy Felder | j****1@g****m | 96 |
| yshekel | y****l@g****m | 74 |
| release-bot | r****t@i****m | 35 |
| DmytroTym | d****1@g****m | 34 |
| ChickenLover | R****1@g****m | 33 |
| ImmanuelSegol | 3****s@g****m | 29 |
| Leon Hibnik | 1****k | 28 |
| Miki | 1****a | 22 |
| Otsar | 1****u | 22 |
| HadarIngonyama | 1****a | 21 |
| Vitalii Hnatyk | v****k@g****m | 18 |
| stas | s****y@i****m | 15 |
| nonam3e | 7****e | 15 |
| ShaniBabayoff | s****b@i****m | 15 |
| Shlomtz | o****s@g****m | 9 |
| Koren-Brand | 1****d | 8 |
| danny-shterman | 1****n | 8 |
| idanfr-ingo | i****n@i****m | 8 |
| Emir Soyturk | e****k@g****m | 8 |
| Elan | 1****K | 7 |
| Guy Weissenberg | g****y@i****m | 6 |
| Stas Polonsky | s****s@i****m | 5 |
| Shanie Winitz | 1****z | 5 |
| Aviad Dahan | 1****o | 4 |
| Karthik Inbasekar | 6****t | 4 |
| Koh Wei Jie | c****t@k****m | 4 |
| Otsar | 1****i | 3 |
| Vlad | 8****p | 3 |
| Vitalii | v****i@i****m | 3 |
| BigSky77 | s****2@g****m | 2 |
| and 19 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 112
- Total pull requests: 1,175
- Average time to close issues: 5 months
- Average time to close pull requests: 7 days
- Total issue authors: 37
- Total pull request authors: 83
- Average comments per issue: 1.65
- Average comments per pull request: 0.36
- Merged pull requests: 796
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 13
- Pull requests: 673
- Average time to close issues: 12 days
- Average time to close pull requests: 6 days
- Issue authors: 10
- Pull request authors: 66
- Average comments per issue: 2.69
- Average comments per pull request: 0.27
- Merged pull requests: 425
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ImmanuelSegol (34)
- LeonHibnik (13)
- TalDerei (8)
- jeremyfelder (7)
- ChickenLover (6)
- cliff0412 (4)
- Otsar-Raikou (3)
- 0xnullifier (3)
- flyq (2)
- sss1h (2)
- DmytroTym (2)
- btilmon (2)
- qiji2023 (2)
- bigsky77 (2)
- vhnatyk (1)
Pull Request Authors
- yshekel (225)
- jeremyfelder (151)
- ChickenLover (92)
- LeonHibnik (75)
- nonam3e (58)
- mickeyasa (53)
- ShaniBabayoff (42)
- Otsar-Raikou (39)
- HadarIngonyama (39)
- emirsoyturk (37)
- vhnatyk (36)
- DmytroTym (32)
- svpolonsky (29)
- ImmanuelSegol (23)
- Koren-Brand (22)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 7
-
Total downloads:
- cargo 3,017 total
-
Total dependent packages: 2
(may contain duplicates) -
Total dependent repositories: 1
(may contain duplicates) - Total versions: 93
- Total maintainers: 1
proxy.golang.org: github.com/ingonyama-zk/icicle
- Homepage: https://github.com/ingonyama-zk/icicle
- Documentation: https://pkg.go.dev/github.com/ingonyama-zk/icicle#section-documentation
- License: MIT
-
Latest release: v1.10.1
published almost 2 years ago
Rankings
proxy.golang.org: github.com/ingonyama-zk/icicle/v3
- Homepage: https://github.com/ingonyama-zk/icicle
- Documentation: https://pkg.go.dev/github.com/ingonyama-zk/icicle/v3#section-documentation
- License: MIT
-
Latest release: v3.9.2
published 9 months ago
Rankings
proxy.golang.org: github.com/ingonyama-zk/icicle/goicicle
- Homepage: https://github.com/ingonyama-zk/icicle
- Documentation: https://pkg.go.dev/github.com/ingonyama-zk/icicle/goicicle#section-documentation
- License: MIT
-
Latest release: v1.0.0
published about 2 years ago
Rankings
proxy.golang.org: github.com/ingonyama-zk/icicle/v2
- Homepage: https://github.com/ingonyama-zk/icicle
- Documentation: https://pkg.go.dev/github.com/ingonyama-zk/icicle/v2#section-documentation
- License: MIT
-
Latest release: v2.8.0
published over 1 year ago
Rankings
proxy.golang.org: github.com/ingonyama-ZK/icicle
- Documentation: https://pkg.go.dev/github.com/ingonyama-ZK/icicle#section-documentation
- License: mit
-
Latest release: v1.10.1
published almost 2 years ago
Rankings
crates.io: icicle-cuda-runtime
Ingonyama's Rust wrapper of CUDA runtime
- Homepage: https://www.ingonyama.com
- Documentation: https://docs.rs/icicle-cuda-runtime/
- License: MIT
-
Latest release: 1.3.0
published about 2 years ago
Rankings
Maintainers (1)
crates.io: icicle-core
A library for GPU ZK acceleration by Ingonyama
- Homepage: https://www.ingonyama.com
- Documentation: https://docs.rs/icicle-core/
- License: MIT
-
Latest release: 1.3.0
published about 2 years ago
Rankings
Maintainers (1)
Dependencies
- nvidia/cuda 12.0.0-devel-ubuntu22.04 build
- github.com/consensys/bavard v0.1.13
- github.com/davecgh/go-spew v1.1.1
- github.com/kr/pretty v0.1.0
- github.com/pmezard/go-difflib v1.0.0
- github.com/stretchr/testify v1.8.3
- gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
- gopkg.in/yaml.v3 v3.0.1
- rsc.io/tmplfunc v0.0.3
- github.com/consensys/bavard v0.1.13
- github.com/davecgh/go-spew v1.1.1
- github.com/kr/pretty v0.1.0
- github.com/kr/pty v1.1.1
- github.com/kr/text v0.1.0
- github.com/pmezard/go-difflib v1.0.0
- github.com/stretchr/testify v1.8.3
- gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
- gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
- gopkg.in/yaml.v3 v3.0.1
- rsc.io/tmplfunc v0.0.3
- ark-bn254 0.4.0 development
- ark-ec 0.4.0 development
- ark-ff 0.4.0 development
- ark-poly 0.4.0 development
- ark-std 0.4.0 development
- ark-bn254 0.4.0
- ark-bls12-377 0.4.0 development
- ark-ec 0.4.0 development
- ark-ff 0.4.0 development
- ark-poly 0.4.0 development
- ark-std 0.4.0 development
- ark-bls12-377 0.4.0
- ark-bls12-381 0.4.0 development
- ark-ec 0.4.0 development
- ark-ff 0.4.0 development
- ark-poly 0.4.0 development
- ark-std 0.4.0 development
- ark-bls12-381 0.4.0
- ark-bw6-761 0.4.0 development
- ark-ec 0.4.0 development
- ark-ff 0.4.0 development
- ark-poly 0.4.0 development
- ark-std 0.4.0 development
- ark-bw6-761 0.4.0
- nvidia/cuda 12.0.0-devel-ubuntu22.04 build
- nvidia/cuda 12.2.0-devel-ubuntu22.04 build
- nvidia/cuda 12.0.0-devel-ubuntu22.04 build
- nvidia/cuda 12.0.0-devel-ubuntu22.04 build
- nvidia/cuda 12.0.0-devel-ubuntu22.04 build
- actions/checkout v3 composite
- codespell-project/actions-codespell v2 composite
- actions/checkout v2 composite
- nvidia/cuda 12.0.0-devel-ubuntu22.04 build
- actions/checkout v4 composite
- tj-actions/changed-files v39 composite
- actions/checkout v4 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- peaceiris/actions-gh-pages v3 composite
- actions/checkout v4 composite
- actions/download-artifact v4 composite
- actions/upload-artifact v4 composite
- Jimver/cuda-toolkit v0.2.11 composite
- actions/checkout v4 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- ark-ec 0.4.0 development
- ark-ff 0.4.0 development
- ark-poly 0.4.0 development
- ark-std 0.4.0 development
- nvidia/cuda 12.0.0-devel-ubuntu22.04 build
- 1096 dependencies
- prettier ^3.2.4 development
- @docusaurus/core 2.0.0-beta.18
- @docusaurus/preset-classic 2.0.0-beta.18
- @mdx-js/react ^1.6.22
- clsx ^1.1.1
- hast-util-is-element 1.1.0
- mdx-mermaid ^1.2.2
- mermaid ^9.1.2
- prism-react-renderer ^1.3.1
- react ^17.0.2
- react-dom ^17.0.2
- rehype-katex 5
- remark-math 3