# ZK WASM Design Author: akashin Contributors: nagisa Created on: 11 August 2023 Status: WIP --- The design is still WIP, but for the [first milestone](https://hackmd.io/w4BM5m50TLONOzeNRSpeOw) we are trying the following approach: ### 1. Write a transpiler from WASM to ZK Assembly Based on [Wasm Parser](https://docs.rs/wasmparser/latest/wasmparser/) by implementing a new visitor that generates appropriate instructions in ZK Assembly. This would already allow us to produce ZK proofs about a subset of WASM programs. ### 2. Generate a WASM interpreter implemented in WASM We will take a simple WASM interpreter implementation, e.g. [Wasm3](https://github.com/wasm3/wasm3) or [Wasmi](https://github.com/paritytech/wasmi) that can be compiled to WASM and then transpile that WASM into ZK Assembly to get the universal WASM ROM that can prove the execution of any program. To do this we will need to support a big enough subset of WASM in the transpiler to tackle the WASM interpreter implementation. See https://github.com/near/nearcore/issues/9386#issuecomment-1679070284 for investigation into this.