https://github.com/alexmllo/zk-hashes
Rust implementation of some Arithmetization-Oriented cryptographic primitives in the Plonk framework
https://github.com/alexmllo/zk-hashes
anemoi arion arithmetic-circuits arithmetization-oriented griffin hash-functions plonk plonky2 poseidon rescue zero-knowledge
Last synced: 3 months ago
JSON representation
Rust implementation of some Arithmetization-Oriented cryptographic primitives in the Plonk framework
- Host: GitHub
- URL: https://github.com/alexmllo/zk-hashes
- Owner: alexmllo
- Created: 2024-06-05T09:10:24.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-06-18T09:23:17.000Z (12 months ago)
- Last Synced: 2025-01-23T15:17:49.789Z (4 months ago)
- Topics: anemoi, arion, arithmetic-circuits, arithmetization-oriented, griffin, hash-functions, plonk, plonky2, poseidon, rescue, zero-knowledge
- Language: Rust
- Homepage:
- Size: 63.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zero-knowledge Library for hash functions
This repository constains the implementation of two Zero-Knowledge Proof (ZK) libraries for ZK-Friendly Hash Functions named zk-lib and zk-dusk, developed as part of the bachelor thesis. The libraries provides plain and zero-knowledge circuit implementation for various hash functions in the Polygon's Plonky2 and Dusk Plonk's Plonk proof systems for generating zero-knowledge proofs, in the Rust programming language.
Hash functions: MiMC, Poseidon, Rescue-prime, Griffin, Anemoi and Arion.
## Requirements
To use this library, ensure you satisfy one of the following prerequisites:- Rust compiler with recent nightly toolchain. You can set up with the following command:
```
rustup override set nightly-YYYY-MM-DD
```
Make sure to replace YYYY-MM-DD with the appropriate date for your setup.- Copy the rust-toolchain file in your project directory. It can be changed to a more recent nightly version.
## Code Structure
- mimc-python:
- Implementation of the MiMC hash function Python, primarily used for testing purposes.
- zk-lib:
- Library containing implementation of the MiMC, Poseidon, Rescue-Prime, Griffin, Anemoi and Arion hash functions, as well as the zero-knowledge circuit for each one using Plonky2 as the proof system.
- Benchmarking of the hashes and the zero-knowledge circuit for each hash function.
- zk-dusk
- Library containing implementation of the MiMC, Poseidon, Rescue-Prime, Griffin, Anemoi and Arion hash functions, as well as the zero-knowledge circuit for each one using PLONK as the proof system.
- Benchmarking of the hashes and the zero-knowledge circuit for each hash function.## Benchmarks
Measurements were conducted on a system configured with a 1.4 GHz Quad-Core Intel Core i5 processor, 8 GB LPDDR3 RAM with a transfer rate of 2133 MHz, and running macOS 14.5. The system was clocked at 1.4 GHz and utilized Rust’s Nightly build dated 2024-02-01. Benchmarking was performed using Criterion 0.5, with Plonky2 version 0.1.4 and dusk-plonk version 0.19.### Plain performance
![]()
![]()
### Plonky2 performance
### Plonk performance
#### Number of constraints#### Performance
![]()