[BUIDL Asia 2023 Builder Stage] Power of ZK beyond zkEVMs by Manasi Vora, VP, Risczero
Kryptoplanet Talks · 3 Jul 2023 · 30:15
Manasi Vora, VP at RISC Zero, looks at what zero-knowledge proofs can do beyond zkEVMs. The talk, on the Builder Stage at BUIDL Asia 2023 in Seoul, draws on RISC Zero's general-purpose zero-knowledge virtual machine to discuss verifiable computation outside Ethereum-style execution.
Speakers
Topics
From Kryptoplanet Talks, hosted by Kryptoplanet.
Transcript
thank you Erica for having me super excited to be her um this is my first time in Seoul so loved the city so far how's everyone's day so far okay okay let's get some energy in the room yeah um so my talk today is titled power of Decay Beyond dkvms and so my assumption is I think most people are familiar with zkevms but let's talk about other approaches to leveraging this you know powerful technology that is ZK and so I'll shed some light on these other approaches what are some benefits and use cases of these approaches but before that
um a little bit about myself my name is Mansi bura I'm a VP of product growth at this company called risk zero where we are building this general purpose zero knowledge virtual machine which I'll talk about in a bit um I just joined the team four months ago so relatively new to ZK but I've been in the crypto space since 2017. I've done a lot of you know of a lot of different things but previously was building a decentralized data storage protocol at science kind of maybe some of you are familiar with it so with that um with 70 zero knowledge proves how many I know Anthony asked this question but how many of you are familiar with
the concept of zkbs quite a few good okay um I think I'll do a quick demo to demonstrate you know just this like core concept it's super simple I need one volunteer if anyone wants to Step Up try now if no one's stepping up um yeah I like him down so what I'm gonna do is I'm gonna prove to all of you but specifically to Prana um that I know this is my phone and then I know the passcode of this phone without revealing the passcode that's one way to tell you just by telling you the password but without revealing the passcode I'm gonna prove that this is my
phone so Bruno um just put a message in here don't show it to me and then lock the phone thank you for being a volunteer okay so if I didn't know the password I wouldn't know the message but because I know the password I love this message hi Mom is that correct okay and humidified it so you know thank you Bruno um but this is essentially a very simple example uh where I proved something to you uh a statement that's true without revealing any additional underlying information and so that's what dkbs are zkbs are these cryptographic proofs to
prove something and there are two key functionalities that zkbs enable one is privacy which you know Anthony talked about and in this context I preserve the privacy of my phone I did not reveal the password and the other other functionality that zkp is enable is verifiable computation and this is what I'm going to focus a lot on Anthony already covered a lot of the Privacy applications so makes my job easier so what is verifiable computation verifiable computation is essentially um your ability to verify a certain competition was done correctly
without having to rerun it so again you know in this example I was um the prover turned out is the verifier and say now Prana wants to offload certain piece of computation he doesn't have the hardware or doesn't have the time and he's like man say hey can you run this uh code for me um and give me the outputs it's like sure I can run this piece of code and give the outputs of that code to pranav now try numbers two options he just has to trust me blindly that I ran that code correctly did not have any malicious intent and gave the output so he's either trusting me blindly or he has to rerun that competition on his own and check the outputs and match
the outputs results which seems wasteful right why would you rerun the entire competition um so that's where zkbs come into picture where when I'm running this piece of code I can also generate a zero knowledge proof that I ran that piece of code accurately and then the only thing I have to give front of is the zero knowledge proof and the outputs and now pranav doesn't have to trust me he can verify this zkp and use the outputs if the zkp is valid so there's a functionality for zkp which is essentially verifying the zero knowledge proof is significantly less worth than having to do the competition get and so
that's kind of what verifiable computation enables is this offloading of competition in a trustless manner any questions so far okay I think everyone's kind of on the same page great um and so extending that verifiable computation functionality that brings us to scaling in the ethereum context so right now what happens you know assume that's it layer one all the transactions all the competition that happens on ethereum is essentially run by all nodes again and again each road is running the entire chain uh verifying every single transaction and
doing a lot of extra work at the moment and also causing like just scalability bottleneck and so as we you know determined earlier that's kind of wasteful and what you can do is you can leverage or offload that competition on sale so ZK Roll-Ups essentially bundle these like transactions that are happening on chain and they will take it off chain do the execution and submit a validity proof that the execution was done correctly so you can offload all of this like heavy computation you don't have to worry about it you don't have to do it on chain and you can transfer that off cheat but you still know that it was done correctly and you don't have to
brainly trust um the competition and so essentially ZK VMS or ZK Roll-Ups but in the evm compatibility context any questions yeah validity proof is essentially um a ZK proof that proves the entire transaction was done correctly from the initial state to the final state okay you're all VK experts now let's go all right so this is kind of the Crux of my talk ZK is a very powerful technology that we can leverage in various kinds of
decentralized applications from privacy preserving one to just complex computationally heavy applications and ZK VMS is definitely one way of doing that but there are so many other approaches to leveraging this technology and VK VMS are specifically optimizing for evm compatibility whereas these other approaches are building the technology with ZK first design in mind and that enables them to harness its full power of ZK and so that's super exciting let's look at some of these approaches I mean you're already familiar with Elio because with Anthony but let's start
with the first approach this approach is you know go hardcore you can design and write ZK circuits on your own which is definitely doable as you're building your application you will Design these like arithmetic circuits and Leverage The zkp generated through these circuits in your application it's also incredibly hard you need to understand the ZK cryptography you need to understand the math behind it it just takes a lot of time and effort if you're building a simple application the other approach is using or building on a ZK enabled L1 so now there are l1s in the market that are built with CK
first mentality and you can build your applications using those l1's and you will get all the benefits of using CK in that manner I think the kind of trade-off is these are the ones as we know are really hard to bootstrap you have to create an entire new ecosystem around that they also have new languages that developers have to get comfortable with this is where zkvm or zero knowledge virtual machines come into play and when I say zkvm I mean general purpose so when we talk about zkevm you drop the e zkvm is you know again like I said evm compatible specifically
designed to run smart contracts or things that can be run in an ebm context versus zkvm is a virtual machine that allows you to run software that can be run on your computer any software that can be run on this laptop on your phone you can run that software in the zkvn and generate a zero knowledge proof and so it just broadens the application space and uses um zkp for very general purpose use cases even in this like zkvm context there are two approaches when Cairo was darknet maybe people are familiar with it um the first approach is again you know
creating a new language a custom language that's you know domain specific language that's what dsls are and those are created to leverage you know that particular zkvm it's like specific to it which is great because you're using a very specific language that can harness the power of ZK but again like I mentioned whenever there's a new language created one there's a little bit of barrier to entry does have to learn that language not only that you have to build all the tooling and the libraries and you know all of the pieces for that language from the ground up and that's a difficult job to do it it can be done but it takes a lot of resources and so that brings us to this other
approach of the KVM which is what risk zero the company I've worked for is taking and that's targeting existing languages the architecture that we've taken here is essentially enables us to Target languages like rust C plus plus go you know traditional languages that devs are familiar with that have existed for years you could Leverage The cargos and libraries written in this language to build your applications and you can still use the power of the game so in this context you're focused on building as a developer you're building your you know you're solving a problem for the end user you're focused on building your application you don't really have to worry too much about the
underlying ZK and still plug and play CK into your application I want to give an example of how this works are people familiar with overcooked no oh my God okay it's my all-time favorite Co-op game check it out if you haven't played it's on PS4 it's on Xbox all I think switch as well I've heard more people would know overcooked seven anyway now you'll know so this is my favorite game um in the web 2 world and if you're not familiar essentially you are a chef in this game and you have so many different responsibilities and
your goal is to you know cook meals and serve customers and in that process you have to cut vegetables you have to cook meat you have to assemble all the order you have to wash dishes you have to deliver product you have to coordinate with your friends a lot of fun but also a lot of different work and if you know if you are better than me you wouldn't reach the stage but in most cases sometimes you end up burning your kitchen because there's like compute overload you're like doing so many things it's exhausting so going back I think you can think of um say in this like overcooked example the chef has
evm or the chef is like this person who has a lot of responsibility has a lot of tasks and your maybe a friend who is joining you in the overcooked game as a sous chef and Sous chefs are really good at Specialized things they'll do this one thing but they will do it really well and so say a sous chef is really good at cutting vegetables and so what you can do is offload that responsibility to the sous chef you don't have to worry about it and you can focus on your freed up to do other things and so when you think about ZK VMS the general purpose dkvms that I'm talking about you can think of them as similarly the sous chef in this context or cool
processor and so you know the evm is your central processing unit you are using it to to look smart contracts your security your consensus and then you can Leverage The zkvm as a co-processor to do really heavy computationally heavy things that is prohibitively expensive because of gas costs aren't you and that's kind of the example here with the co-processor all right hopefully everyone is excited about zkvms now but I'm sure everyone's like okay how does this actually work okay let's get into the details um I'm gonna showcase the example of zkvm with this
product that we are launching called bonsai Bonsai leverages the risk 5 zkvm that we've built and it's essentially enabling developers to build general purpose truly general purpose applications using ZK compute both on chain and off chain so that the option point I'm I won't talk a lot about that but that's equally important because excuse me because the use cases of ZK are not just in crypto there's so many web 2 applications that can leverage DK technology and that is also Bonsai that is also something Bonsai can enable but let's get into the fun part
so in this example blockchain let's assume this is your eat L1 and Bonsai is this like co-processors we gave yet and so on your etel one you'll you know in the same manner you'll write your smart contract you will create your application and deploy it and from that smart contract what you'll do is any heavy computation that's like really not you know optimizable from a gas standpoint you'll ask Bonsai this is kind of the Bonsai proxy or relay contract you'll ping it and you'll ask it can you hey I don't want to run this competition I'll give it to you can you run it in aziki context and bring it back to me so that's what the Ping is
happening this is all on chain The second contract is also a smart contract entry now this contract essentially sends it to the Bonsai kind of proving Marketplace where the proof is added to a request pool I won't go too much into the details around the marketplace but essentially in the background what's happening is there's a lot of Brewers who are bidding for your request and these Brewers will you know one of them will pick your requests run it in the zkvm and the prover is doing all the infrastructure that's needed all the coding that's needed to run the ZK VM and taking all of that work from you
and it'll run this program and then generate what we call receipt which is essentially what I explained as proofs so physique VM receipt is generated this is all happening in the Bonsai context and once the receipt is generated of course we can you know deploy that receipt or send that receipt back on chain as this if you want but usually again you don't want to post every single request every single proof on chain because that's again going to bloat up the chain so this concept of recursion is super powerful in crypto and again don't have too much time to go into it but essentially you can combine a lot of different proofs across your application across other applications
into a single proof single root proof that then can be again using this like relay Bridge contract submitting it back on chain and so what this bridge contract does is also handles the verification part which is what pranav did in this case um it'll verify the proof that was submitted by the Bonsai Network for you and you'll do the verification you'll make sure yeah this looks correct the computation was run correctly and then send the final output which is what you need essentially you need the execution to run and then you need the final output um send that back to your contract and that's kind of how you can think of
those bonsais EK VM as a coprocessor expanding the capability of on-chain contracts okay if you're interested in learning more about Bonsai I definitely recommend taking QR code love it when all phones go up I love to see that um okay let's move on so what are some benefits of this you know like I said using ZK you can use
Zeke in so many different approaches EK VMS EK VMS as an L1 what are some benefits that you get just by using it as a general purpose zero knowledge virtual machine first of all we already spoke a lot about offloading compute this is when you know the computation on chain can be very expensive we all know gas cost is like super expensive with the theorem you can only do minimal competition on chain and so you want to build really complex real world applications what you can do is offload the computation and this provides scalability on your base layer um which can be ethereum or any any the second thing it enables is
smart contract complexity which is again like I mentioned with ethereum um and evm generally and solidity in particular there are just certain constraints in the way it was built it was built very optimized for evm uh specific transactions and so the ability for your smart contract to do like real world applications really complex applications is limited by this constraint and so if you use the zkvm as a co-processor you're not constrained anymore because now you're writing program in trust C plus plus go these languages that are general purpose and you can express a lot more in that format and still leverage all of that accessibility in these languages with an
on-chained contract I think this is a big benefit leveraging existing languages it's a benefit both for web 3 devs but also web 2 devs who are not familiar with solidity who have to learn all of that language they don't need to learn all of that they can you know use their knowledge and rest C plus plus go and use the tooling and libraries that exist so you know if I give an example if you're building a on-chain game in a lot of cases you have to build the tools build the libraries build the different pieces of an on-chain game as well as build the game itself if you're using an existing language the benefits are there's so many open source libraries out there you can just
plug and play you can leverage like call this particular library and then build your application um in a very like limited like low time to development manner which is like you can build it faster than in other application environments and I think one other thing I want to point out is you know languages like rust have been around for many years and they've been battle tested they have done security research and reviews of these languages and so compared to any new language that will get created these languages that have existed are going to have a lot more security guarantees in place and so I think we've seen some hacks in the
crypto space and you know hopefully that'll change over a period of time but leveraging existing languages definitely bridges that Gap finally I think this is more specific to bonsais benefits where you're writing this like you know off-chain logic it's in a chain agnostic manner so for example you are building an application that you know needs to work on ethereum and solar now in the current environment you'll write you know a Solana code and an ethereum cohort and then have you know figure out a way for those to communicate where's this here you're putting very minimal like a small smart contract on each chain and most of your code that's you
that you're writing is written in this like common language rust for example and so that code that you've written can be deployed everywhere you don't have to rewrite that code for each chain if you're building a multi-chain application and then finally the multi-chin support piece is also important like I said let me go back to this uh this proof that gets generated enrolled on can of course go back to the chain that you requested it from but the proof can also be submitted anywhere really doesn't matter it can be submitted on other chains it can be just you know you can have a web 2 API call for those proofs and you can access that proof from any
um environment so essentially the multi-chain support comes out of the box okay let's talk a little bit about use cases like let's make this real like what is being built in this like ZK VM context like how are people using it today so these examples that I'm going to give their actual um applications that devs have built on the zqvm as of now the first category again I'm gonna continue hammering the fact that you can use it for opt-in compute let's talk about a club are people familiar with the cloth no okay Club is just essentially a
central limit order book which is you know the way how traditional exchanges you know there's a there's a buy order there's a sell order there's an order book which you know there's a matching algorithm that does matching and that's how trades have it right now it's extremely computationally expensive to do a matching algorithm on chain like I don't even know how many thousands of dollars you would have to spend just for matching one um ticket and so what you can do is push your matching logarithm of chain and on Bonsai keep you know your just like basic um basic kind of smart contract function Leon chain where you accept these orders
Bing Bonsai asked to run the matching algorithm it'll do the matching and submit kind of the match trades that can be settled back on J so it's essentially expanding what D5 can do um right now we have a lot of the Fabrications but they're not really representative of chat 5 D5 applications they're not as complex you don't have all the functionalities like you can't run black shows option pricing model aren't you because it's just not computationally feasible and so expanding the capability with this opt-in computer is super um interesting um use case I think it's the same with gaming again your gaming logic put that
on chain good luck your gaming engine putting that on chain is going to be really high and so what you can do is essentially again offload all of that compute and create really like right now the games that exist in crypto are very primitive and so I think with this you can really start building games that exist in the web 2 space um something equivalent um I think this is the thought I'm not going to talk as much about privacy applications but there's this like hidden secret component which also enables a lot of use cases um the first one is a ZK proof of exploit so this is a way for white hackers to coordinate
um vulnerabilities in applications with the teams so either you can just tell the team that hey I found a hack they believe you or they don't and it's a long process for you to just go back and forth instead what you can do is find this vulnerability and create a zero knowledge proof of the vulnerability that shows that something is wrong with the you know smart contract or whatever application you are trying to find a vulnerability or hackeron and submit that proof and when you do that the team can actually verify that there is actually something wrong with the application without getting to know what the exact exploit is and so they are still incentivized to work with you and learn okay yes we agree that there's
something wrong let's work with you let's work with you um and you know we'll pay you let us know what the exploited so that's kind of the hidden secret or like hiding a piece of information but also still being able to prove um that a statement is true the other application the same kind of you know context is proof of assets a lot of centralized exchanges um don't reveal how many assets they are actually holding they um you know or they have these like audit firms who ordered their balance sheet and we have to trust that that's all done correctly in the ZK context they can send you a proof that they're actually holding
those assets without revealing any of their Wallet information which has like privacy implications this is another use case that I'm super excited about this is kind of merging the world of optimistic roller and Zeke roller so in the optimistic role of Bowl um the way it works is you just assume that these transactions that you're pushing off to in are done correctly and then there's a seven day withdrawal period which is where you do these like fraud dispute mechanisms and if a fraud is detector you would essentially rerun the entire competition the transaction on Jane to make sure okay was the fraud correct not correct and based on that that's how optimistic
rollups were now if you use ZK in an optimistic manner so you're still doing all of the transactions in an Optus optimistic manner but if there's a fraud that gets detected you use DK proofs and that just reduces the window from like seven days to a couple hours and you can withdraw your assets much faster um than what what's possible right now with Optimus grow-ups and I'm really excited because I don't know if you've seen optimism is actually put out in RFP to build a ZK fraud proof in their optimistic role and of course the last use case is you can build ZK Roll-Ups using the zkvm so
you can build a ZK evm using the zkvm because it's a general purpose um technology you can actually use them whichever application chain uh whichever blockchain you want to leverage you can build a roll up for that chain you can also deploy your application as a roller which is you know a really New Concept but it's fascinating that you can actually deploy your entire application just as a roll-off and then connect it to any chain okay lastly conclusion um I think the potential for ZK is really massive there's a lot these examples use cases are just scratching the surface of what's possible with ZK
it all started especially like in the crypto context with the kvms but zkvms are up and coming um and there's just a design space of leveraging ZK is multifaceted each of cross approach has its own trade-offs but there's a lot of potential to make ZK Tech accessible to a point where you don't have to think about what your cryptography is and you can still leverage the technology in your application and so specifically with reservo we are targeting existing languages and enabling this like new wave of decentralized applications and one thing I'll leave you with is if you're not paying attention to ZK you should this is definitely I think I believe it's the future
thank you