ZK Rollups: Applied Privacy / Danny Holland
EthPrague 2023 · June 2023 · 18:17
Danny Holland looks at zero-knowledge rollups as a tool for applied privacy and not only for scaling. The ETHPrague 2023 talk covers how ZK rollups can be used to obscure private information, putting the zero-knowledge proofs behind layer 2 scaling to work for confidentiality.
Speakers
Topics
From EthPrague 2023, hosted by ETHPrague.
Transcript
everyone ready hi everybody I'm Danny Holland I'm with Vega protocol um uh I'm a smart contract developer for the last six years full-time that's all I've been doing um our the main job I've been doing I've also recently taken a real deep dive into AI the local large language models running locally things like this I'm also a musician and I'm just all around a nerd so if you ever want to chat about literally any nerdy topic I'm up for it um as I said I'm with Vega protocol they're a fully decentralized derivatives platform running on a tenement base and the big news is Alpha maintenance is live after five years we've been at this
for five years since 2018. so this is a big deal so vega.xyz that's all the Shilling I'll do and next okay so whoa hey now back um the clicker's dead guys yeah this is this is fun uh okay help is it okay good back one here we go okay what are ZK proves um well uh there's been a lot of talks on ZK uh ZK zero knowledge proofs here uh uh over the over the week and whatnot so long story short is zero knowledge
proof is just an ability to prove that you have a piece of information or um you have done a piece of compute without showing the information or without showing the compute but just get handing a proof of that to a verifier and they know for a fact because of black magic math that it is accurate so that's effectively what a ZK proof is okay so why does it matter for ethereum well you can use this uh offloading of compute to massively scale ethereum last time I was here I gave a talk on uh how to scale ethereum doing actual like you know real world examples of how to do it
and uh um yeah it's it's useful it's great everybody talks about that it can scale ethereum but no one's told says how you can scale ethereum so I did that last year um this year I'm talking about ZK privacy because again everybody says oh well with zero knowledge stuff because there's zero knowledge transferred for me to someone else um uh you can use it for privacy but no one says how so I'm going to start with a quote from Edward Snowden arguing that you don't care about the rights of privacy because you have nothing to hide is different than is no different than saying you don't care about Free Speech because you have nothing to say
to which I would like to point out Eric Schmidt the former CEO of Google if you have something that you don't want anyone to know maybe you shouldn't be doing it in the first place so obviously Eric has nothing to say all right so uh um the main way or at least the way I uh make these ZK Roll-Ups at the moment is with a technology called uh ZK snarks um it's been talked about a lot it's comes from uh it works with ethereum you can put the validators on ethereum and and uh or the verifiers on ethereum and you can verify a proof with very little gas cost and the language we use for this or that I use for this there's a couple
languages that compile to this but is is circum it's fairly complicated it's you know really Niche it doesn't work like most languages kind of a pain but you can make uh you can protect the user privacy and protect all the data which is great and the verifications are very very efficient to verify on ethereum it doesn't cost a lot of gas and the input values are only for you and 256s and then whatever parameters you need to do business logic all right so we're going to start with a toy example the first one is age verification so if you go to the United States and you go to a bar um you got to be over 21 to drink at that bar which I know for most of you in
here like really 21 okay come on well um the bartender is going to ask you for your ID now think for a second how much data is on your passport there's your name your phone number there's a just just or maybe not phone numbers there's your a uh all the demographic information but what's actually required from the bartender they need an image to know that you are the person that's that you say you are and that's that's the person in front of them and they need a simple Boolean value a thumbs up or a thumbs down are they over 21 or you know 18 if you're in in Europe this is the information you leave this is the information you leak you leak uh you name your address your
signature your donor status your veteran status your your gender your height weight hair color eye color um place of resonance everything I mean this is all the information you leak just to get a beer probably not helpful Okay so using ZK Roll-Ups you can you can do this uh oh good it shows up pretty well here okay so first up the user will uh submit all of their demographic information all of their ID information to some authority figure some third party who will verify that yes this is you are who you say you are and uh um they will hash that they'll salt that assault data information and they'll hash it and they'll store it on a smart
contract well after uh after you do that the user when they go to the bar go to wherever they will they can on their phone on their device they can put in all their information all the information that's on their ID card on their device and they can generate a proof and all that comes out of the proof is um the actual proof the four un256s and the hash of the image that they just handed the bartender well they give the user hands the proof and the image to the Bartender Bartender verifies the image hash and then runs the proof through the the smart contract and the smart contract will validate and
ver or it will verify that it's an accurate proof and if it verifies the person must be of age you don't need to know anything else so all you've given them is just that image and that's it that's all the knowledge they have which you know it's much better than linking all the all your other information so what are the benefits of this well you keep your personal information under your control it's on your device and never leaves your device and if you've got a secure enclave and whatnot it's it's safe I mean you know except for the NSA but yeah we're not going to talk about that anyway um it hides all unnecessary demographic information which lowers your individual attack profile because your data less of your information is out there but um the
interesting one that a lot of people that have not heard anyone else talk about is uh cover your ass works both ways the uh like the you can't leak what you don't have so all of these hacks all of these reaches all of these day you know all the data getting linked everywhere if they didn't have the data it couldn't get leaked so there's benefits here okay what are some of the challenges well as I said it requires a one-time third-party Authority which is slightly a problem for a lot of the people out here given that we're you know fairly Authority uh Authority averse but uh there's not really good Solutions there's like internet of trust and things like that but our Network address whatever but it's it's not super useful
uh so you end up needing an authority plus there's always the authority and the law and whatnot that you have to deal with um there's no guarantee that a verifier uh um deleted your picture so they you know the bartender might keep your picture so you did leak a little bit of information and they might not delete it and that might be a problem but uh it's minimal and then I did put this on here the uh potential repetition attack I put it up there um because I was thinking hey if you know you try to go to the bar and it says no well you've said you've signaled no that you can't do it and then one day it works well then hey they now know have your birthday however if you build a circuit in such a way that it doesn't even generate a proof unless the user is
over 21 then then you're good and so the repetition attack isn't even um isn't even an option okay so toy example two a more realistic problem all right uh okay so you go to buy a house say you are of a demographic you are of a minority you are of something that is typically discriminated against well you go to my house and uh what what is the required information that the loan officer needs they only need to know if you qualify for the loan nothing else literally nothing else and in the process if any of you have ever bought a home you leak all the things on your ID plus job history relationship status blood type everything you leak all of
your information which has been a can be and has been used against people and it allows people to discriminate because now we know everything about you all right so solution sorry solution to this problem is actually less complicated than the previous one so the user submits all their documents through the circuit again on their device uh to the uh or to the yeah which generates the proof and all that comes out of the proof is the document hash and the pro the four un256s again so the user takes that per the loan officer takes that proof um and puts it into the ZK uh uh the
verification contract the verification contract says Yep this is valid and then afterwards if uh you can audit all of that data the user can then after they're already approved prove every document to the loan officer which is which is great um so you've already made the decision whether or not you approve of this loan and it's it's already too late to discriminate so what are the benefits um all the data is is hidden during the approval process it protects the user's right to privacy especially if you know they get declined because they don't meet the requirements and everything is post Hawk auditable so um the loan on the bank and everything
can be happy that yes we did our due diligence and everything is as they said it was none of them are forged documents or whatever but the great thing is verifiers the loan officers the bank and whatever can't discriminate despite themselves so even if they want to even if that individual loan officer wants to discriminate it protects the bank as well as you know protecting the the person applying for the loan so not too bad okay remaining challenges here it requires that all the auto all the documents be available to be audited or you'd go back to the previous problem where you verify each document through a trusted Authority so either way you end up having having this potential of data leakage elsewhere but you can you can
mitigate that but there is no guarantee that once you reveal the information that it will be deleted there's no way to deal with that as of now although I do know a good cryptographer who probably has some good examples or good solutions to that problem and as of now there is nothing that currently compels parties to abide by the output of the proof so you know we make the agreement it's approved they see you know I'm something they don't like and they go oh well no never mind there's nothing to force them to do that and worst of all the regulatory Frameworks are super slow to adapt and if you uh if you look at things like mortgages at least in the United States I know that's one of the most regulated things ever
so there's that okay so here's a couple potential ideas there's a software Integrity you can you can have a software publisher prove that their software meets certain requirements it uh it does certain calculations it doesn't you know do certain other things based on how you build up this this proof um and uh so the you as the downloader who needs to use the software you can trust software you know you can trust the software because it meets your requirements without any having a look at the source code or anything like that I'm a big fan of Open Source software but it's not 100 necessary and this is a way to a good middle ground
another one is online gaming um if you set it up right you can prove that all all the moves that each all the players are using are our legal moves everything's accurate everything's fair and not leak the information of of each of the players which of course is necessary because people get really you know angry during these games and people have literally tracked other people down and and killed them because someone looted the wrong World of Warcraft item so you know there's that medical research um obviously there's all these this demographic information in there and it's highly confidential and there's lots and lots of laws protecting this
but the researchers need the data and they need to know that it's accurate so this is another potential use of this okay um and the one I'm I'm most excited about is uh neural networks so everyone's used gpt4 everyone uses you have used these tools by now and uh say that you have a specific prompt and you need a specific output or you need the output from a very specific model but the uh say like open AI they don't want to give their models in out publicly as of right now they can make any changes they want to it and and you have no control you have no knowledge of which specific model they're you they're
putting your information through they're running your prompt through well you can use a zero knowledge proof to to guarantee that the output you received was based on the input you put in and came from that exact model so challenges remaining the the zero knowledge proofs are very expensive to compute there's always going to be the data availability problem I mean it's kind of this chicken egg thing like do we want to hide the data or do we not want to hide the data so if you need to recompute things it gets a little a little hectic there there's not a lot of people looking at this right now it's much better than it was last year but it's still a problem we don't have the infrastructure the um stack Overflow isn't like super
um super robust for circom at the moment there's no Auditors which of course if you you and crypto if you've ever done a smart contract and what you need you need auditing and um it's all new crypto so it's new hash functions it's new signing functions and what's the first rule of uh of crypto don't roll your own crypto so these are the challenges that remain so my call to action is uh come experiment like if you have any interest in any of these things I just said or zero knowledge producer in general or if you have a cool application come try it like come out play uh because that's the only way we're going to get the community that's the only way we're going to get past this these hurdles we are with ziranolas stuff where uh
ethereum the whole ethereum ecosystem was when I first started in in 2017. so so like we can get there but people have to come and play so come and play all right any questions [Applause] okay it is a unit of liquidity we call the cisca because of the guy who uh who figured out the the equation he's a member of the team yeah he doesn't like that we use that name and that's why we use that name thanks Danny great hello yeah thanks to
any great talk um trying to still formulate the question but I'm wondering like you talked to a lot of people you must do about zero knowledge and yet there are still a lot of people who have zero knowledge about zero knowledge and it is there any wisdom you feel you can share about like if we want to if people want to start or people I mean this has been a great talk to give some sort of Primitives but like how can we all get better at zero knowledge because clearly everyone thinks it's going to be a big thing um watch my talk from last year because it was about uh how to apply it and to scale ethereum so there's there's some
code in there and there's some very specific like toy examples and whatnot so uh yeah watch my talk last year um uh back to the community thing like start posting on forums start asking the questions because you know every stack Overflow thing starts with a question so you know ask that question um otherwise I don't know and if you find something let me know and I'll add it I'll add it for the next time I give this um so uh if there is no further questions um thank you again I'm Danny I go by sacrificial Pancakes on Twitter and everywhere else I also make music I'm on all the streaming if you want to and again with Vega protocol uh please come try it's fun we've got this great test
net that allows you to play around and whatnot that's it thank you [Music] [Applause] [Music] thank you