This is the World ID Widget Module to demonstrate the integration of two powerful Web3 technologies:
- World ID: Worldcoin's privacy-preserving proof-of-personhood protocol
- Reown AppKit: Advanced wallet connection infrastructure for seamless dApp interactions
This application serves as a reference implementation for developers looking to build dApps that require both wallet connectivity and human verification, enabling use cases like sybil-resistant voting, fair airdrops, and authenticated user experiences.
NOTE:
- In this repo, the
WorldIDV3BadgeManagerForOffChainVerifiedProof.sol, which is deployed on World Chain mainnet / sepolia, would be used.- The deployed addresses of the
WorldIDV3BadgeManagerForOffChainVerifiedProof.solcan be seen here.
- The deployed addresses of the
- World ID Integration: Privacy-preserving human verification using Worldcoin's orb and phone verification methods
- Secure Wallet Connections: Connect to popular crypto wallets using Reown's advanced protocol
- Multi-Chain Support: Support for Ethereum, World Chain, Base, and other EVM-compatible networks through Wagmi
- User-Friendly Interface: Clean, intuitive UI for managing both identity verification and wallet connections
- Real-Time Verification: Instant World ID verification with detailed result display
- Cross-Platform Compatibility: Works seamlessly on desktop and mobile devices
- Frontend: React v19 with TypeScript and Next.js v15.3.3
- Identity: World ID (@worldcoin/idkit) for human verification
- Wallet Integration: Reown AppKit with Wagmi adapter for multi-wallet support
- State Management: React Query (@tanstack/react-query) for server state management
- Blockchain Interaction:
@wagmi/core (v2)Viemfor Ethereum interactions - Styling: CSS modules with responsive design
- Development: ESLint for code quality and TypeScript for type safety
-
Clone the repository:
git clone https://github.com/masaun/world-id-widget-module.git cd world-id-widget-module -
Install dependencies:
npm install
-
Configure environment variables:
cp .env.example .env
Update the following variables in
.env:NEXT_PUBLIC_WORLDCOIN_APP_ID: Your World ID'sapp IDfrom Worldcoin Developer PortalNEXT_PUBLIC_WORLDCOIN_ACTION: Your World ID'saction (ID)name from Worldcoin Developer PortalNEXT_PUBLIC_WORLDCOIN_RP_ID: Your World ID'sRP IDfrom Worldcoin Developer PortalNEXT_PUBLIC_WORLDCOIN_RP_SIGNING_KEY: Your World ID'sRP Signing key, which is aPrivate Keythat is downloaded from Worldcoin Developer PortalNEXT_PUBLIC_PROJECT_ID: Your Reown project ID from Reown Dashboard
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
-
Launch the application
-
Click
"🌍 Verify with World ID"button to start the human verification process -
QR code modal for a
World ID v3 Proofverification (irisbased verification usingorb) would be displayed: (NOTE: Visit a Worldcoinorblocation in advance if you has not verified via the Orb yet) -
Once a user scan the QR code via their World App, the
World ID v3 Proofgeneration and verification would get started. -
Once a
World ID v3 Proofgeneration and verification would be completedoff-chain(backend), the proof data is stored into theon-chainstorage via thestoreVerifiedWorldIDV3ProofData()of theWorldIDV3BadgeManagerForOffChainVerifiedProof.sol. (NOTE: You can also use the source function to call it) -
View your verification status and details
-
You can check wether a user has a
World ID v3 Proofin the form ofWorld ID v3 Proofbadge by invoking thehasWorldIDV3Badge()of theWorldIDV3BadgeManagerForOffChainVerifiedProof.sol. (NOTE: You can also use the source function to call it)
NOTE:
-
Also, you can check a data of the verified
World ID v3 Proofby invoking thegetVerifiedWorldIDV3ProofData()of theWorldIDV3BadgeManagerForOffChainVerifiedProof.sol -
Where the files, which is for
World ID v3 Proofgeneration and verification would be completedoff-chain(backend), is stored:RP Signaturegeneration:app/api/world-id/rp-signature/route.tsWorld ID v3 Proofgeneration and verification:app/api/world-id/verify-proof/route.ts
- Click "Connect Wallet" to establish a wallet connection via Reown
- Scan the QR code with your preferred wallet app or select from available wallet options
- Approve the connection request in your wallet
- Start interacting with the dApp using your connected wallet
Once both World ID verification and wallet connection are complete, you can:
- Access features that require proven human identity
- Interact with smart contracts using your verified identity
- Participate in sybil-resistant activities
- The deployed addresses of the
WorldIDV3BadgeManagerForOffChainVerifiedProof.solcan be seen here.
- World ID Documentation
- World Developer Portal
- Reown Documentation
- Next.js Documentation
- Wagmi Documentation
This project is licensed under the MIT License - see the LICENSE file for details.
World ID Widget Module is a development project for demonstration purposes. Always verify transactions and use at your own risk. Never share your private keys, seed phrases, or personal verification information with untrusted parties.