Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edits on readme 1 #599

Merged
merged 12 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- uses: codespell-project/actions-codespell@v2
with:
# https://github.com/codespell-project/actions-codespell?tab=readme-ov-file#parameter-skip
skip: ./**/target,./**/build,./docs/*.js,./docs/*.json
skip: ./**/target,./**/build,./docs/*.js,./docs/*.json,./*.svg
# https://github.com/codespell-project/actions-codespell?tab=readme-ov-file#parameter-ignore_words_file
ignore_words_file: .codespellignore
Binary file added Frostythelion.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions INGOLOGO.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added McPaw.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 90 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,75 @@
# ICICLE

<div align="center">ICICLE is a high-performance cryptographic acceleration library designed to optimize cryptographic computations across various hardware platforms, including CPUs, GPUs, and other accelerators.</div>
<div align="center">
ICICLE is a high-performance cryptographic acceleration library designed to optimize cryptographic computations across various hardware platforms, including CPUs, GPUs, and other accelerators.
</div>

<p align="center">
<img alt="ICICLE" width="300" height="300" src="https://user-images.githubusercontent.com/2446179/223707486-ed8eb5ab-0616-4601-8557-12050df8ccf7.png"/>
<br>
<img alt="ICICLE" width="300" height="300" src="McPaw.gif"/>
</p>

<p align="center">
<br>
<br>
<a href="https://discord.gg/EVVXTdt6DF">
<img src="https://img.shields.io/discord/1063033227788423299?logo=discord" alt="Chat with us on Discord">
<img src="https://img.shields.io/discord/1063033227788423299?logo=discord&style=flat&labelColor=black&color=5765f2" alt="Chat with us on Discord">
</a>
<a href="https://www.linkedin.com/company/ingonyama">
jeremyfelder marked this conversation as resolved.
Show resolved Hide resolved
<img src="https://img.shields.io/badge/follow-blue?style=flat&logo=linkedin&labelColor=black" alt="Follow us on LinkedIn">
</a>
<a href="https://twitter.com/intent/follow?screen_name=Ingo_zk">
<img src="https://img.shields.io/twitter/follow/Ingo_zk?style=social&logo=twitter" alt="Follow us on Twitter">
<a href="https://x.com/Ingo_zk">
<img src="https://img.shields.io/badge/follow-darkgray?style=flat&logo=x&labelColor=black" alt="Follow us on Twitter">
</a>
<a href="https://github.com/ingonyama-zk/icicle/releases">
<img src="https://img.shields.io/github/v/release/ingonyama-zk/icicle" alt="GitHub Release">
<img src="https://img.shields.io/github/v/release/ingonyama-zk/icicle?style=flat&labelColor=black&color=lightblue" alt="GitHub Release">
</a>
</p>




## 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: ICICLE supports multiple hardware platforms, making it adaptable to various computational environments.
- Efficiency: ICICLE is designed to leverage the parallel nature of ZK computations, whether on GPUs, CPUs, or other accelerators.
- Scalability: ICICLE provides an easy-to-use and scalable solution for developers, allowing them to optimize cryptographic operations with minimal effort.
- **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

ICICLE is a versatile cryptographic acceleration library with support for multiple platforms. This guide will help you get started with ICICLE in C++, Rust, and Go.
This guide will help you get started with ICICLE in C++, Rust, and Go.

> [!NOTE]
> Developers: We highly recommend reading our [documentation](https://dev.ingonyama.com/) for a comprehensive understanding of ICICLE’s capabilities.
> **Developers**: We highly recommend reading our [documentation](https://dev.ingonyama.com/) for a comprehensive explanation of ICICLE’s capabilities.

> [!TIP]
> Try out ICICLE by running some [examples](https://github.com/ingonyama-zk/icicle/tree/yshekel/V3/examples) available in C++, Rust, and Go bindings. Check out our install-and-use examples in [C++](https://github.com/ingonyama-zk/icicle/tree/yshekel/V3/examples/c%2B%2B/install-and-use-icicle), [Rust](https://github.com/ingonyama-zk/icicle/tree/yshekel/V3/examples/rust/install-and-use-icicle) and [Go](TODO)
> Try out ICICLE by running some [examples] available in C++, Rust, and Go bindings. Check out our install-and-use examples in [C++](https://github.com/ingonyama-zk/icicle/tree/yshekel/V3/examples/c%2B%2B/install-and-use-icicle), [Rust](https://github.com/ingonyama-zk/icicle/tree/yshekel/V3/examples/rust/install-and-use-icicle) and [Go](TODO)

### Prerequisites

- Any Compatible Hardware: ICICLE supports various hardware, including CPUs, Nvidia GPUs, and other accelerators.
- [CMake]((https://cmake.org/files/)), Version 3.18 or above. Latest version recommended. Required only if building from source.
- [CUDA Toolkit](https://developer.nvidia.com/cuda-downloads) Required only if using NVIDIA GPUs (version 12.0 or newer).
- Any compatible hardware: ICICLE supports various hardware, including CPUs, Nvidia GPUs, and other accelerators.
- [CMake](https://cmake.org/files/), Version 3.18 or above. Latest version recommended. Required only if building from source.
- [CUDA Toolkit](https://developer.nvidia.com/cuda-downloads), 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 or newer.
> 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.

Checkout [Google Colab](https://colab.google/). Google Colab offers a free [T4 GPU](https://www.nvidia.com/en-us/data-center/tesla-t4/) instance and ICICLE can be used with it, reference this guide for setting up your [Google Colab workplace][GOOGLE-COLAB-ICICLE].
[Google Colab](https://colab.google/) offers a free [T4 GPU](https://www.nvidia.com/en-us/data-center/tesla-t4/) instance and ICICLE can be used with it, reference this guide for setting up your [Google Colab workplace][GOOGLE-COLAB-ICICLE].

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

## 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 [Getting started page](https://dev.ingonyama.com/icicle/getting_started) and [Build From Source](https://dev.ingonyama.com/icicle/build_from_source) for full details about building and using ICICLE.
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](https://dev.ingonyama.com/icicle/introduction) 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.
Expand All @@ -86,7 +96,24 @@ cargo build --release

### Go

TODO
Add ICICLE v3 to your go.mod file:

```sh
go get github.com/ingonyama-zk/icicle/v3
```

Before you can use ICICLE in your project you will need to build it using the provided [build script][ICICLE-GO-BUILD-SCRIPT].

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++

Expand Down Expand Up @@ -125,7 +152,8 @@ 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/
Expand All @@ -134,21 +162,24 @@ cmake --install build # install icicle to /path/to/install/dir/
**Run tests (optional):**

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/test_field_api # or another test suite
# can specify tests using regex. For example for tests with ntt in the name:
./build/tests/test_field_api --gtest_filter="*ntt*"
```

> [!NOTE]
> Most tests assume a CUDA backend exists and will fail otherwise if a CUDA device is not found.
> [!NOTE]
> Most tests assume a CUDA backend exists and will fail otherwise, if a CUDA device is not found.

**Build Flags:**

Expand All @@ -159,7 +190,7 @@ You can customize your ICICLE build with the following flags:
- `-DBUILD_TESTS=ON/OFF`: Enable or disable tests. `default=OFF`.
- `-DBUILD_BENCHMARKS=ON/OFF`: Enable or disable benchmarks. `default=OFF`.

## Install cuda backend
## Install CUDA backend

To install the CUDA backend

Expand All @@ -168,22 +199,6 @@ To install the CUDA backend
3. In your application, load the cuda backend and select a CUDA device.
4. All subsequent API will now use the selected device.

C++:

```cpp
#include "icicle/runtime.h"

// Load the installed backend
eIcicleError result = icicle_load_backend_from_env_or_default();
// or load it programmatically
eIcicleError result = icicle_load_backend("/path/to/backend/installdir", true);

// Select CUDA device
icicle::Device device = {"CUDA", 0 /*gpu-id*/};
eIcicleError result = icicle_set_device(device);

