Skip to content
gattaca-comPublic

About

Minimal zkVM for Ethereum.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

leanVM

leanVM

minimal hash-based zkVM, for post-quantum Ethereum

Documentation

leanXMSS aggregation 1600/s
leanSPHINCS aggregation 500/s
leanDA commitment 3,2 MiB/s
2-to-1 recursion 140 ms
proving KECCAK 700K/s
cheap cycles 7,6M/s

security

leanVM is designed for security:

  • 125-bit ROM (62-bit QROM) soundness
  • no proximity gap conjecture
  • end-to-end formal verification
  • a traditional hash function (Keccak-256)

work in progress

  • leanVM is not yet stable
  • Formal statements are still under review
  • The Lean statements only describe the spec. Proving the Rust implem is faithful to the spec is still WIP.

leanVM is not (yet) production ready.

benchmarks

machine: M4 Max MacBook Pro (12 performance cores, 4 efficiency cores, 48GB RAM, CPU only, i.e. no metal GPU)

leanXMSS aggregation

The leanXMSS parameters are specified in leanXMSS.pdf, with a security proof in Lean 4. This is not the definitive parameter set.

cargo leanvm aggregate --xmss 1400 --log-inv-rate 2 --repeat 3
aggregation, 1,400 leanXMSS signatures
  cycles (VM steps)           : 1,147,761 = 2^20.13
    details                   : XOR 2^17.999 (22.8%)  KECCAK 2^17.994 (22.7%)  MUL 2^17.855 (20.7%)  SET 2^17.365 (14.7%)  DEREF 2^17.3 (14.1%)  JUMP 2^15.81 (5.0%)  MEMORY 2^21.081  BYTECODE 2^18.812  TOTAL_COMMITTED 2^25.589
  proof size                  : 209.4 KiB
  proving time                : 0.885 s ± 0.8%      peak memory 4.995 GiB
  per signature               : 1,581.591 signatures/s
  verifying                   : 4.522 ms

leanSPHINCS aggregation

The leanSPHINCS parameters are specified in leanSPHINCS.pdf, with a security proof in Lean 4. This is not the definitive parameter set.

cargo leanvm aggregate --sphincs 500 --log-inv-rate 1 --repeat 3
aggregation, 500 leanSPHINCS signatures
  cycles (VM steps)           : 2,757,351 = 2^21.395
    details                   : XOR 2^19.755 (32.1%)  MUL 2^19.435 (25.7%)  SET 2^19.391 (24.9%)  KECCAK 2^17.976 (9.3%)  DEREF 2^17.195 (5.4%)  JUMP 2^16.058 (2.5%)  MEMORY 2^22.043  BYTECODE 2^18.812  TOTAL_COMMITTED 2^26.422
  proof size                  : 294.1 KiB
  proving time                : 0.986 s ± 0.4%      peak memory 4.574 GiB
  per signature               : 507.34 signatures/s
  verifying                   : 5.341 ms

data availability

cargo leanvm aggregate --blobs 16 --log-inv-rate 1 --repeat 3
aggregation, 16 blobs
  cycles (VM steps)           : 3,020,842 = 2^21.527
    details                   : XOR 2^20.098 (37.1%)  MUL 2^19.811 (30.4%)  DEREF 2^19.206 (20.0%)  JUMP 2^18.052 (9.0%)  SET 2^16.043 (2.2%)  KECCAK 2^15.088 (1.2%)  MEMORY 2^21.799  BYTECODE 2^18.812  TOTAL_COMMITTED 2^26.306
  proof size                  : 289.9 KiB
  proving time                : 0.608 s ± 3.4%      peak memory 4.279 GiB
  blob throughput             : 26.299 blobs/s, 3.287 MiB/s
  verifying                   : 5.714 ms

recursion

cargo leanvm recursion --n 2 --xmss-per-leaf 1400 --leaf-log-inv-rate 2 --log-inv-rate 1 --repeat 3
recursion 2→1, over leaves of 1,400 leanXMSS signatures, leaf rate = 1/4, recursion rate = 1/2
  cycles (VM steps)           : 431,087 = 2^18.718
    details                   : MUL 2^17.185 (34.6%)  XOR 2^16.726 (25.1%)  DEREF 2^16.641 (23.7%)  SET 2^15.409 (10.1%)  JUMP 2^13.797 (3.3%)  KECCAK 2^13.747 (3.2%)  MEMORY 2^19.394  BYTECODE 2^18.812  TOTAL_COMMITTED 2^23.611
  proof size                  : 270.5 KiB
  proving time                : 0.146 s ± 3.9%      peak memory 0.917 GiB
  verifying                   : 6.921 ms

Proving KECCAK

cargo leanvm hash --log-n 17 --repeat 3
Keccak GKR batch proving, 131,072 permutations, a state committed every 12 rounds
  witness                         :      9.8 ms ± 32.7%    5.5%
  commit                          :     18.1 ms ± 12.6%   10.0%
  output claim                    :      2.2 ms ± 22.3%    1.2%
  layers and openings             :    126.6 ms ± 2.8%   70.2%
  pcs opening                     :     23.7 ms ± 3.9%   13.1%
  ------------------------------------------
  prove TOTAL (witness included)  :    180.4 ms ± 4.5%
  verify                          :      2.4 ms
  throughput                      :        726,763 permutations/s ± 4.5%
  proof size                      :       237.7 KiB  (1639 scalars, 212.1 KiB of Merkle openings)

Fibonacci

cargo leanvm fibonacci --n 2000000 --log-inv-rate 1 --repeat 3
Fibonacci (in the exponent, i.e. modulo 2^64 - 1), N = 2,000,000
  cycles (VM steps)           : 2,040,016
    details                   : MUL 2^20.944 (98.9%)  SET 2^13.288 (0.5%)  DEREF 2^12.967 (0.4%)  JUMP 2^10.968 (0.1%)  XOR 2^10.966 (0.1%)  MEMORY 2^20.959  BYTECODE 2^10.017  TOTAL_COMMITTED 2^25.014
  proof size                  : 262.6 KiB
  proving                     : 0.267 s ± 2.1%   7,641,814 cycles/s      peak memory 1.733 GiB
  verifying                   : 3.85 ms

SNARK machinery

FV Credits:

About

Minimal zkVM for Ethereum.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages