Skip to content

Commit 82549ed

Browse files
authored
Modular precompiles (#99)
* Merkle precompile * remove 8 columns from Merkle table (at the cost of not supporting height=1 anymore) * missing constraint * SliceHash precompile * naming * missing use of dot_product_be in recursion program * fix * EqPolyBaseExt Precompile * prepare "table on demand" * deactivate unused tables at runtime * wip * Poseidon16 "core" table * Poseidon24 "core" table * finally connect together the buses to poseidon core tables * better recursion program * w * wip * improve xmss guest program * magic number * multiple WHIR recursions proved together * remove CounterHint * new hint: private_input_start * repeated whir proofs in memory for more realistic benchmark * no rayon on small instances in multilinear-toolkit * degree 2 in DotProduct table * PARALLEL_THRESHOLD = 512 * fix * small fix * deps * deps * update readme * clippy * fix readme --------- Co-authored-by: Tom Wambsgans <[email protected]>
1 parent 5ad5619 commit 82549ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4388
-2500
lines changed

Cargo.lock

Lines changed: 59 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ itertools = "0.14.0"
6767
colored = "3.0.0"
6868
tracing = "0.1.26"
6969
serde_json = "1.0.145"
70+
serde = { version = "1.0.228", features = ["derive"] }
71+
bincode = "1.3.3"
7072
num_enum = "0.7.5"
7173
tracing-subscriber = { version = "0.3.19", features = ["std", "env-filter"] }
7274
tracing-forest = { version = "0.3.0", features = ["ansi", "smallvec"] }
7375
p3-koala-bear = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }
76+
p3-baby-bear = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }
7477
p3-poseidon2 = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }
7578
p3-symmetric = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }
7679
p3-air = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }
@@ -92,25 +95,25 @@ multilinear-toolkit.workspace = true
9295
whir-p3.workspace = true
9396

9497
# [patch."https://github.com/TomWambsgans/Plonky3.git"]
95-
# p3-koala-bear = { path = "../zk/Plonky3/koala-bear" }
96-
# p3-field = { path = "../zk/Plonky3/field" }
97-
# p3-poseidon2 = { path = "../zk/Plonky3/poseidon2" }
98-
# p3-symmetric = { path = "../zk/Plonky3/symmetric" }
99-
# p3-air = { path = "../zk/Plonky3/air" }
100-
# p3-merkle-tree = { path = "../zk/Plonky3/merkle-tree" }
101-
# p3-commit = { path = "../zk/Plonky3/commit" }
102-
# p3-matrix = { path = "../zk/Plonky3/matrix" }
103-
# p3-dft = { path = "../zk/Plonky3/dft" }
104-
# p3-challenger = { path = "../zk/Plonky3/challenger" }
105-
# p3-monty-31 = { path = "../zk/Plonky3/monty-31" }
106-
# p3-maybe-rayon = { path = "../zk/Plonky3/maybe-rayon" }
107-
# p3-util = { path = "../zk/Plonky3/util" }
98+
# p3-koala-bear = { path = "../Plonky3/koala-bear" }
99+
# p3-field = { path = "../Plonky3/field" }
100+
# p3-poseidon2 = { path = "../Plonky3/poseidon2" }
101+
# p3-symmetric = { path = "../Plonky3/symmetric" }
102+
# p3-air = { path = "../Plonky3/air" }
103+
# p3-merkle-tree = { path = "../Plonky3/merkle-tree" }
104+
# p3-commit = { path = "../Plonky3/commit" }
105+
# p3-matrix = { path = "../Plonky3/matrix" }
106+
# p3-dft = { path = "../Plonky3/dft" }
107+
# p3-challenger = { path = "../Plonky3/challenger" }
108+
# p3-monty-31 = { path = "../Plonky3/monty-31" }
109+
# p3-maybe-rayon = { path = "../Plonky3/maybe-rayon" }
110+
# p3-util = { path = "../Plonky3/util" }
108111

109112
# [patch."https://github.com/TomWambsgans/whir-p3.git"]
110-
# whir-p3 = { path = "../zk/whir/fork-whir-p3" }
113+
# whir-p3 = { path = "../whir-p3" }
111114

112115
# [patch."https://github.com/leanEthereum/multilinear-toolkit.git"]
113-
# multilinear-toolkit = { path = "../zk/multilinear-toolkit" }
116+
# multilinear-toolkit = { path = "../multilinear-toolkit" }
114117

115118
# [profile.release]
116119
# opt-level = 1

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
XMSS + minimal [zkVM](minimal_zkVM.pdf) = lightweight PQ signatures, with unbounded aggregation
44

5+
## Status
6+
7+
- branch [main](https://github.com/leanEthereum/leanMultisig): optimized for **prover efficiency**
8+
- branch [lean-vm-simple](https://github.com/leanEthereum/leanMultisig/tree/lean-vm-simple): optimized for **simplicity**
9+
10+
Both versions will eventually merge into one.
511

612
## Proving System
713

@@ -38,15 +44,17 @@ RUSTFLAGS='-C target-cpu=native' cargo run --release -- poseidon --log-n-perms 2
3844
The full recursion program is not finished yet. Instead, we prove validity of a WHIR opening, with 25 variables, and rate = 1/4.
3945

4046
```console
41-
RUSTFLAGS='-C target-cpu=native' cargo run --release -- recursion
47+
RUSTFLAGS='-C target-cpu=native' cargo run --release -- recursion --count 8
4248
```
4349

4450
![Alt text](docs/benchmark_graphs/graphs/recursive_whir_opening.svg)
4551

52+
Detail: before 4 December 2025, only 1 WHIR opening was benchmarked. Starting from now, we prove a dozen of openings together (to be closer to the n-to-1 aggregation scenario) and we report the proving time / WHIR.
53+
4654
### XMSS aggregation
4755

4856
```console
49-
RUSTFLAGS='-C target-cpu=native' cargo run --release -- xmss --n-signatures 1000
57+
RUSTFLAGS='-C target-cpu=native' cargo run --release -- xmss --n-signatures 1775
5058
```
5159

5260
[Trivial encoding](docs/XMSS_trivial_encoding.pdf) (for now).

crates/air/src/prove.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ where
4040
"TODO handle the case UNIVARIATE_SKIPS >= log_length"
4141
);
4242

43+
// crate::check_air_validity(
44+
// air,
45+
// &extra_data,
46+
// &columns_f,
47+
// &columns_ef,
48+
// last_row_shifted_f,
49+
// last_row_shifted_ef,
50+
// )
51+
// .unwrap();
52+
4353
let alpha = prover_state.sample(); // random challenge for batching constraints
4454

4555
*extra_data.alpha_powers_mut() = alpha

crates/air/tests/complex_air.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fn test_air_helper<const VIRTUAL_COLUMN: bool>() {
170170
virtual_column_statement_prover,
171171
true,
172172
);
173-
let mut verifier_state = build_verifier_state(&prover_state);
173+
let mut verifier_state = build_verifier_state(prover_state);
174174

175175
let virtual_column_statement_verifier = if VIRTUAL_COLUMN {
176176
let virtual_column_evaluation_point =

crates/air/tests/fib_air.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn test_air_fibonacci() {
9292
None,
9393
true,
9494
);
95-
let mut verifier_state = build_verifier_state(&prover_state);
95+
let mut verifier_state = build_verifier_state(prover_state);
9696

9797
let (point_verifier, evaluations_remaining_to_verify_f, evaluations_remaining_to_verify_ef) = verify_air(
9898
&mut verifier_state,

0 commit comments

Comments
 (0)