Skip to content

Commit

Permalink
Bump docs version
Browse files Browse the repository at this point in the history
  • Loading branch information
release-bot committed Jan 14, 2025
1 parent cb1cdcb commit 7b0fc40
Show file tree
Hide file tree
Showing 66 changed files with 7,763 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/versioned_docs/version-3.4.0/contributor-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributor's Guide

We welcome all contributions with open arms. At Ingonyama we take a village approach, believing it takes many hands and minds to build a ecosystem.

## Contributing to ICICLE

- Make suggestions or report bugs via [GitHub issues](https://github.com/ingonyama-zk/icicle/issues)
- Contribute to the ICICLE by opening a [pull request](https://github.com/ingonyama-zk/icicle/pulls).
- Contribute to our [documentation](https://github.com/ingonyama-zk/icicle/tree/main/docs) and [examples](https://github.com/ingonyama-zk/icicle/tree/main/examples).
- Ask questions on Discord

### Opening a pull request

When opening a [pull request](https://github.com/ingonyama-zk/icicle/pulls) please keep the following in mind.

- `Clear Purpose` - The pull request should solve a single issue and be clean of any unrelated changes.
- `Clear description` - If the pull request is for a new feature describe what you built, why you added it and how its best that we test it. For bug fixes please describe the issue and the solution.
- `Consistent style` - Rust and Golang code should be linted by the official linters (golang fmt and rust fmt) and maintain a proper style. For CUDA and C++ code we use [`clang-format`](https://github.com/ingonyama-zk/icicle/blob/main/.clang-format), [here](https://github.com/ingonyama-zk/icicle/blob/605c25f9d22135c54ac49683b710fe2ce06e2300/.github/workflows/main-format.yml#L46) you can see how we run it.
- `Minimal Tests` - please add test which cover basic usage of your changes .

## Questions?

Find us on [Discord](https://discord.gg/6vYrE7waPj).
23 changes: 23 additions & 0 deletions docs/versioned_docs/version-3.4.0/grants.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Ingonyama Grant programs

Ingonyama understands the importance of supporting and fostering a vibrant community of researchers and builders to advance ZK. To encourage progress, we are not only developing in the open but also sharing resources with researchers and builders through various programs.

## ICICLE ZK-GPU Ecosystem Grant

Ingonyama invites researchers and practitioners to collaborate in advancing ZK acceleration. We are allocating $100,000 for grants to support this initiative.

### Bounties & Grants

Eligibility for grants includes:

1. **Students**: Utilize ICICLE in your research.
2. **Performance Improvement**: Enhance the performance of accelerated primitives in ICICLE.
3. **Protocol Porting**: Migrate existing ZK protocols to ICICLE.
4. **New Primitives**: Contribute new primitives to ICICLE.
5. **Benchmarking**: Compare ZK benchmarks against ICICLE.

## Contact

For questions or submissions: [grants@ingonyama.com](mailto:grants@ingonyama.com)

**Read the full article [here](https://www.ingonyama.com/blog/icicle-for-researchers-grants-challenges)**
27 changes: 27 additions & 0 deletions docs/versioned_docs/version-3.4.0/icicle/arch_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Architecture Overview


ICICLE v3 is designed with flexibility and extensibility in mind, offering a robust framework that supports multiple compute backends and accommodates various cryptographic needs. This section provides an overview of ICICLE's architecture, highlighting its open and closed components, multi-device support, and extensibility.

### Frontend and CPU Backend

- **Frontend (FE):** The ICICLE frontend is open-source and designed to provide a unified API across different programming languages, including C++, Rust, and Go. This frontend abstracts the complexity of working with different backends, allowing developers to write backend-agnostic code that can be deployed across various platforms.
- **CPU Backend:** ICICLE includes an open-source CPU backend that allows for development and testing on standard hardware. This backend is ideal for prototyping and for environments where specialized hardware is not available.

## CUDA Backend

- **CUDA Backend:** ICICLE also includes a high-performance CUDA backend that is closed-source. This backend is optimized for NVIDIA GPUs and provides significant acceleration for cryptographic operations.
- **Installation and Licensing:** The CUDA backend needs to be downloaded and installed. Refer to the [installation guide](./install_cuda_backend.md) for detailed instructions.

## Multi-Device Support

- **Scalability:** ICICLE supports multi-device configurations, enabling the distribution of workloads across multiple GPUs or other hardware accelerators. This feature allows for scaling ZK proofs and other cryptographic operations across larger data centers or high-performance computing environments.


## Build Your Own Backend

ICICLE is designed to be extensible, allowing developers to integrate new backends or customize existing ones to suit their specific needs. The architecture supports:

- **Custom Backends:** Developers can create their own backends to leverage different hardware or optimize for specific use cases. The process of building and integrating a custom backend is documented in the [Build Your Own Backend](./build_your_own_backend.md) section.
- **Pluggable Components:** ICICLE's architecture allows for easy integration of additional cryptographic primitives or enhancements, ensuring that the framework can evolve with the latest advancements in cryptography and hardware acceleration.

3 changes: 3 additions & 0 deletions docs/versioned_docs/version-3.4.0/icicle/benchmarks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Benchmarks

TODO
179 changes: 179 additions & 0 deletions docs/versioned_docs/version-3.4.0/icicle/build_from_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@

# Build ICICLE from source

This guide will help you get started with building, testing, and installing ICICLE, whether you're using C++, Rust, or Go. It also covers installation of the CUDA backend and important build options.

## Building and Testing ICICLE frontend

### C++: Build, Test, and Install (Frontend)

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.

#### Build Commands

1. **Clone the ICICLE repository:**
```bash
git clone https://github.com/ingonyama-zk/icicle.git
cd icicle
```

2. **Configure the build:**
```bash
mkdir -p build && rm -rf build/*
cmake -S icicle -B build -DFIELD=babybear
```

:::info
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, bls12_377, bls12_381, bw6_761, grumpkin.
:::

:::tip
If you have access to cuda backend repo, it can be built along ICICLE frontend by adding the following to the cmake command
- `-DCUDA_BACKEND=local` # if you have it locally
- `-DCUDA_BACKEND=<commit|branch>` # to pull CUDA backend, given you have access
:::

3. **Build the project:**
```bash
cmake --build build -j
```
This is building the [libicicle_device](./libraries.md#icicle-device) and the [libicicle_field_babybear](./libraries.md#icicle-core) frontend lib that correspond to the field or curve.

4. **Link:**
Link you application (or library) to ICICLE:
```cmake
target_link_libraries(yourApp PRIVATE icicle_field_babybear icicle_device)
```

5. **Installation (optional):**
To install the libs, specify the install prefix in the [cmake command](./build_from_source.md#build-commands)
`-DCMAKE_INSTALL_PREFIX=/install/dir/`. Default install path on linux is `/usr/local` if not specified. For other systems it may differ. The cmake command will print it to the log
```
-- CMAKE_INSTALL_PREFIX=/install/dir/for/cmake/install
```
Then after building, use cmake to install the libraries:
```
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/
```

6. **Run tests (optional):**
Add `-DBUILD_TESTS=ON` to the [cmake command](./build_from_source.md#build-commands) and build.
Execute all 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 cannot find a CUDA device.
:::

#### 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`.

#### Features

By default, all [features](./libraries.md#supported-curves-and-operations) are enabled.
This is since installed backends may implement and register all APIs. Missing APIs in the frontend would cause linkage to fail due to missing symbols. Therefore by default we include them in the frontend part too.

To disable features, add the following to the cmake command.
- ntt: `-DNTT=OFF`
- msm: `-DMSM=OFF`
- g2 msm: `-DG2=OFF`
- ecntt: `-DECNTT=OFF`
- extension field: `-DEXT_FIELD=OFF`

:::tip
Disabling features is useful when developing with a backend that is slow to compile (e.g. CUDA backend);
:::

### Rust: Build, Test, and Install

To build and test ICICLE in Rust, follow these steps:

1. **Navigate to the Rust bindings directory:**
```bash
cd wrappers/rust # or go to a specific field/curve 'cd wrappers/rust/icicle-fields/icicle-babybear'
```

2. **Build the Rust project:**
```bash
cargo build --release
```
By default, all [supported features are enabled](#features).
Cargo features are used to disable features, rather than enable them, for the reason explained [here](#features):
- `no_g2` to disable G2 MSM
- `no_ecntt` to disable ECNTT

They can be disabled as follows:
```bash
cargo build --release --features=no_ecntt,no_g2
```

:::note
If you have access to cuda backend repo, it can be built along ICICLE frontend by using the following cargo features:
- `cuda_backend` : if the cuda backend resides in `icicle/backend/cuda`
- `pull_cuda_backend` : to pull main branch and build it
:::


3. **Run tests:**
```bash
cargo test # optional: --features=no_ecntt,no_g2,cuda_backend
```
:::note
Most tests assume a CUDA backend is installed and fail otherwise.
:::

4. **Install the library:**

By default, the libraries are installed to the `target/<buildmode>/deps/icicle` dir. If you want them installed elsewhere, define the env variable:
```bash
export ICICLE_INSTALL_DIR=/path/to/install/dir
```

#### Use as cargo dependency
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
```
Can specify `branch = <branch-name>` or `tag = <tag-name>` or `rev = <commit-id>`.
To disable features:
```bash
icicle-bls12-377 = { git = "https://github.com/ingonyama-zk/icicle.git", features = ["no_g2"] }
```
As explained above, the libs will be built and installed to `target/<buildmode>/deps/icicle` so you can easily link to them. Alternatively you can set `ICICLE_INSTALL_DIR` env variable for a custom install directory.
:::warning
Make sure to install icicle libs when installing a library/application that depends on icicle such that it is located at runtime.
:::
### Go: Build, Test, and Install (TODO)
---
**To install CUDA backend and license click [here](./install_cuda_backend.md#installation)**
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Build Your Own Backend

TODO
Loading

0 comments on commit 7b0fc40

Please sign in to comment.