proof-aggregation/codex-plonky2-circuits
M Alghazwi 7a24f7d081 add testing params 2024-11-05 13:19:00 +01:00
..
benches major refactor 2024-11-05 12:57:49 +01:00
src add testing params 2024-11-05 13:19:00 +01:00
.gitignore init 2024-10-07 10:36:11 +02:00
Cargo.toml add sample_cells bench 2024-10-18 12:01:01 +02:00
README.md major refactor 2024-11-05 12:57:49 +01:00

README.md

Codex Plonky2 Circuits

WARNING: This is a work-in-progress prototype, and has not received careful code review. This implementation is NOT ready for production use.

This crate is an implementation of the codex storage proofs circuits for the plonky2 proof system.

Code organization

  • merkle_safe is the implementation of "safe" merkle tree used in codex, consistent with the one here.

  • merkle_circuit is the Plonky2 Circuit implementation of "safe" merkle tree above.

  • sample_cells is the Plonky2 Circuit implementation for sampling cells in dataset merkle tree.

  • params is the parameters used in the circuits.

  • utils contains helper functions.

Usage

TODO!

Benchmarks

In here we show the preliminary benchmarks of codex storage proofs circuits.

Running benchmarks

To run the benchmarks for safe merkle tree circuit, you can use the following command:

cargo bench --bench safe_circuit

To run the benchmarks for proving cells circuit, you can use the following command: Note: make sure to adjust the parameters as need in params

cargo bench --bench prove_cells

To run the benchmarks for sampling circuit, you can use the following command: Note: make sure to adjust the parameters as need in params

cargo bench --bench sample_cells

Results

Benchmark results for proving 10 cells (10 samples) in a Slot Merkle tree with max depth 16 with the small tree (block tree) is of depth 5 so 32 cells in each block. Cell data size is 2048 bytes (256 field elements)

Operation Time (ms)
Build 34.4 ms
Prove 50.3 ms
Verify 2.4 ms

Circuit size: 210 gates

Proof size: 116,008 bytes