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

Loading player…

Worldcoin 🛠️ Global Proof of Personhood with World ID - Ian Dilick

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Ian Dilick from Worldcoin for a workshop titled "Global Proof of Personhood with World ID". World ID is the protocol to bring global proof of personhood to the internet, designed to be privacy-first, decentralized and self-custodial. This workshop goes over everything you need to get started with World ID, whether it's on-chain, off-chain, or using Sign In with Worldcoin! 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] well hello everyone I'm Penryn I lean developer relations at worldcoin and I'm here to talk about global proof of personhood with World ID uh the protocol developed by World coin and tools for Humanity uh supporting the world coin ecosystem so in this workshop I'll go over what world ID is why worldcoin created it what you can do with World ID and most important part how to integrate World ID all right so World ID answers this question of like how do you know who or what is a real and unique person um worldcoin started out as a project that wanted to give everyone in the world a little bit of cryptocurrency to introduce them to this digital economy but in order to do that effectively and fairly and not get a bunch of money taken by Bots you basically have to solve the Civil resistance problem um so we did right that's why we built World ID which also fun fact as of yesterday is now publicly available so for those of you who have hacked on world ID before and remember having to scan a QR code get access to the dev portal that's done all of you can build on world ID now which is great right so we need World ID to be private inclusive and robust right we want this proof of personhood system to not unnecessarily disclose any information about who you are and keep that privacy and anonymity wherever possible we want it to be inclusive right this needs to be something that as many people in the world can use especially when our mission is introduce the entire world to this new digital economy we also need it to be robust right we need to make sure that every real person can only get one account right so as many real humans as possible but each one only gets one and we also don't want to know which real human you are just that you are a real human who's unique so when we look at ways that we can go about sort of building this system right we looked at like verifying emails or phones which is nice and simple it's super accessible it's also not robust in any way right I myself have multiple emails and multiple phone numbers and that just breaks one of the Three core pillars of what world ID needs to be we looked at doing kyc on official government IDs but the problem with that is that less than half of the global population has a digitally verifiable government ID it's just not inclusive enough for us we looked at web of Trust Systems but the issue with web of Trust Systems is that you know when you start with a core verified set right a hundred or a thousand to scale that to all of humanity you have to get a lot of hops of verification away we're like person a verifies person B person B verifies person C eventually you're like 20 hops away from that initial verified set and every single hop is less trust that you can have that that web of trust actually is working effectively so with that we settle on Biometrics which initially sounds scary and skepticism about it is a good thing but we do manage to do it in a privacy preserving way when it comes to the Biometrics that we use we looked at fingerprints and face scans and palm scans but the issue with those is that there simply isn't enough information to distinguish people on the scale of humanity Touch ID and face ID on your iPhone can distinguish about one in 30 million people which works just fine when you're trying to prove that the person in front of the phone right now is the same person who is in front of the phone you know months ago when they set it up right the odds that like the person who steals my phone in the United States is one of 10 people in the country who would also be able to unlock my phone I'm happy with those odds um but when we're trying to prove that you're different from everyone else who's in like the global population one in 30 million doesn't cut it for us we also looked at DNA problem is that it's highly invasive in every way it's impossible to do that in a way that doesn't tell you a lot about that person um someone got cast aside pretty quickly and we settled on the iris right the iris has far more entropy than fingerprints palm prints face scans it's well studied and additionally it's really really hard to do it without someone consenting to it right if someone is trying to like scan your iris you can close your eyes right and it's the kind of thing where at the level of detail that we use with the orb um it's not something that you can do passively it requires your attention so that like consent is sort of built into the system as well which is important when dealing with biometrics so then now that we've settled on Iris verification how do we actually want to implement that phone sensors sound great a bunch of people have them problem is that the quality isn't super great and it's also not a trusted Hardware solution um you know you can't you can't be sure that someone isn't just piping in a bunch of fake data to the camera module right for off-the-shelf Hardware similar situation it can be a more trusted environment but it still is not fully trusted and again we ran into issues with the quality of the photos of the iris it was able to take so we settled on building custom Hardware which taking the leap from we want to give everyone in the world a little bit of cryptocurrency to we're a hardware company it's a really big leap and I always just think it's really funny how that's what ended up happening but this is the custom Hardware we built the orb um we have four of them down at our booth as well uh so what the orb does or sorry your's been in development for quite a few years now it started development right before the pandemic hit back in 2020 it's gone through a lot of Evolutions in order to make it more secure be able to scan people more quickly things like that there's an incredible amount of engineering that's gone into this device so the orb make sure that you're a real human right it can tell if you try to put a cat or a dog in front of the orb it takes photos of your irises and on device without ever needing to store those photos anywhere calculates an iris code a digital representation of the entropy of your iris and then once it's verified that that Iris code is unique to all the other Iris codes that have been signed up your world ID is then verified so your world ID is a self-custodial identity stored on your mobile phone and when we verify that we actually take the public key of that identity put it into a Merkle Tree on chain so that you can then generate zero knowledge proofs in the world app attesting that you are one of the identities in that set without revealing which one so that you can maintain that privacy and anonymity that we want to help you maintain while simultaneously proving that you are a unique human and being able to prove that you're only taking a specific action once so when it comes to civil resistance and knowing that someone isn't a bot it's an incredibly powerful solution to do that when you don't even have to tell worldcoin your name right so yeah World ID is like this it is a global digital identity protocol somewhat like an internet passport these credentials are like stamps in that passport so or verification is the strongest credential right now we also offer phone verification which is a much much weaker credential where you verify that you control a phone number in the app um it's useful in some situations but for a lot of other situations you'd want the really strong proof that or verification provides which is why that you can configure which one you want to use when you're using World ID and I can explain more about that later right okay win over these credentials already so World ID is built to be privacy first it's decentral is it it's decentralizing right and it's open source so decentralization is a gradual thing for us if we had started out fully decentralized immediately as a Dao then we would end up a lot shorter than we've gotten today right building things is tough especially when there's Hardware involved but we want to decentralize as much as possible that's why we have the world coin Foundation that stewards the protocol whereas tool for Humanity is the corporation like building the orbs and things like that and it's open source so the smart contracts our front end widget all of that is available on GitHub there's a lot of different use cases for this proof of personhood system right voting is one that makes a lot of sense you want to let someone vote know that they're only voting once and also de-anonymize themselves between their different votes or sorry anonymize themselves amongst their different votes right so that you can't just look at someone's voting history um for customer incentives this is one of one of my favorite use cases where say someone's orb verified you know really strongly that they're only going to be able to claim that like sign up discount once maybe you give them 50 off their first order whereas if their phone verified it's a much weaker credential you still want to give them something maybe five percent off their first order and you do that because the phone credential there's a higher chance that they're going to be able to create another account verify again right like I know I have gotten months of free Netflix out of spinning up new emails to get that two-week free trial and we built World ID also to be super easy to integrate you can use it on web on mobile and on chain and there's two main ways to integrate World ID you have signed it with worldcoin and Anonymous actions uh so sign in with worldcoin essentially wraps it wraps World ID in an open ID connect provider so if you've ever implemented like sign in with Google in an app it's extremely similar Anonymous actions are a little bit more flexible that's where you can ensure a user is doing something only once uh for the Civil resistance and Anonymous actions you can do both you know just on the web as well as on chain so let's start with talking about sign in with worldcoin and let's see how it works so I will actually demonstrate this for us right now by signing into our developer portal right and we can see my my phone right here so for me to sign in with world going which we have to use for our developer portal all right I click login pops up this QR code for me to scan I tap the button in the top left in the app scan the QR code oh come on don't fail me now let's try this again refresh the page it's wallet connect underneath oh interesting let's try it this time and see if it works here we go so I hit verify with World ID and that zero knowledge proof is generated on my device and now I'm signed into our developer portal yay um and I'll walk us through that a little bit more later so there's a bunch of different ways that you can integrate sign in with worldcoin we have an integration with auth zero now so in about five minutes if your app already uses alt zero for sign in you can add sign in with worldcoin we have a nextdoth.js template so if you are building on next you can Implement cyan with roller coin super easily that way if you're using some other authentication provider you can use the oidc well-known file or you can custom build your open ID connect flows or you know there's plenty of different ways you can do this but I'll walk us through how we would integrate it with nextdoth.js this one configuration file is all you need to integrate sign up with worldcoin using nextdot.js you're just creating a single provider for next off you give it the well-known file from open ID configuration which is part of the standard uh you have to pass it the client ID and client secret that you get from our developer portal and then we map the uh the information returned from our open ID connect provider to that user in your app right so if I want to create a client ID and client secret first let's start with creating an app I click up here add new app let's just call this uh Paris test so let's just say I want to go straight to production if I want to use sign with worldcoin I have to make it a cloud action create new app I click sign in I can get my client ID here which is also the same as the app ID and then for client secret I reset it there I copy it I put it in the configuration additionally I have to put in a redirect URI so if you use our template that's explained in the readme it's just a specific route that our open ID or our signing page knows to redirect your user to after they've completed the verification with World ID so once you've done all that sign in with worldcoin is already just implemented it's that simple and now let's dive a little bit into anonymous actions so Anonymous actions you're you're able to know that your user is a unique human doing something once with a specific signal right and that signal is a lot more useful for on chain use cases generally um so one example there is that if you're offering an airdrop and you want to make sure that you're a user you know your users are real humans they each just get to claim that airdrop once um what you would use the signal for is the wallet address that they are claiming that airdrop to right that signal gets used as a little bit of information included in the proof generated on the user's device that you can ensure hasn't been tampered with right so it would really suck if someone were to like man in the middle attack your app change that address and then the user accidentally submit to transaction claiming their airdrop to someone else's address but using the signal prevents that because if that gets changed the proof won't verify on chain right so let's see a quick demo of what using Anonymous actions looks like so I have uh My Little World ID playground this is based on our cloud and template uh which is freely available for all of you to build on top of as well let me make sure my phone's unlocked so I clicked verify with World ID and this opens up ID kit our front end widget which is used for any situation involving Anonymous actions so I'll go ahead and scan this like the flow for your user is very very similar oh this is a staging action my bad how about I use the simulator then um so when you're testing things right we have a simulator for that especially if you're testing civil resistance if you only have your one world ID on your phone to test with kind of sucks simulator uh helps fix that where we have a bunch of identities here there's five and you can always just add more they say unverified that will change in a few seconds all of these identities in the simulator are already phone and or verified um so if I want to go ahead and verify here with the simulator I can actually click the QR code to copy the information there go over to the simulator I click manual input since I'm on desktop you can also use the simulator from your phone I click submit and then here I can select which credentials I actually want to use as part of that proof so if I wanted to test being only phone verified I'd uncheck Biometrics only ORD verified unchecked phone both leave them both checked with our proof system we actually just return the highest credential so phone and Biometrics both checked versus just Biometrics checked won't actually change anything but I'll go ahead and click verify with World ID if I go back here successfully verified and it tells me about this nullifier hash that nullifier hash is sort of the unique identifier for a user in the context of an action right so if the same user tries to take the same action twice they'll generate the same nullifier hash which is how we can Implement civil resistance so let's go back to the slides right everything using Anonymous actions starts with ID kit it's one react component you can also use it with vanilla JavaScript and you have to give it information about the action you're performing so the name of the action your app ID that app you've created in the developer portal the credential types you want to accept it's an array of phoner orb this is also typescript um if you're using non-type script JavaScript then you would just have strings orb and or phone there's two callback functions on successes mandatory handle verify is optional handle verify is it shows the user a loading State while that's being called and waiting for a response on success is what gets called after the idkit modal is closed um there's plenty of other uh things that you can configure and our docs go over all of those but this is basically everything you'd need you also have to pass it a child like button that opens the the component when the user clicks on it and then once the user is finished this flow with idkit this is the response that you get you get a Merkle root so the root of the Merkel tree against which you should verify these proofs you get the nullifier hash the unique identifier for that user in the context of that specific action you get a really long hexadecimal string that's the proof and that one you don't really need to worry about too much you just pass that either to our API or the smart contract on chain when you're verifying that proof and you also get which credential type that user's been verified with right but you have this response you still have to verify it um because that proof is sent directly to your front end from the user's device right we use wallet connect to create that connection between your front end and the world app so the user can pass that proof to you we do that because we can't monitor that again like we don't want to be able to associate actions back to the same user so when we have a direct connection between the user's proof generation on their device and the thing they're trying to verify with it helps keep that anonymity and that privacy and you can verify that proof either on chain or with our API so if you want to do it with our API um you should first pass information return from idkit to your back end because if you try to verify that proof with our API directly from your front end the user can still manipulate the response right nothing in the front end is secure the user can always modify that so you should pass it to your back end and then call our API so developer.worldcoin.

