## EPF - Week 10 This week we were finally able to execute our hello world contract. While the transpilation still has many limitations, it was still nice to reach this milestone on time. Before starting on the next milestone, I want to spend some time thinking about the larger picture of how this PoC could be (after the next milestone) be used in a useful setting and how we could have support for a state tranistion function. ### [Milestone 1](https://github.com/eth-protocol-fellows/cohort-six/blob/master/projects/erigon_riscv_proof_sourcing.md#first-iteration-of-the-transpilation-module-weeks-5-10) completed So we merged in two PRs this week - [Adding more state opcodes](https://github.com/2xic/erigon-risc-v-executable-proof-sourcing/pull/4) which adds some opcodes which hadn't yet been implemented. - [Setup for proving hello world contract](https://github.com/2xic/erigon-risc-v-executable-proof-sourcing/pull/5) which implements the remaining logic for us to be able to create proofs and verify them. It also contains a tiny CLI to demonstrate this. With this merged, using the `prove` binary which can be built by running `make build` we are able to transpile and generate proof for provided bytecode and calldata (if we are able to transpile it). [Milestone 1](https://github.com/eth-protocol-fellows/cohort-six/blob/master/projects/erigon_riscv_proof_sourcing.md#first-iteration-of-the-transpilation-module-weeks-5-10) is in other words completed and on time! ### Resources Some other resources I found useful this week. - [Ethproofs Call #4 | enshrine RISC-V?](https://www.youtube.com/watch?v=rJiEV7jJFl4) - what was interesting here was the talk from RiscZero on why RISC-V for zkVMs. - [Revisit Native Rollups](https://taiko.mirror.xyz/Mr5Fl0epl7ooCr5199yVrmGXWUV-IdYBHHtAwLXrp58) - mostly as it was a good article with the overview of native rollups. - Some of the comments related to the `EXECUTE` opcode [1](https://ethresear.ch/t/native-rollups-superpowers-from-l1-execution/21517/12) [2](https://ethresear.ch/t/native-rollups-superpowers-from-l1-execution/21517/18) [3](https://ethresear.ch/t/native-rollups-superpowers-from-l1-execution/21517/20) - [Native Rollup Deposits by Passing L1 Context](https://hackmd.io/@peter-scroll/rJSKJAFnyx) Some of the native rollup research is the result of earlier discussion with mentor on what is a [sufficient proof ~two weeks ago](https://hackmd.io/@2xic/ry-9L-Fueg#Discussions-with-mentor). It's still a bit unclear to me how the state transition function would work for our project so I think I'll need to try to formalize it a bit more as this also affects how we transpile things. ### That is one large proof One thing I noticed after generating the proof from OpenVM is that the data needed for verification is much larger than I expected. Even simple proof like this ```bash ./bins/prove -b "00" -o stop_proof ``` Would give out ```bash > ls -lah | grep "stop_proof" -rw-r--r-- 1 parallels parallels 1.7M Aug 26 22:42 stop_proof.proof -rw-r--r-- 1 parallels parallels 178K Aug 26 22:42 stop_proof.vk ``` I was under the impression that the proof size would be less than a 1MB. ```bash ./bins/prove -b "60808060405260043610156011575f80fd5b5f3560e01c90816306661abd1460b157508063371303c01460935780636d4ce63c1460795763b3bcfa82146043575f80fd5b346075575f3660031901126075575f545f1981019081116061575f55005b634e487b7160e01b5f52601160045260245ffd5b5f80fd5b346075575f36600319011260755760205f54604051908152f35b346075575f3660031901126075575f54600181018091116061575f55005b346075575f3660031901126075576020905f548152f3fea2646970667358221220c209c45def074bedc382780b71a3b0929108d17fb8be45d6299265ce72ff682c64736f6c637829302e382e32392d646576656c6f702e323032342e31302e31332b636f6d6d69742e3538396638623165005a" -c 2e64cec1 -o counter_proof ``` Creating a trace for the Counter contract, creates a larger proof ```bash ls -lah | grep "counter_proof" -rw-r--r-- 1 parallels parallels 2.2M Aug 26 22:44 counter_proof.proof -rw-r--r-- 1 parallels parallels 178K Aug 26 22:44 counter_proof.vk ``` There is likely something wrong in my mental model arround zk proofs which I need to correct. I was under the impression that the proof size would be constant and also smaller than 1MB. ### Next week We are supposed to start on [milestone two](https://github.com/eth-protocol-fellows/cohort-six/blob/master/projects/erigon_riscv_proof_sourcing.md#stabilizing-the-transpilation-module-weeks-11-17) next week. I think before starting on that, I want to spend the week trying to formalize the state transition function a bit more as that is what I still feel a bit uncertain about. To make things more concrete, we should have a delivery of a spec of some sort which clearly explains it and how it might work in practice. We should also correct our mental model arround zk proof sizes as that seems to be somewhat [wrong](#That-is-one-large-proof).