# EPF - Week 4
This week I wanted to complete the [quick checklist](https://hackmd.io/@2xic/ByHVramrxl#Proposal-writeup-checklist) that I created last week to get a good (medium level) overview over how to approach the project. This got mostly done and I'm now needing to complete the project proposal as it needs to be done before the end of week five.
## Writeup checklist
In the previous week, I wrote up a [quick checklist](https://hackmd.io/@2xic/ByHVramrxl#Proposal-writeup-checklist) over things I wanted to have done before publishing the final proposal. These checkboxes have now all been completed (minus completing the project proposal).
### Basic toolchain for verifying generic RISC-V programs
For now, I think OpenVM seems like the easiest to work with to get a basic toolchain working. They have been quick to respond on issues and their framework makes it easy to integrate with.
The high level code will then be something like this
```rust
use openvm::io::read;
use std::arch::global_asm;
#[unsafe(no_mangle)]
extern "C" fn read_u64_func() -> u64 {
read::<u64>()
}
// This can live in a separate file.
global_asm!(
".global transpiled_risc_code",
"transpiled_risc_code:"
// Example host call
" call read_u64_func",
// ... transpiled code.
);
unsafe extern "C" {
fn transpiled_risc_code();
}
fn main() {
unsafe {
transpiled_risc_code();
}
}
```
Where `global_asm` will contain all the code needed for the transpiled execution. This will work with the existing OpenVM stack and allows proof generation to be done from generic risc-v code.
The quick start project written in this way can be seen [here](https://gist.github.com/2xic/82ff5065eff396f063c60bb4a281034b) as can be seen, we still also have access to the OpenVM host calls when doing this.
### Basic integration point with Erigon
One of the mentioned places where it could be good to add the transpilation module would be part of a custom tracer. I investigated this and looked at the existing [OpcodeTracer](https://github.com/erigontech/erigon/blob/v3.0.14/cmd/state/commands/opcode_tracer.go). I have a modified implementation of this working locally which allows me to trace custom bytecode against a mock state db. This can be seen [here](https://gist.github.com/2xic/1bcccc8cf74419ae0c837fce03285625).
### The way forward
Now that we have a way to execute raw RISC-V which can be proved using OpenVM and a way to introspect provided EVM bytecode, the missing piece is writing the bridge between them which is the transpilation module. The current setup we have now is actually quite a good starting point as it more or less has what we need to get a feedback loop going :D
### Project proposal
I'm almost done writing my project proposal. Mainly the roadmap section is missing and some thinking about the challenges that I might run into needs to be written before it's submitted.
## Next week
I need to complete the project proposal and then also try to get some feedback from my mentor on it. After that is done, it's all about execution.