Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: aiken-lang/setup-aiken@v1.0.3
with:
version: v1.1.19
version: v1.1.21
- run: aiken fmt --check
working-directory: zkp
- run: aiken check -D
Expand Down
83 changes: 50 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,71 @@ A standards-compliant Zero-Knowledge Proof (ZKP) library for Cardano smart contr

## Project Overview

The Aiken ZKP Standards Library takes a pragmatic approach to implementing zero-knowledge proof systems on Cardano. We distinguish between committed features (ready for production) and aspirational features (planned for future development).
The Aiken ZKP Standards Library takes a pragmatic approach to implementing zero-knowledge proof systems on Cardano. We distinguish between committed features (current targets) and aspirational features (planned for future development).

## Features
This implementation is designed for Plutus v3, leveraging its built-in BLS12-381 curve functions to ensure efficient and secure verification of ZKPs. It emphasizes clarity and maintainability, making it suitable for educational/demonstrative purposes without sacrificing security.

### Features Currently Under Development
## Targeted Features

#### Groth16
- Generic Groth16 proof verifier system
- Example circuits and R1CS constraint sets
- Comprehensive test suite
### Groth16

#### Plonk
- Generic Plonk proof verifier system
- circom and SnarkJS integration
- Complete verification examples
Status: Complete

#### Bullet Proofs
- Generic Bullet Proof verifier system
- Example circuits and implementations
- Extensive testing suite
The Groth16 implementation is largely based on Modulo-P's [ak-381](https://github.com/Modulo-P/ak-381), with some ideas taken from [zarassh's implementation](https://github.com/tarassh/zkSNARK-under-the-hood/blob/main/groth16.py) and an emphasis on explicitness and clarity. This should make this implementation ideal for learning, or for further modification.

### Aspirational Features
Currently, the Groth16 module includes:

- **Marlin**: Preprocessing zkSNARKs with Universal and Updatable SRS
- **Plonky2**: Advanced recursive proof composition
- [x] Generic Groth16 proof verifier system
- [x] Onchain verification tests

## Implementation
Wishlist:

### On-Chain
- Leverages PlutusV3's BLS12-381 curve builtin functions
- Focuses on efficient verification
- Maintains strong security guarantees
- [ ] Integration examples with circom and SnarkJS
- [ ] Integration into a merkelized validator

### Off-Chain
- Examples using circom
- Integration with SnarkJS
- User-customizable proof generation
### Plonk

## Getting Started
Status: Optimizing

### Prerequisites
- Aiken development environment
- Familiarity with ZKP systems
- Understanding of Cardano smart contracts
The Plonk implementation is loosely based on perturbing's [plutus-plonk](https://github.com/perturbing/plutus-plonk-example), with several optimizations and restructuring done around point compression to improve performance and clarity.

The Plonk module currently includes:

- [x] Generic Plonk proof verifier system
- [x] Onchain verification tests

Wishlist:

- [ ] Optimize further to fit within Plutus resource limits
- [ ] Integration examples with circom and SnarkJS
- [ ] Integration into a merkelized validator

### Bulletproofs

Status: Early Development

The Bulletproofs implementation is in the early stages, with a focus on building out the necessary field arithmetic and point operations required for Bulletproofs.

### Helper Functions

- Affine point operations - conversion to/from native types
- Field arithmetic utilities

## Aspirational ZKP Systems

- **Marlin**: Preprocessing zkSNARKs with Universal and Updatable SRS
- **Plonky2**: Advanced recursive proof composition

## Contributing

We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for:

- Development guidelines
- Submission process
- Testing requirements
- Testing requirements

### Prerequisites

- Aiken development environment
- Familiarity with ZKP systems
- Understanding of Cardano smart contracts
4 changes: 2 additions & 2 deletions zkp/aiken.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

[[requirements]]
name = "aiken-lang/stdlib"
version = "v2.1.0"
version = "3.0.0"
source = "github"

[[packages]]
name = "aiken-lang/stdlib"
version = "v2.1.0"
version = "3.0.0"
requirements = []
source = "github"

Expand Down
4 changes: 2 additions & 2 deletions zkp/aiken.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "adao/zkp"
version = "0.0.0"
compiler = "v1.1.19"
compiler = "v1.1.21"
plutus = "v3"
license = "Apache-2.0"
description = "Aiken contracts for project 'adao/zkp'"
Expand All @@ -12,7 +12,7 @@ platform = "github"

[[dependencies]]
name = "aiken-lang/stdlib"
version = "v2.1.0"
version = "3.0.0"
source = "github"

[config]
Loading
Loading