1B biometric users of Worldcoin: SMPC to scale data privacy
ETHCC 7 · 11 Jul 2024 · 22:11
Remco Bloemen of the Worldcoin Foundation explains how Worldcoin uses secure multi-party computation (MPC) to protect iris-code data behind its proof of unique humanness. He walks through the flow: an Orb signs an image of the eyes, the user's device builds a zero-knowledge proof and secret shares, and MPC participants verify them. He says fully homomorphic encryption and trusted execution environments were weighed and MPC was favoured for its security properties. He also covers the GPU hardware needed and plans to replace linear scans with a hierarchical navigable small world index to scale towards a billion users.
Speakers
Topics
From ETHCC 7, hosted by Ethereum France.
Transcript
Good morning. So uh I'm Remko from WorldCoin Foundation and I'm gonna be talking about our biometric solution for human uniqueness. And in particular, I'm gonna deep dive into a part of the overall stack, um, which is our multi-party computation setup. So a little bit of a quick out of overview of what is worldcoin. Um the the TLDR is you are a unique human, you can go to an org, it will verify that this is indeed true, and then it will give you a world ID, and using that world ID you can create anonymous, zero knowledge proof that you are indeed a unique human being, and this allows you to um do all sorts of things on chain like claim airdrops, participate in votes. Um BI schemes, you name it.
Basically having a concept of a unique human being is a missing primitive in the digital world. Um increasingly to be able to distinguish from uh humans and bots. We've kind of used all sorts of hacky solutions to work around it with captchas and fancy rules around airdrops that then get gamed and then people make even more complicated rules. Um the end game of this is really uh we just need to be able to identify human bodies and then have a way to have them online. Um the other thing is that we need to get serious about digital identity.
Everything is moving online, and more and more you will have integrated solutions where your identity transfers between different providers in the in the web tool world. And this is going to be a complete privacy mess if we don't come up with a better alternative. We need to push here for having proper solutions using the technology that we like in the Web3 world, like zero knowledge proofs and so on. Um the core of all these solutions is the concept of a human being because all these identity in the uh in the end um resolves back to a single human being. So again we have this problem of we need to have a concept of a human being online.
Now why did we end up picking Iris codes as the method for identifying human beings? It's basically because none of the alternatives work at a Earth population scale. Data is not as as protected.
But yeah, we came up uh we ended up with iris codes because they uh they have uh they have like some some very ideal properties here. Uh in particular um it's very hard to to get someone's iris code without them act actively participating in the process. Now that was the simplified diagram. This is the more more technical diagram, and I'm gonna quickly talk you through it. Um this is the proposed architecture, and we're in the process of uh rolling this out during the course of probably the next uh next couple of months. We already have like an initial version of the multi-party computation live.
Um so the way it works is the the user installs an app, um, the app will direct them to a nearby orb, and and then the user basically has like an authenticated selfie picture made uh using the orb as a camera. So what what what the orb does is it it verifies that you're indeed a human being and not a robot pretending to be a human being. And once that is established, it will um um create a good high resolution image of of the uh eyes. It will sign it with its hardware key.
This is a trusted hard resolution, um, and send you the signed image back. So now you have a signed image verifiably of uh your eyes that um you can trace back to a a um certificate of the orb. Um with this on your device, you can create a zero knowledge proof that processes this image into what is known as an iris code, kind of like a feature factor if you're in the machine learning world. But basically, like a a it it it takes the the raw image and and compresses it into effective format that you can then use to verify uniqueness.
Uh but that's only half of what the serial knowledge proof does. The other part of the zero knowledge proof creates secret shares for uh for the multi-party participants. And then uh the public inputs only contain commitments to these secret shares. So now you have a zero knowledge proof where basically it starts with um let's say the public key of the orb that signed off on it, and it ends with um commitments to the multi-party shares. You can now send this zero knowledge proof package together with um one of these secret shares to each of the MPC participants. Now the MPC participants will check that um first of all, they check that the other participants are running the correct protocol.
It verifies that the zero knowledge proof is correct, it decommits the iris code share, so now each of these participants has the share that uh only knows the share that they need to know. And now they can engage into an MPC protocol with each other where they will verify that this iris code was not seen before, it is a unique one, uh, and if indeed it uh it passes this this test, it will get added to the entries. And then um it's the the parties each send a signature back to the user. So now the user has collected three signatures that attest that all of the MPC participants have succeeded in doing the uniqueness check protocol. Um, and the user can submit their public key together with this evidence, basically, these three signatures, to a smart contract on Ethereum, and their public key gets um added to an on uh an online uh sorry, on chain anonymous set.
And from there on they can produce zero knowledge proofs that they have a private key that is part of this set. Um there's it there's a lot going on here. Um a lot of different um technical work streams are necessary to make this work. First of all, there's the ORP. Um the ARP is um adapted to create a zero knowledge proof friendly commitment to an image. Um we have, of course, the the IVS code algorithms themselves, which are a work stream. Then you may have heard of CKML, which is something we started looking into, I think two years ago now, where basically we want to be able to run machine learning algorithms efficiently on a um mediocre mobile phone uh smartphone fast enough that we can compute iris codes. Um a lot of interesting stuff going on there, not today's topic.
Then we have the MPC part I just described where you have the uh uniqueness uh check happening. Uh the NPCs themselves uh they run in a trusted execution environment. This is sort of defense in depth. This adds an extra layer of protection to it. Uh it also allows us to pick more efficient MPC protocols for reasons I will go into soon. Now, then there's a work stream called um HNSW, which will make the whole system uh much more efficient going forward and make it actually scale to a billion people that I will get into at the end. Umaphore is a protocol developed by the privacy and scaling exploration groups at the Ethereum Foundation, which is basically a very generic, nice, primitive to get anonymous set membership.
And then we have um our own little mini ZKA roll-up like thing that is running on the Ethereum mainnet. It actually allows us to insert millions and millions of people into a Merkle tree efficiently. We're working with a lot of external teams on this, a lot of like really strong RD teams. So what what are NPCs?
Basically, they solve the problem of having to do compute over global private state. This is a different problem than blockchain solve. Blockchains can do compute over global public state. Making this private requires some additional tricks. First one is fully homomorphic encryption, which is using some really fancy uh mathematics that allows you to do arbitrary computations over encrypted data without without the server having to know the decryption keys. But you still have a single decryption key, and you need to store that somewhere.
So you kind of have a second server that just does the decryption of the final result. And you kind of end up with a two-party, multi-party computation setup in that sense. If you want more security, there's something called threshold FHE where you distribute the decryption key of a multiple machine so that you have like better security guarantees, but you end up essentially with the same security properties as you would have in a multi-party computation setup, just with a lot more effort. So that was dismissed.
Then the last one is trusted execution environment, where you basically have your CPUs or your GPUs sign up, uh sign off on like, hey, I executed this um this software faithfully. Um and here is Intel signature to back this up. Um they they're cool, they have the advantage that they have nearly zero overhead, but they have the disadvantage that you have a trust assumption on the hardware provider now, and they're in practice quite complex, and information leakages especially keep getting found in these. Um and we care most of all about privacy in this scenario, so leakage is is bad here.
Secure multi-party computation, on the other hand, um, actually has what is known as perfect security, which is a pretty unique quality in cryptography, where you can actually prove that no algorithm can exist, um, quantum or traditional, that can uh break the security properties of the scheme. There's some assumptions around here, like you um you assume that encrypted network connections exist and that um random number generators exist, and in practice you use hash functions there, so like you kind of don't get the perfect guarantee anymore, but it's it's a lot better than what you can get with uh most cryptography. Like this is one of the few things we know is uh secure against quantum computers just as much as it is against classical computers, for example.
Um before I got into it, I I only heard of JALS garbled circuits, um, which is a quite complicated two-party protocol. Um, and only into the project I learned about linear MPCs, which are so much more elegant and simple. Um generally, MPC schemes come in two variants, so-called semi-honest, where you assume that where the property is that if all the parties run the protocol correctly, then the information is private and the end result is correct. If one of the parties starts to deviate from the protocol, they can scramble the end result.
But nothing a party can do will allow them to learn more than they are allowed to learn, which is essentially nothing. They're not allowed to learn the secret values. There is another category that is called malicious secure, where you also have a protocol that is robust against malicious actors trying to inject noise into the protocol and ruining the outcome of the circuit, the outcome of the computation. Those though have some substantial overhead. Semi honest linear MPCs inside TEEs.
Iris codes are a 12,800 bit uh masked bit factor. The distance is measured using something known as a fractional hemming distance. Basically you like a particular bit in in an IRIS code is either uh masked a zero or one. You take all the bits that are not masked in uh both inputs, and you do a Hamming distance between that and divide by the number of unmasked. What you can do is you can encode um the bits as minus one and one, and then you can uh have a masked bit be zero, and if you do that, it turns out that your fractional hemming distance turns into a dot product. You just take the element wise product um of your vectors and you uh sum over them.
So quick intro into uh additive secret sharing. Um basically additive secret sharing is a three out of three scheme where you have where you create three random numbers such that they sum to the secret value that you have. This scheme allows you to locally compute the sum of two secrets, you can uh multiply it by constant, but what this scheme doesn't allow you to do is uh compute the product of a secret value. So we modify it, we create replicated secret sharing. Now we give every party two shares instead of one. Um this um this reduces our collision resistance because now any two parties can uh together decode the secret, but now we have a clever trick that allows us to compute um to compute the product of uh two secret values.
And the end result is that each party will now have a share of an additive sharing of a product. Um so we started with replicated sharing of the inputs, and we ended up with um an additive sharing of the uh of the product. So we need to convert back to replicate it if we want to do further further multiplications. For this, we add some like random noise to re-randomize the results, and then uh we need to communicate between the parties. And this is kind of like a standard pattern in all these MPC protocols. You start with one scheme, you do a product, and then you need to do some communication to get back into your starting scheme.
Because if you if you have an inner product, it's basically you do a whole bunch of multiplies and then you sum them together. But we don't need to do the conversion back to replicated after each multiplication. We can leave it in the additive domain, add them all up, and then only convert the sum back to the replicated sharing. So we get um so we can do all the uh all the products locally and only have like one round of communication for the final result, which in our case uh in our case means a 12,800 times improvement over uh over the alternatives. And this is actually what makes this viable in the first place.
Um using MPC for biometrics has been um studied before, and all the papers we found basically said that well it's um it's a theoretically more privacy preserving and secure scheme, but in practice it's not feasible because of performance reasons. Turns out if you use linear MPCs and you use this optimization for inner products, you can actually make it um viable. Uh yeah, quick summary. Um some overhead in these in these schemes. So replicated in particular, uh you have every share twice, so all your operations need to be done locally twice. There is another secret sharing scheme that is also linear based on Sharmeer secret sharing, it uses polynomials, it's mathematically a little bit more complex, but not too bad.
Um, but that one actually allows you to only have one share per participant and gives you essentially no blow up in uh no no um addition, like no more operations than you would have to do on the plain text. Um we found a very clever trick to actually make this work over um unsigned integers of uh in our case 16 bit unsigned integers. Um that's that's maybe good for a later talk. But right now I want to dive into uh what it means to build this thing in practice and in particular what it means at R scale.
So some numbers here, a whole bunch of napkin math, but basically we have 12.3 million users right now. Of those, um over six million users have been um have their uniqueness established using Iris codes, um, five million monthly active users. Now those are the users we have. We do about one uh like average uh about one sign up per second uh with with a peak of 10. So we need to design a system that can handle that can handle a set of six million existing users and a capacity for 20 signups per second. Um you can do some math on how much memory compute and and network bandwidth this requires, and and you'll end up with like about 600 gigabytes of memory for performance reasons.
This needs to be memory, not hard drives. Um, as we'll see, in fact needs to be TPU memory even. Um compute uh to do the amount of verifications we need, we uh need to do over 400 terraf field operations per second, and we need about four terabits of bandwidth. We've done some benchmarking, um, we've had implementations in various architectures. We found bugs in both LLVM and CUDA that we had to fix in order to make the benchmarks work, so it was interesting. Um, but the end result is that for what we want, um uh in particular AWS's implementation of H100s are ideal.
They they have eight GPUs on them uh that can handle the compute, and they have a nice architecture where you can directly um transfer um transfer from GPU memory to the network interfaces, which we need um in order to realize the 3.2 terabits of communication bandwidth that these machines have. Um because if we were to transfer it to regular memory, that bandwidth would already be confining. It's kind of funny.
These machines have like 192 CPU cores, and you just ignore them because they're insignificant compared to what the GPUs can do. It's quite wild. Um but uh getting to a billion people, so these algorithms scale linear in the number of humans, they scale linear in the number of verifications per second. Um we're on an exponential growth directory, and the number of verifications is the first derivative of the number of users. So it will grow quadratic with our user size and more than exponential over time, uh, which is not great. So this linear scan is clearly not sustainable because we're already using like incredible hardware just to run it at where we are now.
So one of the things we're working at is um having like a proper indexing uh factor database indexing structure. In particular, we're looking at hierarchical navigable small world networks. Um they they give you a logarithmic um uh query time and all it really needs internally is is a simple query of like hey I have uh three factors here a b and c is a closer to c or is b closer to c that's that's all it needs to know and we can implement that query quite easily in MPC and therefore um get get to this um index structure so that's like a quick deep dive into into our our little MPC uh setup. If you want to learn more we're around here and uh please hit me up after thank you.
Let's let's plug next one
Related talks
- What Happens When AI Can Pretend to Be Anyone?
- Self Sovereign e-ID Schemes & Privacy Challenges
- TLSNotary Workshop | Hendrik Eeckhaut | Own your data with TLSNotary | ETHDam 2024
- The Future of Digital Identity
- Meetup #13 - Provando dados com zkTLS - Danilo Kim
- Bringing One Billion People On Chain
- Privacy by Design: ZK, MPC, TEE – San Francisco 2025
- Minting your sanitary pass for fun and privacy
- Inside the Orb: Privacy in World's Hardware