# EPF Development Log: Project Summary **Developer:** Developeruche **Program:** Ethereum Protocol Fellowship (EPF) **Core Focus:** zkVM Performance, Precompile Architecture, Hybrid Ethereum (RISC-V/EVM), and L1 Consensus Integration. ## Phase 1: zkVM Performance & Architecture Research ### Week 1: zkVM Trace Generation Research **Focus:** Investigated the bottleneck of trace generation in zkVMs, specifically analyzing the ZisK team's 1.5GHz breakthrough. * **Key Analysis:** Identified Ahead-of-Time (AOT) compilation (RISC-V to x86) as the driver for 10x performance gains over JIT. * **Metrics:** Reviewed benchmarks showing 36M gas processed in 0.5s on consumer hardware. * **Output:** Authored "Breakthrough Emulation Bottleneck in zkVM". * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/BkSyxy_Vxl) ### Week 2: Deconstructing ZisK Architecture **Focus:** Deep-dive into ZisK codebase to understand parallelization strategies. * **Discovery:** Identified the "Minimal Trace" architecture (Memory Read Log + Register Checkpoints) enabling "memoryless re-execution." * **Mechanism:** Decoupled trace generation into Phase 1 (Speed/AOT) and Phase 2 (Parallelism/Witness Generation). * **Output:** Technical article "Deconstructing the 1.5 GHz zkVM." * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/SJlkqwzHge) ### Week 3: Practical Proof-of-Concept (Stateless Validation) **Focus:** Validated ZisK architecture by building a functional PoC of an Ethereum Block Execution, happening statlessly. * **Implementation:** Built a stateless Ethereum block validator using `reth-stateless` and `alloy-primitives` running inside `ziskemu`. * **Technical Win:** Successfully compiled complex Rust crates for `riscv64ima-zisk-zkvm-elf` target. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/B1ye_85Hee) ## Phase 2: Post-Quantum Consensus & OS Compatibility ### Week 4: Post-Quantum Consensus (Beam Chain) **Focus:** Introduction to Beam Chain consensus layer and how it works. * **Cryptography:** Implemented Winternitz One-Time Signature (WOTS) in Rust as a precursor to XMSS, this was done to better understand the Beam chain Cryptographic landscape. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/rk2qBFzIgl) ### Week 5: Linux ABI & Syscall Analysis **Focus:** Determining minimal OS requirements for running ETH clients in zkVMs. * **Analysis:** Compared `reth` (Rust) vs. `geth` (Go) syscall profiles using `strace`. * **Findings:** Rust relies on simple `brk`/`write`; Go requires complex `mmap`, `clone`, and `futex`. * **Strategy:** Defined a tiered ABI support strategy (Basic for Rust, Advanced for Go/Managed Runtimes). * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/rJrbfojUxl) ### Week 6: Bare-Metal Go on RISC-V **Focus:** Taming the Go runtime for constrained environments. * **Implementation:** Compiled Geth `t8n` tool for bare-metal RISC-V using the Tamago toolchain, removing Linux dependency. * **Optimization:** Constrained Go runtime (`GOMAXPROCS=1`, `GOGC=off`) to eliminate threading/signal syscalls. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/rJNsGB8Dee) ## Phase 3: Precompile Strategy & Benchmarking ### Week 7: zkVM Precompile Survey **Focus:** Categorizing hardware acceleration across the ecosystem. * **Survey:** Cataloged precompiles for RISC0, SP1, Airbender, Zisk, OpenVM, Ziren, and Pico. * **Insight:** Identified a spectrum from minimalist (RISC0) to rollup-centric/exhaustive (Ziren/Pico). * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/r1KxHax_ee) ### Weeks 8-9: Quantifying Precompile Impact (SP1) **Focus:** Benchmarking `bn256` pairings to settle the "Fat vs. Lean" precompile debate. * **Benchmarks:** Tested `substrate_bn`, `crypto-bigint`, and `arkworks` in SP1. * **Key Finding:** Specialized ("Fat") precompiles offered ~27x cycle reduction. However, highly optimized software (`arkworks`) *without* precompiles outperformed generic libraries *with* generic `bigint` precompiles. * **Conclusion:** Software optimization + Lean precompiles is more sustainable than exhaustive hardware intrinsic sets. * **Link:** [Week 8 Log](https://hackmd.io/@0xdeveloperuche/HkcbqYuOlg) | [Week 9 Log](https://hackmd.io/@0xdeveloperuche/r14DREfFge) ### Week 10: Research Finalization **Focus:** Synthesizing data into a formal report. * **Deliverable:** Submitted report "Fat vs. Lean Precompiles in zkVMs: Short-Term Speed or Long-Term Sustainability?" * **Thesis:** Advocated for "Lean" precompiles to avoid ecosystem fragmentation. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/rkF8xtiKel) ## Phase 4: Hybrid Ethereum (RISC-V Execution Layer) ### Week 11: Hybrid Architecture Design **Focus:** Experimenting with replacing the EVM with a RISC-V engine while maintaining backward compatibility. * **Design:** Proposed a system detecting contract types via Magic Numbers (EVM vs. RISC-V). * **Concept:** Designed a `mini-evm` interpreter to run as a RISC-V program to handle legacy bytecode. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/H1gNFzesgg) ### Week 12: Prototyping the Sandbox **Focus:** Initial implementation of the Hybrid VM. * **Dev:** Established RISC-V execution sandbox and bytecode detection logic. * **Interop:** Designed `syscall` interface for `SSTORE`/`SLOAD` to bridge RISC-V execution with RETH state. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/S138tfgigx) ### Week 13: RETH Integration & Tooling **Focus:** Coupling the engine with a real node. * **Implementation:** Finished `mini-evm-interpreter` and integrated it with a RETH node. * **Tooling:** Released `cargo-hybrid` CLI for scaffolding, compiling, and deploying RISC-V contracts. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/r1S2OfHixl) ### Weeks 14-15: Benchmarking Hybrid VM **Focus:** Performance testing EVM compatibility mode. * **Execution:** Benchmarked Hybrid Node (running `mini-evm`) against standard `revm`. * **Assets:** Integrated ERC20 standard contracts for realistic load testing. * **Documentation:** Integrated benchmark reports into the official project book. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/Bkm7rQd3xg) ### Weeks 16-17: RISC-V Mode Benchmarking & Release **Focus:** Testing native RISC-V performance and automation. * **Benchmarks:** Completed performance analysis for native RISC-V contract execution. * **DevOps:** Implemented manual release scripts and updated CI workflows. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/H1YgEBp6gg) ## Phase 5: Consensus Layer Integration (Prysm) ### Weeks 19-20: Optional Execution Proofs **Focus:** Integrating zkEVM proofs into Prysm (Consensus Client). * **Prototype:** Started work on "Stateless Attestors"—allowing CL nodes to verify execution payloads via proofs without a full EL. * **Architecture:** Implemented a "Proof Chain" structure to track proven blocks parallel to fork choice (avoiding direct fork choice modification for now). * **Status:** Prototype PR created to map architectural changes in Prysm, this is still incompelete and I intend to follow on with this after the EPF program. * **Link:** [Full Log](https://hackmd.io/@0xdeveloperuche/S1EkgLYg-l)