New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Unirep and Unirep Social, Applied ZK - Day 1

Ethereum DEV NLSun, Oct 9, 2022, 12:00 AM

Exploration of the cryptography primitives and data structures used in UniRep, a protocol enabling users to give, receive and prove reputation anonymously. We’ll also demo UniRep Social, a Reddit-like social app using the UniRep protocol. Speaker(s): Vivian Jeng, Barry Whitehat Hosted at Devconnect Amsterdam, 2022 Visit the website: https://devconnect.org/ Or follow @EFDevconnect on Twitter

Transcript

[Music] so so i talked earlier about like these groups and how we want to make a lot of them and like sidor and jeff kind of presented about a way to make these centralized groups and like the idea is that we have this kind of chicken and an egg situation where we want to have a lot of private applications but in order to have them we need to have like groups for people to be able to signal from and in order to have groups we need to have private applications so the idea is that we will start with something like interrep and we can we can make these like private groups and then we can we can use that to bootstrap like on chain groups that are completely decentralized that that insult is working on and with with other people and like maybe we can chat about that later but like the the idea is that like we want to build this kind of like ecosystem of private applications so well we have these groups and what can we do next like the first thing that we need to realize is that like when you do things in a private world there's no consequences right because like if everything is completely private and all your actions are private you can't really be held accountable for your actions like for example there's this there's this social media uh project called autism that that that's basically uses semaphore to make like a message board and i think i think brian do you have one called zk messenger is that the same okay that okay okay not the same but similar idea uh so yeah so people can post however many messages they can they can like not be really penalized for the things that they're saying like there's there's no kind of feedback right that like when you do things privately you don't kind of get this sort of feedback uh so so and because we don't know who is doing something we're not able to like punish them or like adjust the system so that they have like different properties or different like amounts that they're able to say the next thing to realize is that like we can do objective things in inside ckp's like we'll hear from oscar later i think about orlan which which is like if someone messages more than x messages per second we can we can punish them i don't like the word punish penalizes maybe better or yeah i don't know what a good word is but um this works because it's completely objective right but when we're thinking about like the context of like social media it's not so objective like if someone made a bad post or if someone made an inappropriate post like this is like subjective and like we need to have ways to be able to react to this and we can't do this inside of zero knowledge proof so we need to have a way to like deal deal with this hard problem and then vivian is going to tell you how we do that and i'm going to tell you like the final thing i'm going to talk about is like uh if we can do this then then it'd be really cool right because we would be able to have like this kind of private world where you're able to like not only like signal about like things that happened in the non-private world world but you can change and adjust and things can grow and it feels like this is like an exciting set of applications and like we can do all kinds of fun things and vivian is going to tell you how to do these things yes thank you very much and i'm viviane and i want to introduce you how the unirap protocol works and i will demo uh the social media we built upon the uni red protocol yeah so uh you can imagine that there are a lot of a lot of application in web2 and and we know that there are many kinds of reputation in this application for example you have followers in your youtube or you have like or disliked in your youtube video or for example you have stars in your github account but there are a lot of this interpretation yeah right yeah but um imagine a situation that you are a platform a user and you want to prove that you have a certain amount of reputation to a b platform user and yeah like for this example as one to prove that he has certain amount of reputation in a platform but how can alice prove that his reputation yeah for example alice can take a screenshot in his app but it will compromise less privacy and also the screenshot can easily be forged and also another user cannot be convinced yeah because it's really easily to be forged yeah so we built unirev to solve this problem yeah so the unira means universe universal reputation and it's a private and non-reputable reputation system and users can give others the positive or negative reputation and also users can voluntarily prove that he has certain amount of reputation for example you have like 100 reputation and you can voluntarily prove that oh i only have 10 yeah and users cannot refuse to receive bad reputation from others right and yeah and we i will introduce how it works and so there are two extras in unirep one is a tester and another is users and the tester is like application itself so it is public uh public information that everyone can see this at the attestation is from which a tester yeah like the a tester can like issue reputation token to others so everyone will see oh this is the application token or the application token and there is another role called users and user can receive this reputation and prove how many rep how much reputation i have yeah and how can we achieve privacy is that a user can generate a temporary identity called epaki and a user can generate like k apar keys in one for example an fpi like seven days and if if they are all effort keys and you cannot link any apache to one identity yeah the epic is like just the random number in the universe social yeah and i will demo the universe social and also you can scan things this link to our our website or you can just type the unirep.social so you can link to our website oh yeah and and now the unirev social net requires the invitation code and we have we brought some invitation code so after this reputa presentation you can ask us to give you reputation invitation code yeah so this is the social media like this i just log in and you can see uh yeah this is my red and people can oh i should if you enter this website and you can use join to and enter the invitation code to join this system and yeah and also you can request here and our colleague will help you to join this and yeah after re after you sign up you will enter this website and you can publish the post like for example ck workshop and i can choose the these three identities i uh three personas i have and they're all uh like random numbers so everyone cannot link anyone to to to anyone to myself or to an identity and here is the reputation display like i said people a user can optionally prove that how many reputation i have so i can scroll this bar and i can prove i have 100 reputation here yeah and in this system we we don't want the post to be like no cost so we ask users to like spend five reputation here to post yeah so you will receive five negative reputation if you publish the post yeah and it has to generate proof and to submit to the uh blockchain blockchain so yeah let's wait yeah it's finalized so you can see my post here yeah and you can see the transaction on user skin yeah and if you sign up you can vote or upload or download my post and you can also choose the identity you have and also you can comment here right and also then you can choose the identity and repetition you want to display so yeah so how user can sign up in this universe protocol uh we use the sample identity right like jeff said um we can use this identity and identity commitment to oh we use this identity commitment to set up in the unirac smart contract and and there's a global state tree and it stores the hash of your identity commitment and your your user state tree root and what is the user state tree it is the uh your state of reputation yeah yeah so the leaf of the uh this this uses state tree is your uh hash of positive reputation and negative reputation and also gravity and santa fleck and you can just imagine that you have positive and reputation and negative reputation and the the other one the other two is like to make your reputation more diverse so you can make more um more application to in your in this reputation system yeah so you know that um there are testers in this protocol so the index of each leaf is the the a tester id yeah so um yeah so this is sparse macro tree to store all your reputation state and what is the global state tree is that you has your id commitment and the user state tree root yeah so there will be another hash in to to insert into the global stage and it is an incremental micro tree that the first user site first user signed up and it will insert in the first first index yeah and it's all public data so oh yeah in this user state tree the your reputation are private right so you don't want to other you don't want others to see your reputation and then in this global state tree the hash that value is a public public data and if your leave is inserted in the global state tree it means you are signed up or and you are a valid state in this reputable protocol and how a tester signed up it just used the a tester's account or a smart contract to sign up through unirep yeah so the universe contract will store the the address and to assign a tester id to this a tester yeah so in the uniref social example the universe social itself is a is a tester in this in this protocol yeah so to sum up user will use their identity commitment to sign up and a tester will use this address to sign up and how can user generate the epa key the application is computed by the hash of her identity identity and epoch and nows yeah but how can we make sure that the user has already signed up in the universe protocol and how can we make sure that the epoch is computed correctly and it is not a random number so we use a zika proof to prove that this epic key is valid and compute compute correctly so in the epa key proof it will compute the apache itself and also it shows the global state tree route so you will see uh if if it matches the current global state tree route and we can make sure that you this user has already signed up in this system in this epoch so the if after users generate the epaki proof and the apa key and the submit is proof to the smart contract and the other users can give attestation to this epic key why we have to submit this proof function because we have to we like everyone to verify this proof is correct and then this is this user is allowed to receive reputation yeah and after this after the user gives the reputation it also starts on smart contract and the reputation has to be compute a hash chain and the hash chain is to hash all the reputation yeah like the reputation is uh hash of the reputation is computed by the tester id and positive reputation negative rotation and other two variables and in this way each apa key can generate their hash chain so the user cannot ignore any reputation because or the hashing will be totally different yeah so now we have reputation here and how can users receive this reputation now there's a action called apart transition and after this apart transition we will hash all the sealed all the hash chain and it it will compute another tree uh another global another tree called apac 3. and the apache is the its value is the sealed hash chain and its index is the epa key right so the all the reputation in this airpod it will generate another tree and other many um other one um all the users know this have ipad 3 right so you can verify if your apple key is in uh indeed in this apache and you you don't ignore any reputation and user has to generate another proof to uh to perform users they transition right because user has its user state tree and we have to update this user state tree so the user has to generate approve that to process all the like yeah for example the uh usage is empty and we receive the reputation one and i update my reputation on my user state tree and if i receive another reputation and i will subsequently update my user state tree yeah and then in this circuit we also confuse all the all the upper keys you have so uh we in this circuit also it checks the uh the if the hashing and the apache matches the current apache route yeah so after we update the user's day tree and user will gen will have another global stage relief to be inserted in the next epoch yeah and we have a nullifier called apache nullifier to prevent user from your user state transition [Music] more than one time yeah and after user state transition end users users stay tree updated and the user can generate the proof that to prove how many reputation the user has yeah the idea is that i can prove that one of the leaf in the usa state street and also this lift is in the global state tree yeah so the overview is like um user can user in a tester site up here and a user can generate apache proof and others can give reputation and the effect transition is to seal all apaki apache hash chain and build a apache route and user performed uses state transition to receive all this reputation he has and update the user state tree and then he can prove his reputation yeah thank you [Applause] any questions the identity is not known how do you follow someone how do you know you're following you oh yeah good quote and who switch those first posts and i don't get that yeah so the question is that how i can follow it and the author in this social media right oh yeah so this is the things we will do in the future yeah we would like to let user to have their username so i can subscribe this username but we haven't uh done this feature right in this social media right now can i can i ask another thing um how do you you i i heard you can anybody can give you a bad reputation and you cannot refuse of course now how do you counteract for the fact that most people are prone to when when you see something you don't like you you react to it and you give about a bad reputation but not so much when you like something so at the end if you don't have a way to counteract that you will you end up canceling everyone oh also you mean that how can we prevent users to downvote anybody without any cost no it's too is to take into account that you're gonna get more bad reputations uh that good reputations and normally because when people are offended for something it's it's very easy for people to give a bad reputation but most people don't go in to do a review a good for for a good thing that they saw for at least not for most things that they see oh do you mean there is more bad thing more bad reviews that good reviews normally so you mean the bad behavior users how can we prevent them like no what i'm saying is you're gonna find the natural bias in in people uh giving bad reputations it's it's usually in more than the people that will give reputations to to do good things so at the end it will tend to unless you have a way to counteract on that a percentage or something tend to have get people all with bad reputation yeah okay so like the first thing so let me repeat the question just to make sure you understand like you're basically asking that like people are bad and they they don't they don't do good things you know they have emotional reactions to stuff and i don't think that we can have a zero knowledge proof solution to this however there's two things that like mitigate it like sorry sorry no that's not the people are good but the when when it comes to reviews the reaction of of people i mean you see a lot of good things every time yeah you normally don't go oh that's good i'm gonna give it a review good review no that's good i'm gonna give you a review but when you see something wrong you are you tend to oh i'm gonna give it up review because i don't like this so you give a lot of bad reviews okay and not so much good reviews so it will be skewed like this it costs to give negative reviews and it costs to give positive reviews so like the system will equivalate it come to an equilibrium around this even more because you were not gonna pay your reputation to give a good review but you will for a bad review because you didn't like that in the interest of time all right yeah yeah we'll get a quick response and then do one more question yeah thank you all right you want to take one more thank you for your talk um so as an attester how much information do i have to reveal and how much information can i keep private like can i attest anonymously can i only reveal the positive can i conceal both the positive and negative also as the site uh the the site up a tester it cannot be anomaly um yeah so the rep the you give representation is public and the in this system the attester cannot generate the apache and another proof yeah so if you uh you want to your privacy you have to like actor act like an user in in this protocol yeah should we want to do one more yeah let's do one more question thank you for the talk i think it's a very interesting topic so um one of one of the things that i'm that i want to like in the close future is a way just to integrate all these kind of things with without the permission of the providers yeah so for instance uh there's some some tool that exists that is called tls notary that is a way used to to use the tls protocol to to get a proof that this website generates something so do you think that we can if there is a way to do this do you think that we can find a way to just to bypass bypass providers permission for this kind of claims so i think that that's more to do with like making the groups that semaphore kind of consumes the groups and like you're saying how can we make these groups in a trustless way and there's yeah there's all kinds of things we can do like just a tls notary to to like make these groups in a you know in a like it's still like it's still a kind of trusting that like but the set of people you have to trust is reduced it can be just done unilaterally on the part of the user with tls notary um yeah i think i think that like as time goes by we're going to have to get better at like having on-chain reputation sources that like i think i think about interrupt and tls notary as kind of bootstraps because we have this like chicken and egg thing where we want more groups we want more applications and we need to have some groups so we can have some applications and as soon as we have some applications we'll have some decentralized groups as well or we'll have more that's my that's my thinking what do you think vivian okay thank you all right thanks so much barry and viviane [Music]

Automatic transcript — names and jargon may be misspelled.