8 releases (breaking)

new 0.7.0 Nov 26, 2024
0.6.0 Jul 15, 2024
0.5.0 Jul 15, 2024
0.4.0 Jun 12, 2024
0.1.0 Feb 21, 2024

#6 in #plonky2

Download history 10/week @ 2024-07-30 4/week @ 2024-09-10 1/week @ 2024-09-17 20/week @ 2024-09-24 12/week @ 2024-10-01

538 downloads per month

MIT/Apache

8MB
70K SLoC

Rust 48K SLoC // 0.1% comments Assembly 23K SLoC Pest 41 SLoC // 0.1% comments

An Ethereum Node executes transactions in blocks.

Execution mutates two key data structures:

  • The state, which tracks, e.g the account balance.
  • The storage, which is a huge array of integers, per-account.

Ethereum nodes expose information about the transactions over RPC, e.g:

The state execution correctness is then asserted by the zkEVM prover in evm_arithmetization, relying on starky and plonky2.

Prover perfomance is a high priority.

The aformentioned data structures are represented as tries, which may have subtries hashed out. That is, any node (and its children!) may be replaced by its hash, while maintaining provability of its contents:

    A               A
   / \             / \
  B   C     ->    H   C
 / \   \               \
D   E   F               F

(where H is the hash of the D/B\E subtrie).

The principle concern of this module is to step through the transactions, and reproduce the intermediate tries, while hashing out all possible subtries to minimise prover load (since prover performance is sensitive to the size of the trie). The prover can therefore prove each batch of transactions independently.

Non-goals

  • Performance - this will never be the bottleneck in any proving stack.
  • Robustness - this library depends on other libraries that are not robust, so may panic at any time.

Dependencies

~37–53MB
~1M SLoC