// Any call will now execute on GPU-0
```

Rust:

Expand All @@ -202,14 +217,42 @@ icicle_runtime::set_device(&device).unwrap();

Go:

TODO
```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 = icicle_load_backend_from_env_or_default();
// or load it programmatically
eIcicleError result = icicle_load_backend("/path/to/backend/installdir", true);

// Select CUDA device
icicle::Device device = {"CUDA", 0 /*gpu-id*/};
eIcicleError result = icicle_set_device(device);

// Any call will now execute on GPU-0
```

Full details can be found in our [docs](https://dev.ingonyama.com/icicle/https://dev.ingonyama.com/icicle/getting_started)
Full details can be found in our [getting started docs](https://dev.ingonyama.com/icicle/introduction)

## Contributions

Join our [Discord Server][DISCORD] 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.
Join our [Discord Server][DISCORD] 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

Expand Down Expand Up @@ -241,7 +284,7 @@ This will ensure our custom hooks are run and will make it easier to follow our

## Help & Support

For help and support talk to our devs in our discord channel ["ICICLE"](https://discord.gg/EVVXTdt6DF) or contact us at support@ingonyama.com.
For help and support talk to our devs in our discord channel [#ICICLE](https://discord.gg/EVVXTdt6DF) or contact us at <support@ingonyama.com>.

## License

Expand Down Expand Up @@ -271,6 +314,7 @@ See [LICENSE-MIT][LMIT] for details.
[ICICLE-CORE]: ./icicle/
[ICICLE-RUST]: ./wrappers/rust/
[ICICLE-GO]: ./wrappers/golang/
[ICICLE-GO-BUILD-SCRIPT]: ./wrappers/golang/build.sh
[ICICLE-CORE-README]: ./icicle/README.md
[ICICLE-RUST-README]: ./wrappers/rust/README.md
[ICICLE-GO-README]: ./wrappers/golang/README.md
Expand Down
Loading