Revocation Registry Smart Contract
The Revocation Registry manages credential revocation status on the ADI blockchain. It supports single and batch revocation operations with reason codes, and provides on-chain verification of credential status.
Contract Address
Deployed to ADI devnet. See deployments/ for current addresses.
Interface
Key Functions
revokeCredential
Revokes a single credential. The caller (msg.sender) is recorded as the issuer. If already revoked by the same issuer, the reason and timestamp are updated.
Reverts if:
credentialIdis empty- Credential was already revoked by a different address
isRevoked
Check whether a credential has been revoked. This is a view function (no gas cost for external calls).
batchRevoke
Revoke multiple credentials in a single transaction. All credentials receive the same reason string.
Reverts if:
- Array is empty
- Array exceeds 100 entries
- Any credential was already revoked by a different address
getIssuer
Returns the address that revoked a credential.
Returns the zero address if the credential has not been revoked.
Revocation Reason Codes
The API layer maps numeric reason codes to human-readable strings before calling the contract:
Storage
Credential IDs are hashed with keccak256 before use as mapping keys:
Security
- ReentrancyGuard: All state-mutating functions use OpenZeppelin’s
nonReentrantmodifier. - Issuer enforcement: Only the original revoker can update the reason on an already-revoked credential.
- Batch limit: Maximum 100 credentials per batch to prevent gas limit issues.
Interaction Examples
JavaScript (ethers.js)
Go (API integration)
The RevocationService in packages/api/pkg/credential/revocation.go provides a Go interface that coordinates between the local PostgreSQL database and the on-chain contract:
StatusList2021 Integration
The platform also supports the W3C StatusList2021 bitstring-based status tracking via packages/api/pkg/credential/status.go. Each credential is assigned an index in a bitstring, and the status list is published as a Verifiable Credential.