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

Loading player…

Hackathon Workshop:PSE MACI_ETHTaipei 2024

ETHTaipeiWed, Oct 9, 2024, 12:00 AM

Transcript

okay hello everyone it's me again I'm Doris from PSC team and I'm going to talk about Massie like in the technical side so yeah it's the same p is like the introduction so I won't like go through it again so it's just a unchair voting protocol and you can check it check it out on the previous pbd to know the background and how do we decide to make it and how like we uh decide the structure so when running the Messi like first of all you need a trusted coordinator so the coordinator will deploy the contracts and deploy a poll and starting a voting period and also like they will choose the user from signing up and during the signing sign up period everyone who fulfilled the requirements could be able to sign up to the contract and then during the voting period that everyone could submit messages such as uh the vote message and the key changing message to the to the Messi contract and after the voting period ends uh the coordinator will process the messages and totally result and update upload to the chain and everyone could verify it so the architecture of the Massi project the Messi protocol is like this first of all is the there are circum circuits because like the messages the results are like um using building on top of the ZK narc the zero knowledge approves so we built some zum circuits for the processing messages and T votes like uh so far actually we also built one for non be for non-quadratic voting ones like previously only the quadratic voting ones there yeah and there are smart contracts and if anyone's want to like building on top of Messi this is the uh the place like you might modify it the most like first of all it's the messy contract like it's controlling all the Logics happening in messie and the second is the poll like the poll like you can uh submit message to it and then The Gatekeepers the gatekeeper is like gatekeeping users from signing up and the message processor is processing the message that it's mainly for the coordinator to to run it and also the tally votes contract so B besides that that there are several types libraries um so there are domain objects like containing logical container of purely domain information such as the public Keys private Keys the key Pairs and also the structure of the commands like the commands is um one a part of the message like in a in the message you submit that there are command and your signature so and the second one is the crypto the cryptal package like holds the abstract abstractions over cryptographic such as the acq and I will uh explain the acq later so the third one is the core the core package containing the smart contrast logic com for logic uh for loog for local processing so like you can imagine it like there are typescripts that pulling the data from the smart contracts and then like build a whole Massy St or pole locally and the user I mean the coordinator will processing all the things locally and generate proof and upload to the chain and everyone could verify it like we do this is because like running locally is more efficient and the fourth one is the cly so everyone could like enter the Cly package and run the commands there and the last one is the integration test like you can test each Cent comment and also the entire flow of messy so let's explain like more about the whole flow like first of all is the sign up so you can imagine that the coordinator deploy contracts first and there are several contracts I only list out four of them like and then the user can generate Massy key Pairs and then submit the public key to sign up to Massy contract so contract that it is dealing with the whole logic and managing the Massi State like for example if you are going to sign up you could call like messi. sign up and there are factories beh holded by the Massie like the the factories are deploying polls and also like message processor uh contracts and we use a factory to hold it to decrease the size and there are gatekeeping gatekeeper contracts like uh you could deploy a free for all signups gatekeeper but also you could like make some restrictions to it for example like only the user who is holding a certain Coop could sign up like you could build that kind of GateKeeper by yourself and the fourth one is the V registry this is like really uh intuitive like just holding the B keys so while generating the key pair like the key pair is holding like both public key and private key and it looks like this it's a little bit small but it starts with like messy PK or messy SK like stands for public key and private key and you will like sign up or uh sending messages using these keys so while you're signing up like you're submitting your public key the Massy public key and also the gatekeeping data for example you have certain pullup like this is kind of a gatekeeping data and you submit it to the messy contracts and the messy contract will check it through the gatekeeping contract and then to know to see if you could sign up or not or not like everyone could only only sign up for ones so after the sign up period there is a voting period And once the user call uh the coordinator called the um Massi that deploy poll the voting Period start immediately so there is a duration parameter there so after the duration par after the duration time the voting period Clos CL so everyone no one could submit any poll after the Voting is closed and before like during the voting period the user could generate messages and submit to the poll and the messages could look like a poll a a vote or a key key changing so let's see how it looks like so a message is containing a command and signature and being encrypted with a ecdh shared key generated from the Emeral key and the coordinator public key so like inside the command like there are State index which is the state Le index where the signing key located and then there's public key so the state index you the the each user has its own State index and the public key is the who is the one who submit this message and the vote option index is which option you're voting for and the vote weight is like how much do you want to vote for the option and then there are nons to cheack the message order so and it could invalidate previous votes so if you submit it like for the same like vote option but for different weight it could be like invalidate and then there are poll ID and sold so if you are submitting vote for a certain option like mainly you are changing these two parameters and for the publicy it would be the same but if you're are going to do the key changing and you will some you will modify this parameter to your new public key okay so actually every one could vote could uh could do the vote could submit the messages but only the side up users message would be counted and then after the voting period end there is final processing like rely on the coordinator so first of all they they need to do the merch trees and because we are using the trees like as accumulat Q so that's why we need to merge it and there are two trees the first one is the S up tree and the second one is the message tree and then after merging trees and the coordinator will build the message State locally and then process messages locally and this code could be find could be found in the core package after processing messages the uh you could go to the top Hotes and then generate proof for both of them and submit the proof on chain and for users you could verify the proofs on chain like every user could do that even though you are not signed up you just you could verify that so this is the accumulator queue that you can found in the crypto package so why we use this queue is is because it could subsidize gas Cod and not requiring state route to be updated at its full death so at the end of the voting period we need to merge the sub Roots so actually when you running a Messi you need some trust assumptions so the assumption is the coordinator is honest if not they could publish the Crypt messages which would violate privacy because only the coordinator and the one who submit the message could uh decrypt the message and then not including a round or delayed calling that not running not uh forcing to to the message and then collude with the briber will like violate the collusion resistance but but even they are not honest they still canot not sensor vots since it's all like running on a pre-agreed code and also they need to perform correct processing and toing since it's running on the ZK snar so the circum will check all of it so uh we could try try it now so if you have computer so you could get clone off our messy report and then install it and build it and download the test keys and the keys is uh already being uh C running after the ceremony and then you could go to the contracts and set up the environment file and deploy config file and then run the hard hat locally and deploy all the things locally try all the things so these are the defa Z Keys um for the state tree death we Al which is the allow user amount because we use the quinary tree so defaultly is like um this amount of user could be sign up and there are like in intermediate state tree and message tree death and vote option tree death like which is really intuitive and the default value is 10 1 and two okay so uh at the beginning you could generate your messy key pair if you're a user so just run the comments there at the top of this picture and you can get the private key and public keyy and then you can use the private key and public key in the following steps and then sign up so for the sign up you can check out the uh index file inside the cly package so this shows displays how like it's successfully signed up and then you could publish message then this is the example for publishing the message for voting a certain option yeah so uh here like below is if you are like publishing message after the poll ended there will be an arrow telling you the voting period is over so after that you could run the merge like for merge sign ups and merge mer messages just as we talked about before like these comments are Rong on in the C package but since we update the contracts package so you can also run it in the contracts package just run merge Local Host and like insert your PO ID also generating proof and the T results you can just run the proof Local Host and well actually there are several parameters below like there are so many of them so I didn't put it here so just check out the cly package or just try it and then everyone could run the verify to verify the toally results and the with the PO ID so this is this page is Samus I introduced this protocol so the first one is CTIC founding and quadratic voting which is like we also collaborate with clear F found now to run several quadratic founding and maybe you could build some Dow voting app or just purely voting app vote for everything or vote for games V for like who do you like or just like yeah just whatever you like and the new gatekeeper so like now we know what is the gatekeeper so maybe you could collaborate like you could import the POA import EAS import other protocol to to run your gatekeeper and SEO protection so as you see so everyone who have a uh Massy key pair could sign up to this protocol so what if someone like generate a lot of key pair and sign up like uh s make many multiple signups to it and break this whole system so maybe it's a good way for you to build and extract some of the Primitives and build something else so we like introduced before such as the acum accumulator queue or some of the key pair like generating things so if you can build on build things on top of it it's also like it's also welcome to to apply for the Bounty uh also now we only can run the comments on our computer uh I mean on the clment line so if you build like a front end or a application to for the coordinator to manage the Massy rounds that's also like willing to see it and there are several discussions uh inside the Messi GitHub repo and more uh more options for you to build out so if you have any question during the implementation or installing feel free to ask in the Discord or check out our document and I'll also be the mentor for tomorrow so if you have any questions could also ask me yeah thank you

Automatic transcript — names and jargon may be misspelled.