Aleph ZK Week - Intro and current state of ZK
Aleph Crecimiento 2024 · 10 Oct 2024 · 28:30
Diego Kingston, co-founder of Aligned Layer, introduces zero-knowledge technology and why it matters for scaling blockchains. The talk shows how short proofs let a network verify heavy computation without re-executing it, compares SNARKs with hash-based STARKs, and explains how zkVMs make provable applications easier to write. It then turns to the main obstacle to wider adoption, the high cost of verifying proofs onchain, and how Aligned aims to bring it down. Part of ZK Week at Aleph, Crecimiento's pop-up city.
Speakers
Topics
From Aleph Crecimiento 2024, hosted by Edge City.
Transcript
[Music] hi hello happy to be here it's the first time I think I will be speaking about CK in my home country uh but uh I wanted to share with you some thoughts on this uh game changing technology okay so a little bit of my presentation I will mostly have like some open questions and some titles and I'll try to tell you more or less a story but the road map of my presentation is of course starting with what is ZK and why is it useful then I am going to talk about two key
words that frequently appear when talking about CK technology which are snarks and Starks we'll learn what they mean and why they are useful and then I am going to focus on uh hash based proof systems which are what we call also Starks okay because they offer some performance advantages and things like that uh then I am going to talk a little bit about the development of ckvm and how that improves the development of provable applications and then some recent uh improvements developments that have been happening that we will believe will
accelerate uh the adoption of CK Technologies and then I am going to uh point at some challenges that we face for Mass adoption of CK and some of the uh Solutions we are proposing and finally we can do some summary and of course uh some final questions or whatever you have so what is CK and why is it useful first I am going to do a disclaimer I'm going to speak about CK in a broader sense okay CK in fact has a more restrictive um definition that goes back to its Origins but um over time it grew to Encompass other Technologies and so I
am going to work on this uh broader definition and why is it useful okay so instead of first giving you the definition I am going to tell you a problem and how we can solve it so when you want to coordinate between different computers and you want to make sure that something happened how can you be sure for example that if party a did something then they did it right of course there is one trivial way in which we can be sure which is re execution okay what I can do is you say you run this code with this inputs and and you
got an answer and so I run the same I get the same result I check and then I convince myself about the result of course the problem with that is that I have to do the same effort you did okay and that's precisely how blockchains work blockchains are verifiable computers and we get the ver verifiability by re-executing okay but the problem we get is that the weaker device es in the network act as bottlenecks why because they don't have the same capacity to process and so they cannot reexecute as fast as the rest so it gets bottlenecked okay so is there a way we can
possibly uh do things like faster or avoid this bottleneck because we really want this uh to scale up so the thing is how and it happens that uh a long ago in the '90s we had a series of results where they analyze the consequences of verifying a computation much faster than re-execution typically what we want is something like what we call a logarithmic scaling that means if for example to do a computation I want I have to do 1 million steps May maybe I can verify it in something like 20 or
proportional to 20 maybe 600 okay and [Music] um with these uh Technologies we with what we can do is then instead of uh checking the computation check this short proof okay and this uh property that the proofs are short is what we call um SX synness okay so what we can do then is somehow generate these these proofs and with that what we can do is eventually bundle arbitrary computations into these very small proofs and then uh
verify them okay and this what it enabled was the birth of C rollups okay what we can do is move execution of chain and then submit this proof and people just verify it and since verifying is much faster than re-execution what we get is an increase in in throughput okay so when I talk about CK I will be mostly referring to this uh thing which in fact refers more to uh what we call scalability okay and this proofs what they show is what we call the Integrity of a computation Okay so
um the question is okay how can we build that and why do we need it okay so to be able to do this uh verification M much faster than re execution what we need is interaction between two parties one which will be the approval which will be tasked with heavy computations and another party which will be the verifier of course then there are ways in which we can transform and avoid this interaction between the prover and the verifier by by simulating it using a construction that is called the fistic okay so in in this case what we want this
proof to satisfy are two basic properties which are called completeness so what I want is that if somebody did things right he will convince me with probability one that the proof is valid okay and another one which is called soundness which is that if I have a dishonest prover he will fail to convince me that he did things right if he didn't okay we we can express it like more concretely but basically what we want is to accept all valid proofs and to reject false proofs with a very high probability okay and there is this other property
that is called CK okay CK stands for zero knowledge it was an idea first proposed in a paper by uh um chaffy goldvaser um U and collaborators and the idea is that I can prove you the validity of a given statement without revealing sensitive information okay one example for example of this kind of uh protocols is what we call um schar signatures so when I sign a message using signatures what I want to show you is that I have in my position in my possession a secret key okay and how can
I convince you that I have this secret key of course one way would be to give you the secret key but that would lose its purpose because then you have the secret key and you could also sign the thing is I can devise a mechanism where I can show you that I know that uh secret key and I can convince you that I have it without you knowing that okay so that is what we mean by zero knowledge of course we have then these two properties one which is zero knowledge which is mostly related to privacy and then we have this property of s synness or scalability which is the one that we
need for many applications in blockchains of course privacy matters for other applications and the good thing about having these Integrity proofs that are succinct is that then we can we can prove that arbitrary computations were done correctly and that that has applications for example even outside blockchain for example one interesting application is suppose that I want to show you that I have an image and that that image was taken by a real camera it was not generated by an AI of course when you want to publish that uh photo in the newspaper or something you have to do like some changes maybe um
scale it down or downgrade it a bit okay and so how can you be sure that in fact that came from the camera not from the AI in the real image you have a signature okay cameras have a signature you can get and so you can show that that photograph came from a camera but the problem is when you edit it you cannot do that but what if you could like take your original image say that you run some code on it and then you obtained the new image then what you could do is simply show me the image the the edited image
and and prove me that that image comes from a picture taken by a camera okay and these are some kind of applications that we are going to get by having these types of proofs so there are like two big words that we have when we talk about um CK Technologies which are snarks and Starks in fact many people will say that um Starks are in particular snarks okay but the distinction is a bit important in terms of maybe engineering and also on um focusing on certain properties so first what do
these words mean snarks stand for succinct non-interactive arguments of knowledge so these are not proofs but arguments okay that I know what we call a witness okay to some uh what we call an NP statement an NP statement is simply a statement related to um an MP problem okay a problem which we can verify in polinomial time okay and they are non interactive because even though the protocol originally is interactive we can render it non- interactive and so the prover can generate the proof by by himself
without need of a real interaction with the verifier and succinct because what we want to emphasize is in particular this uh fact that the proof is much shorter than um the witness we need to prove the the computation okay and Starks are a bit different they are called scalable transparent arguments of knowledge and here transparent is related to the fact that we don't need what we call a trusted setup okay so the thing is that even though this revolutionary ideas were from the late 80s or
um beginnings of the 90s it was not until 2013 14 that we got like viable Technologies to do so why because in general what we want to do is be able to prove like arbitrary computations and being able to device something that can prove rather arbitrary computations is complicated so the thing is that the first constructions really relied mostly on something called el elliptic curves and needed a lot of pre-processing so I want to prove you something but then first I needed to calculate like some parameters but there was this thing that I we needed like to have these
parameters not be known or some secret parameters not be known by anybody because if not we could Forge proofs okay so really snark starting de started developing just more or less a decade ago and it was with their introduction for example in ccache okay and then also in blockchain they started like acknowledging this interesting part of okay we can scale up by by building what we call CK rollups okay so the problem with these early constructions was that they relied on elliptic curves and they had like some trusted parameters and a lot of
pre-processing that in general made things like difficult to prove okay because for example these setups originally were like specific for one kind of program so if you wanted to prove Fibonacci you had a set of parameters but then if you wanted to prove I don't know a larger Fibonacci then you had to redo all the work and so it was a bit cumbersome of course then they devised other methods to have what we called Universal setups okay and then you can prove like more General programs and you don't have to redo this ceremony in the case of starks what they devis is a strategy to avoid having these uh
trusted parameters they rely on very simple and elegant constructions such as cryptographic hash functions everything already Builds on top of crypto cryptographic hash functions so that is not a problem and uh what we call linear codes and in fact we use linear codes a lot more than we think okay so in this case of starks the good thing is you don't need to have any ceremony or anything you just are able to prove computations in a much faster way so you have this distinction of course there are people that like more uh elliptic curve uh base sarks some people
like more Starks I think that Starks what they offer is several advantages in terms of first not having a trusted setup they are uh conjectured to be postquantum secure and in fact in terms of performance they offer like several advantages besides you can do some other constructions designed at proving like larger computations such as uh proof recursion more efficiently than you get with um elliptic curves so I am going to focus then on these hash based proof systems what is the thing that makes them like super efficient first they depend on hash functions okay hash functions are
really fast to to compute on Hardware they are really well understood uh then of course you also have linear codes they also depend on for example having what we call the fast for year transform and the fast for year transform is one of the most widely used and efficient algorithms that we have and uh another thing that we have is that in this case we are able to choose uh what we call smaller Fields okay so when we wanted to prove things we have to work over some what we call finite field which is like the basic data type that we are going to have
instead of working with bytes we are going to work with very large integers okay so when you use elliptic curves the problem is you are forced to use one field and generally it means something like a 256bit field so every variable you want to represent is going to take 256 bits okay so you want to represent a b no problem but it's going to cost over 200 times more to represent it with one of these the good thing about these hash based proof systems is that you can go like way smaller you can choose very very small fields and for example one of the recent developments that has been a
game changer is precisely the introduction of circle Starks Circle Starks have been able to prove nearly uh 600,000 hashes per second in an M2 or M3 notebook okay some uh consumer and hand hardware and that is like two orders of of magnitude more than you you can prove with um snarks currently and that is because you are able to use uh a particular field which is called a meren field which has like very fast uh computations okay so that's why I am
like a big fan of hash based proof systems because you kind of reduce the overhead to represent a lot of things and you can get um a lot of performance gains while avoiding this problem of the um trusted setup okay um and one interesting thing is that remember I told you that you could prove pro programs the problem you had with C when it was introduced was that if you wanted to prove your program you had to transform it to what we called an arithmetic circuit which is something like if you wanted to prove something you had to or to compute something you
had to code it in assembler okay coding in assembler is way more difficult than coding in Python okay and so the problem with CK was originally this if you wanted to prove a given program you had to write it in some kind of assembler now some people thought okay maybe what we can do is instead of having people write each program they want in assembler maybe what we can do is just create a CK virtual machine okay and people just write code in some high level language for example you write it in in Rust then you feed it to the virtual machine and what you prove is the correctness of the execution of the
virtual machine okay that way the developer is saved from uh all the complexity of having to write these circuits you just write it for the virtual machine and you just write in your um favorite language and then it gets proven okay and we think that this of course is going to make uh the development of what we call provable applications much easier okay and if you if you've been in the space you'll see that over the last two years there have been like several virtual machines you have the Ciro VM risk zero Nexus um and the sort valida okay and
with that what you can do is you just code in Rust you send it to the virtual machine and you get the proof of your program no more writing circuits no more writing that so we think that in this sense it's like precisely uh developing like a higher level language for uh writing like circuits okay so we think that this is going to be one of the game changers so as to the improvements the thing is of course these virtual machines at first were perhaps not as performant as as performant okay of course if you want to build an application maybe coding in assembler is going to be faster or what
you cod in assembler is going to go a bit faster but the problem is it takes like more time to develop this okay so in many cases you'll prefer like ease of development over performance but the good thing is that uh there have been a lot of improvements that make like proving these uh virtual machines really easy and really fast so for example we've seen the development of what we called um faster lookup arguments okay so basically what they allow is instead of computing something maybe you can show that you had a table with results of valid results and then
you went and fetched the result um then of course we have this development for example of circle Starks of what we call new commitment schemes or even some new accumulation schemes okay that um for example what they allow is suppose that you want to prove like a very large computation what you could do is instead of like proving the whole computation maybe you prove one one bit okay and you stop there and then you go to the next chunk and okay you say okay my program ended here but I am going to use this as input for the next segment and then you prove the
different segments and you get different proofs but then there are like some techniques by which you can combine all those proofs into just one okay so what what we are seeing right now is that the the proving capabilities are going like up very very very fast I already told you that even on consumer and hardw you can prove like half a million hashes per second which is like crazy and that of course is going to enable uh Lots of new things of course even though we have um or we can say that the
development of uh CK applications is going easier because we we have these virtual machines and so you don't have to understand all the lowlevel details and you can just write code in Rust and then get the proof and everything there are still some challenges for for Mass adoption of course improvements in improving technology will continue to go on and it's just a matter of time until we get maybe to where we would like but still there is another bottleneck which is related to uh onchain proving costs okay so if you want to send one of these
proofs and have and have it verified in ethereum you'll find that the cost is quite high of course that depends on the network congestion but this can mean that even for the cheapest proofs maybe you are going to pay $45 20 50 100 okay and we think that while okay maybe some values seem like small maybe you don't care paying $1$ four do we still think that we have to go an extra step what what we would like is something where these verification costs go
down um very consistently because then of course if adding CK is easy because you just write ordinary code and you send it to one of these VMS and you get things proven and then you can verify it really cheaply then you are going to find like new use cases in this sense what we envision is that what we are trying to build is something like the Broadband for CK so so if you've lived when I was little and you wanted to use the the internet it was problematic because it went by phone you could not download things this the way you wanted and you were downloading something somebody
picked up the phone and it was interrupted and you had to start again so you had lots of issues but soon as as soon as we got the Broadband we started seeing new things such as the rise of social media YouTube other types of interactions so what we think is that in this case if we can take these verification costs uh down of course people will start finding ways of incorporating this technology in ways we don't really Envision okay because when we build the Broadband for example nobody could foresee that we are going to get for
example YouTube and that people were going to watch more YouTube than they watch the television okay people would have beted that perhaps uh YouTube was not a use case of broadband okay or having Netflix and so we think that people of course are going to find ways to do so so at align what we are doing is trying to find precisely ways to reduce these onchain verification costs and we have like some strategies to to do so we have two different working modes what we call the fast mode and the aggregation mode and we think that with these strategies we will see verification costs go down like by at least an order of
magnitude okay if we want to learn more then we can continue talking after that so the idea is that these CK proofs what they allow us is precisely to prove the Integrity of a computation in a way that is more efficient than re-execution of course this technology originally was like uh complicated to use because the tooling was not well developed and we didn't have uh the sufficient mathematical tools to do it in an efficient way but in the last at least three years we have seen the rise of a lot of new proof systems for example you might have heard of um
Circle Starks or plon or the the sort okay and these um have made the the proving times go down and the amount of things that we can prove uh really go up really fast so thanks a lot and if you have any questions I'll be more than happy to answer [Music]
Related talks
- EigenLayer Hackathon: Aligned: Accelerating the Adoption of ZK Technology
- The Future of zkVMs and Post-Quantum Signatures in Ethereum
- Zero Knowledge Virtual Machines Running Rust code inside a Zero Knowledge Proof - Jeremy Bruestle
- Turn a WASM-Based Browser Application Into an Ethereum Rollup via ZKWASM | Xin (Sinka) Gao - zkWASM
- Introduction to hash-based proof systems by Diego Kingston | Devcon SEA
- STARKs: Verifying Computations Faster than Re-Executing Them - Christian Reitwiessner
- ZK Application Design Patterns | Devcon Bogotá
- Zero-Knowledge Machine Learning and its use cases
- Improving Performance of Provable Computations Using Rust | Devcon Bogotá
