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

Loading player…

Global Proof of Personhood with World ID

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join Ian Dilick from Worldcoin, for a workshop titled, “Global Proof of Personhood with World ID.” Learn to integrate World ID into your application for protection against bots and sybil attacks! This workshop took place during ETHGlobal Brussels, a 3-day hackathon held in Brussels, Belgium from July 12 to 14, 2024. ETHGlobal Brussels brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ---------------- Follow us: x.com/ethglobal Website: https://ethglobal.com Email us at: hello@ethglobal.com

Transcript

[Music] all right hello everyone I'm Ian I do devr and Partnerships at tools for Humanity supporting the worldcoin ecosystem and I am going to talk about global proof of personhood how you use World ID so what I will go over in this workshop I'll go over what world ID is why worldcoin created it what you can do with it and most importantly how to integrate World ID into your project then I've also got a couple extra special notes at the end that are unique just to this event so the big question that world ID answers is how do you know who or what is a real and unique person right you might use captas online to prove that you're not a bot AI is getting really good at solving captas right and when AI get so good that captas aren't really that useful anymore most places will then default to have you upload a photo of your passport or your driver's license or some other ID and just a few weeks ago the ID verification provider for Uber and Lyft got hacked and photos of people's IDs got released and lots of personal information so that's not a great solution either right so with World ID you can think of it as this like passport right to prove you're a real human online totally anonymously we've built World Ida to be private inclusive and robust right so for privacy we want to know as little about you as possible just that you're actually a real human we want to make sure that as many real humans as possible get to use World ID and we want to make sure that it actually does what it says it does that with World ID you know this is one real person so when it comes to this we looked at a lot of different approaches of how we can help solve this problem right emailer phone don't really work well super easy to get extra phone numbers super easy to get extra emails when it comes to doing kyc of official government IDs while it does work fairly well for knowing okay yes this is a real human is verified by some government the problem is that less than half of the global population has a digitally verifiable government ID web of Trust Systems are a little more web 3 native also can work fairly well but they're not quite as scalable as we need them to be right in a web of trust system where you start with maybe a hundred sort of pre verified people right you might know them personally or they might be well-known figures in the space that can work well for a moderate scale but when you scale up to all of humanity you have to be so many sort of hops away from that initial core set the more hops away you are the less trusted you are inherently and that leaves us with Biometrics is really the next and only way to verify humanness that solves our needs and when it comes to Biometrics there are lots of different biometric factors you can look at right fingerprints face scans Palm scans those are ones that we're all pretty familiar with but face ID and Touch ID on iPhones can only distinguish up to about 1 in3 million people and those odds are great for authentication right I live in the us the odds that the person who steals my phone is one of about 13 or 14 in the entire country that could unlock it with face ID I'm totally comfortable with those odds that's way better than just them randomly guessing a six-digit passcode but we're trying to ensure that you're unique at the scale of billions and one in 30 million is not going to get us there we also looked at one of the most data heavy pieces of biometric information DNA but that is impossible to do in a private way we can't claim to not know anything about who you are if we're using DNA and it's also really expensive to work with and invasive generally something we wanted to stay away from so we settled on Iris biometric right that colored part of your eye around the pupil it's got lots of entropy so it can be used for distinguishing that you're unique at the scale of all of humanity but it's also something that's visible it doesn't require any sort of invasive thing right it's just a photo if you don't want to have that photo taken you can close your eyes it inherently requires like consent and attention whereas a face scan is something that someone could do like while you're walking down the sidewalk going past them so that's why we settled on Iris Biometrics and then when we've looked at what we use to work with those Biometrics phone sensors simply don't have enough detail right a photo of your iris is not going to actually have a high enough resolution to get the iris code that we use to distinguish that you're unique at all of humanity we also looked at off-the-shelf Hardware if you've heard of clear uh at the airports to like Fast Track your way through security we looked at Hardware just like that but that off-the-shelf Hardware is very expensive it's very heavy it's meant to be at a fixed location it's not portable and it comes with a lot of trust assumptions about it right none of that offthe shelf Ware is open source so we had to settle on building custom hardware and that was a pretty long train to get to being a hardware company which we never wanted to do in the first place but we did and this is the hardware we built this is the worldcoin orb the orb has been in development since early 2020 gone through lots of different revisions making it faster more secure more affordable for us to build and the orb makes sure that you're a real human it has I believe over a dozen AI models running on the orb to check and make sure that you're not a cat not a dog not someone holding up a photo of a human not a mannequin head right making sure you're not wearing colored contact lenses to try and trick it into thinking your iris is different than it actually is so and then it takes a photo of each of your irises and on the orbit calculates the iris code a digital representation of the pattern of your iris you only thing we use that Iris code for is making sure that you don't get to sign up twice the iris codes are stored in an snpc setup so there's no one entity that has your whole Iris code right we are actually like pushing the boundaries of how MPC is being used in production and once we've verified that your iris code AS generated by the orb is unique then we verify your world ID your world ID is a self custodial key pair stored on your mobile phone and verifying your world ID means that the public key goes into a Merkel Treon chain so that when you use your world ID to prove to some application that yes you're a real human only signing up or doing this specific action once you're generating a zero knowledge proof proving that you control the private key to one of those public keys in that Merkle tree we've designed World ID to be privacy first decentralized and open source or and the orb overall right so with the orb specifically 95% of the hardware is open source uh the only things that aren't open source are the security board which handles like secure signing operations tamper resistance Etc understandable why that wouldn't be open source um and then the majority of the orb software is also now open source and we are gradually open sourcing more and more modules as we have them audited and ensure that they're you know safe to put out into the world because we want to make sure that the tech building uh is structured in such a way that it's difficult to use for any sort of Nefarious purposes people might want to do World ID has lots of different use cases that it's suitable for right World ID is built on semor a protocol built by psse funded by the ethereum foundation and one of the core use cases there was around voting right you want to prove that you're part of a set and that you're casting a certain vote without revealing who's casting that vote uh social media obviously makes sense we've all seen all the bots on Twitter and how you know paying $5 a month for a blue check mark doesn't stop Bots from paying $5 a month for a blue check mark and customer incentives are one that I find particularly interesting Netflix used to have a free two week trial when you signed up with a new email and people spun up a bunch of new emails and never ended up paying Netflix obviously didn't like that so they stopped their free trials but if they were to use something like World ID they could offer you a twoe free trial or a one month free trial and they know very strongly that you're only going to be able to get that free trial once right doesn't matter what email you use if you try to verify with the same world ID to claim that free trial again they'll know that you've already claimed it we've designed World ID to be super easy to integrate using it either on the web on mobile or on chain there's two main ways to integrate World ID sign in with world ID and Incognito actions so we'll start with sign in with World ID with sign in with World ID you can use ozero next OJs use our oidc well-known file with some other Library you can custom Implement your oidc flows on and on and on we'll focus on next OJs if you want to use signing with World ID and xjs this one single provider configuration is all you have to add to your configuration of nexo and then you have implemented signin with World ID right and we have a template repository that already has this built out right you don't need to try and snap a photo and type all of this into your code editor but it's pretty simple right we are instructing next off to use our well-known file that includes a lot of configuration of what endpoints to use things like that you'll put in the client ID and client secret that you'll get from the worldcoin developer port portal and then in the profile we include the ID which is the nullifier hash your unique identifier from World ID for the specific website you're logging into and then the credential type or verification level is this user orb verified or are they just device verified right the device verification allows you to install World app on your phone World app checks to make sure it's running on a real phone not a virtual machine and that that only has one world ID associated with it so it's a much weaker civil resist resistance mechanism but still a a valuable one because you'd have to spend at least $50 or so per phone to get another device verified World ID so that especially works well for signing with World ID when you don't want to require that user logging into your application has to visit the orb first for example then we can also talk about Incognito actions Incognito actions are sort of the Native way to use World ID with Incognito actions your application gets to know that your user is a unique human doing an action only once or however many times you want you can make it two times or three times or 10 times or even unlimited times you have that flexibility and optionally with a tamper proof message that we call the signal right so I'd mentioned that semor the protocol on which World Ed is based had voting in mind is one of the key use cases so this signal is where you would put uh the information of who you're voting for for example right it's a piece of information that's an input to generating that zero knowledge proof as well as verifying that zero knowledge proof and if it doesn't match exactly between both of those the proof won't verify and that's how you can make sure it hasn't been tampered with another place that you might use that signal is if you are say gating an airdrop behind World ID you might have that signal be the wallet address that should receive that airdrop and then when you verify that proof in your smart contract on chain you know that when they generated the proof they wanted it to go to this address so we'll just send it to that address rather than maybe the uh the wallet that sent the transaction and the flow with Incognito actions is quite simple the user will scan a QR code created by ID kit our SDK that's displayed in your application's front end and that tells World app running on their phone what application in action they're verifying for the user will generate the zero knowledge proof on their phone and return that zero knowledge proof to your application's front end and then your app will verify that zero knowledge proof and you can either do this offchain or onchain offchain chain it is an API point on our developer portal whereas onchain it's directly in the smart contract right and this is that zero knowledge proof that your app will receives the Merkel root says you know this is the root of the Merkel tree that this proof was ver or created against um the Merkel route on ethereum mainnet for orb verified users is updated at least once an hour because we batch insertions from new orb signups that nullifier hash is is the unique identifier of that user for this specific action right so for signing with World ID that will be anytime they sign into your app this is that identifier or if you're using Incognito actions uh that nullifier hash can vary if you use multiple different actions within your application right so if you have a vote once a week you might use a different action for each vote the proof is actually much longer than it looks here and that is math automatically this your knowledge proof that's getting verified and then the verification level tells you if this user is orb verified or just device verified so let's see what using World ID in cognito actions actually looks like so if I go to the worldcoin docs in our try it out section you can just experiment with World ID here so we'll go with Incognito actions in the production environment since since I have World app installed on my phone I will say I want a minimum verification level of device verification and we have this action with this randomly generated string here so I haven't performed this action before so I'll click continue with worldcoin and this QR code pops up so I can either scan this with the QR Scanner built into World app or just with my phone's camera and it will take me to the app I see information about what application I'm verifying for a description of the action and I tap verify with World ID so then on my phone that zeron proof is generated sent back to the application this application passes its proof or passes this proof to its back end and its back end calls the world coin developer portal to verify it offchain and we see that I successfully verified so if I try to verify for this action again I've generated another proof it gets sent over to this application and we can see that I've already verified for this action doesn't let me do it twice so any integration of incognito actions starts with ID kit with ID kit right and for this example we're using react uh ID kit is a single react widget you give it the app ID in action as you configure them in the world coin developer portal on success and handle verify are two call back functions handle verify gets called as soon as it receives the proof but still shows that pending State on success gets called after the uh proof has verified successfully uh handle verify is optional uh because for onchain use cases right you don't want to keep ID kit open but have to you know have the user send a transaction so for unchanging you would typically just not Define handle verify on success would store that proof and then you would have your user submit the transaction on chain that would include that proof to verify uh and then that last parameter the verification level you can set the minimum verification level you want for your user that one's also optional it defaults to orb verification but if you're doing an app offchain and you want to let the device verification be allowed you can also specify the device verification and then the child of the widget in this case is just the button that opens the widget uh we do also have a vanilla JavaScript package that you can use um and we have a we also have a cloud verification template using nextjs if you're interested in that right so this proof response here is what gets passed into the handle verify and on success call backs right so after we see that green check we're not done with it I have seen lots of projects both at hackathons and like production use cases that get this proof back and think great the user's verified but that is essentially you know a piece of paper that says yeah I I'm human right you have to go check that the signature on that piece of paper is legit so we have to verify the proof I cannot like make that clear enough we have to verify the proof and when it comes to verifying that proof right I've said we can do it offchain and onchain and I'll start by describing how we do that offchain right so in your back end this again is a nextjs example we have our app ID in action from our environment variables uh we get the proof object and the signal from the front end right so the signal if that was specified you can have it be whatever you'd like uh we get that in the request body to our backend we have this verify cloudproof helper function that will call our developer portal pass in all the necessary information and will return a success response or an error based on whether the proof verified or not it'll explain why the proof wasn't verified and then if it was successful you should return that successful response to your front end or you should uh you know send a response to your front end explaining why it didn't succeed um but you would also typically want to actually do something now that the user's verified and you should do that in your back end where the user can't manipulate State like they can in the front end so that might be that you mark the user is verified in your database uh might be that uh you go ahead and you know send them a discount code on Shopify for example that's an integration that we've built um but verifying these proofs is super simple it's a single API call and we have a helper function that abstracts that away for onchain verification it's a little more complex but again we have a template repository that already has a very basic smart contract written for you so in the constu structure of your contract you need to input the app ID and action ID again as you got them from the developer portal but World ID here is the address of the world ID router right that is the Smart contract that is a proxy that will always make sure that you know that contract address stays consistent and that's where you call the verify proof function submit the proof and get to know if the user is actually verified with World ID or not the external nullifier as defined here is actually a term from semaphore if you're familiar with it you'd know that that's what they use to scope the uniqueness of an action for us we combine the app ID and the action ID to create that external nullifier that is so you can have multiple actions within one application uh so when the user scans that QR code they'll see the same app they'll see a different description for that action uh but in semaphor every time you change that action it's something different and the external nullifier is just the value that defines that and then the function to verify and execute something here right that's left undefined it takes in the signal the root of the Merkle tree the nullifier hash and that proof object itself a very long heximal string that's really just used for all the math and the first thing we do is that we check on M that we defined earlier um that should have been in the slide for the Constructor um we have a mapping of nullifier hashes where when we sort of use a nullifier hash we mark it as used so first thing we check is have we seen this nullifier hash before if we have we know the users already done this action we're just going to revert because we don't want them doing it twice you could also have that Ma to an integer and count how many times they've done it and limit the them to doing it five times but once we've checked that the user hasn't done this action before then we call the verify proof function on that world ID router we pass in the root the group ID which on Jane currently is always one for the orb verified group um device verification can't be verified on chain at this time um then we have the signal hashed a specific way to ensure that it's within the field of the curves used for the zero knowledge Pro proof a nullifier hash that external nullifier we set in our Constructor and the proof that verify proof function call Will revert if the user is not verified or the signal is incorrect or for whatever reason it shouldn't but if it does verify correctly the program just continues there's no value returned or anything like that so the first thing you should do after that proof gets verified successfully is that you should Mark that nullifier hash is used and after that is when you should do whatever it is that you want the user to have happen after they verify with World ID so that could also be marking their wallet address as verified if you want to reference that later that could be going ahead and sending them tokens it's part of an airdrop right that is where your application defines what happens now that you know the user's verified so we have $20,000 in prizes overall 10,000 of that goes to the four best overall projects so $4,000 to first place 3,000 to Second 2,000 to third 1,000 to an honorable mention we have $2,500 each for the most creative use case the best governance app and the best public goods use case and then a $2,500 prize pool and in that prize pool uh that is for projects that don't win one of these other prices but make a good faith effort to integrate World ID right so if you just say that you integrated World ID or have somewhere in your code a comment saying this is where we put World ID that's not going to have you be eligible for the prize pool but if you make an actual effort to integrate World ID right if you have ID kit in your front end and some commented out code in your contract saying so we couldn't get it to work that's a good faith effort right and I will be at our booth all weekend I'm probably sleeping here Saturday night because I like staying up late working with hackers right right so it's much more about like trying to use World ID obviously I want to help you get the Integrations to work that's why I'm here uh but if you aren't able to get it to work correctly you can still get some funds from that prize pool and then as I mentioned at the start of this there's a couple new things that I'm excited to talk about here the first of them is that just on Tuesday we announced that the developer preview of world chain our our own op stack layer 2 is now live so if you want to apply for access to this Dev preview you can go to worldcoin dogworld dchain preview um and this Dev preview is more for protocols and existing products that want to deploy to World chain before General availability um but if you're interested in building on world chain during the hackathon you might be able to get you access but a lot of the protocols you'd expect to be there aren't there yet and that's why we don't have any bounties around uh World chain so far and then the next thing I'm really excited about this is the first time we're publicly talking about world ID mini apps mini apps create a seamless integration of world ID Incognito actions signing with World ID or inapp payments by having your application open in a web view inside of World app these apps can be displayed on the world app homepage they're discoverable by our 10 million plus World app users um and getting your app in front of 6 million verified uh or verified humans around the world it's pretty good distribution mechanism for this industry especially if you want to learn more about mini apps and get Early Access come see us at our booth the team member responsible for them is arriving this evening um so I won't be able to help you until later this evening but learn more come chat with us thank you all for your time at worldcoin dog Brussels 24 you can see a notion page that covers a lot of what I went over here links to our template repositories everything like that and you can come find me at the worldcoin booth at almost any time through 8 or 9: amm on Sunday and then after that for judging I have to sleep a bed [Music]

Automatic transcript — names and jargon may be misspelled.