Introduction to the MACI Wrapper

PSE Showcase · 10 Jul 2024 · 16:54

A technical walkthrough of Introduction to the MACI Wrapper, covering the project’s purpose, architecture, and use of privacy-preserving or verifiable computation.

Topics

From PSE Showcase, hosted by Privacy Stewards of Ethereum.

Transcript

hello everyone welcome to a new PSC showcase session I'm Vian Placencia and today we have jash who will be talking about introduction to the Mac rapper H as usual you can write the questions in the chat and Yash will answer all of them at the end of the presentation and you can also unmute yourself at the end of the presentation to ask questions and welcome Yash thank you very much for being here and the stage is yours feel free to start whenever you want thank you so much so hi guys my name is Yos and I've been working on Macy raer and some other applications of Mai for the last four months so basically if you don't know what Macy's uh Mai is about so Mai is uh minimal uh anti- collusion

infrastructure and it is basically built to reduce the uh collision and um like if a few people are voting in someone's favor and other people see those votes and it creates a bias effect that is one uh one thing that may see prev and also it uh it does Private voting it helps in private voting so it's built for blockchain voting uh mechanism uh without any collusion so let me give you a demo about demo on the Macy reer so what I was thinking is like uh I can set up a new project new Macy rapper project so that people will get the

whole uh overflow like how to set this up also so let me go to the repository and start setting this up so it's cloning the project and oh wait a second this is wrong

one it's ring the project and now if I go to m project and you can do a install so on one terminal I will start the harded node after the installation so for starting a harded node you can run Yan chain and we need to deploy uh download the Z keys so for that you download Z

Keys it is going to download the keys uh in one terminal I will deploy the code and start the uh next year's application so for that uh you can run y start so now the keys are downloaded and I can deploy the contract on

harded using Yan deployer okay it's deployed now I can go to the website let me open this in the development instance of myring this one okay so it is going to connect with my metamask and and make a signature uh signature request and after signing in it is asking me to register on the starter kit because this is a fresh key

and fresh instance so for uh by resing we resing on the ma contract let me clear my metamask history because I just started the plent okay yeah so I have registered and as you can see there are no active post right now so we can go to the admin panel as this is the admin account uh it can go to the admin panel and create a poll so let's call it test poll one and it can expire 6 hours or 5 hours from now and uh we can select three different types of polls which is single candidate

select multiple candidate select or multiple weighted candidate select I'll create all three in uh in this demo but let's first create a single candidate select then we can select quadratic on non- quadratic voting options and let's select non quadratic and candidate names so the poll is created now because uh I'm running this on hard Network and the there is a slight delay between the harded uh time stamp and the system time stamp it's not started but it will start

in a few moments let me create the other old types also in the time being so let call it 4 56 just forck seeing the difference now the first poll is open let me also create the third poll okay so all three polls are created and first poll is open and the other polls

will be open very shortly now second is open go to the homepage Let me refresh once you can see all these three polls and if we go to the poll which is single candidate select then it would give these radio button based options so we can select one option and vote for vote for this uh candidate now if I go to the poll which has multiple select uh we can see that here the check box up here and I can select multiple candidates and vote for them after signing the message it shows uh

vote successfully casted and the last type of the uh vote is the vote with weights so user can assign different weights here uh let's say I want to give 70% of my vote to candidate 8 and uh 20 votes to candidate 9 I can vote now um this was a brief demo for users who want to like go into smart contract and like check some Fields they can click on debug contract and in the debug contract they can see all the uh basically this is for

uh development but uh like it depends like if you want to make this public you can also make this public else for for development when you are developing you need to check some contracts and uh check their fee or write something directly on the contract you can go to the debug contract Tab and check each each contract skes so for example if I go to Massi rapper and F the poll ID zero it gives me the whole poll ID data and um I can I can take a look at this or maybe write something also now let me go into the code and uh tell you how to uh change some fils if uh if you want to customize this so you

