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

Loading player…

Ethereum Foundation - Semaphore: The Power Of Anonymity

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join Vivian Plasencia of the Ethereum Foundation for a workshop titled, "Semaphore: The Power Of Anonymity." This workshop focuses on the Semaphore protocol, what it is, how to use it to build zero-knowledge applications, and some use cases. With a week of open learning, hacking, and workshops on all things Zero Knowledge technology, as well as $50,000+ USD in prizes, Circuit Breaker is a great way to connect with the community from around the world, and help shape the future of Ethereum! ----------------- Find more about Circuit Breaker: https://ethglobal.com/events/circuitbreaker Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

[Music] hello everyone and welcome to the circuit breaker PSC ethereum Foundation Workshop semaphor the power of anonymity joining us today is Vivien Placencia who will be taking us through this session and with that I'll pass over to Vivian to get the session started thank you so much H for the invitation let me share my screen hello everyone H my name is vencia and I'm a software engineer in the privacy and scale expirations team at the theor foundation today I will be talking about a semap for how can you use it to build Ser knowledge application and some use cases and a bit more so this is the structure of the application we will start with where is SEMA for then we will talk a bit about some use cases then H the three main components of semap for identities then groups and then Ser knowledge proofs H in semaphor which are the signals and and also how to integrate semaphor into your project and and some and the architecture of a SEMA for application and I will show some code during the presentation H let's start with what is semaphor so semaphor is a c knowledge protocol that allows users to prove their membership in a group and send signals such as postes H feedback or any other text message without revealing the user identity this means that signals has have no connection with identities it also provides a simple mechanism to prevent double signaling H which means that you cannot verify the same signal h the same proof twice and semop for is a public good project is free and open source so everyone can use it and contribute to it let's talk a bit about H SEMA for use cases so here is H you can see a link to the projects some projects that H other developers have build H with semaphor and here is another link for ideas to about ideas to build with semafor and one example of project using SEMA for is Pand there was a workshop earlier so is a which is an infrastructure to manage privacy preserving groups so developers use sem for H for many use cases H they use it sometimes for identities and sometimes for anonimous signaling so yeah you can find more about it in the list of projects here the first part to interact with the semap for protocol is H to create an identity so an identity is made up of two secret values values which are the identity dor and identity nullifier and there is a another public value which is the commitment so the posidon hash of the Trap trapdor and nullifier is called identity Secret and the has of this identity secret is called the commitment which is the public value here that you can see here and the identities can be created using a JavaScript library and you can create two types of identity one is the random a random identity which you will not pass any parameters in the identity to Identity class and you can also create ident identities using a a secret message so these identities are called deterministic identities and you create one passing a parameter in the identity class you can also export your identity so that you can use it and import it later here is the link to the documentation with more information about the identities H there are also groups and groups you can think uh the a group is a like a set H it's like an anonymity set and it's a binary mcle tree in which the leaves are the identity commitments and all the other nodes in the tree are hashes of their two sh notes and you can find more information about the groups in the in the documentation in the groups H page there H this the semur groups can be created of Shain with the JavaScript library or onchain with the SEMA for contracts H here you can see how to create the a group with the JavaScript library and also the other box you can see how to do it with the semap for contracts and after creating an identity and joining a group users can anonymously prove that they are members of that group and send signals and to generate a valid proof we need an external nullifier which can be used to prevent a double signaling so H this external nudifier is hash with the identity nullifier to create H to you to use and this hash is used to prevent dou signaling so for example if you want to to create a voting for a voting process if you want a voters to vote only once you can use as as an external fire the group ID so that um the the users when they generate a proof ER you you will has the the protocol will has then the identity Notifier of that user and also this external Notifier and since the external Notifier is always the same every time the same user create the same proof H create another proof they will not be able to to verify it twice so because this hash are saved on CH so you cannot verify the same proof twice you can find more information about this proofs in the documentation page related to that Zer knowledge proof can be generated of with the JavaScript library but they can be verified both offchain and onchain so the proof generation is always offchain because H this process uses the the private values of the identity so it's better to generate it to generate them always and in a frontend app H so that H in in one device so that er only the user owns his private values the private values so this way you can generate the proof and and verify it with the JavaScript library and the other box you can see how to verify it with the with the in the contracts to start using semaphor H you can find three ways H to integrate semap for in your project um one is the CLI and the other is the boilet plate and you can also install the packages manually so let's start with the CLI so you can use npx to do everything or you can install it globally using mpm and you can create a new project using the create command and there are three templates one is called H contast hard hat the other is called monor repo ethers and the other monor repo subgraph and the contrast harad template has a just the contract part it doesn't have the front end it's if you it's just for you if you want to work with the contract SE for and the mono ethers and mono subgraph this h both are complete applications with front in and backing h i mean with rning and contracts H to to to create entire applications mono ethers is using ethers under the hood to query onchain data and Moro subgraph is using the graph protocol on the the hood so that you can create query on shine data and with a CLI you can also query on chain data for the groups like you can get H the group you can get group information like the members of a Group H on specific Network um group information and Etc so you can find more information about the CI in the GitHub repository in this link um so you can see the other comments too you can also create a project using the boilet plate H you can Fork it or use it as a template so here is the repository link and also the the boilet plate LIF up so this is the the demo the deployed one so you can check it out and play around with it so yeah H you can understand more what is going on you can also install the packages manually here is a link to all the packages and just installing the identity the group and proof and data package to create your entire application and yeah this is another way if you don't want to use a the CLI theoy plates you can just integrate sem for into your project like this so I will talk about the architecture of a SEMA for application you can create applications H with SEMA for can create completely off applications or can create completely onchain applications I will start explaining the onchain applications and then I will explain the architecture of the on offchain applications so this is uh this is like the architecture for a decentralized application using semaphor in one part we have H the onchain part which H contains the contracts for this part you will use the SEMA for contracts and then you will add your own contracts the SEMA for contracts will emit a logs H which will be used for the front end app H to to create proof and things like that so we also have this other part which is the offchain part and this part you will you will have your entire web application in the front end and for this part you will use the identity package to create the identities you will use the group and proof package to generate proofs because to generate the proof you need to recreate the group using the logs and we also need the data package to query these locks so we will need all these packages in the front end to H to have a sem for um application and then we will also need a relayer or or a back end you can create your own relayer ler a backend for that to send transactions so that we can keep the anonymity and yeah we can preserve the anonymity of the user then uh this would be the architecture for a SEMA for offchain application and you will need a database to store your data the members and the signals and then you will need the backend to this data and send it to the user and and to verify the proof and the back and you will verify the proof and then in the front end you will generate the identity and have the group and proof package to to generate the proof H which will be verified as I said before in the back end part so this is this will be like H the architecture for the offchain application and I would like to take some time to talk a bit about SEMA 4 version four so the version you will be using is version three which is already audited H there are several projects using it and is is already tested H by many projects but we are working on SEMA for verion 4 and the Alpha version is out and it has some improvements a lot of H some new features improvements so I will talk a bit about some of them so regarding the circuit there are new names for some variables and we will have simplified identities Al so we added syntactic sugar we also have Dynamic depths now and we will have additional circuits to use to use them with semaphor so you will have other features not integrated into to the protocol but you can use it with the protocol H we have an optimized mle tree um the one that H we are using right now an incremental mle tree but we will have an an optimized version of this incremental Merle tree which is called Lan incremental Merle tree H this H this Merle tree doesn't have zero hashes ER it has Dynamic depths H also B insertion and bare results for JavaScript and solidity benchmarks you can see some of these you can read some of these benchmarks in the reserve repo H that I added the link here and all the benchmarks are there you can also run the Ben benchmarks and your computer so this new uh data structure is also part of the CK kit repo H CK kit is a set of libraries H plugins algorithms or utility functions that can be reused in different projects and Z knowledge protocols making it easier for developers to access userfriendly tested and documented libraries for common task so H SEMA for version three use the stick kit but in the version four we are using it even more and there are a lot of packages that are used in semafor and are part of this repository so you can know more about it in this link the GitHub link so the read file so here are some packages that you can find in this repository if you want to learn more about H SEMA for and PSC you can go to the website Discord and and so here is here are all the links so here is my GitHub with all the all my links and the PSC Discord and thank you so much H let me know if you have questions awesome cheers thank you Vivian yeah if anybody has any questions please feel free to type them in the chat or take yourself off mute and you can ask Vivian directly and for those that are uh have been maybe keeping an eye on the partnership channels in Discord Vivien has responded to a few questions already so um you can find her find her there in the PSC partner Channel um but yeah if there are no other or no questions then uh thank you Vivian for this great workshop and presentation and thank you everybody else for attending uh we have about just a little over an hour until the kickoff uh for circuit breaker begin so don't forget to attend that and then we do have a two other workshops later this afternoon as well um so cheers thank you all um and yeah have a good rest of your Friday and happy hacking thank you thank you [Music]

Automatic transcript — names and jargon may be misspelled.