A blockchain-based DID management system built using Ethereum smart contracts and Hardhat.
paper
The system uses two types of identifiers:
-
DID Address (Private)
- This is your Ethereum wallet address
- Keep this private - it's like your password
- Used for managing your DID (updates, deactivation)
- Never share this with others
-
Public ID (Shareable)
- A short, readable identifier (e.g., "a1b2c3d4")
- Generated when you create your DID
- Share this with others so they can view your public information
- Safe to share publicly
Think of it like a house:
- DID Address = Your house key (keep private)
- Public ID = Your house number (share publicly)
- Install dependencies:
npm install- Start local Hardhat node:
npx hardhat node- Deploy contract and set up environment:
npx hardhat run scripts/set_contract.js --network localhostnpx hardhat run scripts/create_did.js --network localhost- Enter your credentials (name, email, organization, role)
- System generates your Public ID
- Save both your DID Address and Public ID
- Share only your Public ID with others
Public View (for everyone):
npx hardhat run scripts/view_did.js --network localhost- Choose option 1 (Public View)
- Enter the Public ID
- Shows:
- Name
- Organization
- Active Status
Private View (only for DID owner):
npx hardhat run scripts/view_did.js --network localhost- Choose option 2 (Private View)
- Shows all information:
- Name, Email, Organization, Role
- Creation and Update dates
- Public ID
- Status
npx hardhat run scripts/update_did.js --network localhost- Enter your DID Address (not Public ID)
- Verify ownership with current credentials
- Enter new information (press Enter to keep current values)
- Confirm changes
npx hardhat run scripts/deactivate_did.js --network localhost- Enter your DID Address (not Public ID)
- Verify ownership with current credentials
- Review DID information
- Confirm deactivation (this action cannot be undone)
- Name
- Organization
- Active Status
- Role
- Creation Date
- Last Update Date
- All other DID details
- Two-level identification system (DID Address and Public ID)
- Credential verification required for updates and deactivation
- Private information only accessible to DID owner
- Confirmation required for important actions
- Active status verification
- Timestamp tracking for all changes
contracts/- Smart contract implementationscripts/- Management scripts for DID operationscreate_did.js- DID creationview_did.js- View DID information (public/private)update_did.js- Update DID credentialsdeactivate_did.js- Deactivate DIDdeploy.js- Local deploymentset_contract.js- Contract setup
Yeamine Alam Sorol
🎓 BSc in Computer Science & Engineering
💻 Full-Stack Web Developer | Blockchain Enthusiast
🔗 LinkedIn: https://www.linkedin.com/in/yeamine-alam-sorol-746831347/
📘 Facebook: https://www.facebook.com/sorol.meh
© 2026 Yeamine Alam Sorol. All rights reserved.