[BUIDL Asia 2022] ZK Crypto + Next Digital Revolution
BUIDL Asia 2022 · August 2022 · 31:31
Alex Pruden of Aleo demystifies zero-knowledge proofs with a focus on real applications for developers. The talk walks through their history, from interactive proofs and sigma protocols to Fiat-Shamir, SNARKs and Groth16, then shows how they resolve the tension between verifiability and privacy, and looks at tooling, hardware acceleration and the importance of keeping decentralization central.
Speakers
Topics
From BUIDL Asia 2022, hosted by Kryptoplanet.
Transcript
uh hope everyone is enjoying the conference so far thank you very much for having me it's a pleasure to be here it's my first time in korea and i'm very excited to do this presentation for you all so um as i mentioned i am the ceo of elio but today i'm not actually going to be talking about a leo specifically this talk is really about kind of demystifying zero knowledge proofs and focusing on the applications and really and really use cases for them so um yeah oh and one other thing i wanted to mention is i tried a new format for this slide deck and i'm excited uh for this for a number of reasons but if you want to scan this qr code what you can do is you can actually find this talk on hackmd so i wrote a version of this talk
on hackmd and hackmd is just kind of a simple markdown editor an online markdown editor and you can follow along and add comments anywhere and you can see the exact content that i'm going to present here and my hope is that this can be a community document that anybody can feel like they can comment on and potentially contribute to and and it could be a living document if anyone wants to take this presentation and have his notes later you know so you don't have to take notes during the presentation or if you want to give a similar talk yourself feel free and use this so or feel free to follow along okay so the motivation for this talk is like i said is not to focus on the low level zero knowledge cryptography um you know how the protocols work how the math works all that the focus here and by the
way i'm not a cryptographer you know i'm the ceo of alio my background is investing i was at a 16d before and before that i i was in uh i was i was in the military but and there's plenty of people here who understand the low level nuances of zero knowledge cryptography i would encourage you to ask them there's tons of great resources out there but the focus of this talk is really about the applications i think we have a ton of work including by you know some great teams like enoma who you just saw starkware uh elio the the project that i work at zcash it's a ton of great work on the protocol level for building these platforms for developers to to create applications powered by zero knowledge but there's not that many unfortunately example applications of there's not that many example
applications out there so the point of this talk is to really give is designed the audience is supposed to be for the developers out there who want to use this technology and apply it to real world problems and so you know the idea is to inspire is to give enough context to be able to do that okay so gonna start off by just kind of giving like a short run through history of zkp's and i'm gonna i'm gonna apologize in advance uh to anyone who's a cryptographer in the room this is gonna be a high level presentation so there's probably gonna be some oversimplifications in there and again if you have any feedback on any aspect there's talk the qr code you can leave comments in there and everything and we can you know kind of iterate over time but uh the idea here is just again like
give some uh some context about zero knowledge proofs how they came about and then transition into what i really want to talk about which is the potential use cases for this technology so here we go okay so the motivating problem and two cryptographers walk into a bar not the start of a bad dad joke although i am a big fan of bad dad jokes as a father of three um but this is this is really the motivating problem behind like these ideas that became zero knowledge produced and it's not it's not two cryptographers that walked into barbers is two mathematicians and the idea is basically like it was basically that the mathematician a says to mathematician b hey i've just found this interesting result and here's a proof
and hands the other one a proof and then mathematician b you know that is okay how do i know this proof is correct without re-running every step or re-executing every step of that proof and the question that motivated this is like what can mathematician be verify mathematician a's claim without walking through it all the way and so this is called interactive proofs this is a class as um in complexity theory and this is the i i basically just described the idea we have two parties approver and a verifier prover hands a proof of summerville to the verifier and after some back and forth the verifier accepts or rejects on its face it kind of just seems like a toy problem that wouldn't have really any applicability to anything that we care about
but it turns out that this paradigm can apply to a huge range of problems that we do care about um okay so here's here's the same thing in emoji form so again ellis makes a claim bob is allowed to ask alice some questions and they do this over the course of several rounds and at the end of this process alice or sorry bob either accepts or rejects alice's claim and kind of one one key piece here which i already hinted at is that the interaction or the the transcript uh of this interaction is shorter you know i'm just kind of a hand way of what that means for a second but it's shorter than the actual computation proven itself because the simple way for or the trivial way for bob to verify alice's claim would be to redo
everything so that's not really interesting what we're looking for here is some way for bob to do it in a more efficient way okay and so what are the key properties here so the first one is completeness so an interactive proof you know system should should have this property of completeness which means that the prover in this case alice should be able to prove anything within the language that alice and bob are speaking and bob should be convinced of it if it's a correct proof and then soundness is this idea that alice should not be able to fool bob into accepting an incorrect proof except with basically uh negligible probability and there's kind of one more question here that people started thinking about was well what if alice could prove something to bob
without revealing anything else about the statement being proven other than the fact that it was just true or false and this is this concept of zero knowledge this is the first time that we really have this concept like hey what if we added this property of zero knowledge this is really the first time that this vernacular came into being and this is the paper actually was published in 1985 by silvio mccauley uh shafi goldwasser and charlie rakoff that basically came up with this concept right so this is the idea of like could the prover not reveal anything to the verifier other than whether or not the statement was true okay and so you know from this point we basically kind of get you know this is the journey begins for all these different zero knowledge proof flavors so
what i just talked about with interactive proof so if you have this interactive proof system and you add this kind of zero knowledge property into it you get what are called sigma protocols and a sigma protocol you guys may not know it but probably many of you are at least familiar have heard of schnorr signatures or schnorr protocol so schnorr signatures are being considered to be added to the bitcoin protocol through the taproot upgrade and those are that's an example of a sigma protocol so it's an interactive zero knowledge proof scheme and if you take a sigma protocol which is interactive and you add you basically i have this magic eight ball to signify some randomness if you apply this trick of hey instead of the prover interacting with a verifier you have approver that's effectively rolling dice or flipping coins to simulate what a verifier might randomly
ask then you you can turn up interactive protocol into a non-interactive one it's called the fiat chamier heuristic so if anyone's ever heard that wonder what it meant that's what it means it's a relatively simple idea but very powerful because now the prover can just get you know can prove things to the world to no one in particular and make a claim that then anybody can come along afterwards and verify and say okay this claim is correct and so the if you mix you know this uh via chamier heuristic and this randomness effectively with interactive or sorry sigma protocols you get nizix and that stands for non-interactive zero knowledge proofs and if you mix a non-interactive zero knowledge proof with i'm just gonna say magic it's not magic but there's like it's not the purpose of this talk to go into what goes into making a nizik a zk snark so
i'm just gonna hand wave that but just understand that a nizik you know plus some special stuff is what a zk snark is and as ek snark stands for zero knowledge succinct non-interactive argument of knowledge okay so i'm almost done with the context setting but i wanted to define these terms for all of you because in my journey in the space in this industry i've often found that people don't actually know this history and they don't understand what this means i think the context is important as you think about how to potentially apply it so again so we have interactive argument which is like gets back to the beginning where we had talked about interactive proof systems um the non-interactive piece implies that the fiat schemer heuristic is implied we have some randomness that got kind of added in there and the succinctness piece the definition of succinctness and the
variations on that definition are really what define or make up the different protocols the different flavors of zk snarks this is where you get the difference between like starks and bulletproofs for example and and just and the traditional zk snarks that zcash uses for example the the different ways that we just define systems and just i guess at a high level the way to think about succinctness is that this the size of the proof should either not grow or grow in a very at a very slow rate compared to the program being proven okay so um again just to wrap up the first section here so it's like kind of looking at the way these things have evolved so again we have you know the 80s that published the paper that i showed earlier was published the 90s we
had the schnorr protocol which also itself was you know was presented in a paper in 91 we have these things called probabilistically checkable proofs which were of interest mostly in research in the 90s and 2000s and that kind of led to this the first zk snark um that was implemented in web 3 and zcash right so the first in the first iteration of the zcash protocol they use this pinocchio proof system and then that they later implemented the first i think i think was the first hard fork and zcash uh this proof system called groth 16. so if you ever heard this term groth 16 it is named for the author of the uh of this paper that was published in 2016 um about a specific kind of construction of a zk snark and so that was a real breakthrough because it was a huge leap
forward in efficiency and then that itself inspired a host of other interesting proof systems that do all kinds of different things okay so that was the context i wanted to give you so now i want to turn to like the real meat of the talk which is what are they good for so what's the purpose of these things it sounds really interesting we have these interactive proofs you know is this theoretical thing or can this be applied in the real world so i think the way i like to start by talking about this is thinking about like what's the real breakthrough here and the simplest way is thinking about this this before this technology existed you had this kind of unbreakable tension between being able to verify something and being able to conceal information right so the simplest example that i like to use here
is poker let's say you and i are playing a hand of poker and you claim to have a royal flush right and the only way that if you're playing real poker for you know you to prove that you have a real royal flush just build it is to show your cards once you know the betting is over and the round is complete and what zero knowledge proofs effectively do is to let you prove that you have a royal flush without showing your cards and so that's that's really like the key paradigm shift that this technology enables which is why i think it's going to be so transformational not only in web 3 but even with traditional web 2 use cases so effectively in short it lets you to not trust anyone but you can verify and cryptographically ensure that whatever statement that you're being
presented is true or false okay um in the web3 context um at least with most of the use cases we see today these typically break down proofs zkps are typically used in two ways and that's because they they both conceal and compress information so go back to the definition of zk snark for a second so zk zero knowledge implies some conceal you're concealing some information from a verifier or from anyone and the succinct part of the zk snark implies that again there's some compression happening and so if you look at you know we're going to get into some of these use cases but you know if you think about roll-ups effectively what a roll-up is it's not actually concealing that much information but it's using this property of compression uh to
enable you to have a more efficient computation or a more efficient protocol where something like zcash or alio you know it's basically the point is to hide or is to enable users to hide sensitive data from any observer and that's that's really the use case there so concealing concealment and compression okay so now we've arrived to the listicle part of the talk where i'm just going to kind of run through some of my favorite use cases for zk snarks and again the hope here is to really try and inspire people to think through other use cases of this technology which i think is going to be to be a potential breakthrough okay so the first one that i want to talk about here is regulated stable
coins so we have stable coins i think most people are familiar with the concept of stable coins i think the one of the more popular ones is usdc right and the idea of usdc is on ethereum is relatively simple you have effectively a blacklist where people can send tokens which are pegged one to one to a dollar to anyone else who's not on the blacklist and it's amazing it's a breakthrough for many reasons i mean one of the reasons is that it makes settlement between parties extremely cheap especially across borders so if i you know have a dollar i have a dollar bank account i want to send somebody in korea some money in the traditional financial system it turns out that's extremely complicated but in web 3 as we all know that's it actually becomes very trivial and much cheaper at scale than many in the
existing rails that we have now the drawback of something like usdc or any uh stable coin that's issued on on a chain like ethereum or any transparent blockchain is that if you give me your address to send you usdc not only do you reveal all the assets that you currently own but you also reveal everyone you've ever interacted with right and we just think about this for a second in context of how the traditional financial system works like not only is that not price it's it's less private since it's much less private right um and so there's potential reasons especially when you talk about real economic use cases businesses supply chain contracts et cetera that you would want to maybe hide some of that information and so you can use zero
knowledge proofs to create stable coins that enable private transfers between parties and this like basically is what zcash is the taking it a step further though you can also add logic like usdc has where you have a blacklist or some it could be even more complicated than a blacklist some regulatory regime that you want everyone to comply with and you use the zero knowledge proof as you're you know if you're transferring an asset on chain you attach a proof that say hey i complied with this regime with these constraints and then this not only ensures to regulators that you're following a law it also massively simplifies the problem of compliance for regulators or for banks right for i mean a lot of people may or may not know this
but some of the biggest banks in the world employ massive compliance departments that really have to do the manual job of sifting through transactions and understand hey is this a fraudulent transaction is this person laundering money et cetera et cetera so again i think the thing i like to point out here is zkp is actually it's a two-prong use case it definitely helps it helps on the consumer front protecting your personal data that you don't want to reveal to everyone for all time but it also helps regulators and does their job easier okay cool another use case that i like a lot is the on chain i mean everybody loves trading on chain um you know all these assets are you know basically uh assets that you can trade and so there's liquid marketplaces such as uniswap on chain and it's a great use case for
crypto i mean the ability to access and move liquidity around quickly and automatically is one of the really powerful use cases on ethereum certainly and but one of the challenging things for that again in the model of transparency is you know if you want to do a large trade there's potentially you potentially could end up sending a signal to a market that you don't intend to send and as a person who used to work at a very large venture capital firm that had big positions in various um in various networks you know you could see a scenario in which you know hey the fund cycle it necessitates some sale of an asset but you don't want to appear to be short of you know you don't want to convey to the market that you know you're you're not bullish on the future
of it um and you know there's a whole bunch of reasons why people use otc trading in fact in some asset categories the otc market is much bigger than like what's traded on exchange and again this is much it's very difficult to do on a transparent platform uh like ethereum and so you need to kind of mix in to something like ethereum or on another platform potentially zkp's to enable this use case where you basically have two counterparties who may not know each other and the amounts to the world may be private but you can do this you can have the same on-chain settlement that you wouldn't say say unit swap but in a way that would enable the specific use case proof of solvency okay this one unfortunately is very relevant these days i think we're all pretty familiar
with over the course of the last three months in crypto all of the um i guess scandals blow ups um issues that have affected various large protocols and or funds that have cascaded and kind of rippled throughout the markets of course you know initially we have kind of the issues with luna and the peg breaking for that stable coin and then and kind of the ripple effects of that through three hours capital all the way through all these large kind of quote-unquote quote-unquote crypto banks nexo celsius block fi etc and really the fundamental problem here is that the transparency there was very opaque in terms of what the transparent you know of transparency and how certainly at the larger funds
such as 3rs capital how risk was being managed and one of the nice things about zero knowledge proofs again it lets you break this paradigm of hiding something and verifying something right and so one of the advantages or potential use cases i think especially in light of these things is a proof of solvency right so if you're running a fund or even a crypto bank you can prove without revealing the positions of all your assets that these assets you know that you you're able to you know meet all of your margin requirements so that you're able to pay all of your liabilities or within some multiple of that so you can encode all of that logic inside of the zero knowledge proof and actually this is not even a new use case people first thought of this concept after uh the mt gox hack um several years ago and this
idea that you know what how do you know that an exchange actually has enough reserves to meet its liabilities and so there's some research out of stanford actually now several years old that you know enables you to do that as an exchange like hey without revealing all the on-chain addresses that we use without revealing the specific asset positions without revealing any of this other stuff we can prove that we can meet all of our liabilities so again i think for d5 or especially for the intersection of where c5 meets d5 what some people like to call cd5 these types of constructions are going to be extremely important okay so kind of transitioning from a couple web three use cases to maybe something more familiar to at least people who are newer to the space is passwordless authentication so um probably some of you know that the
way authentication works today is you know you have a password you choose a password and you type the password in on your device what's supposed to there's a whole bunch of things that are supposed to happen in that protocol where you're authenticating to the server um to protect your password to make sure it doesn't get stolen the problem is you as a user very in not very often do you have control over whether or not all those things were implemented or implemented well and this is why there's all these hacks that constantly happen in exploits credit bureaus and everything else where it's like it turns out that these organizations weren't doing what they were supposed to do and as a result public information that should have information that should have been private became public right and so what what this paradigm does if you or the
paradigm that i'm imagining for passwordless authentication is you know you basically authenticate by proving knowledge of something it could be a password without ever revealing um like what the thing is there's never any reason to store it on the server right that the advantage of that from a user perspective is that you no longer have to trust anyone to do it other than yourself right so it takes the power away from organizations that maybe aren't incentivized to protect this information and puts it back into your hands self-sovereign identity uh is another big one and this one could be a talk all on its own um but for those who aren't familiar with the concept self-sovereign identity refers to this idea where you basically it's a digitally native identity where you can take a night you can you can have this set of traits that
define you effectively and you can take those to anywhere on the web and you can maybe just show selectively certain traits to certain people without revealing everything about yourself and you can probably already understand how i just described that like it basically requires or necessitates something like zero knowledge proofs right so if you want to take like another example that i like is if you want to go out to a bar and you want to prove that you're of legal drinking age you know you go stand in a line you show the bouncer whoever's at the door your id and what you're trying to prove is that you're over 18 or 21 or whatever the legal drinking age is but in the process of proving it you of course are revealing all this personal information to the bartender or sorry the bouncer and you know that maybe is not something you
want to reel now for in a real world interaction i mean is the bouncer going to read your address and come to your house probably not but in the digital world of course everything can be scraped very easily in fact i mean probably most of us in the area of covid or or even just traveling have had the experience of having to upload a passport to some website and it's like you have no idea whether that information is being saved what purpose is being used for so imagine a situation which you could authenticate as a citizen of a country say i am a u.s citizen but i don't need to show you my passport i don't need to scan and send this because now you have my passport number and potentially makes it a lot easier to impersonate uh private and secure voting another really big use case i think is
very applicable to daos so dao's today most of them operate transparently where you know votes come up to adjust the protocol et cetera et cetera and people go ahead and cast their votes and you know and then the result is settled but there may be situations which you want to have private voting i mean the obvious one is when we elect uh certainly in the us and i think most other places when we elect our representatives part of our democratic system you know votes are counted manually by just an individual and those like names are not associated with votes it's private and so you may want to in certain situations uh in a dow for example you may want to keep that information private you may not want to tie people publicly to given votes especially given that because these are blockchains they persist for a
very long time right so there could be a lot of interesting new constructions that we haven't yet explored for dows um that zero knowledge proofs really enable in terms of the private voting um private and secure blockchain like clients so this one so it mostly i've talked about the utility of zkp's in terms of this aspect of concealment of information this use case is much more web 3 focused and it's really focused on the the ability for for zero knowledge proofs to compress information right and so um this this particular use case is the idea that you can take a blockchain which what is a blockchain it's a long series of blocks or a long it's a bunch of information organized into a long
series of timestamp blocks and you know if you get to the and as new blocks are added the state is updated but what if you want to sync a new client to the chain what if you want to download a waterfall and you want to re-download everything and make sure and kind of restore what you had before well how do you know that you're getting the right blockchain like who did you connect to what's the trust assumption there and it turns out if you haven't looked into this it's a really interesting question it's not really that it's very nuanced in terms of how do you know you have the right state of the world and one of the nice applications for zero knowledge proofs is that you can prove recursively all the way back block by block by block to the beginning to know that you have
actually the right version of history on your device without having to store the entire thing and re-run it all yourself right remember back to the initial example that i gave with the two mathematicians like how do you prove it without re-running it all yourself the way ethereum works today if you sync an archive node you literally have to go and rerun everything yourself and the advantage of this like a zero knowledge proof based construction is that you can just have these proofs that kind of recursively are layered such that you you are given the latest state and you know that it was computed correctly cryptographically and there's already teams that are doing this i think one team that i i really like that deserves to be called out uh for this is cela so they have a um they have a super light client wallet mina does this too so
these these constructions i think are really interesting and i think hope i hope that the ethereum community considers this for the future uh the future of their protocol as well okay uh privacy preserving aiml for health data okay so most of the time if you say aiml and blockchain in the same sentence people or at least certainly i roll my eyes because you're like okay lots of buzzwords like what you know do all these buzzwords belong together but actually i think zkp's have a lot of utility especially when it comes to protection of personal data in the context of aiml so think about advertising right so yeah i mean arguably the biggest use case by value of ai and ml algorithms is getting user data from browsing the internet right
browsing the internet watching videos and this is exactly how tick tock works right so you browse to you watch videos on tick tock that information is collected ai ml algorithms are run and then you serve new content right now what's happening there implicitly is you're paying with your data right there may be situations like i use the example of health data where you don't want to give anyone your health data maybe outside of your doctor but there could be huge societal benefits to giving access to you know health care professionals in general access to this data so potentially you could you could see a situation or there i can imagine a situation or an application where um you as a user run an algorithm client side based on your data and then you produce maybe like you know just use a
simple example like a linear regression where you give a slope and you give an intercept and you don't reveal any of the points that that line went through and so you can kind of in some ways protect the data that you care about protecting but still get some utility from it okay play your own games actually this is one of my favorite use cases for web 3 in general there's so many cool ideas that are floating around out there and i know korea especially is is really a hotbed of like the latest in game development and i think the opportunity for player owned games in crypto and web 3 is so exciting because you can imagine a world in which a game that you really love you also are a park owner of and you have a you have a stake in being able to vote for
whatever new features or rule changes happen and that's what really that's not a zero knowledge thing that's just a web three thing that's really cool what zero knowledge enables that you can't necessarily get uh on you know kind of just in in the regular sense or in the you know traditional web three uh setting is you have this ability to introduce this hidden information component to gaming so i think there's a great game that i highly encourage everyone to try on ethereum actually i think it's uh i think you play the game on nose's chain but it's called dark forest and it uses zero knowledge proofs to hide information about everyone's moves um super interesting and basically it's the difference between playing chess and playing battleship playing chess you know as a fun chess is a fun game very you know there's no element of
hidden information battleship you can't you can't play battleship without hidden information it just doesn't make sense the whole point is to guess where someone's pieces are so zero knowledge enables this class of games and potentially augments what's already i think a really exciting use case or category um okay i'm gonna start skipping ahead because i'm running a little on time um okay so i just told you about how awesome all these uh zero knowledge proofs are so why isn't everyone just using them already and we talked about we we thought of this in the 80s why are we like why are we still here um okay so it turns out there's some complications and some challenges right so one of them and you may have remembered a couple weeks ago there's a lot of announcements and maybe i think a few people talked about today is you
know this you have to zk evm so making this compatible with the evm very hard problem and not trivial at all to solve and so that incompatibly with incompatibility with existing models remains a challenge for this technology but i think we're getting better and approaching ways around that lack of tooling this one i think is much closer to being solved for example at alio like we have a smart contract language called leo which basically lets anybody write high level javascripty syntax which compiles down to r1cs which is kind of the low level stuff that proofs are made of and before that you had this kind of you know you had to basically hand make all these things in a very uh you know time consuming way um there's some performance overhead
which i already talked about and then data availability the data availability problem is just you know ensuring that whoever needs to generate the proof has access to the right data okay what does the future hold so i hope the slide i showed a little while ago about how the space progressed has convinced you there's just an exponential growth and new techniques to make this to solve all the challenges i just laid out uh better tooling and language support is coming hardware acceleration actually the t-shirt i'm wearing for z prize like the whole this is an issue that i helped run and this you know consists of 32 teams across the space the whole idea is to incentivize hardware acceleration of a lot of these low-level algorithms to make the real-world human time or the real-world human cost of these things lower and so we're getting to the point where a lot
of these things feel like they're far away today but we're advancing we're rapidly advancing towards um towards solutions okay in the last 30 seconds i'm going to leave some closing thoughts um okay so zero knowledge cryptography helps us overcome the tension between verifiability and privacy i already went through that but i think this is the big takeaway if you take nothing else away from this talk i think this is what i want you to take away um and i i think you know i've been talking mostly about use cases in the web3 context and i think it's just important to note that there's a lot of ways to apply zero knowledge cryptography both inside and outside of web3 but i i would encourage people to remember that the value of decentralization in web 3 is extremely important and the way that these zero knowledge proofs are applied
i think should be used to empower users and ensure that decentralization remains a core principle that we uphold as opposed to the opposite because there are ways and there are companies out there that don't actually hold that to be a core value um so i think it should be and i guess moving on from there you know i view web 3 as a quantum leap forward but i don't think we can all as a species just take for granted that we're constantly going to be advancing as time passes i'm a little bit of a technological utopian so i believe that as we get better and new technology life will get better but that's not guaranteed and it requires the work of everybody including many of the researchers whose work i reference in this talk many of the people who are here presenting
you know how their zero knowledge proof systems are going to make the world better and all of you potentially who can contribute to the space or who are even here to learn about it takes all of us together to push these boundaries forward and lastly i'll leave on this note if you want to get involved and you want to start learning more there's never been a better time this is truly the beginning of the beginning and i highly encourage you to do some research in fact if you uh if you go to this qr code this is the end of my talk but if you go to this qr code again there's a bunch of resources in there i would encourage you to add more and again we should consider this talk that i just gave a community resource that i encourage all of you to take and use as
you see fit hopefully this was helpful thank you all very much [Applause]
