Internet Computer (ICP)
This guide explains how to integrate Civic Pass verification into your Internet Computer Protocol (ICP) application using the Civic Pass canister and React component.
Why Use Civic Pass?
Civic Pass provides essential security and verification features for Web3 applications. Here are the key reasons to implement Civic Pass:
Bot Protection and DDoS Prevention
Protect your dApp from automated attacks and bot farming
Prevent system abuse through automated scripts
Ensure fair distribution of limited resources or NFT drops
Protect against DDoS attacks by verifying human users
Sybil Attack Prevention
Stop users from creating multiple accounts with different wallets
Ensure fair participation in governance voting
Maintain integrity in reward systems and airdrops
Prevent manipulation of decentralized systems
Age Verification
Comply with age-restricted content regulations
Protect minors from accessing inappropriate content
Meet legal requirements for specific jurisdictions
Implement age-gated features without collecting personal data
Common Use Cases
NFT Launches: Prevent bot manipulation during minting
DeFi Applications: Ensure genuine user participation in yield farming
Gaming: Prevent cheating through multiple accounts
DAOs: Maintain voting integrity
Airdrops: Ensure fair distribution to genuine users
Social Platforms: Verify unique human users
Compliance: Meet regulatory requirements for age verification
Prerequisites
Access to an Internet Computer application (Guide to creating an IC application)
Node.js and npm/yarn installed
Understanding of ICP canisters and React
Basic familiarity with Principal IDs in the Internet Computer ecosystem
Civic Pass Canister
The Civic Pass ICP canister is the backbone of the verification system:
Available Gatekeeper Networks
Civic Pass offers the following verification networks:
CAPTCHA Pass
A challenge-response test to determine human or bot behavior. Ideal for basic bot prevention.
Uniqueness Pass
A video selfie verification system ensuring one user has one wallet, preventing Sybil attacks.
Age 13 Pass
Age verification system to ensure users are 13 or older.
Integration Flow
1. Pass Acquisition Flow
Direct users to https://icp-getpass.civic.com
Users select their desired pass type (CAPTCHA, Uniqueness, or Age 13)
Users complete the verification flow specific to their chosen pass
Upon successful verification, the system generates a credential
2. Pass Storage and Verification
The credential is automatically stored in the Civic Pass canister
Backend Verification:
Use the DFX Verifiable Credentials SDK to verify credentials on your canister
This is the most important verification step
Code examples provided in the next section
3. Frontend Display (Optional)
The React component provides visual feedback about credential status
Note: This is primarily for UI/UX purposes and should not be relied upon for security
Using the DFX Verifiable Credentials SDK
Installation
Backend Verification Example
React Component Integration
Installation
Basic Usage
Component Props
principal
The user's ICP principal
Principal
Yes
gatekeeperNetwork
The Gatekeeper network for the Civic Pass
string
Yes
config
Configuration options
Partial<Config>
No
onCredentialCheck
Callback for credential check results
(response?: CredentialCheckResponse, error?: Error) => void
No
Credential Structure
Credentials issued by the Civic Canister follow the W3C Verifiable Credentials specification:
Testing & Development
Environments
Production Portal: https://icp-getpass.civic.com/
Demo Flow: https://icp-sign.civic.me/
Testing Steps
Create a test application using the provided code
Visit the demo site to test the complete verification flow
Implement backend verification using the DFX SDK
Test credential validation in both frontend and backend
Verify error handling and edge cases
Common Issues and Solutions
Credential Not Received
Verify the user completed the full verification flow
Check that the correct principal ID is being used
Ensure the canister ID is correctly configured
Verification Failures
Double-check the gatekeeper network configuration
Verify the credential hasn't expired
Ensure backend verification is properly implemented
Security Considerations
Always verify credentials on the backend
Frontend verification is for UI purposes only
The React component should not be used as the sole verification method
Principal ID Verification
Always verify that the credential belongs to the correct principal
Never accept credentials from unverified sources
Expiration Handling
Implement proper handling of expired credentials
Consider implementing automatic renewal flows if needed
Last updated
Was this helpful?