<section style="font-size: 0.75em; text-align: left;">
# zkVM Benchmarking on Ream's STF
**Utsav Sharma** โ EPF Cohort 6
Project lead: **Unnawut**
Focus: Beacon Chain STF in zkVMs for Beam Chain
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## Motivation
Modular chains (like Beam) require proving consensus logic inside zkVMs.
The **Beacon Chain State Transition Function (STF)** is:
- Critical to Ethereumโs consensus
- Complex, multi-layered, and data-heavy
- Not designed with SNARK-friendliness in mind
We aim to benchmark zkVMs to answer:
> How viable is SNARKing consensus code for real-time L2s?
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## What is the STF?
The **State Transition Function** (STF) for the Beacon Chain:
- Inputs: `BeaconState`, `SignedBeaconBlock`
- Processes:
- Slot advancement, proposer duties
- Attestations, sync committees
- Rewards, penalties, slashings
- Output: Updated `BeaconState`
Defined in [ethereum/consensus-specs](https://github.com/ethereum/consensus-specs)
Implemented in Rust by [Ream](https://github.com/unnawut/ream)
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## zkVMs in Scope
**zkVMs = General-purpose proving VMs**
We benchmark Beacon STF inside:
- ๐น **SP1**: Rust-based VM with STARKs, native Rust support
- ๐น **RISC Zero**: RISC-V emulation, SHA-based ZK-STARKs
- ๐น **Jolt**: Polynomial IOPs over RISC-V, optimized IR
- ๐น **Zisk**, **Valida**, **Brevis Pico**, **OpenVM** (planned)
Key differences:
- Instruction sets (custom vs RISC-V)
- Precompiles, memory model, I/O constraints
- Witness size, proof time, recursion support
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## Current Benchmark Setup
- Rust STF code from `ream-consensus`
- Input SSZ data (compressed `BeaconState`, `SignedBlock`)
- Benchmarks run inside zkVM entrypoint
- Outputs verified post-execution
Metrics collected:
- Guest execution time
- Proving time / memory
- Instruction cycle counts
- Throughput limits
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## Design Goals
- ๐งฉ **Modularity**: Swap zkVMs with minimal code change
- ๐งช **Isolation**: Test STF subfunctions independently (`process_attestation`, `process_block`)
- ๐งฎ **Metric Logging**: Consistent measurements across backends
- ๐ ๏ธ **Snark-Friendly Prep**: Transform code with minimal I/O/memory footprint
Benchmarking serves dual purpose:
- Short-term: guide Beam zkVM selection
- Long-term: snarkify next-gen L1 consensus logic
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## STF Execution in zkVMs: Bottlenecks
Early benchmarks highlight:
- ๐ง Heavy Merkle tree operations (state roots, committee caches)
- ๐ฆ SSZ encoding/decoding costs
- ๐ง High memory footprint for `BeaconState` mutations
- ๐ Nested loops in attestation and slashing logic
- ๐ Random accesses to validator registry, committee assignments
SP1 and RISC Zero show divergent behavior due to:
- ISA efficiency
- Precompile availability
- Trace size overhead
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## Work Plan
### โ
Done
- SP1 + RISC Zero integration
- Benchmarks for `process_block`, `process_attestation`
- Test input pipeline with mainnet data
- Logging cycle counts, constraints
### ๐งญ In Progress
- Port to **Jolt**, **Valida**, **OpenVM**
- Minimize state mutation footprint
- Add proof verification stats
### ๐ฃ๏ธ Coming Up
- Generalize for Beam Chain STF
- Automate regressions / profiling
- Publish zkVM comparison report
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## Example: SP1 Benchmark Logs
- STF run: `process_block`
- Cycles: 8.1M
- Trace size: 12MB
- Memory used: 18MB
- Proving time: ~40s
Bottlenecks:
- `get_beacon_committee()`: heavy indexing + hashing
- Sync committee updates: large Merkle recalculations
- Rewards loop: variable-length loops
</section>
---
<section style="font-size: 0.75em; text-align: left;">
## Long-Term Impact
This project enables:
- ๐ก Data-driven zkVM choices for Beam Chain
- ๐งฑ Foundation for SNARK-friendly consensus clients
- ๐ฌ Benchmarking culture for STF implementations
- ๐ Closer alignment of zk infrastructure with Ethereumโs modular roadmap
> STF snarkification is a crucial step toward fully trustless light clients and verifiable execution chains.
</section>
---
<section style="font-size: 0.75em; text-align: left;">
# ๐ Summary
โ
Beacon STF is complex and non-trivial to prove
โ
Early benchmarks on SP1 and RISC Zero are promising
โ
Modular benchmarking framework is live
โ
Integration with more zkVMs is next
โ
We aim to support Beam Chainโs zk future with real data
---
## ๐ Links
- ๐ธ [Ream GitHub](https://github.com/unnawut/ream)
- ๐ธ [EPF Wiki](https://github.com/ethereum/ethereum-org-website/wiki/EPF)
- ๐ธ [Consensus Specs](https://github.com/ethereum/consensus-specs)
- ๐ธ [SP1 Docs](https://docs.succinct.xyz/sp1)
- ๐ธ [RISC Zero](https://www.risczero.com/)
</section>
{"title":"Project Proposal Presentation","description":"Ethereum Protocol Fellowship - Cohort 6","contributors":"[{\"id\":\"0b089b2a-a200-45d0-86ee-9248ab0cc97a\",\"add\":5312,\"del\":0,\"latestUpdatedAt\":1752002338531}]"}