-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
258 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,74 @@ | ||
# Zerokit | ||
|
||
A set of Zero Knowledge modules, written in Rust and designed to be used in other system programming environments. | ||
[](https://crates.io/crates/rln) | ||
[](https://github.com/vacp2p/zerokit/actions) | ||
[](https://opensource.org/licenses/MIT) | ||
[](https://opensource.org/licenses/Apache-2.0) | ||
|
||
## Initial scope | ||
A collection of Zero Knowledge modules written in Rust and designed to be used in other system programming environments. | ||
|
||
Focus on RLN and being able to use [Circom](https://iden3.io/circom) based | ||
version through ark-circom, as opposed to the native one that currently exists | ||
in Rust. | ||
## Overview | ||
|
||
## Acknowledgements | ||
|
||
- Uses [ark-circom](https://github.com/gakonst/ark-circom), Rust wrapper around Circom. | ||
|
||
- Inspired by Applied ZKP group work, e.g. [zk-kit](https://github.com/appliedzkp/zk-kit). | ||
Zerokit provides zero-knowledge cryptographic primitives with a focus on performance, security, and usability. The current focus is on Rate-Limiting Nullifier (RLN) implementation. | ||
|
||
- [RLN library](https://github.com/kilic/rln) written in Rust based on Bellman. | ||
## Features | ||
|
||
- [semaphore-rs](https://github.com/worldcoin/semaphore-rs) written in Rust based on ark-circom. | ||
- **RLN Implementation**: Efficient Rate-Limiting Nullifier using zkSNARKs | ||
- **Circom Compatibility**: Uses Circom-based circuits for RLN | ||
- **Cross-Platform**: Support for multiple architectures (see compatibility note below) | ||
- **FFI-Friendly**: Easy to integrate with other languages | ||
|
||
- The circom witness calculation code of the rln crate is based on [circom-witnesscalc](https://github.com/iden3/circom-witnesscalc) by iden3. The execution graph file used by this code has been generated by means of the same iden3 software. The circom-witnesscalc code fragments have been borrowed instead of depending on this crate, because its types of input and output data were incompatible with the corresponding zerokit code fragments, and circom-witnesscalc has some dependencies, which are redundant for our purpose. | ||
## Architecture | ||
|
||
## Users | ||
|
||
Zerokit is used by - | ||
|
||
- [nwaku](https://github.com/waku-org/nwaku) | ||
- [js-rln](https://github.com/waku-org/js-rln) | ||
Zerokit currently focuses on RLN (Rate-Limiting Nullifier) implementation using [Circom](https://iden3.io/circom) circuits through ark-circom, providing an alternative to existing native Rust implementations. | ||
|
||
## Build and Test | ||
|
||
To install missing dependencies, run the following commands from the root folder | ||
> [!IMPORTANT] | ||
> For WASM support or x32 architecture builds, use version `0.6.1`. Current version has dependency issues for these platforms. WASM support will return in a future release. | ||
### Install Dependencies | ||
|
||
```bash | ||
make installdeps | ||
``` | ||
|
||
To build and test all crates, run the following commands from the root folder | ||
### Build and Test All Crates | ||
|
||
```bash | ||
make build | ||
make test | ||
``` | ||
|
||
## Release assets | ||
## Release Assets | ||
|
||
We use [`cross-rs`](https://github.com/cross-rs/cross) to cross-compile and generate release assets: | ||
|
||
```bash | ||
# Example: Build for specific target | ||
cross build --target x86_64-unknown-linux-gnu --release -p rln | ||
``` | ||
|
||
## Used By | ||
|
||
We use [`cross-rs`](https://github.com/cross-rs/cross) to cross-compile and generate release assets for rln. | ||
Zerokit powers zero-knowledge functionality in: | ||
|
||
- [**nwaku**](https://github.com/waku-org/nwaku) - Nim implementation of the Waku v2 protocol | ||
- [**js-rln**](https://github.com/waku-org/js-rln) - JavaScript bindings for RLN | ||
|
||
## Acknowledgements | ||
|
||
- Inspired by [Applied ZKP](https://zkp.science/) group work, including [zk-kit](https://github.com/appliedzkp/zk-kit) | ||
- Uses [ark-circom](https://github.com/gakonst/ark-circom) for zkey and Groth16 proof generation | ||
- Witness calculation based on [circom-witnesscalc](https://github.com/iden3/circom-witnesscalc) by iden3. The execution graph file used by this code has been generated by means of the same iden3 software. | ||
|
||
> [!IMPORTANT] | ||
> The circom-witnesscalc code fragments have been borrowed instead of depending on this crate, because its types of input and output data were incompatible with the corresponding zerokit code fragments, and circom-witnesscalc has some dependencies, which are redundant for our purpose. | ||
## Documentation | ||
|
||
For detailed documentation on each module: | ||
|
||
```bash | ||
cargo doc --open | ||
``` |
Oops, something went wrong.