[ZKLLVM] Trustless ZK-proof TVL oracle

Updates on some additional steps we’ve taken over the week.

Tested with mainnet

We have tested the solution with the real data from mainnet and compared it to the lido-oracle accounting report. In short, ZK-oracle and accounting module reports perfectly match in CL balance, all validators and exited validators count.

Report: slot 6984000, all validators 247929, exited validators 1739, CL balance 7880438321299961 Gwei

Oracle logs: gist
Screencast: video

The report was built on lido-oracle/develop with minimal adjustments:

  • Enable running reports not being a part of the membership committee.
  • Always report the count of exited validators.
  • Compute report on the “first slot of the next epoch after currentFrame.ref_slot” - practically just +1 slot. This is a temporary means to align lido-oracle with BeaconState checkpoints available through public services. In production oracle relies on a private Beacon Chain node, and should be able to obtain BeaconState for any slot.

Note: the screencast was recorded for a smaller problem size - see next section for details.

UPD: another run, without “+1 slot” (i.e. canonical lido-oracle logic): gist

Proof generation time and verification cost

We successfully ran the entire solution end-to-end on a smaller subsets, and confirmed the following.

2^10 validators (CPU-only Single-Core Intel Xeon):

  • Correctness: generated proofs consistently pass verification.
  • Proof generation time: 45 minutes.
  • Proof verification cost: largest expense we observed was ~3.6m gas.

2^10 validators (CPU-only 128-Core AMD EPYC):

  • Correctness: generated proofs consistently pass verification.
  • Proof generation time: <= 60 seconds.
  • Proof verification cost: largest expense we observed was ~3.6m gas.

2^20 validators (CPU-only 128-Core AMD EPYC):

  • Correctness: generated proofs consistently pass verification.
  • Proof generation time: ~292 minutes.
  • Proof verification cost: largest expense we observed was slightly above ~5m gas.

Since there is still room for optimizations, following numbers are achievable:

  • Proof generation time: ~25-30 minutes
  • Proof verification cost: ~5m gas

No hardware will be required to be used for proof generation from Lido side as all the computations will be outsourced to the Proof Market.

Code

Note: there are a bunch of shortcuts I’ve made to speed up development (largely around putting things in certain locations, hardcoding absolute paths, setting environment, etc.) This will be cleared out later, but if someone would like to run it - let me know, so I can walk you though “environment setup”.

4 Likes