can go to the packages uh folder and in the harded folder you can check the uh different files basically when you deploy this for the first time it will create a few things it will create the uh coordinator key pair. Json which will contain the private key and the public key for the key uh for the coordinator and it will also create the contract addresses. Json now this file is in the same format as expected from the mcla so if you install the Massi CLI uh using the instruction written in the GitHub repository here so it's using uh the 1.2 documentation

version uh where is it here so uh you yeah you can clone this package from the uh PSC GitHub uh GitHub account and then go to this particular commit using get resch hard than the commit ID and uh in there you you can uh follow these instructions to First copy the Zs and then build the project and then this contract addresses file which I just showed you will go to the CLI build folder um and this is going to be the same format as expected from the CLA after that you can run any command which is present on the Massi uh CA documentation and

and uh do the state merge on the uh using the coordinator on the smart contract and then the message merge and then generate them uh generate the state local state and subsequently proves now the other files that I wanted to show are the constant file so if you want to use some different uh Z Keys maybe uh want to do a bigger uh poll which require a lot more users so you will generate your own Z Keys using mli and then you can change the config here to update the smart contracts maybe if you want to uh not use the default gatekeeper which is free for all and can

resister you can change the gatekeeper name here and add the contracts here uh in the contracts fer and same goes for the initial Voice credit uh contract and the verify contract name so if you add new contracts you just need to change the name here and it would deploy your contract instead of of the default contracts now for deploying it to different networks you can just run y deployer hyphen uh hyphen Network and then the name of the network and this will deploy the contract to the particular Network selected which in this case would be base if we deploy there now after deploying to the uh different network you need to change one

config file in the uh next CH pack packages in the next CH package you need to go to the scaffold config.cfg you can select multiple chains also chains. base and now it would support B both hardit and base Network granted that you must need uh to deploy the contracts before you add this here and uh uh if you if you want to update uh the update the client to support a different method of signing uh one thing important is like how the private keys are generated on the client

side So currently the user is asked to sign a message and uh that signature is used as a source of Randomness in generating the private key you may want to use different mechanism for generating private keys and that can be done in the context folder in all. context so here we are uh doing this logic of generating key pairs you may want to use different logic in this uh function and there there is a file called um like in components there is a file called po dat. TSX and this is the poll so you may want to use a different logic in displaying pole you may want to change the Styles and you you can do

that in this well in poll details yeah and uh if we if we talk about like the stuff which is currently built using this is uh there was a team in eam who did a feedback system a private feedback system using uh M rapper and also I'm uh over the phone but uh currently I'm also working on another project uh using the M rapper which is uh which is a telegram bot uh you users will be able to write like SLG Governor uh add admin let's say if you want to tag someone let's say tag check me so at theate yes and then it would start a poll on chain that would uh that

would like user will be able to go to that poll using a link and they will be able to connect through their telegram account and after connecting with the telegram account they will be able to vote either in favor of me or against me and based on the outcome the bot will do the relevant action on the telegram and uh also uh I'm currently adding new ways of uh signing sorry new ways of signing the vote here on the M rapper so uh currently if if we log out uh here currently you need to log in using your wallet and then uh sign a message to generate the randomness Source but I'm also adding another keeper system more information will be

available on my GitHub soon but basically user will be able to download a application on the mobile uh mobile and then uh sign in using a QR code scan and after that the mobile application is going to manage all the uh different key pairs related to your Massi account and you can switch GPS you will be able to use different GS for different side or the same GP for different size as you wish yeah um uh this was all about the Massi rapper and if you have any questions I'm happy to answer in the chats thank you very much um yeah I

will yeah now people can unmute themselves to ask questions you can also write the questions in the chat and thank you very much for the demo really nice project thank you let me I'm share the screen second stop sharing okay yeah it looks like there are not questions so thank you very much for the

great presentation and really nice demo and interesting projects the the B thank you interesting so thank you everyone for attending thank you very much J for the presentation and have a nice day everyone thank you thank you Yash good work thanks guys thank you thank you bye bye bye