New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

If Knowledge is Power, What is Zero Knowledge? An Intro to zkVMs with Eric

Ethereum DenverMon, Oct 9, 2023, 12:00 AM

In the past decade, we have seen the rise in popularity of zero-knowledge proof systems along with terminologies that are used to describe them such as STARK, SNARK, PLONK, etc. But what sorts of applications does zk tech actually enable? This talk aims to illuminate what is possible today through zkVM’s and what it means to write programs for them. The focus of this presentation is to describe the features of a zkVM and how developers can use it to build applications on blockchains and beyond!

Transcript

my name is Eric Canada and I'm an engineer at risk zero and I have a question for you today if knowledge is power what is zero knowledge well let's start with what is your knowledge proof is now like kind of like the Layman's explanation is that um zero knowledge proofs are problems that can be so that are typically involving multiple parties where uh one of the parties that wants us wants the problem solved uh gets the solution without knowing uh any more than necessary so for example uh this is called the two color ball and two two balls problem and the colorblind person now this one this problem is near and dear to my heart because I'm partially colorblind so anyway the problem the problem is that let's say that there are two different color balls and there's a person that cannot see colors very well and so the person is trying to determine if the balls are of the same color or the different colors so what happens is like a per person hands me the balls and I will put them behind my back and I will pretend to switch them or maybe not switch them and then ask the person who can see the colors if it is uh if I've switched them from the initial configuration so now I will do this repeatedly and record my results until I am convinced that either a the balls are of the same color or they are of different colors now notice that throughout this problem I am not getting the information about what color the balls are I'm only I'm trying to get the understanding that they are different or the same so that is a quick rundown of what is your knowledge proof is but why does it matter well fun fact is that it takes zero knowledge proofs to unlock verifiable Computing and in the past few years this has been a very very hot topic and so there has been a lot of things that have been said about what zero knowledge proofs can do what verifiable Computing can do and like the future kind of looks like this and people have said that it could accomplish many many things such as privacy security elections and governance identity management maybe even securing power plants nuclear disarmament and even like Anonymous ad auctions on your browser but when we a lot of times when we try to dive into this space the world kind of looks like this all right with all these terms such as Starks or finite Fields or plancks or polynomials well it sounds like math constraint polynomials um and fiatrimir heuristics or Frye or Montgomery form or deepali and I think you get the point this is uh this seems to be a very complicated space but what is verifiable computing well let's start with a program okay and we have a special virtual machine that we'll call the zkbm now the zkbm will take the program and their inputs and then runs the program and as a result it will generate a receipt the receipt can be then verified by an outside entity to make sure that the computation was done okay so now let's take a closer look at receipts the receipt has um three parts so it has the what we call at risk zero the image ID which is the Sha of the executable code you can think of it as like a unique identifier that represents all the code that is being run and two a proof that an executable code was run as well as the journal which is which we can think of as the result of the computation now the result of the computation is up to the program itself and so the seal indicates that the program that is indicated by the image ID was run correctly and produced this result in the journal now let's take a look closer look at the zero knowledge virtual machines like many virtual machines that are like um a lot of things such as like memory and whatnot but one of the major differences between a regular virtual machine and the zero knowledge virtual machine is that it has a circuit and this is where all of the complicated mathematical Concepts used to enable zero knowledge proofs lie in this system and in particular for risk zero this circuit represents it implements a risk five assembly emulator so risk five and as as um and I had some people um who weren't familiar but assembly is like the code that runs on the actual CPU now and a little bit of a clarification here the assembly emulator although it is software okay so now let's put this back into our picture now so we have the ZK VM and all the complicated math goes in here which means that the the programmers do not have to be encumbered or think about polynomials or finite fields or other ZK math unless they really want to and that sounds like a cool application now because the circuit enables or is interpreting risk 5 code it means that that the programmer can use programming languages with compilers that will translate from source code to risk 5 code so now let's take an example here um uh to that uses these Concepts so I was on a flight and this is an actual story I was on a flight with my partner and we were bored so we started playing an in-flight backgammon so it's like you know she was on one screen I was using another screen and there was an issue there's a bug in the random numbers generator useful they're dice rolls which meant that on each game I the amount the numbers that came up as dice rolls were the same so it's not it's not like so each game had like the same set sequence of numbers which was uh kind of like nice because I won like 10 games in a row and um shortly after and she was actually teaching me backgammon and so I loved backgammon uh um shortly after we got home we purchased the backgammon board and turns out that true Randomness uh makes the game more difficult so now um as as inconsequential as this may seem this is an example of us humans uh you know not trusting systems the reason why we stopped that after 10 games was because my partner knew she lost trust in that this in-flight video game was going to give us a fair game so how can we trust in-flight backgammon again using these Concepts well so we have some you know assuming that we have some sort of uh computer that is managing the games right we can have the um the server run these computational proofs with a receipt that contains some sort of information about what kind of random numbers are being generated now this also implies that we're replacing Trust on the zkvm itself which might not be good so there might be more creative ways such as the players themselves submitting their own random numbers and maybe like there can be some sort of game theoretic way to make interesting results so that the gameplay is more fair and as you know and because the receipt is submitted like each of the players um assuming that they're uh on different notes can verify the computation to say hey this is what this is a correct and desired outcome of the game another example that where we can apply this is on current like blockchains where one machine will wins the transaction and does the transaction blocks which means like they execute a lot of smart contract code what happens then is all the subsequent machines will start doing the same work over and over and over and over again but with this approach of uh verifiable computation what we can do is instead the machine can then submit a receipt that can't that that thing can be verified on all the other nodes so to wrap up let's go back to this question if your knowledge is power then what is general knowledge and in my in my view zero knowledge enables uh verifiable computing and in turn and and today we have zero knowledge virtual machines that are easy to use for any programmer without having to know a lot of zero knowledge mathematics and three um by using these Technologies we can build more secure and trustable uh environments so where are we now in the past we have been doing there have been a lot of mathematical research that has been done and this is of course ongoing at at all times and we have this future that is like ZK enabled future but we are here now with all these tools that enable us to write ZK apps so uh on and execute them on services such as bonsai so I I encourage all of you to check us out um and thank you for your time

Automatic transcript — names and jargon may be misspelled.