Skip to content
parithoshPublic

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 Python verifier

leanXMSS aggregation 965/s
leanSPHINCS aggregation 440/s
leanDA commitment 2,6 MiB/s
2-to-1 recursion 0.21s
proving KECCAK 560K/s
cheap cycles 6,2M/s

security

leanVM is designed for security:

  • 128-bit ROM (64-bit QROM) soundness
  • no proximity gap conjecture
  • end-to-end formal verification
  • a traditional hash function

warning: Formal verification is in progress. leanVM is not (yet) production ready.

work in progress

Expect leanVM to change significantly:

  • hash: Keccak-256 is a placeholder: SHA2, BLAKE2s and BLAKE3 are actively considered.
  • ISA: A migration from leanISA to RISC-V (rv64im) is planned.
  • zk: Support for zero-knowledge is planned.

note: Prior to binary fields leanVM used KoalaBear and Poseidon. The historical design is in this branch.

benchmarks

machine: M4 Max MacBook Pro (12 performance cores, 4 efficiency cores, 48GB RAM)

note: The Metal GPU was not used.

leanXMSS aggregation

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

cargo leanvm aggregate --xmss 1500 --log-inv-rate 2 --repeat 3
aaggregation, 1,500 leanXMSS signatures
  cycles (VM steps)           : 1,227,023 = 2^20.227
    details                   : XOR 2^18.099 (22.9%)  KECCAK 2^18.094 (22.8%)  MUL 2^17.955 (20.7%)  SET 2^17.46 (14.7%)  DEREF 2^17.38 (13.9%)  JUMP 2^15.91 (5.0%)  MEMORY 2^23.147  BYTECODE 2^18.899  TOTAL_COMMITTED 2^26.993
  proof size                  : 265.1 KiB
  proving time                : 1.554 s ± 4.2%      peak memory 9.646 GiB
  per signature               : 965.372 signatures/s
  verifying                   : 7.364 ms

leanSPHINCS aggregation

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

cargo leanvm aggregate --sphincs 530 --log-inv-rate 1 --repeat 3
aggregation, 530 leanSPHINCS signatures
  cycles (VM steps)           : 2,464,998 = 2^21.233
    details                   : XOR 2^19.929 (40.5%)  MUL 2^19.399 (28.0%)  SET 2^18.124 (11.6%)  KECCAK 2^17.994 (10.6%)  DEREF 2^17.259 (6.4%)  JUMP 2^16.141 (2.9%)  MEMORY 2^23.152  BYTECODE 2^18.899  TOTAL_COMMITTED 2^26.983
  proof size                  : 372.9 KiB
  proving time                : 1.193 s ± 4.7%      peak memory 7.501 GiB
  per signature               : 444.43 signatures/s
  verifying                   : 7.92 ms

data availability

cargo leanvm aggregate --blobs 16 --log-inv-rate 1 --repeat 3
aggregation, 16 blobs
  cycles (VM steps)           : 3,019,625 = 2^21.526
    details                   : XOR 2^20.098 (37.2%)  MUL 2^19.811 (30.5%)  DEREF 2^19.201 (20.0%)  JUMP 2^18.052 (9.0%)  SET 2^16.056 (2.3%)  KECCAK 2^15.088 (1.2%)  MEMORY 2^21.817  BYTECODE 2^18.899  TOTAL_COMMITTED 2^26.494
  proof size                  : 340.2 KiB
  proving time                : 0.762 s ± 3.3%      peak memory 5.968 GiB
  blob throughput             : 20.993 blobs/s, 2.624 MiB/s
  verifying                   : 7.904 ms

recursion

cargo leanvm recursion --n 2 --xmss-per-leaf 1500 --leaf-log-inv-rate 2 --log-inv-rate 1 --repeat 3
recursion 2→1, over leaves of 900 leanXMSS signatures
  cycles (VM steps)           : 542,049 = 2^19.048
    details                   : MUL 2^17.622 (37.2%)  XOR 2^17.183 (27.5%)  DEREF 2^16.839 (21.6%)  SET 2^15.214 (7.0%)  JUMP 2^14.526 (4.4%)  KECCAK 2^13.63 (2.3%)  MEMORY 2^19.78  BYTECODE 2^18.467  TOTAL_COMMITTED 2^24.02
  proof size                  : 216.9 KiB
  proving time                : 0.309 s ± 1.6%      peak memory 2.315 GiB
  verifying                   : 9.176 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                         :     14.8 ms ± 87.7%    6.3%
  commit                          :     17.7 ms ± 34.5%    7.5%
  output claim                    :      2.1 ms ± 20.4%    0.9%
  layers and openings             :    177.0 ms ± 4.1%   75.4%
  pcs opening                     :     23.2 ms ± 7.0%    9.9%
  ------------------------------------------
  prove TOTAL (witness included)  :    234.8 ms ± 10.4%
  verify                          :      4.2 ms
  throughput                      :        558,291 permutations/s ± 10.4%
  proof size                      :       290.2 KiB  (1562 scalars, 253.6 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.261
  proof size                  : 311.2 KiB
  proving                     : 0.326 s ± 7.1%   6,257,419 cycles/s      peak memory 2.46 GiB
  verifying                   : 5.963 ms

SNARK machinery

About

Minimal zkVM for Ethereum.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages