Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into danny/poseidon2_sponge
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-shterman committed Jan 30, 2025
2 parents 66a2de8 + 33d586e commit 99abe0f
Show file tree
Hide file tree
Showing 143 changed files with 9,117 additions and 1,220 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cpp-golang-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ jobs:
- name: Build field
working-directory: ./icicle
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true'
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true' || needs.check-changed-files.outputs.rust == 'true'
run: |
mkdir -p build && rm -rf build/*
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DFIELD=${{ matrix.field.name }} ${{ matrix.field.build_args }} ${{ steps.cuda-flag.outputs.CUDA_FLAG }} ${{ steps.cuda-flag.outputs.CMAKE_INSTALL_PREFIX }} -S . -B build
Expand Down Expand Up @@ -405,7 +405,7 @@ jobs:
fi
- name: Build
working-directory: ./icicle
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true'
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true' || needs.check-changed-files.outputs.rust == 'true'
# builds the hash and merkle tree lib using a local copy of the CUDA backend
run: |
mkdir -p build && rm -rf build/*
Expand Down
33 changes: 21 additions & 12 deletions docs/docs/grants.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
# Ingonyama Grant programs
# Ingonyama Grants Program 2.0

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.
Exactly one year ago, we launched our first-ever grants program, offering $100,000 to support research involving ICICLE. Today, we’re excited to announce our second grants program — another $100,000 dedicated to researchers. Details below!

## ICICLE ZK-GPU Ecosystem Grant
### 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.
- **Students:** Utilize ICICLE in your research.
- **Performance Improvement:** Enhance the performance of accelerated primitives in ICICLE.
- **Protocol Porting:** Migrate existing ZK protocols to ICICLE.
- **New Primitives:** Contribute new primitives to ICICLE.
- **Benchmarking:** Compare ZK benchmarks against ICICLE.

Additionally, we’re encouraging researchers to reimplement algorithms from existing papers using ICICLE and aim to outperform their benchmarks. The larger the performance gain, the larger the grant reward.

### How to Apply

Applying is straightforward.

1. [**Fill out this form:**](https://forms.monday.com/forms/d0ed9699146d61e3b5a649b56ba2c663?r=use1) Start by telling us about your idea through the form, which will ask you to briefly describe your proposal, e.g., “I want to implement Whir in ICICLE” (note: this one’s already taken by Giacomo).
2. **Collaborate:** We’ll discuss and finalize the performance milestones together. Expect some back-and-forth to align on the project goals.
3. **Approval:** Once we’re aligned, we’ll greenlight the project.
4. **Get started:** Begin your work with our support and drive it toward success!

## Contact
### Get in Touch

For questions or submissions: [[email protected]](mailto:[email protected])
If you have any questions, email us at **[email protected]** and we will get back to you

**Read the full article [here](https://www.ingonyama.com/blog/icicle-for-researchers-grants-challenges)**
180 changes: 0 additions & 180 deletions docs/docs/icicle/primitives/poseidon2.md

This file was deleted.

53 changes: 49 additions & 4 deletions docs/docs/icicle/programmers_guide/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,59 @@ struct DeviceProperties {
## Compute APIs
### Multi-Scalar Multiplication (MSM) Example
### Including Curves and Fields
To use a specific elliptic curve (e.g., BN254) or its associated fields, include the relevant header files. For example:
```cpp
#include "icicle/msm.h"
#include "icicle/curves/params/bn254.h"
```

The bn254 namespace includes key types like:

- **scalar_t**: Scalar field elements.
- **projective_t**: Points on the elliptic curve in projective coordinates.
- **affine_t**: Points on the elliptic curve in affine coordinates.

### Namespace Usage

There are two ways to access types and functionality for a specific field or curve:

1. **Bring the Namespace into Scope**
This approach simplifies the code but may cause conflicts if multiple curves are used:

```cpp
using namespace bn254;

scalar_t s; // Scalar field element
projective_t p; // Point in projective coordinates
affine_t a; // Point in affine coordinates
```

2. **Use Fully Qualified Names**
This is recommended if you are working with multiple curves or libraries to avoid namespace conflicts:

```cpp
bn254::scalar_t s; // Scalar field element
bn254::projective_t p; // Point in projective coordinates
bn254::affine_t a; // Point in affine coordinates
```

### Leveraging Template APIs

ICICLE’s APIs are designed to work seamlessly with templated types, enabling flexibility and type safety. For example:

#### Multi-Scalar Multiplication (MSM) Example

Icicle provides high-performance compute APIs such as the Multi-Scalar Multiplication (MSM) for cryptographic operations. Here's a simple example of how to use the MSM API.

```cpp
#include <iostream>
#include "icicle/runtime.h"
#include "icicle/api/bn254.h"

#include "icicle/curves/params/bn254.h"
#include "icicle/msm.h"
using namespace bn254;

int main()
Expand Down Expand Up @@ -245,15 +289,16 @@ int main()
}
```

### Polynomial Operations Example
#### Polynomial Operations Example

Here's another example demonstrating polynomial operations using Icicle:

```cpp
#include <iostream>
#include "icicle/runtime.h"
#include "icicle/curves/params/bn254.h"
#include "icicle/ntt.h"
#include "icicle/polynomials/polynomials.h"
#include "icicle/api/bn254.h"

using namespace bn254;

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/icicle/rust-bindings/vec-ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct VecOpsConfig {
- **`is_b_on_device: bool`**: Indicates whether the input b data has been preloaded on the device memory. If `false` inputs will be copied from host to device.
- **`is_result_on_device: bool`**: Indicates whether the output data is preloaded in device memory. If `false` outputs will be copied from host to device.
- **`is_async: bool`**: Specifies whether the NTT operation should be performed asynchronously.
- **`batch_size: usize`**: Number of vector operations to process in a single batch. Each operation will be performed independently on each batch element.
- **`batch_size: usize`**: Number of vector operations to process in a single batch. Each operation will be performed independently on each batch element. It is implicitly determined given the inputs and outputs to the vector operation.
- **`columns_batch: bool`**: true if the batched vectors are stored as columns in a 2D array (i.e., the vectors are strided in memory as columns of a matrix). If false, the batched vectors are stored contiguously in memory (e.g., as rows or in a flat array).

- **`ext: ConfigExtension`**: extended configuration for backend.
Expand Down
9 changes: 0 additions & 9 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,6 @@ const config: Config = {
darkTheme: darkCodeTheme,
additionalLanguages: ['rust', 'go'],
},
image: 'img/logo.png',
announcementBar: {
id: 'announcement', // Any value that will identify this message.
content:
'<strong>❄️🎉 New Release! ICICLE v3.3! 🎉❄️</strong>',
backgroundColor: '#64f5ef', // Light blue background color.
textColor: '#000000', // Black text color.
isCloseable: true, // Defaults to `true`.
},
} satisfies Preset.ThemeConfig,
};

Expand Down
5 changes: 0 additions & 5 deletions docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ const cppApi = [
label: "Hash",
id: "icicle/primitives/hash",
},
{
type: "doc",
label: "Poseidon2",
id: "icicle/primitives/poseidon2",
},
{
type: "doc",
label: "Merkle-Tree",
Expand Down
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).
Loading

0 comments on commit 99abe0f

Please sign in to comment.