Alternative to RISC-V Based zkVM: AI Based Transpiler W/ Fuzz Diff Testing | Clement Walter -Kakarot
Ethereum Denver·Thu, Oct 9, 2025, 12:00 AM
RISC-V based zkVM, though not perfectly suited for proving, are receiving a lot of attention thanks to their underlying promise "prove everything" meaning "prove all your existing codebases". take another approach by transpiling existing codebase into Cairo, a zk-native language. Doing so, we benefit from both existing codebase and zk-optimized ISA. 🚀 Get Ready for ETHDenver 2025! 🚀 We're already hard at work preparing for next year's biggest Web3 event! Keep your eyes peeled for more info on ETHDenver 2025—it’s going to be epic! 🌟
Transcript
all right hello everyone thank you for joining us for our next talk it's called an alternative to risk 5based zkm AI based transpiler with fuzz diff testing a lot of words there we're going to get it all broken down for us please welcome to the stage Elias tazartes co-founder of Kakarot hey guys can you hear me okay good so my name is alas I'm one of the co-founders of kaka funny story a Clon my co-founder was supposed to be here today and he just had a newborn so congrats Clon so I'll be doing the talk we're both engineers and this is um kind of the newest framework or Dev framework we've been building in the last two months surprisingly cuz AI moves so fast um so I'm going to just Define quickly why you would want to have ZK just to get us on a plane level and then investigate how you go from just any software to provable software so why you would want uh ZK especially in uh verifiable Computing mainly for cheaper verifiability so blockchains as you know are verifiable compute engines and the I would argue that the most important thing that defines them or like characterizes them is the ability to for anyone to come in be become a participant of the network and convince themselves with sovereignty that the protocol is operating with Integrity so this is what we call verifiability and ZK provides us with a new way to have verifiability that is cheaper than the formal way which was re-execution is broader because it requires less compute and it gives you good interrupt because ZK allows you kind of to to mix and match many data sources whether it is your passport uh onchain data offchain data so that's why you build provable software to have verifiable compute and have more eyes or like I would say sovereignty on the results that you expect from digital economies and today we're going to talk about how to transpile code from a normal code base whether it is in Python rust go to a state where it is provable and remind I would like to remind everyone that the I think one of our core values but I think a value that lots of people share is that you don't want to write code so the less code you write the better you are off and I think this is what leads most of the changes in the space for the last year so imagine you have a software uh and let's take the evm because this is one software that we're very familiar about uh with at kakalot it is the execution engine of the eum protocol so it is written in many languages it's a it's a piece of software it's written in goang it's written in Rust it's written many by many people in different ways and you want it to become provable what it means to be provable is that any execution any run that you do with this virtual machine needs to be able to generate a ZK proof a Zer knowledge proof which is essentially a certificate of Integrity that your software run was done correctly or obeying some constraints so you can do it two ways is you can write circuits which is this mathematical kind of Applied computer science construct that allows you to Define constraints it's very low level it's Ain to assembly and no one I would not encourage teams to write it because it is very time consuming and uh resource consuming the other way to do it is just just you just take the code base that you have today which you have already written uh in R go Etc and you compile it down to uh to ZK so to a instruction set that is provable and this is what we call risk 5 based zkm and there are others but this is the main kind of the main Paradigm that occupies occupies sorry people's U mind share so this is how we kind of see it is uh right circuits it takes time most teams that have been writing circuits in the last years are either very Specialized or switching to ZK VMS and so it's too long to write ciruits too hard to audit too Ted to maintain and it's for the f there are few teams that are doing it but most people are using ZK VMS so you choose an instruction set uh risk 5 wasm mips who here has already heard about risk 5 that's so many people and so risk 5 has gone lot has gained a lot of Mind share in 2024 mainly because it's performant enough and it's so fast to go to market with it because you have a code base and you just make it provable in less than a week so you just this is just what you want when you're a team you want fast go to market cheaper audits because less code and maintainability so as Mo as much as blockchain space changes you need to adapt uh ethereum we started the analogy of etherum taking it as an example etherum hard Forks or upgrades its protocol once every six months to a year when you write circuits it's very hard to keep up so R 5 won a lot of Mind share many languages can compile to R 5 you have a stable two chain finally and you have good enough performance so is there any other way or is this the end like is this the end state is this the kind of space has matured enough so that it doesn't need to change anymore and to some extent circuits are no longer I think the choice for teams that want to do cryptography ZK VMS are but there are many ways to go about ZK VMS and this is what we're going to explore in the remaining 14 minutes so what's a zkm I think if you really go down to the essence a ZK VM is simply a VM so some kind of computer for which execution can be proven and this is very powerful when you think about it so far what we were able to do was maybe prove theorems with form of verification but we have never been able to link a codebase with a result so you've never been able to link to be able to say this result that I've had had uh that this algorith algorithm sorry fed me is the correct execution of this algorithm today you have to either trust who is giving you the results so whether it is an AI system or any kind of blockchain when you connect to RPC you trust that they're giving you the right result or reexecute and this is what nodes in the Bitcoin protocol or etherum protocol do they just don't trust they verify and the way they verify is that they reexecute every single transaction in a block and that's very costly so a VM that can be proven and that a VM is simply just an instruction set so it doesn't it doesn't mean just five or wasm it means any instruction set that can run to in complete like any type of app so that's that includes kro valida maid so maybe just to show and who here has heard of CYO in the past yeah half of people so just prove an instruction set so what's the trade-off what instruction set gives you the best performance but is easiest to M to master so if you have a product how fast can you make it provable um and still be performant is it one day with RIS 5 is it one week with Cairo or is it one year with circuits and we call ZK native an instruction said that is made to be proven so risk five was made to be broad was made to be um very simple to compile from Ross to RIS 5 but it was not made to be proven it is is a very fortunate good um convergence point that is easy enough to prove so what if we could transpile a code base like a Ross code base a Goan code base to K assembly really fast like what if we could bridge this Gap the whole Spectrum being one year to write ciruits but then one day to compile to risk five and that's kind of what we're trying to do with Gen because it gen is evolving so fast that you will find that it's surprisingly a surprisingly good second best option for compiler work and what do I mean by this I mean that as long as your code base is spec driven that someone wrote a yellow paper for it or even like a specification that is a blueprint in code you are able to use gen extremely easily to kind of adapt this this this blueprint in any language that you want why because you can test it on the specification so you have this kind of like source of truth that will tell you you have implemented correctly this blueprint and I think this is this is what unlocks the potential of constraining gen so that it doesn't hallucinate but still leveraging the speed at which cursor allows you to replicate uh specification into an implementation so that's the new Choice kind of that we're exploring at Kakarot because we're Koo experts so as I said car is a z KVM that's optimized for performance not yet privacy mostly and unly performance so how does it go you just choose a ZK native instruction set for us it's Caro then you pick a spec driven mature code base so The Ether virtual machine is mature because it's been implemented in eight languages and it has a yellow paper which has tests edited by The Ether foundation and you have more than 200,000 tests which means that whatever you do as long as you pass those tests you can call yourself a evm so so that's it and and the Crocs of what we're doing trying to do at least to speed up our development is to use AI to transpire existing work into a ZK DSL and the way you get security is that you diff test every single entry point against the specification with fuzzing but as you know and I guess who here has used AI like a AI co-pilot in the last week who here is uses GPT cursor okay well I'm I use cursor as well and I think it boosted the team's productivity like we're 10 engineers in Paris I think it 10x our productivity but we did we do sometimes spend a couple of hours just trying to fix some hallucination and I think you do not you cannot trust gen to produce production code so what's the what's the what's the catch how can you make it pro ready something that was generated very fast by AI first of all and as I mentioned you you always refer to the specification second of all you need differential testing what it means is that you take a block let's take a block from etheral one you run it on the specification implementation whether it is a it's called el it's a python implementation or a g which is the goang implementation of the etherum protocol execution layer and you run it and then you run it with yours and as long as you fail the test you start over or like you you you do you you better it and that sounds awfully like reinforcement learning or um something that AI craves it is a source of Truth something that someone knows it's true and as many tries as you want to make it work F testing is a nice addition to just ensure completeness of tests like for uniti functions so I think we can go into our lessons learned so our lessons is that we set out in end of December to rewrite from scratch the entire evm specification in Cairo with Gen and with a very very small team of like two people so we call it ZK native because we are using a VM that is made for proving and that has no other use case that than performant star generation at least for now we'll see how it evolves and we we Ed as a source of Truth the Els which is the one-year-old etherum Foundation repository that gives you anyone the source of Truth on what ether is in terms of code code Behavior so so what did we learn actually we using F testing and it's very good tool for those who don't know it's called hypothesis in Python I know not many people use Python anymore but in the geni uh sphere lots of people still use it and it's perfect for unitary functions so you're able to take one function from the spec uh not uh actually not State transition but let's take I don't know uh operation ad operation multip multiply and you are able to F test the entire um code production from AI in a very seamless way you don't even have to write code uh for tests you just write two lines of code that say assert my function does the same thing as this spec function and then you say you specify the type that you want it to behave on so you say for a unsigned integer of up to 256 bits which is the word size in the THM try any number of values like 15,000 values on the whole spectrum of values use that are within two to the^ of 256 and test it and then we realized that this doesn't really work for um specific functions that are extremely precise so you cannot fuz State transition you cannot fuzz header validation because it's too precise in terms of inputs and outputs that I expect so for this you need to rather use the specification what we also noticed is that you must produce human readable code why because this is not purely transpilation or at least it's not compilation it is translation of languages that is 10x the speed via AI so what you're looking to do is do it once and then start maintaining the the repo you have obtained via this transformation of that takes approximately one week to one month and so what nice is that you start from a high level code base that can be proven with some performance you translate to a extremely performance proving language and then you just go with it you keep that you maintain it as time goes and you notice that one it's maintainable and second it's more performant so I would say that lessons lears this approach is extremely extremely good for when you have to prove infra and what I mean by that is infra is usually code that is spec driven and that changes once every few months but not once every few days so the main thing that we learned is this is we'll see with time but this is not yet a applicable to apps uh which might need to be proven for some reasons but this is more applicable to blockchain infra so VMS uh execution layers consensus layers Bridge proofs proof breast interrupt and the last thing we learned is that when we started it was Clow 3.5 today is 3.7 and um the speed at which things in U Get Better is is actually scary and the the sizes of the context allow you to kind of feed the entire specification to Ai and makes your job way easier so we're going towards commoditization of code writing I think this is how we see it no one wants to write code so people compile to risk five and AI is getting so good that no one wants to write code and ask AI to write it you cannot trust AI to write good code so you check the specification that was written long time ago that AI is behaving correctly and there you go you have this kind of way to write entire specification for blockchain in two months in a provable way oops sorry and this is what allowing us at least Kaka to prove ethereum in real time because KO is performant but on um in a very novel way because we are producing code that has never been written before and that is completely like Z native but also I would almost say Sovereign in the sense that we are not reusing existing code bases as is we're producing a new code base and I think we'll see that this is extremely powerful for security because we're we're not as ecosystem not putting our eggs into the same basket we're not creating systemic risk of always using the same compile compiler like flow and and you will maybe see it later coming up in the next months the this idea of multi prooof and also a redundancy for clients so we have a bit more time but this was not the the the the Croc of the talk so I will leave it at that yeah I'm available for questions and and that's it that's our social and um I thank you for attention can we take questions or it's not even cuz it's not so practical at any rate I think it's not so adapted
Automatic transcript — names and jargon may be misspelled.