A Self-Sovereign Identity (SSI) system built on Polygon blockchain using ERC-1056 DID standard with BBS+ signatures for privacy-preserving selective disclosure.
- Decentralized Identity (DID): Create and manage your own digital identity based on ERC-1056 standard
- Verifiable Credentials: Receive W3C-compliant credentials from trusted issuers (universities, employers, government)
- Selective Disclosure: Share only specific attributes without revealing full data using BBS+ signatures
- On-chain Verification: Instant credential verification with revocation support on Polygon
- Privacy-Preserving: Zero-knowledge proofs enable proving claims without exposing underlying data
| Component | Technology |
|---|---|
| Blockchain | Polygon (EVM compatible, low gas fees) |
| Smart Contracts | Solidity 0.8.24 + Foundry |
| Identity Standard | ERC-1056 (ethr-did-registry) |
| Credential Standard | W3C Verifiable Credentials |
| Cryptography | BBS+ Signatures (@mattrglobal/bbs-signatures) |
| Frontend | React 18 + Vite + TailwindCSS + shadcn/ui |
| Web3 | ethers.js v6 |
┌─────────────────────────────────────────────────────────────────┐
│ FRONTEND (React) │
│ • Wallet connection (MetaMask) │
│ • Credential management UI │
│ • Selective disclosure interface │
│ • Verifier portal │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ OFF-CHAIN SERVICES │
│ • BBS+ signature creation/verification │
│ • Selective disclosure proof generation │
│ • DID document resolution │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ ON-CHAIN (Polygon) │
│ • DIDRegistry: Identity ownership & delegation │
│ • IssuerRegistry: Trusted issuer management │
│ • CredentialRegistry: Credential anchoring & revocation │
└─────────────────────────────────────────────────────────────────┘
.
├── contracts/ # Solidity smart contracts (Foundry)
│ ├── src/
│ │ ├── DIDRegistry.sol # ERC-1056 identity registry
│ │ ├── CredentialRegistry.sol # Credential hash & revocation
│ │ ├── IssuerRegistry.sol # Trusted issuer management
│ │ └── interfaces/ # Contract interfaces
│ ├── test/ # Foundry tests
│ └── script/ # Deployment scripts
├── packages/
│ ├── credential-service/ # Off-chain BBS+ credential service
│ │ └── src/
│ │ ├── bbs/ # BBS+ signing, verification, selective disclosure
│ │ ├── did/ # DID resolution and document management
│ │ └── credential/ # Issuer, holder, verifier modules
│ └── frontend/ # React application
│ └── src/
│ ├── components/ # UI components (shadcn/ui)
│ ├── hooks/ # React hooks (useWallet, useContracts, etc.)
│ └── pages/ # Page components
├── docs/ # Documentation
└── public/ # Static assets & screenshots
- Node.js >= 22.0.0
- npm or yarn
- Foundry for smart contract development
- MetaMask or compatible Web3 wallet
git clone <repository-url>
cd Digital-Identity-Management-System
# Install Foundry (if not installed)
curl -L https://foundry.paradigm.xyz | bash
foundryupcd contracts
forge build
forge testcd packages/frontend
npm install# Terminal 1: Start local blockchain
cd contracts
anvil
# Terminal 2: Deploy contracts
forge script script/Deploy.s.sol:DeployLocal --rpc-url http://localhost:8545 --broadcastAfter deployment, you'll see output like:
=== Local Deployment Summary ===
DIDRegistry: 0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9
IssuerRegistry: 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707
CredentialRegistry: 0x0165878A594ca255338adfa4d48449f69242Eb8F
Test Issuer: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
Create .env file in packages/frontend/:
VITE_DID_REGISTRY_ADDRESS=0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9
VITE_ISSUER_REGISTRY_ADDRESS=0x5FC8d32690cc91D4c39d9d3abcBD16989F875707
VITE_CREDENTIAL_REGISTRY_ADDRESS=0x0165878A594ca255338adfa4d48449f69242Eb8Fcd packages/frontend
npm run devOpen http://localhost:5173 in your browser.
-
Add Anvil Network:
- Network Name:
Anvil Local - RPC URL:
http://localhost:8545 - Chain ID:
31337 - Currency Symbol:
ETH
- Network Name:
-
Import Test Account (this account is pre-registered as an issuer):
Private Key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 Address: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
- Connect your MetaMask wallet
- Your Ethereum address automatically becomes your DID (
did:ethr:polygon:0x...) - Receive credentials from trusted issuers
- Use Selective Disclosure to create presentations with only the claims you want to reveal
- Share presentations with verifiers
- Get registered as a trusted issuer (admin adds you via
IssuerRegistry.addIssuer()) - Access the Issuer Portal to issue verifiable credentials
- Choose credential type: UniversityDegree, EmploymentCredential, or GovernmentID
- Fill in the holder's DID and credential claims
- Credentials are hashed and anchored on-chain
- Revoke credentials when needed via Manage Revocations
- Access the Verifier page
- Paste the verifiable presentation JSON from the holder
- The system verifies:
- Credential structure and format
- On-chain status (not revoked, not expired)
- Issuer is trusted in the registry
- Issuer and holder addresses match on-chain record
Manages decentralized identifiers with ownership and delegation.
function identityOwner(address identity) returns (address)
function changeOwner(address identity, address newOwner)
function addDelegate(address identity, bytes32 delegateType, address delegate, uint256 validity)
function revokeDelegate(address identity, bytes32 delegateType, address delegate)Manages trusted credential issuers with role-based access.
function addIssuer(address issuer, string name, string did, string[] credentialTypes)
function removeIssuer(address issuer)
function isIssuer(address issuer) returns (bool)
function canIssue(address issuer, string credentialType) returns (bool)Manages credential hashes and revocation status.
function registerCredential(bytes32 credentialHash, address holder, uint256 expiresAt)
function revokeCredential(bytes32 credentialHash)
function getCredentialStatus(bytes32 credentialHash) returns (CredentialStatus)
function isCredentialValid(bytes32 credentialHash) returns (bool)- Create
.envfile incontracts/:
PRIVATE_KEY=your_private_key
POLYGON_AMOY_RPC_URL=https://rpc-amoy.polygon.technology
POLYGONSCAN_API_KEY=your_api_key- Deploy:
cd contracts
source .env
forge script script/Deploy.s.sol:Deploy --rpc-url $POLYGON_AMOY_RPC_URL --broadcast --verifyforge script script/Deploy.s.sol:Deploy --rpc-url $POLYGON_RPC_URL --broadcast --verify| Type | Description | Example Claims |
|---|---|---|
UniversityDegree |
Academic credentials | degreeName, fieldOfStudy, university, graduationDate |
EmploymentCredential |
Employment history | employer, jobTitle, department, startDate, endDate |
GovernmentID |
Government-issued ID | idType, idNumber, fullName, dateOfBirth, nationality |
- Private keys never leave the user's wallet
- BBS+ signatures enable unlinkable presentations
- On-chain revocation provides instant status updates
- Role-based access control for issuer management
- Credential hashes (not full data) stored on-chain
# Smart contract tests
cd contracts
forge test -vvv
# Credential service tests
cd packages/credential-service
npm test
# Frontend build check
cd packages/frontend
npm run build- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
