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

Loading player…

Ethereum Foundation 🛠️ Privacy and Scaling Explorations - How to hack on a ZK Project! - Ya-wen Jeng

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Ya-wen Jeng from National Taiwan University for a workshop titled "Privacy and Scaling Explorations - How to hack on a ZK Project!". Discover the power of the latest open-source ZK projects and protocols. Learn how you can unleash your creativity with privacy and security by building on top of user-friendly ZK building blocks. Thank you to everyone who joined us for ETHGlobal Paris 2023! Paris is the city of light and birthplace of many revolutions. Therefore we were thrilled to be back in one of the most buzzing and free-spirited cities in Europe for ETHGlobal Paris 2023. A lot has changed in the European ecosystem since the last time we hosted a hackathon in 2019. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Music] from privacy and Skilling exploration thing and today I'm talking going to talk about how to hack on the ZK project yeah and this is the slides uh lives there's a link and then the first link is those lights so you can see the examples and links in inside yeah so the PSE provides a price so I'm going to introduce a little bit uh so we provide fight 5K and we will choose four projects and you can these four projects can choose either uh uh three of these projects and first one is semaphore and then second one is unirp and the last one is each E2 easy k e c d s a and I will going to introduce these three projects later yeah so you can choose one of them to to hack yeah and I will introduce a little bit about Decay really short so uh video shares an example how so how we verify a transaction is correct so for so how how we verify that the X this equation is correct then we provide a plain text X so the miner and others can verify oh you know uh the the x of this equation yeah so quasi K does is that we provide a proof and then you don't know what is the equation and then on chain you just verified approved and then till tells you if it is correct or not so it is the Decay do on on Chen if you want to know more about zero knowledge you can go to the ethereum that website and there's a zero knowledge proof page and then audio X Park is also provide some materials for you to learn about ZK yeah so I'm going to introduce the first project called semaphore and semaphorn is in uh like an identity system and then you can generate a identity and then you can generate a membership pool of this of a group and then also you can include a signal in the proof tool such as to vote or endorsement some some information in it in this proof and there's a symbol for website and then you can uh getting started easier in in this website yeah so what 74 can do is something like you can prove that you uh you are a member of One uh of a group and then you don't reveal Who You Are and like I said uh you can endorse and signal so you can include a signal in this proof to prove that uh I I want to say something oops oh no okay like like voting always told bullying yeah so I will provide some example codes here like how how you generate and random identity so you you install the semaphore identity package and then you use a new identity function to create identity and there are several uh secrets and uh or public signals in this identities they are called trapdoor no fire and commitment and you can go to the documentation to see the definition of this different uh different terms yeah so this is basically how you create an uh identity yeah and then you can add add your your identity to a group and then you install a package called semiform protocol group and then you can create a group with index one and then you add a member in this group always then add member function yeah and then how you generate a Decay proof and you install the a package called semaphone protocol proof and then there is a general generate proof function inside and then you you can um generate uh external nullifier and signal in your proof and external neural fire is used to prevent your action being doing twice for example if you want to vote an event and then the external rule fire is the name of the event like the topic and then your signal is your vote like you vote one or two or three or something like that so the signal can be uh can can happens many times but the external neurovirus it can only happens once yeah so you you include this information in your proof and then I'll call it with the generate proof function yeah and there's a verify proof function as well so you provide the proof and then the group dips and then the group divs is the Mercury dips so and then I think it's provided in the in a group uh group object so you can just use the group dips depths and also semaphone provides CLI to install the package easier so you install the COI and then you can use semaphore create and your product directory to create your your project and if you want to explore this comments you use the simmer form Dash help to help you understand these commands yeah if you want to learn more about semaphore you can use the demo app or go to their Discord to ask them questions and then we are also in the first floor so you can find us and then ask us about uh if if you have questions yeah in their documentation yeah so the second project is called uni wrap so uni rep is a private and non-reputable data system and it is also and provides an anonymous to to users but in the same time the user can prove how much how much data they have and then if you you can go to this unirep.io to see the document yep so what it's used for you can use it for the reputation or data application for example you have GitHub and then you want to prove that you have how many stars in GitHub and how many followers in in GitHub you can use this protocol so you turn the web to data to web3 and then you can generate a zero knowledge proof to prove oh I have I have such amount of stars in GitHub yeah and also you can improve the membership of oh I'm a a user of GitHub something like that yeah and there are some example application they build by our collaborators so the first one is a trust list so uh you can it's a uh you can sell product product and then you choose which uh which buyers you you want to change uh transaction with yeah and the users are Anonymous and then the second one is what I said you can Bridge your web to reputation to websterite yeah and then the Third example is a social media so we can build an anonymous social media and then other people can upload or download a post and if you are not able to generate a positive proof in the future you are not able to post in the in this Anonymous social media yeah so it can help to manage an anonymous social media in web 3. yeah and then the last example is uh voltasan so it is about like a voting system but it's different from semaphore is that in the end of the hack Zone you you finish the pro uh you think people finish voting and then you can prove that how much votes I have yeah it is odd a little bit different from semaphore yeah so to install this package you use the npn install your new rap core and they are the file the following example codes yeah because they are pretty much sorry yeah so uh the the first uh the example here is that if we want to deploy a unirp contract we use the deploy unirap from the contract package and then you just connect your wallet and then call the deploy your new Red Smart contract yeah and if you want to connect to a deployed unirp contract you provide an address and then your the provider or your wallet and then you can connect to a deployed a small contract yeah and then the protocol is uh like this floor so the users are just providing proof to the testers and then a tester or relayer will submit the proof to Smart contract to verify these proofs and then the users can uh see the data on the smart contract and then know how which data is my uh which is my my data and then you can generate a valid proof to prove them yeah so uh so the a tester here is like an application and then you set up rules for the data how user can can can get data like for example like the GitHub GitHub is in a tester and then a developers are users in this application and then the GitHub will manage how users get uh received stars or followers and something like that yeah so the the tester is pretty much like a an application and set up rules for users yeah so uh you can sign up and a tester with a wallet oh here's a wallet example so you call this a small contract and then call the function a tester sign up and provide an airport lens yeah and you can go to the document to see the definition of like a park or a packet yeah and then there's another way to sign up and the tester is use a small contract so you you yeah you can call the uni rep on chain with with the small contract yeah so if I'm a user of this application you can generate uh so how to sign up a user so user can generate a semaphore identity here and then create a synchronize all the untrained state with the user state uh class so you provide a proverb it is uh used in a circuit is help you to provide a zero knowledge proof and then you will provide the unirp address contract address and then you provide a provider and then your semaphore identity and then you see you use the start and wait for sync to start syncing the whole event happens in uni rep contract and then you can generate a sign up proof with a gen user sign up proof function and if you want to uh return and then you just call the users users they stop or it will keep syncing synchronizing all the states yeah and when users generate this proofing client the user can should submit this proof to the tester or application itself and then to call the a tester and only the test card can call the unirp contract to send a proofs on Trend and then update the unirp uh smart contract state yeah and how users receive testations or data or reputation uh the user should generate a temporary identity called apaki so you can imagine that you you have a list of wallet accounts and people cannot link all these accounts to you but uh so but in example in unirp you can generate a set of Epic keys and then you can prove that all this this assets is yours yeah so epic is one of this like address the effort it only lasts for a and a part and Epoch can be like one day or seven days or one week or something like that yeah so if you the the upper is too short you're not able to use this EPA key for a long time but if it Parks too long you are uh you should wait uh you should use the same identity for a long time yeah so this is how you generate a temporary identity called Epic yeah and a tester whether a tester see this apaki he can send data or attestation to this airport key yeah so in this uh example um the the testers and the index we all data index 0 to 5. yeah because we provide for example six data lens so you can change six of six of them yeah but uh this in this example is that if we Define a field index 0 is the GitHub Stars so if and and it increased by five so you you give the index zero index 0 to 5. yeah it is how if you don't want want to know more about data you can go to the documentation to see how data is defined yeah and when an airport ends we the users will call a user State transition to receive all the data to uh the user itself so after users they transition the user can prove how much data he has yeah so here's an example to generate a usage day transition proof and also this user should submit this proof and then it can be submit by a relayer so yeah I use the assigner here but not really here yeah and after users say transition the user can generate approve to prove uh how much data he has for example if the user has have five and then they can prove that oh I have at least three yeah so you don't have to review all your your assets or amounts of data and that but you can generate a valid to to prove or you are in a certain range of data yeah and then you can also build a tester with the CLI is more easier and this call this CLI I will provide a a circuits and contracts and relayer in front end so you can start the app by uh yarn build and with hard hat node and then deploy your small contracts and then you can start the relayer in front-end client yeah so the last project is called e2e ZK EC DSA so it's it's a private easy DSA signature verification so you prove the ownership of a Syrian address yeah so the problem with the previous example is that you you have to generate a new identity secret but it is really hard to manage uh many different secrets so uh this use this example is that you can use your wallet to generate a proof so you don't have to manage a new Secret yes and then you can use the rzk ecdsa for a verifier contract so that your your contract can can still there by assets but you'd uh but but with uh ZK zika proof and then you can use for an anonymous airdrop yeah or a Discord verification but yeah uh and really enough familiar with this product so please go to the website to check how uh how it can be used yeah so this the also an example code here yeah but yeah and there is a demo app so you can prove your assets with your wallet is in this link yeah so we have these three projects and yeah 5K baltis so if you are interested in one of these projects please uh uh hack it yeah so oh if you have more further questions you can go to the PSE Discord now there are many peoples there too answer questions for for people yeah and thank you [Applause]

Automatic transcript — names and jargon may be misspelled.