org API slash V1 verify your app ID um you pass it information uh about the app ID the action the signal if you're using it because the signal is optional and then the Merkle root the proof the nullifier hash everything like that again our template repositories already like handle all of that for you to make sure that you can't do it wrong and it's all of the required parameters for this API call are gone over in our documentation so then if you get a 200 response from our API great you should go ahead and like Mark the user as verified in your database or whatever else it is you want to do after you know they're a verified human and then send a response to your front end to let them know everything is good for on-chain verification it's a little bit more complex um so in the Constructor you'd set the address of the world ID smart contract that you want to verify against uh if you're looking at our docs you'll see contracts called the world ID router those are the contracts you should verify against um they are available on ethereum optimism and polygon both main Nets and test Nets so for test Nets it's ethereum girly optimism girly polygon Mumbai that is a new change that some of you who've hacked with World Eddie in the past might be kind of surprised about we just finished our migration to optimism yesterday um so we're super happy that now you can use World ID on a much broader variety of chains than just polygon um and you can find the addresses for those contracts again in our docs we have an address book that goes over everything there um the app ID and action ID are generally things that you would set in the Constructor as well so that those can't be tampered with and it also keeps things more gas efficient the external nullifier um is basically just the identifier that um that scene before the zero knowledge proof system that we're built on uses to identify that action the user's taking it's a combination of your app ID and action ID and then your verify and execute function will take in a few different parameters like the signal the root of the Merkle tree nullifier hash and then that proof first it checks to make sure we haven't seen that nullifier hash before because you have to implement the Civil resistance yourself in a smart contract we call the verify proof function on the world ID smart contract the group ID is zero for phone credentials one for orb credentials you can also set that in your Constructor if you only want to accept one or the other you pass it the other information you've received from idkit and then if that doesn't revert everything checks out you add this nullifier hash to the list of nullifier hashes we've seen before so that you make sure that user can't do that same action again once that's all done then you would mint them in nft let them claim an airdrop whatever that may be and in this hackathon we've got 20 grand of prizes um I don't need to read all of these to you you can look at them on the website or just read them right now um if you have any questions about them feel free to like find me at our booth and then we have a bunch of resources for hackers as well so worldcoin.org parish23 will take you to a notion page that goes over our bounties links to our template repositories or documentation everything you need in order to build on world ID I'll give everyone a little bit to scan that QR code I mean it's just my closing flight after this I might as well just leave that up for everyone any questions I think yeah you there yeah uh thank you so much for the talk I in the very beginning when we entered to mentioned that when you generate the ID whether like based on the orb with iris of the human eye you check that it is unique yeah right um two things have you mentioned the cases when it's not unique and what you do if you get the same thank you yeah so the way that we check that it's Unique uh is that that Iris code and the public key of your identity get uploaded to worldpoint servers and then our servers compare that Iris code with all of the other Iris codes that we've seen before um we don't actually check strict mathematical uniqueness we use the Hamming distance so how different are these two Iris codes When comparing one to n uh because your iris code can change slightly over time right your iris will just change a little bit as you get older uh and then it's like is it different enough from all the other Iris codes in the situation where I use we do have a user whose Iris code is too similar to one that's already in the set we simply just return like hey you're you've already signed up right the orb will tell them that the verification is not successful um and then we don't insert the public key of that identity into the Merkle tree we just turn them down right because for us like our algorithms on the orb right now we are extremely confident they can handle one in a billion today so the odds of a true Collision in that Iris code is so unbelievably low uh what about yeah what about the identical twins I'm sorry what about identical twins the twins oh your twins have very different irises okay even identity I didn't know that okay thank you so much hi um could I somehow take a full list of verified users no on chain I mean no uh like you can have the Merkle tree of the you know public keys of the identities right and one thing to note is that the key bear for your identity is completely separate from the key pair for your wallet so like that Merkle tree is publicly available but the public key of that identity is only ever revealed when you're getting like verified at the orc because any time that you are using World ID to verify to some other app you're just generating a zero knowledge proof that you're one of them in that tree you don't tell them the public key of your identity so we do that again in order to preserve users privacy so no you can't see just a list of all of the identities that have been verified um could I be able to get such list after the airdrop would they be able to take an as such list of all of the verified users after the airdrop I mean the world going the exact coin well it with worlds when we do token grants over time so the token is still not yet live um but users can claim beta grants to the Token one per week um so yeah there's not like one moment uh hi I have a great idea for the hackathon which is decentralized science getting responses from the real users some behavioral economics if you are looking for the team please join me the centralized science and tapping into unique users running some social experiments Behavior behavioral economics please join me thank you okay this guy's had to stand up the whole time hello thanks for the um thanks for the presentation so um I have few questions I mean how much time you have I don't know but let's let's go with the first one so um what does with the data what happens with the data in you know the orb scans my eye and then what happens with that data so if you didn't opt into having the photo store they get deleted from the orb if you did opt in they are uploaded to our servers in Germany using sealed box encryption uh you can choose to have them deleted at any point in the future and then we there are two things that we would use those photos for one is that if we significantly upgrade our like Iris code algorithm in the future we would be able to just run that algorithm on the photos that are stored for users who opted in whereas users who didn't opt in would have to go back to in order to re-verify we can also use those images to help improve our algorithms and make them more secure okay and um what guest stores don't change what gets stored on changing the only thing that's stored on chain is that Merkle tree of the verified identities and what's inside the miracle 3 uh just the public it's the identity commitment right essentially the public key of these identities that never gets revealed in any other situation but but it's like a hash it's the public identifier of that identity I like I'm okay it's just like you have the wallet address of your wallet this is the public key of your identity thank you very much thank you

Automatic transcript — names and jargon may be misspelled.