Feature/bls12 381 dory pc #96
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add BLS12-381 Curve Provider and Dory-PC Backend
Summary
This PR adds support for:
Motivation
BLS12-381 is widely used in production systems (Ethereum 2.0, Zcash) and offers strong security guarantees. Dory-PC provides O(1) commitment size and O(log n) verification.
Changes
New Files
src/provider/bls12_381.rs- BLS12-381 curve implementation viahalo2curvessrc/provider/pcs/dory_pc.rs- Dory-PC adapter wrappingquarks-zkcratebenches/pcs_comparison.rs- Benchmark comparing Hyrax vs Doryexamples/sha256_bls12_381_dory.rs- SHA-256 circuit example with Dory-PCexamples/BENCHMARK_RESULTS.md- Benchmark resultsModified Files
src/provider/mod.rs- RegisterBLS12381HyraxEngineandBLS12381DoryEnginesrc/provider/pcs/mod.rs- Exportdory_pcmoduleCargo.toml- Add dependencies (quarks-zk,ark-*crates)New Engines
Benchmark Results (Simple Circuit)
SHA-256 Circuit Results (Heavy Circuit, 131K+ constraints)
Performance Observations
What works well:
Current bottlenecks:
Potential optimizations (not in scope for this PR):
Assessment
This is a research-grade implementation. The numbers are expected for:
For production use, significant optimization work would be needed.
Testing
cargo test --features dory cargo bench --bench pcs_comparison --features dory cargo run --release --example sha256_bls12_381_dory --features doryDependencies
New optional