* Add SelfVerificationConsumer contract for self-verification logic - Introduced an abstract contract, SelfVerificationConsumer, that extends SelfVerificationRoot. - Implemented nullifier tracking, verification success events, and customizable validation and update methods for nullifiers. - Added error handling for nullifier check failures and hooks for derived contracts to implement custom logic after successful verification. * Add SelfHappyBirthday contract example using SelfVerificationConsumer - Introduced SelfHappyBirthday contract that allows users to claim USDC on their birthday. - Integrated SelfVerificationConsumer for handling verification and nullifier tracking. - Added functions to set claimable amount and window, along with event emissions for state changes. - Implemented logic to check if the claim is within the user's birthday window and transfer USDC accordingly. * Refactor imports in HappyBirthday contract for better organization - Updated import statements in HappyBirthday.sol to use relative paths for ISelfVerificationRoot, SelfCircuitLibrary, and SelfVerificationConsumer. - Improved code readability and maintainability by organizing imports more logically. * Refactor Airdrop contract to use SelfVerificationConsumer for registration logic - Updated Airdrop contract to inherit from SelfVerificationConsumer instead of SelfVerificationRoot. - Refactored mappings for user identifiers and nullifiers for improved clarity and functionality. - Enhanced error handling and updated function parameters for consistency. - Implemented new validation and update methods for nullifiers, streamlining the registration process. - Removed deprecated verifySelfProof function and integrated logic into new methods. * Add events and refactor SelfVerificationRoot and related contracts - Introduced new events in SelfVerificationRoot for verification configuration updates, scope changes, and attestation ID management. - Updated Airdrop contract to remove deprecated events and added a new event for Merkle root updates. - Refactored SelfPassportERC721 to inherit from SelfVerificationConsumer, enhancing verification logic and event handling. - Improved function parameters for consistency and clarity across contracts. * Refactor contracts to use SelfVerificationRoot and enhance verification logic - Removed SelfVerificationConsumer contract and updated related contracts to inherit from SelfVerificationRoot. - Refactored mappings and event emissions in Airdrop, HappyBirthday, and SelfPassportERC721 for improved clarity and functionality. - Enhanced verification success hooks to include user identifiers and nullifiers for better tracking. - Updated constructor parameters for consistency across contracts and improved error handling for user registration and claims. * Refactor constructor in SelfPassportERC721 for improved readability * Refactor function parameters in SelfVerificationRoot and related contracts * Refactor constructor parameter names in IdentityVerificationHub, Airdrop, IdentityRegistry, and ProxyRoot contracts for improved clarity and consistency
Monorepo for Self.
Self is an identity wallet that lets users generate privacy-preserving proofs from government-issued IDs such as passports. By scanning the NFC chip in their ID document, users can prove their validity while only revealing specific attributes such as age, nationality or simply humanity. Under the hood, Self uses zk-SNARKs to make sure personal data is redacted, but the document is verified.
Use cases unlocked include:
- Airdrop protection: Protect a token distribution from bots
- Social media: Add humanity checks to user's profiles
- Quadratic funding: Prevent farmers from skewing rewards
- Wallet recovery: Safeguard assets using IDs as recovery sources
- Compliance: Check a user is not part of a sanctioned entity list
FAQ
Is my passport supported?
Checkout our coverage map here
What exactly is being signed ?
When a country issues a passport, they sign datagroups that include at least:
- First name
- Last name
- Nationality
- Date of birth
- Gender
- Expiration date
- Passport number
- Photo
What is the signature algorithm ?
Countries use different signature algorithms to sign passports. Check out our coverage map to see which
I just read my passport but it says my signature algorithm is not implemented. What do I do ?
Not all signature algorithms are currently supported. To help us add support for yours, please contact us.
Where can I find the countries' public keys ?
You can download the full list of public keys on the ICAO website. Our parsed list is at /registry.
What's the ICAO ?
The International Civil Aviation Organization (ICAO) is a specialized agency of the United Nations. Among other things, they establish the specifications for passports, that have to be followed by all countries. The full passport specs are available here.
Project Ideas
- Integrate Self to Gitcoin passport or a similar system to allow better sybil resistance in quadratic funding
- Combine with other sources of identity to provide quantified levels of uniqueness, totem-style. Examples can be anon aadhaar, Japan's my number cards or Taiwan DID
- Add Self as a Zupass PCD
- Build a social network/anonymous message board for people from one specific country
- Create a sybil-resistance tool to protect social networks against spambots
- Do an airdrop farming protection tool
- Allow DeFi protocols to check if the nationality of a user is included in a set of forbidden states
- Gate an adult content website to a specific age
- Create a petition system or a survey portal
- Use for proof of location using place of birth and/or address
- Passport Wallet: use active authentication to build a wallet, a multisig or a recovery module using passport signatures
We will provide bounties for all those applications. Those are not fixed right now, so please contact us if you're interested.
Licensing
Everything we write is MIT licensed. Circom and circomlib are GPL tho.
Contributing
We are actively looking for contributors. Please check the open issues if you don't know were to start! We offer bounties for any significant contribution.
Contact us
Contact me @FlorentTavernier on telegram for any feedback or questions.
Thanks Rémi, Youssef, Aayush, Andy, Vivek and Andrew for contributing ideas and helping build this technology, and PSE for supporting this work through grants!