# Advancing Towards ZK Fraud Proof - zkGo: Compiling L2 Geth into ZK-Compatible Wasm

- Channel: [EthPrague](https://streameth.org/ethprague)
- Date: 2024-06-02
- Duration: 27:06
- Watch: https://streameth.org/watch/665833db036a981493b0c0c2
- Download: https://vod-cdn.lp-playback.studio/raw/jxf4iblf6wlsyor6526t4tcmtmqa/catalyst-vod-com/hls/8e58yk9nd56e66cf/1080p0.mp4

## Description

Optimistic rollup suffers from the long settlement delay because of the multi-round interactive dispute game.  To accelerate the dispute game, ZK fault proof was recently proposed to challenge a malicious sequencer in a single transaction, significantly reducing gas costs and time compared to traditional fraud proofs.  To generate a ZK fault proof, the L2 Geth (a.k.a., op-program-client in Optimism)  needs to be emulated in an instruction set architecture (ISA), and then the execution result of the L2 Geth is proven by a zkVM. We choose WebAssembly (Wasm) - a widely adopted open-standard ISA and prove the execution of Wasm code using zkWasm, the state-of-the-art zkVM for Wasm developed by Delphinus Lab.  However, there are two main challenges in this path: 1, We cannot directly compile L2 Geth to Wasm with Go due to compilation errors.  To solve this problem, inspired by Arbitrum, we make minimum modifications to op-program-client to support Wasm compilation.  2, The compiled Wasm code by Go includes unclean exit code, floating-point instructions, and calls on ill-compatible host functions, which are unfriendly to ZK with high adaption cost.  To address this issue, we introduced zkGo - a customized Go compiler to produce Wasm code compatible with ZK prover.  As a result of these modifications, the execution of the compiled L2 Geth Wasm code can now be proven using zkWasm.
