Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
11b00d4
wip
TomWambsgans Oct 21, 2025
b940c38
wip
TomWambsgans Oct 21, 2025
152b445
wip
TomWambsgans Oct 21, 2025
59f7349
2 full rounds
TomWambsgans Oct 21, 2025
20c9687
partial rounds
TomWambsgans Oct 21, 2025
c3198b1
wip
TomWambsgans Oct 21, 2025
583fd72
real constants
TomWambsgans Oct 21, 2025
4baa7a8
stats
TomWambsgans Oct 21, 2025
bdd2f93
590K poseidons/s
TomWambsgans Oct 21, 2025
a55ac64
fix (still wip)
TomWambsgans Oct 21, 2025
664b94b
works!!
TomWambsgans Oct 21, 2025
50ab9f5
evaluate_sequential
TomWambsgans Oct 22, 2025
7757d6e
typo
TomWambsgans Oct 22, 2025
5777fca
fix deadlock
TomWambsgans Oct 22, 2025
cff0334
experiment-double-internal-layers
TomWambsgans Oct 22, 2025
d4d5c62
Revert "experiment-double-internal-layers"
TomWambsgans Oct 22, 2025
e9fc3ae
naming
TomWambsgans Oct 22, 2025
f4a8bec
WOAwwwwwww
TomWambsgans Oct 23, 2025
ff3fdde
working for real with the pcs
TomWambsgans Oct 23, 2025
3286ee6
overhead versus plaintext
TomWambsgans Oct 23, 2025
6873892
pretty text
TomWambsgans Oct 23, 2025
756ae02
Merge branch 'main' into poseidon_gkr
TomWambsgans Oct 24, 2025
3494c33
evaluate_univariate_multilinear
TomWambsgans Oct 24, 2025
a10ebe0
create a dedicated "poseidon_circuit" crate
TomWambsgans Oct 24, 2025
3ebe317
wip
TomWambsgans Oct 24, 2025
e18dbc2
using packed pcs
TomWambsgans Oct 24, 2025
419a1b0
simplify
TomWambsgans Oct 24, 2025
1e5529a
simplify
TomWambsgans Oct 24, 2025
3077f33
w
TomWambsgans Oct 24, 2025
8cc7409
compress
TomWambsgans Oct 25, 2025
4e04c70
optional compress
TomWambsgans Oct 25, 2025
4816d15
GKR integration in leanVM, wip
TomWambsgans Oct 25, 2025
2e926c8
abstract away the univariate skip from Poseidon GKR api
TomWambsgans Oct 26, 2025
fe9b4b0
fix
TomWambsgans Oct 26, 2025
b80c110
fix
TomWambsgans Oct 26, 2025
07b5550
wip
TomWambsgans Oct 26, 2025
c22a616
fix
TomWambsgans Oct 26, 2025
30a6e4d
gud
TomWambsgans Oct 26, 2025
81026e8
remove dead code
TomWambsgans Oct 26, 2025
f9e7096
Merge branch 'main' into poseidon_gkr
TomWambsgans Oct 26, 2025
d035127
fix whir
TomWambsgans Oct 27, 2025
ed2df45
Proving_Poseidons_with_GKR.pdf + reset benchmarks + cleanup
TomWambsgans Oct 27, 2025
cb16068
revert reseting benchmarks
TomWambsgans Oct 27, 2025
987c885
log scale for WHIR recursion graph
TomWambsgans Oct 27, 2025
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
434 changes: 227 additions & 207 deletions Cargo.lock

Large diffs are not rendered by default.

38 changes: 7 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ lean_prover = { path = "crates/lean_prover" }
rec_aggregation = { path = "crates/rec_aggregation" }
witness_generation = { path = "crates/lean_prover/witness_generation" }
vm_air = { path = "crates/lean_prover/vm_air" }
poseidon_circuit = { path = "crates/poseidon_circuit" }

# External
thiserror = "2.0"
clap = { version = "4.3.10", features = ["derive"] }
rand = "0.9.2"
sha3 = "0.10.8"
rayon = "1.5.1"
Expand All @@ -78,26 +80,15 @@ p3-poseidon2-air = { git = "https://github.com/TomWambsgans/Plonky3.git", branch
p3-goldilocks = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }
p3-challenger = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }
p3-util = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }
p3-monty-31 = { git = "https://github.com/TomWambsgans/Plonky3.git", branch = "lean-multisig" }

whir-p3 = { git = "https://github.com/TomWambsgans/whir-p3", branch = "lean-multisig" }
multilinear-toolkit = { git = "https://github.com/leanEthereum/multilinear-toolkit.git" }

[dependencies]
air.workspace = true
p3-field.workspace = true
p3-koala-bear.workspace = true
p3-poseidon2.workspace = true
rand.workspace = true
p3-poseidon2-air.workspace = true
p3-matrix.workspace = true
p3-challenger.workspace = true
whir-p3.workspace = true
p3-uni-stark.workspace = true
utils.workspace = true
p3-util.workspace = true
packed_pcs.workspace = true
p3-air.workspace = true
multilinear-toolkit.workspace = true
clap.workspace = true
rec_aggregation.workspace = true
poseidon_circuit.workspace = true

# [patch."https://github.com/TomWambsgans/Plonky3.git"]
# p3-koala-bear = { path = "../zk/Plonky3/koala-bear" }
Expand All @@ -110,28 +101,13 @@ multilinear-toolkit.workspace = true
# p3-poseidon2-air = { path = "../zk/Plonky3/poseidon2-air" }
# p3-dft = { path = "../zk/Plonky3/dft" }
# p3-challenger = { path = "../zk/Plonky3/challenger" }
# p3-monty-31 = { path = "../zk/Plonky3/monty-31" }

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

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

