DID Registry Smart Contract
The DID Registry is the core on-chain contract that stores DID registrations, document hashes, and lifecycle state on the ADI blockchain.
Contract Address
Interface
Key Functions
registerDID
Registers a new DID on the blockchain.
Requirements:
- DID must not already exist
msg.senderbecomes the owner- Emits
DIDRegisteredevent
resolveDID
Returns the on-chain record for a DID.
Returns: Full DIDRecord struct including document hash, storage URI, version, and status.
updateDID
Updates the DID Document hash and storage URI.
Requirements:
msg.sendermust be the DID owner- DID must not be deactivated
- Increments
versionId - Emits
DIDUpdatedevent
deactivateDID
Permanently deactivates a DID.
Requirements:
msg.sendermust be the DID owner- DID must not already be deactivated
- Sets
deactivated = true - Emits
DIDDeactivatedevent
Interaction Examples
Register a DID (ethers.js)
Resolve a DID
Gas Costs
Security Considerations
- Only the DID owner can update or deactivate their DID
- Deactivation is permanent and irreversible
- The contract uses a nonce-based replay protection
- All state changes emit events for off-chain indexing
- The contract is upgradeable via a proxy pattern for bug fixes