Old and New Primitives

EDCON 2023 · 21 May 2023 · 17:45

Barry Whitehat of the Ethereum Foundation describes reusable primitives developed by the Privacy and Scaling Explorations team. He explains how tools such as Semaphore provide proof of group membership without revealing an individual identity, reducing the work needed to build zero-knowledge applications.

Speakers

Topics

From EDCON 2023, hosted by EDCON.

Transcript

hello everybody [Applause] okay so I'm gonna be here for like an hour and a half talking about various things the first part is to talk about like Old and New Primitives this is a presentation it's going to take like 20 minutes and then after that we're going to have a panel with me Ellie vitalik uh yeah Zhang and Jordy and we're all going to talk about uh like zkps we're gonna have like a long discussion about all things ekb so yeah let's get started uh so this talk is is to talk about like all Primitives

and New Primitives so we want to do like a lot of things with zero knowledge proofs and like sometimes it can be difficult to build uh all of the things that you need to make a product so one of the things that PSE has been doing is that that we've been trying to build like Primitives we try and make tools for people to use so that we're able to reduce the amount of work that someone needs to do in order to build a zika application so like the first Zeke application in the wild was like zcash and this was this is something that lets you like transfer money to other people privately and basically the way that zcash worked is you needed to have like a proof of membership that you could do inside a zero knowledge proof so you can prove

that like you're a part of a group without revealing who you are and that's basically what we've what we've implemented with semaphore is like a generic proof of membership and we're working on a whole bunch of new tools and what I want to do as far as talk about like semaphore and like how that has progressed to the point of like being started to being used by people and then talk about some of the other uh Primitives that are going to be here soon cool so semaphore can be used for like a whole bunch of different applications we recently had like a semaphore grants around where we gave like grant funding to a whole bunch of teams to build applications on top of them before

um so we had 35 applications and there's a whole bunch of different like use cases for it um so some examples of these are like you can use ZK uh you can use same before to make like a a proof of individuality system so imagine that like the way that things work at the moment is that like if you want to contribute to gate coin or something you need to pass some like proof of individuality mechanism or screening because if you warrant you will be able to just vote like many many many times and it it kind of breaks the system because you can make as many accounts as you want so uh 74 allows us to do this but with privacy that you would first use you would first go through the kyc process

and you would join the semaphore group and then afterwards you would make a proof that you're a member of the semaphore group in order to be able to participate in order to be able to like donate to get coin or vote in the round or whatever so it's a it's a nice way of like adding privacy on top uh so some of us started a long time ago like semaphore was like one of the it was like it was a second zap CK application that I made and I started working on this in 2019 but since then a whole bunch of other people have been like pushing semaphore forward and I have not really been super involved in it so this is a lot of other people's work since 2019.

so the first version of semaphore is written in in C plus plus in 2019 and it was using this Library called libsnark which was this like C plus plus library for making ZK applications at the time there weren't really any other like ways to make applications with CK so I started I I I think I had to port livesnar to work with ethereum and then I started to be able to make some simple simple proofs and finally I was able to make semaphore with it and then in 2019 we did another version of them before and this version improved a lot of things and it also like went a little bit too far that like we made it so that like semaphore became this like very very uh

secure tool but it was like too secure because the approver time was very very slow it took a long time to make proofs and it also had like a lot of these weird dependencies that you needed to worry about for example you had to make a signature and then verify the signature inside the ckp which was like complicated and in 2021 we made a a better version of this which was just very simple we kind of like merged the 2019 effort on the 2020 effort to get this tool that was super simple and easy to use and this has been this has been like a really interesting Journey for for us because it's like the first time we've been trying to get like

a ZK application that people can people can use and it's the first time that we like successfully managed to get like people to adopt and start to build on top of this tool so that's them before and it's it's it's a perimeter that people can use but it's like one of many Primitives there's a whole bunch of other Primitives that are interesting and exciting and that's what I'm going to talk about through the rest of the talk but like the main thing to take away from the first part is that like this is like one of the things that that the PSE is trying to do privacy and scaling aspiration we're trying to like make printers so that we can Empower other people to make new applications so here's some like examples of like where

