Aadhaar Semaphore is a project that integrates the Semaphore protocol with Aadhaar verification, allowing for anonymous group membership and signaling while leveraging Aadhaar for initial identity verification.
The project is divided into three main components:
app
- Next.js frontend applicationcontracts
- Hardhat smart contractssubgraph
- The Graph indexing service
The frontend is built using Next.js, providing a user interface for interacting with the Aadhaar Semaphore system.
To run the frontend:
cd app
yarn install
yarn dev
The smart contracts are developed and managed using Hardhat. These contracts handle the on-chain logic for group management, identity commitments, and signaling.
This contract manages groups and verifies proofs using Semaphore and AnonAadhaar protocols. Deployed Register Contract Address in 0x20e104b3D87272a80f205A72741ac80ED4734c81
-
Interfaces:
ISemaphore
: Interface for the Semaphore protocolIAnonAadhaar
: Interface for the AnonAadhaar protocol
-
State Variables:
semaphore
: Instance of the Semaphore contractanonAadhaar
: Instance of the AnonAadhaar contract- Group IDs for different categories:
above18GroupId
genderMaleGroupId
genderFemaleGroupId
-
Events:
GroupCreated
: Emitted when a new group is createdMemberJoined
: Emitted when a member joins a groupMessageSent
: Emitted when a message is sent in a group
-
Constructor:
- Initializes Semaphore and AnonAadhaar contracts
- Creates groups for above 18, male, and female categories
-
joinGroup:
- Allows a member to join a specified group
-
sendMessageInAbove18Group:
- Sends a message in the Above18 group
- Verifies Aadhaar proof and Semaphore proof
-
sendMessageInMaleGroup:
- Sends a message in the Male Gender group
- Verifies Aadhaar proof and Semaphore proof
-
sendMessageInFemaleGroup:
- Sends a message in the Female Gender group
- Verifies Aadhaar proof and Semaphore proof
This contract allows users to:
- Join specific groups based on their attributes (age, gender)
- Send messages within these groups
- Verify their identity using Aadhaar and maintain anonymity using Semaphore
The contract includes a TODO comment mentioning a generic sendMessage
function that's currently causing issues with the via-ir
flag.
cd contracts
npm install
npx hardhat test
The subgraph indexes events from the smart contracts, allowing for efficient querying of on-chain data. Deployed subgraph: https://thegraph.com/studio/subgraph/aadhargroups/ To deploy updates to the subgraph:
- Aadhaar verification using ZK circuits
- Anonymous group membership with Semaphore
- Private signaling within groups
- On-chain group management
- Efficient data indexing and querying with The Graph