[dev-dependencies]
criterion = { version = "0.7", default-features = false, features = ["cargo_bench_support"] }
rec_aggregation.workspace = true

[profile.release]
lto = "thin"

[[bench]]
name = "poseidon2"
harness = false

[[bench]]
name = "recursion"
harness = false

[[bench]]
name = "xmss"
harness = false
38 changes: 18 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,54 @@ XMSS + minimal [zkVM](minimal_zkVM.pdf) = lightweight PQ signatures, with unboun
## Proving System


- AIR tables committed via multilinear polynomial, using [WHIR](https://eprint.iacr.org/2024/1586.pdf)
- [WHIR](https://eprint.iacr.org/2024/1586.pdf)
- [SuperSpartan](https://eprint.iacr.org/2023/552.pdf), with AIR-specific optimizations developed by W. Borgeaud in [A simple multivariate AIR argument inspired by SuperSpartan](https://solvable.group/posts/super-air/#fnref:1)
- [Univariate Skip](https://eprint.iacr.org/2024/108.pdf)
- [Logup*](https://eprint.iacr.org/2025/946.pdf)
- ...

The VM design is inspired by the famous [Cairo paper](https://eprint.iacr.org/2021/1063.pdf).

Details on how to prove AIR constraints in the multilinear settings are described in [Whirlaway.pdf](Whirlaway.pdf).

[Deep-wiki](https://deepwiki.com/leanEthereum/leanMultisig/1-overview) (thanks [adust09](https://github.com/adust09))


## Benchmarks

cpu: i9-12900H, ram: 32 gb

> TLDR: Slow, **but there is hope** (cf [TODO](TODO.md))
Benchmarks are performed on 2 laptops:
- i9-12900H, 32 gb of RAM
- mac m4 max

target ≈ 128 bits of security, currently using conjecture: 4.12 of [WHIR](https://eprint.iacr.org/2024/1586.pdf), "up to capacity" (TODO: a version without any conjecture, requires an extension of koala-bear of degree > 5)
target ≈ 128 bits of security, currently using conjecture: 4.12 of [WHIR](https://eprint.iacr.org/2024/1586.pdf), "up to capacity" (TODO: provable security)

### Poseidon2

Poseidon2 over 16 KoalaBear field elements.

```console
RUSTFLAGS='-C target-cpu=native' cargo run --release
RUSTFLAGS='-C target-cpu=native' cargo run --release -- poseidon --log-n-perms 20
```

50 % over 16 field elements, 50 % over 24 field elements. rate = 1/2

![Alt text](docs/benchmark_graphs/graphs/raw_poseidons.svg)

### Recursion

```console
RUSTFLAGS='-C target-cpu=native' cargo test --release --package rec_aggregation --lib -- recursion::test_whir_recursion --nocapture
```

The full recursion program is not finished yet. Instead, we prove validity of a WHIR opening, with 25 variables, and rate = 1/4.

```console
RUSTFLAGS='-C target-cpu=native' cargo run --release -- recursion
```

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

### XMSS aggregation

```console
RUSTFLAGS='-C target-cpu=native' NUM_XMSS_AGGREGATED='500' cargo test --release --package rec_aggregation --lib -- xmss_aggregate::test_xmss_aggregate --nocapture
RUSTFLAGS='-C target-cpu=native' cargo run --release -- xmss --n-signatures 800
```

500 XMSS aggregated. "Trivial encoding" (for now).
[Trivial encoding](docs/XMSS_trivial_encoding.pdf) (for now).


![Alt text](docs/benchmark_graphs/graphs/xmss_aggregated.svg)

![Alt text](docs/benchmark_graphs/graphs/xmss_aggregated_time.svg)
![Alt text](docs/benchmark_graphs/graphs/xmss_aggregated_overhead.svg)

### Proof size
Expand All @@ -65,7 +63,7 @@ With conjecture "up to capacity", current proofs with rate = 1/2 are about ≈ 4
- The remaining 100 - 200 KiB will be significantly reduced in the future (this part has not been optimized at all).
- WHIR proof size will also be reduced, thanks to merkle pruning (TODO).

Reasonable target: 256 KiB for fast proof, 128 KiB for slower proofs (rate = 1/4 or 1/8).
Target: 256 KiB for fast proof, 128 KiB for slower proofs (rate = 1/4 or 1/8).

## Credits

Expand Down
42 changes: 0 additions & 42 deletions benches/poseidon2.rs

This file was deleted.

23 changes: 0 additions & 23 deletions benches/recursion.rs

This file was deleted.

26 changes: 0 additions & 26 deletions benches/xmss.rs

This file was deleted.

7 changes: 1 addition & 6 deletions crates/air/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@ p3-uni-stark.workspace = true
p3-matrix.workspace = true
p3-util.workspace = true
multilinear-toolkit.workspace = true
p3-koala-bear.workspace = true
rand.workspace = true
whir-p3.workspace = true
packed_pcs.workspace = true


[dev-dependencies]
p3-koala-bear.workspace = true
p3-matrix.workspace = true
rand.workspace = true
rand.workspace = true
4 changes: 0 additions & 4 deletions crates/air/src/examples/mod.rs

This file was deleted.

Loading
Loading