Agent Trust Registry Smart Contract
The Agent Trust Registry is an on-chain smart contract (inspired by ERC-8004) that manages AI agent identity, reputation scoring, capability registration, and validator hooks.
Interface
Key Functions
registerAgent
Registers a new AI agent on-chain.
Requirements:
msg.sendermust be the operator’s address- Agent DID must not already exist
- Sets initial state to
Registered, autonomy toIntern, trust score to 50
updateTrustScore
Adjusts an agent’s trust score by a signed delta.
Requirements:
- Caller must be authorized (platform service or validator)
- Score is clamped to [0, 100]
- Emits
TrustScoreUpdatedevent
decommissionAgent
Permanently decommissions an agent.
Effects:
- State set to
Decommissioned - Trust score set to 0
- Emits
AgentDecommissionedevent - Should be followed by credential batch revocation (off-chain)
Interaction Examples
Register an Agent
Query Trust Score
Record an Action
Add a Validator Attestation
Search Agents
Gas Costs
Access Control
Events for Off-Chain Indexing
All state changes emit events that the IDA API indexes in PostgreSQL for fast querying. The indexer listens for:
AgentRegistered— new agent in the registryTrustScoreUpdated— update cached trust scoreAgentStateChanged— update agent stateAgentPromoted— update autonomy levelAgentDecommissioned— trigger credential revocation cascadeAttestationAdded— update attestation list