world-id-lens
world-id-lens copied to clipboard
Human verification for Lens Protocol with World ID.
Human verification for Lens
Assert your Lens profile belongs to an actual human through Worldcoin's World ID protocol.
âšī¸ About
This repository contains the smart contract that enables verification of Lens Protocol profiles as owned by a unique human.
- The verification is always exposed on-chain.
- Human verification is done via the World ID protocol.
- A single human can only have one verified Lens profile. Verifying a new profile will remove the verification from the previous profile.
đ Deployment
The official World ID <> Lens smart contract can be found at 0x8f9b3A2Eb1dfa6D90dEE7C6373f9C0088FeEebAB on the Polygon Network. To deploy your own version of this contract, follow these instructions.
- Get an App ID and action from Worldcoin's Developer Portal.
- Run Foundry's
forge createcommand.
đ§âđģ Development
- Install Foundry.
- Install dependencies & build smart contracts
make
Using the contract
To test the contract with your own deployment, we recommend you use World ID's Staging network,
- Point your smart contract to the World ID's Staging network contract, which can be found at https://docs.worldcoin.org/reference/address-book.
- Register an identity as "verified" using Worldcoin's Simulator.
- Use the hosted IDKit's widget & the Simulator to generate a World ID proof to execute the humanity check.
- Easiest way is to use the Try it out page on the Worldcoin Docs.
- After going through the process on the Simulator, you'll get the proof, nullifier hash & Merkle root.
- Call
HumanCheck.verify(PROFILE_ID, merkle_root, nullifier_hash, proof)in your contract. The last three parameters are obtained on step 6. - You can now check your profile is verified by calling
HumanCheck.isVerified(PROFILE_ID).