semaphore is being used so semaphore is like a proof of membership thing but it has been used for a whole bunch of different applications for example there's a bunch of things about like governance and voting and there's also like some iot use cases and some ecosystem use cases uh uh like maybe you heard about like the Taz experience at Devcon or the zuzulu passport azusulu which all use them before to to do use it do this proof of membership uh so it's they're just like it's like our goal is to make like a tool that can be applied to many different use cases and here's some more use cases proof of

individuality which we talked about before like some nft stuff we have a bunch of social media applications that we can build too which is like uh ways of like having like social interactions that are private and there's a bunch of governance stuff too okay so basically the idea of semaphore was that like we had cryptography we wanted to make the system so we invented our own cryptography or we we use cryptography that other people had invented in order to build like systems that that was like very performant and this this was important because zero knowledge proves sometimes the the

proving the proof part is is very is very costly for example the first version of Sam before it took like a minute to make a proof on my laptop and this takes this is not good it takes a long time it's not a good user experience if you wanted to have this kind of application for like for like regular users it would be very frustrating and confusing for them and it's hard to it's hard to ask them to wait a long time so that's why the new version of the the version stand before we're using right now was very optimized but in the same time that we were spending optimizing semaphore we were also spending a bunch of time optimizing like zkps so we're getting to the point now where like the proofs that we make don't have

to be for special crypto or in like new crypto snark friendly crypto but we can use like General crypto that's been that's been around for years and the key thing to take away and the important the reason why this is important is that cryptography is everywhere all the time you're going to like there's two specific Primitives that are that are really interesting for us to spend some time thinking about one of them is RSA which is a signature scheme that was invented like many many years ago and it's used uh it's used all the time the websites use RSA when you go to visit the website uh every time your phone connects to a website you get it or it's a signature they say this website is authentic uh it's using domain names emails is really

cool every time that you that Google sends an email to someone like on your behalf uh they attach an Osa signature that says that this is an authentic email that came from Google we promise and this is this is introduced as like an anti-spam mechanism so that like you could authenticate whether like where emails came from a whole bunch of government IDs also have RSA signatures for example in India the Adair card has an RSA signature from the government that's basically the signature of the hash of your name address phone number and a whole bunch of other like personal information uh so RSA signatures are everywhere and one of the limitations with using semaphore is that we've had to like give semaphore keys to people we had to like

onboard them and find ways for them to use uh find ways for that to give value to the to the crypto that we're giving out and this is this is a lot of friction right there's a lot of work to try and convince someone that like oh this is important this is useful and you have this like chicken in the egg thing where you have to do like more than one thing uh where you you want to make a thing that's valuable but in order for it to be valuable it has to be useful in order for DB so it has to be valuable and it's just very difficult to to kind of close this circle um the other side of primitive that it seems really interesting is ecdsa on P250 the the elliptic curve p256 and this is interesting because everybody's phone has like a a as it has a a special

chip that that you that that when you unlock your phone it can provide this signature so this is a really nice like user experience uh Improvement for ethereum and for other things so what are we missing with these things the thing that we're missing with these things is it's just like signature schemes there's no it just like once you have a signature you can you can show it to someone and they can verify it but there's no way to have like more complicated rules and what we're really searching for here is a way to make these pre these Primitives programmable because one of the really exciting underrated use cases or reasons

why zkps are so useful is because they're programmable that like programmability gives you interoperability and it also gives you this kind of like permissionless Innovation that is really interesting that it's possible to make like specialized systems for each of the things that we want to do we could probably make a semaphore proof that's much more efficient than semaphore but then we lose the programmability that we're able to like layer on top that makes things very very interesting um yeah so who uses or is they oh yeah another example of where auras a keys are used is GitHub every time you make a every time you I don't know if people have said their their GitHub profile to automatically sign their commits but every time you sign your commits on on

