Worldcoin 🛠️ Global Proof of Personhood - Ian Dilick
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Join Ian Dilick from Worldcoin for a workshop titled "Global Proof of Personhood". Welcome to back to ETHGlobal Waterloo, where it all began! Returning to Canada's tech hub, we're thrilled to bring together international enthusiasts and local talent for an unforgettable hackathon experience. This year we had 650+ attendees from 29 different countries and 47% were new to Web3! We concluded the weekend with 168 projects submitted and gave away $250,000+ in prizes ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
foreign [Music] hi everyone I'm Ian I also go by Penryn on Twitter and telegram that's why my pseudonym's up there instead of my real name uh so I do developer relations at worldcoin technically tools for Humanity the corporation supporting the world coin ecosystem and I am here to give you an overview into our Global proof of personhood system how you can use it in your app to know that your users are unique humans doing something only once without having to know anything about which unique human they are so it's very privacy preserving but also you know great to know that you're just not a bot so I'll go over what world ID is I'll go over why worldcoin created it I'll go over what you should do with World ID and most importantly how you integrate World ID into your hackathon project or even later into an app that you're working on after this hackathon so start World ID answers the question how do you know who or what is a real and unique person right 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 fairly and effectively you basically have to solve the Civil resistance problem right you want to make sure everyone who's claiming worldcoin is a real person and you want to make sure that they only get to claim their fair share so for that we built World ID World ID is built to be private right so we don't have to collect any information about who you are we never ask for names emails I you know government ID anything like that it's designed to be inclusive right so that as much as possible of the global population can sign up for World ID and it's meant to be robust right each person only gets one account can't have someone with 10 accounts or anything like that and there's a couple different ways that we wanted to a couple different ways we looked at doing this proof of personhood right email or phone is like the weakest possible version of this I have multiple emails I have multiple phone numbers it's great when you just want to make sure like all right did they at least have to put in some effort to try and create multiple accounts here but it's not super useful when there's a big incentive for someone to make multiple accounts we looked at doing kyc of official government IDs but less than half of the global population has a digitally verifiable government ID and for us that meant that it wasn't inclusive enough we looked at web of Trust Systems right I'm not going to name any names but existing web of Trust Systems really don't work that well when you have an initial trusted set of you know 64 or a thousand users because in a web of trust system every step you take past that initial core trusted set is a less trusted profile right and when you're dealing with trying to sign up the entire global population and your initial trusted set is 64. you get really far away from that initial trusted set and it becomes a very gamable system so that leaves us with Biometrics which initially sounds scary but we can do in a privacy preserving way and I'll explain how in a little bit we looked at fingerprint face scans Palm scans but the problem with all of those is that they simply just don't have enough entropy to distinguish unique humans at the scale of humanity right with face ID or Touch ID on your phone Apple can distinguish about one in 30 million people which sounds like a lot but at the scale of 8 billion isn't right and that's because that's for authentication they want to check is the person in front of the device now the same as the person who is in front of the device during sign up and the odds that some random person who steals your phone is the one in the 30 million who would be able to authenticate as you is really really low and it works efficiently for that use case but for us we have a different use case we're trying to distinguish are you unique from everyone else who's ever signed up so we need to be able to do on the scale of one in a billion or higher so 1 in 30 million that face ID or touch ID can do just doesn't cut it for us and the other end of the spectrum with Biometrics is DNA right lots of entropy lots of data but it breaks the Privacy there's a lot you know about a person just by having their DNA right you can tell what race they are what sex they are and those are things we don't want to know about our users and it's also just generally really invasive so that one was thrown out as well but we settled on Iris recognition your iris has a ton of entropy in it it's something that's non-invasive for us to see it's something that to get at high level or a high level of detail it requires your attention and your focus and inherently then your consent and it's very very unique right even identical twins will have very different irises so it's useful because you can't tell a lot about who that person is just by knowing what their Iris looks like additionally Iris recognition has been studied for decades you also all probably heard about the Apple Vision Pro they use Tech quite similar to what we do but again they use it for authentication rather than proving uniqueness so the level of detail that they're getting with the Vision Pro isn't going to be sufficient for say signing up for worldcoin so then when it comes time to how we do these Iris scans we looked at phone sensors right phone cameras are great but they're not good enough to distinguish one in a billion people we looked at off-the-shelf Hardware if any of you are familiar with clear at airport security in the US it uses Irish verification but for us those still sometimes didn't have enough detail for us and additionally it wasn't a trusted environment so it became really tricky to like actually trust that that Hardware was doing what it was saying it was doing so it left us with developing custom Hardware and if any of you have ever built Hardware in here before you know that Hardware is hard it kind of sucks but it's what we had to do and frankly I think it's kind of fun so with that I introduce you to the orb the artist the device we use to identify you as a unique human it does this by taking photos of your iris Computing an iris code on the device and comparing that Iris code to all the other Iris codes that have been scanned and can verify that that Iris code is unique today we're confident our algorithms can handle one in a billion and they're always Improvement the orb has been in development since before covid so early 2020 it's gone through lots of different revisions as you can see here um we started out with two cameras one for each eye but eventually moved to One camera that can actually move a gimbal mirror to see both eyes right so the the orb make sure you're real checks your iris code and then it verifies your unique World ID World ID is kind of like this Global digital identity protocol like an internet passport in a sense and it supports multiple proof of personhood credentials starting with or Biometrics and phone number right we see this proof of personality is a spectrum in a sense right how strongly can we trust that this is truly a unique human so for some use cases right you're going to want or Biometrics that's just we consider it the gold standard for knowing someone's a unique human but in other use cases just knowing that they have a phone number and have verified that in the world app will be good enough and we're always looking to add more proof of personhood mechanisms to this one that we may add at some point in the future would be verifying a government ID but it is up to app developers using World ID to determine where they set the bar for how strong a proof of personhood they want to allow users to take certain actions in their app World ID is privacy first decentralized and open source right we never collect personally identifying information from you that's sort of the whole point of it is that we can't even disclose which person you are because we don't know in the first place it's decentralized and open source so the protocol all the smart contracts are open source our developer portal code is open source our ID kit the front end SDK that's open source as well and there's lots of different use cases for World ID so some that I really like voting one person one vote is something I'm a big fan of compared to one token one vote uh customer incentives are another one I really like that I think playing well with the fact that we see personhood as a spectrum right so if you have a user who's orb verified maybe you give them a one month free trial and a 25 discount on their first order but if their phone verified right because you're a lot less certain that they're all that they are a unique human with only one account maybe you give them a week-long free trial and a five percent discount on their first order right airdrops are another great use case you want to make sure you don't have someone claiming the airdrop a hundred times social media it's great to know that you're working with a real person instead of a bot lots of different ways that this Tech can be used so we designed World ID to be super super easy to integrate across web mobile and on-chain use cases there's two ways that you can integrate World Eddie one is sign in with worldcoin one is anonymous actions so let's start with signing with worldcoin and let's see how it works so I'm actually going to sign into our developer portal here so with the developer portal I hit login and it takes me to this page with a QR code that I scan within the world app so what's happening here is that QR code tells the app which app it is that I'm signing into when I press verify with World ID the zero knowledge proof will be generated on my device a testing that I am one of the verified worldcoin identities without revealing which one the list of those identities is stored in a Merkle Tree on chain right so to test that I am one of those identities performing an action without revealing which identity I actually am so I press verify that information gets passed back to sign in Portal and then I'm logged in simple as that so I can come back to the developer portal in a little bit but that's a quick demo of how we sign in with World ID and there's lots of different ways that you can integrate sign in with worldcoin so I put alt zero at the top there we're going to be launching an integration soon where if you're using alt zero in your web 2 app you can Implement sign up with worldcoin just as easily as you can Implement sign in with Google sign in with Apple sign in with Facebook whatever it may be right five minute process next auth.js is sort of the go-to right now for using it in any of your web apps we have our open ID connect provider it provides a an IDC well known file so if you've worked with oydc before you're almost certainly familiar with that and makes it quite easy or you can even Implement open ID connect flows yourself but that's a very masochistic exercise and I don't recommend it so here I'll talk about how we can integrate cited with worlds go ahead and using nextdoth.js this is all you need you put this configuration for the world coin provider into Nexus configuration file right you pass it this well-known file or the URL to the Well Done file that instruction on what endpoints to use for authorization for exchanging uh login token right you pass the B client ID and client secret that you get from worldcoins developer portal when you create an app and then down here we are mapping the information returned from sign in with worldcoin to that user so the user ID is going to be the nullifier hash it is a unique identifier for a combination of user and action within World ID anytime that action a user is taking changes that nullifier chat nullifier hash changes and anytime the user performing A Satisfied action changes nullifier hash changes as well the fact that that nullifier hack will always be the same for any combination of user and action means that we use that as your unique identifier when you're signing into platform a but when that action changes say you're signing into platform b instead that nullifier hash also changes which means that your accounts across multiple platforms using sign in with worldcoin can't be correlated to each other at least with the information path by World ID if you were to give platform a and platform B both your email and they were to compare their list of accounts they'd be able to correlate you then but that's with extra information that they have to ask you for specifically World ID doesn't disclose any information like that because we don't have it in the first place and now we can talk a little bit about Anonymous actions which are more powerful they can be used for on-chain use cases and likely what most of you will be interested in so Anonymous actions a test that you are a unique human doing something once or within a specified number of um of times uh you can set that number arbitrarily I'll talk about how you can set that later and for on-chain uses on chain use cases specifically with a specific signal right so say you're claiming an airdrop that signal would be the wallet address you want to claim that airdrop to for on chain use cases even though there is a wallet within the world app it is not designed to be a fully functional cryptocurrency wallet you can't connect it to dapps so you would have users connect their wallet same way that they always do and then they would additionally verify with World ID as part of the transaction to claim that airdrop or mint.nft so let's see a quick demo of anonymous actions so if I go over here we actually have a try it out section in our documentation and additionally here on the on the right I am using our simulator so the simulator is how you can test your apps uh for staging use cases so if any of you guys are doing on chain apps when you use testnet specifically polygon Mumbai test net you have to use the simulator in order to do these actions so in the simulator you can create temporary identities and then validate them as orb and or phone verified or you can actually sign in with an existing crypto wallet you have to generate a persistent identity that you can verify once reuse for multiple use cases but the reason the simulator is important for testing is that if you're just testing Sybil resistance and all you have is your real world app you will run out of opportunities to test your civil resistant the first time it works right so as soon as you have performed an action with that ID you won't be able to anymore whereas in the simulator you can spin up lots of identities to test different use cases and things like that so let's say we're using the staging Network let's make this the Waterloo Test action let's only accept orb credentials and let's hit continue with worldcoin oh I thinks that this is a mobile use case so this is what your users would normally see this modal pops up and for testing use cases uh we can very conveniently click on the QR code to copy the information within it you can also run the simulator on your phone and scan it just as I did in the app earlier and in the simulator we can tap up here to go into the scanner or insert QR manually I paste that in there uh oh I did hit submit let me try that again real quick so I copy the QR code insert it here I'll verify with my Biometrics the orb verification I click verify with World ID and the proof gets passed back to the front end so that's what the flow for your users looks like when they're verifying with World ID and now we can get into how to actually implement it so when you're using Anonymous actions everything starts with idkit idkit is our front end SDK and it's a single react component right so the idkit widget you tell it what action your users are performing as well as the app ID you get both of those things from the developer portal uh you pass it two callback functions handle verify which is actually optional and on success handle verify hat is called as soon as that proof is returned from the user's device on success gets called when the user closes out of the modal and then you have to pass which credential types you want to accept so you could limit that to just phone verification just or verification or both if you leave that one uh if you don't specify it will assume just orb credentials Additionally you pass it the button that is displayed and then pops up the modal when you click it and this is what gets returned from ID kit this is the proof generated on a user's device and passed back to your app's front end so the Merkle root specifies root of the Merkle tree with the user's identity listed within it the nullifier hash as I said earlier is the unique identifier for that combination of user and action the proof um is much longer than shown here and that is actually the cryptographic proof with sema4 and then the credential type is Fastback as well so orb or phone at the moment with more to be supported in the future but what do we do with this we still have to verify that proof right because on the front end anyone can put in any data they want and you can't really trust it so you have to do something on a back end whether that is your web apps back end or if that is on chain so let's start with talking about how you would do this in a web apps back end so you would pass that information to your back end um there's many different ways you can do that in our like Cloud actions template repository that gets handled for you and then in your back end you would run a bit of code like this that would call World coins API right so the base URL would be uh id.
worldcoin.org or I'm sorry developer.worldcoin.org slash API V1 verify and then your app ID that this action is for um you pass it that request body additionally with values the actual like request body there will include values that you had to pass to ID kit in the first place like your app ID and action ID um and then we handle verifying that proof for you you don't have to worry about any of the math for the zero knowledge proofs anything like that but then uh when you get a 200 response back you know that user has been verified and then you perform whatever actions you want to perform for that user from there so that can be you know marking their profile is verified in your database lots of other things you can potentially do but you have to verify them on the back end if you just verify it on the front end a user can manipulate that and it's not actually proving anything now if you want to verify it on chain first you have to construct your world ID instance right so underscore World ID here you would pass the address of the worldcoin smart contract we do have an ens name for that uh it's listed in our documentation which I'll link to at the end and then you have to pass your app ID and action ID as well then you have to actually build the external nullifier yourself um but that's sort of the first step get everything set up from there you can Define your verify and execute function right which you give the signal that that user wants for the specific action right so again airdrop could be wallet address uh you give it the root of the Merkle tree you give it the nullifier hash and the proof so in this example we've implemented civil resistance right for off-chain use cases we handle the Civil resistance for you you can pick an arbitrary number of times you want to let a user do something in the developer portal but for on-chain use cases you have to implement that yourself so in this instance the first thing it does is check if we've seen that nullifier hash before and if it does we revert we just have a list of the nullifier hashes we've seen and we know if it's in there we've seen it before this user's trying to perform an action twice we don't want to let them do that so then we call the verify proof function on world coins contract we pass it root of Miracle tree the group ID so the group ID is going to be either zero or one zero is if that user is phone verified one is if that user is or verified we do that because we have separate Merkle trees for orb and phone verification to explain in our documentation um and in your smart contract if you only want or verified users for example then you can just hard code that as one right but there may be some use cases where you're going to want to pass that information in based on whether that user's orb or phone verified so you ABI encode the signal and hashed field you've asked the nullifier hash and the external nullifier and the proof so if that proof doesn't verify this will revert but if this does verify we'll continue on and we add the nullifier hash for this example into the list of nullifier hashes so that we make sure that that user can't perform this action again and once we've done all that that's when we continue on to do whatever it is that we want our smart contract to do minting in nft claiming an airdrop whatever that may be so that is like the really quick overview into how to integrate World ID um it covers everything right it's actually quite simple and for us we have 20K in prizes here at the hackathon so five thousand dollars to the best overall use case 2500 each to the best governance app most creative use case best AI use case and best sign in with worldcoin app right so the governing app can be you know a bunch of different things that could be Dow governance that can be more political voting systems governance is pretty broad there similarly with AI right that can be AI safety that can be ensuring a human's in the loop with your AI system that can be ensuring that that training data is actually generated by a human again lots of different things there but for all of these I want to clarify that you do have to like integrate World ID into your project it's not that we're giving away 2500 to just some cool AI project that doesn't use World ID additionally uh oh I made a slight typo here we have two one thousand dollar honorable mention prizes and then a three thousand dollar prize pool split among all submissions that properly integrate World ID so our SDK and developer portal is still in beta but we're letting all of you skip the waitlist for hacking here at East Waterloo or east Global Waterloo Additionally you can continue to build on top of world ID after the hackathon if you do please let me know because I really want to be able to help you out I am developer relations it's kind of my job but this will get you access to the SDK I would recommend visiting the URL on a desktop instead of doing it from your phone but you can also if you missed this here come find me at the booth this information will be available there everyone good can I move on all right so if you guys still want to get access I'll give you uh two questions okay so I'll do questions right after I put this link up as well which links to a bunch of resources including our documentation our developer portal template repositories that we have available for you all uh information on our bounties and where to contact us if you have any questions so now questions all right I'll go with you first um the way the way that I've been doing that [Music] so we have consider several options to actually bring class one is that you have the the bill had the attitude to identify the civilian s the other they evaluate the PID so but that's my understanding so if you if if let's say the the more like uh we can identify person as an empathy there there is a more exposure out there you know actual personal information there it's not like the um the the Privacy Information there is a lot it's probably not privacy anymore and it's not only um the the one that you talked about information I just want to note as you guys are the central Anthony and you use the personal information out of that yeah keep the property for yeah so I can expand a little bit on how we use the biometric data in the orb um so in in the orb right it does take photos of your irises unless you opt in those photos never get stored anywhere we compute the iris code that digital represent excuse me digital representation of the entropy of your iris in Ram and if you didn't opt into having those photos stored they get deleted if you did opt in they are encrypted temporarily stored on the orb until they get uploaded to our server using a sealed box encryption mechanism to prevent say a rogue operator from trying to get that data off of the orb the orb itself has lots of other physical security measures uh like tamper resistance things like that but if that is stored it is encrypted full stop and once we have that Iris code right we also know as part of the signup process the public Key Of Your World ID and to clarify the wallet in the world in the world app and the world ID are based on two entirely separate secrets right your Biometrics never touch anything related to the wallet but the public Key Of Your World ID we know which Iris code It's associated with but we just add that public key to the Merkle Tree on chain so that when your device generates a proof that myrtle tree is publicly available for verifying that proof but that public key never gets revealed not even worldcoin knows which actions any specific identity is taking because that zero knowledge group is generated on your device the only way to associate actions back to a public key is if you have the private key and you are the only one who has that private key on your device of course yeah so um foreign so the iris code is not stored on chain just the Merkle tree of world ID public keys but those public Keys themselves aren't really useful for anything because you can't dissociate them with actions they're not meant to be you know a a true like public identifier of who you are right everything with World ID is context specific you have your nullifier hash in the context of a specific app but you don't know that user's public key for their world ID [Music] signatures associated with that to other people so if that's possible but you would have to have the user sign in with both right um in that use case would you want your user to be able to sign in later with worldcoin or would you still want to have them connect their wallet okay so in that case I would say actually just using an anonymous action to have that user verify once right it's using the anonymous action rather than sign in with World coin makes more sense for the use case you're talking about which I would describe as verifying that wallet right right and that's all you're looking to check for yeah so Anonymous actions work great for that as can you speak up please yep so it I couldn't hear you perfectly was the question specifically about why you have to custom do the Civil resistance for anje so that's because uh for off-chain use cases right it's very simple for us in you know our back end to just track how many times this action has been performed uh and let you pick that for your app um it really is just more of a convenient feature for developers who are using things off chain but for on-chain use cases it would add a tremendous amount of bloke to our contracts to track that for you so that the more people use World ID the more expensive it would become for you to use World ID which we don't want to do right so that's why we have you track that yourself it is as you saw an extra two lines of code um so that's why we did that or at least saving you money that you don't have to spend in the first place any other questions yep uh it's most efficient to verify and inclusion proof in a miracle route
Automatic transcript — names and jargon may be misspelled.