Zupass 🛠Zupass Internals and the PCD SDK
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
Join us for a Zupass Internals workshop! From November 17-19 2023, ETHGlobal welcomed developers from around the globe to take part in shaping the future of Ethereum at ETHGlobal Istanbul. Over $600,000 USD in prizes were given away at the prestige Istanbul Congress Center... thanks for an amazing weekend hackers! ----------------- Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com
Transcript
[Music] I'm going to be talking about what exactly zup pass is why we built it some of the things you can do with it um the framing of this Workshop is it I'm not going to be walking through a lot of code it's going to be a quick introduction and then I'm going to potentially have time for questions but probably not so I'm actually just going to delete this okay uh we're going to pretend that I'm onboarding you as a new member to the team okay so zoo pass what is zoo pass uh here are a couple screenshots for those of you who haven't used zass basically it's kind of like a cryptographic file system you probably experienced it as a ticket delivery mechanism but in reality it's a cryptographic file system so the objects that exist in zup pass are pcds so these frogs are pcds your tickets are pcds PCD is a acronym that stands for proof carrying data I'll get into what exactly that means but first i'm going to kind of frame what is going on here with a couple of analogies so I'm sure you guys have seen like Gmail or email clients Gmail is an application and What it lets you do is it lets you operate on these objects called emails so you can send receive compose emails here's here's an example of an email there are many different applications and a lot of the applications that you interact with they have like an affinity for a particular type of file so like Microsoft Word lets you operate on Word documents anyway you get what I'm talking about so Gmail lets you send emails zup pass lets you operate on pcds so in the same way that like word lets you edit or create Word documents or receive word documents from somebody else and edit them uh zup pass does the same thing for pcds okay so what exactly is a PCD a PCD proof carrying data at the most basic level oh man that is really terrible let's see if I can zoom in okay so this is a screenshot from our code base uh we use typescript a PCD is an interface and at the most basic level these are the only two fields that are really important PCD has a claim something it's saying about the world and it has a proof um the way that the two are related is that the proof is a proof that the claim is correct so pcds are intended to be like Atomic pieces of data that are self-evidently correct so a really basic example of a PCD is a prime factorization so let's say that you have like a really big number uh that would be your claim I don't know like 12 for example and a proof that you know the prime factorization of this number would be the array 34 and somebody can look at this thing and trivially verify it using some math or some algorithms so the idea is there can be many different types of pcds and we've built like an SDK and a framework and an application that lets you operate on these things uh Without Really caring about what exactly it is they are so you can have prime factorizations or you can have frogs or you can have tickets or basically anything that you want as long as it's of the form that is a claim and appr proof so this interface has a couple of other fields ID it uniquely identifies a particular PCD and a type so there's many different types of pcds for example in the prime factorization situation the type would be the string I don't know prime factorization or something like that okay so zass it lets you hold a bunch of these pcds and the other thing it lets you do is it lets you do stuff with them so what exactly can you do with a PCD well obviously you can prove a PCD I.E like create a new instance of one you can verify a PCD I.E like check if it's correct or not um another thing that you can do uh are oh man another thing that you can do is you can make zero knowledge proofs about the pcds that you have in your zoo pass um yeah we I I know I described PCD in this like really abstract manner they're like self-evident pieces of data that you can verify are correct based on the proof and claim but what we really trying to do is make it really simple and easy to build applications that let you um make use of zero knowledge cryptography as a developer without really having to understand the cryptography because it's kind of a complicated thing so I have a zup Pass open here this is a local version so it's like a cryptographic file system so you can think of these as folders so for example in the connect folder I have several subfolders and here I for example have a ticket to the event called eth next so this is a PCD under the hood it's one of these guys but it's rendered in this particular way um and then I have another folder here it's called frog crypto my local version doesn't have unfortunately like the actual images I didn't set that up but this is a picture of a cute frog and this is another PCD so what are these things actually well these two different things I showed you uh the ticket and the Frog they're instances of a type of PCD so the ticket one is called an eddsa ticket PCD and the Frog is called an eddsa frog PCD so EDSA is a signature or like encryption algorithm kind of like RSA if you're familiar with that EDSA lets you sign stuff so an eddsa frog PCD is a Json that has been signed with a particular uh edds a private key and it's represented as a PCD so it's got a claim and a proof the claim is some representation of that Json so the frog has like different attributes like the jump attribute or the vibe attribute or the speed or intelligence or beauty so these are like fields in this Json and the PCD has all of these fields encoded in a particular way and it also has a zero or it also has a EDSA signature which would be also in the claim no it would be in the proof and then you can take the EDSA signature which is in the proof combine that with the public key which is in the claim combine that with the frog information which is also in the claim and you can trivially run an algorithm to verify that this is like indeed correct so PCD is one abstraction that we have in the system another abstraction that we have is called a PCD package a PCD package basically defines a new type of PCD so the eddsa PCD has a PCD package um the EDSA frog PCD has a package maybe I will actually open some code so you guys can see so EDSA frog PCD um you can see that this is just like simple typescript and um I have this like frog data thing name description image image URL and over here I have defined a type called EDSA frog PCD claim which is the Frog data and then I have an EDSA frog PCD proof and inside of it I have another PCD funnily enough um frogs all the way down um so this thing actually has uh you know the thing I was talking about public key a message and then a signature and the proof user ID in the claim is what in the claim a user ID or how can I say that I own that frog or are the Frog uh good question yeah so the thing that is in the eddsa Frog PCD um frog data owner semaphor ID so every zup pass user has a zup pass identity which is in reality a semaphor identity I don't know if you guys are familiar with semaphor it's a protocol that lets you make group membership proofs so you can like make statements on behalf of several identities and then the zero knowledge proof basically proves that one of these people with these public Keys said this thing um so yeah the the frogs are soulbound in a sense oh man okay where was I okay so we've got pcds we've got different types of pcds I talked about like frogs I talked about tickets I was just showing you the notion of a p PCD package so like here is the PCD package all of these different types of pcds are npm packages you can install them yeah so that's what's going on here and zup pass is like a place to put all of those little instances of data that are structured in this particular way and now I'm going to get into what exactly you can do with them which is make zero knowledge proofs about them or like that's one of the things you can do with them I guess um so there's this uh website that we built in order to like test all of the stuff that we're doing locally and I'm going to go to this page over here so it's really ugly it's not super interesting um but it does what it says it does which is pretty cool so I have this button um it says request zoo pass event ticket proof and when I click that button a popup opens and this popup is actually zoo pass so this popup is the same website as I have on this big uh site um and what's going on here is that this third-party website which is as you can see on a I guess maybe you can't see it's on a different port this one's 3001 this one's 3000 um anyway so what this popup is is it's a this link is a link to zup pass and then after this hash man maybe I can open this in like text edit um so you've got this really big URL right right and you can see it's got request equals so there's an API that allows third parties to ask zup pass to do stuff so this particular uh instance of an invocation of this API is asking zup pass to make a zero knowledge proof about a ticket so a ticket is an EDSA ticket PCD which is a EDSA signed data and now using this popup I'm going to make a zero knowledge proof that I have a ticket to a particular event ID and product ID without revealing any of the other fields of the ticket so the ticket has a bunch of other fields EDSA ticket PCD um it's got an event name ticket name um image URL blah blah blah and most I guess like importantly it has like an attendee name um and attendee email which are things that you may not want to share with a third party when you're proving that you have a ticket so you could imagine somebody like for example wants to build a website for All devc Connect at s to be able to like log into and like have a forum to talk about stuff one way you could Implement that is you can make them give that website an instance of a ticket PCD or if you're like more privacy conscious you could ask them to make a zero knowledge proof that they have a ticket that was signed by like a valid signer and it was a ticket to this particular event so that's like an example use case so when I click this prove button this pop-up is going to generate a a Groth 16 uh proof using snark JS and then it's going to send that back using a clever window. opener API to this thirdparty website and when I scroll down you can see that I got a zup pass ZK EDSA event ticket proof from zup pass when I expand you can see it's just a piece of data so it's got a claim which includes a partial ticket which is the event ID and the product ID it's got some extra stuff that I'm not going to get into right now and then it's got a proof which is a Groth 16 proof um and then this website actually Imports that same PCD package the ZK eddsa ticket PCD package it uses that verify function that's exported by that package on this literal Json that I just showed you and it says that the proof is valid um and you can see that the only things that were revealed were the event ID and the product ID and all the other stuff was not revealed okay so this API from third-party websites to zup pass it lets you uh make requests to instantiate a new PCD and that UI that you saw um is kind of it's like autogenerated from what the inputs are to that PCD I I don't know if I explained that in a way that made sense um but every single type of PCD as defined by a PCD package in order to instantiate it you have to give it some information and so zass allows a user to input that information into that prove function using this UI um uh using like maybe some pcds that the user has in their zoo pass uh and in some other cases they're able to like type stuff in so in the like prime factorization example one thing that you could do is you could like ask for a proof of a prime factorization of a prime number or a non-prime number PCD that they have in their zoo pass or they could type in like five and you know five and get 25 and that would generate a proof or whatever okay where was I so that's what a PCD is that's what zup pass can let you do there's an API um so like one thing that we built using this in practice that is like more interesting than the stuff that I showed you the stuff I showed you is just like random developer examples so something that exists live and in production now is uh we built this um situation you see on screen where people can use their uh Dev connect tickets to make zero knowledge proofs that they have a ticket and then give that to a web server that permissions them to access a telegram uh Hub which is a collection of telegram topics it's kind of like a mini Discord um so people were able to in their telegram talk to this bot called zcat they type SL start and then zcat opens up a web view inside of itself that has zoo pass in it the user logs into that zoo pass uh in that uh web View and then they see that exact same screen that I was showing you in the popup they click prove uh it thinks for a little bit calculates a bunch of numbers gives it to our web server which then lets that user into the telegram Hub so that's like an example of something that was built in in production uh to give so that's like stuff that we built stuff that ex it'ss now I I I also wanted to like expand your mind a little bit and think about the possibilities about like what are the sorts of things pcds can be so so far I've talked about EDSA signatures of data and then interpretations of that data as represented by the ticket PCD and the Frog PCD um we built those things in order to try to actually get users that's not what we're really trying to do like we're not really trying to make a really awesome ticketing EXP experience like you may have heard of like unlock protocol or something like that like that's not what we're trying to do what we're trying to do is bring this PCD Vision to life where you have a bunch of these like pcds flying around and people you know make proofs about them and talk to each other using pcds anyway so here's like a a cool example of a PCD one might have in the future there's this project called ZK email um ZK email lets you make zero knowledge proofs about emails that you received every single email anybody receives these days is signed by the mail server that is sending that email so if you go to your Gmail and you click the three dots you can download a raw version of your email and that email will contain a signature and that signature corresponds to the public key of a particular email server and so this ZK email thing it is a project that lets you take that email the full one with the signature put it into into uh zero knowledge proof as an input and then it's combined with another project that lets you make proofs about Json inside of a zero knowledge circuit and regular Expressions so basically you can make a zero knowledge proof that you got like an email from Microsoft with a job offer with a particular salary or you can make a zero knowledge proof that you got a password reset from Facebook uh for this particular account or you can make a zero knowledge proof that you got um you know a a venture capitalist sent you a term sheet and that term sheet like had a particular valuation attached to it so all sorts of crazy stuff you can do with ZK email so imagine you put an email that raw email that you have downloaded from Gmail into your zup pass and then you're able to use zup pass then to like make arbitrary statements about that email so like a thirdparty website might be able to ask you you know give me an email with like from this sender or from this set of senders that like says this particular thing and then you click a button the popup pops up you know thinks for a little bit you do the thing um yeah so expanding even further any signed data you can make interesting statements about zero knowledge proofs preserve the Integrity of information as it flows through like a dag of these Zer knowledge proofs okay so couple examples that are relevant for you guys zooo all of these links will be in a QR code this is a starter uh repo that lets you use zup pass stuff uh to sign in don't take a picture yet there will be a QR code uh with this link um so if you want to build with what we've got uh use that for like a login type experience and then if you want to give people pcds you can use this example issuer repo and then Austin Griffith also has an example starter which integrates with the blockchain so you can submit these zero knowledge proofs to like ethereum or something and then somebody I don't know if they use this but maybe they use something else anyway there's like a project that's live right now where you can use your Dev connect ticket to get test net eth somehow somewhere I haven't used it here's a QR code okay that was my 20 minutes [Applause]
Automatic transcript — names and jargon may be misspelled.