GitHub like that's an RSA signature and like you can go to GitHub right now and you can download like millions and millions of RSA signatures from different people and the cool thing about this is that people are already using this they're already and these signatures are already valuable because like they're used to authenticate like whether the software that all of the internet is built upon is being contributed to by the people who are claiming to contribute to it so like one example really cool use case I would like to see is uh GitHub wallet so the vision for this idea is that you have a GitHub repository or it's a git wallet so you have a git repository that's on GitHub or a gitlab or somewhere else and basically in order to make a transfer

what you do is you make a pull request quest to this repository when you make the pull request the continuous integration will do a couple of things it will check that the pull request is correct it will take the signature and try to execute this transaction on chain if the transaction succeeds it will merge your pull request into the repository so we have this really nice use case of like your user interface to ethereum it's just like git git commits and pull requests and this is a really nice way to start to include the tools that we have in other places yeah so another place that it's really interesting to to to Target these tools

is something like smart contract wallets that like one thing that's really difficult about uh cryptocurrency is that like when someone loses their private key this is like the worst user experience ever someone like has their private key and they lose it and they lose their money and like someone loses like 10 or 100 this is the worst user experience you could ever have I mean it's it's really really terrible and one thing that we're trying to do to to alleviate this is to have many different forms of signatures that people can use to recover their bonds if it gets lost so one example uh method that we could use is email wallet the idea here is that you can use uh uh the RSA signature

that Google assigns to your email address to authenticate your recovery transaction or whatever and we could go one step further and we could make this kind of like email wallet system where you're able to transfer money using only emails you can say you can send an email with a subject line send 10 is from me to a certain person or a certain email address or a certain address and then you can just forward this to some kind of relayer and then the relayer can process this on chain and update the blockchain based upon just the signatures that are have been assigned by Google or whatever whoever your email provider is oops Okay so

those are two example applications that we're thinking about doing the ZK email where you're able to like authenticate uh authenticate like that an email came from a certain person and here's a couple more example ideas um like one example idea is like a proof of individuality that you can use it because in your emails you have so much information that's unique to you like maybe you got an email from the government of your country that included like an IED or something you could use this as a proof of individuality you could use a zkp to verify that the signature on the email is correct and

then you could open selectively some pieces of the email to reveal that you're like a unique citizen of a certain country another thing that you could do is you could you could also use it to export your bank records your medical records anything that you've received an email about and this is this is really exciting for us because like so far we expect we spend a lot of time making semaphore and like showing people that okay you can use them before to make interesting applications but like that there was a lot of headwinds there because we had to try and make it valuable make it useful for people to have these credentials and now we're going to a place where we have all of this data and it's super exciting to think about like all the different things that like we could do with this

data another example application is you could make this kind of like trustless bridge between like um venmo and crypto and the way that this basically works is that like every time you send a payment on venmo you get an email to say hey you've sent this payment and what I can do is I can make a smart contract on ethereum that allows someone to deposit money into this contract under the condition that or allow someone to withdraw money from this contract under the condition that they provide a zero knowledge proof that has a signature from banmo on an email that says congratulations you've just sent x amount of money to this person uh so this is a lot this can allow us to

make these like really fun interactive systems where you're able to where you're able to like have this kind of like on off ramp uh in a decentralized Justice Way so this is the end of the talk is there any questions can we take questions yeah oh yeah all right we have a question from hey thanks do you have a sense of how hard it is to break RSA in those cases how to prove or say and also a break oh

yeah or it's a like is targeting 128 bits of security so it's going to be pretty hard to break the the bigger I I think that like the keys that get I think the key is that like is used right now is 200 2024 bits and I think that's targeting 128 bits of security so it's going to be as hard to break as like an ethereum signature yeah it's just another type of signature