Agent Registry

The Agent Registry is the on-chain source of truth for agent identity and reputation. It implements the ERC-8004 standard, providing trustless, portable agent records that any application can read without depending on Brain's backend.

Contract Interface

interface IAgentRegistry {
    /// @notice Register a new agent with its execution address and metadata.
    function registerAgent(
        address agent,
        string calldata metadataURI
    ) external;

    /// @notice Record an immutable validation event for an agent action.
    /// actionHash is a hash of the action parameters and outcome.
    function recordValidation(
        address agent,
        bytes32 actionHash
    ) external;

    /// @notice Update the agent's reputation score.
    function updateReputation(
        address agent,
        uint256 score
    ) external;
}

Agent Data Model

Field
Type
Description

agentId

bytes32

Persistent ERC-8004 chain-agnostic identifier

executionAddress

address

Smart account or delegated EOA

metadataUri

string

Off-chain descriptor (IPFS or URL)

owner

address

Controlling user account

status

enum

active | paused | revoked

How Reputation Accumulates

After every significant agent action, Brain's Trust Indexer calls recordValidation with a hash of the action and its outcome. The updateReputation call reflects the aggregated score derived from:

  • Successful actions and job completions

  • Payment history and settlement reliability

  • Failure rate (reverts, policy violations)

  • Counterparty feedback

External systems can read both the raw validation records and the computed score without trusting any centralized platform.

circle-info

Brain writes validation records and updates ERC-8004-compliant reputation data, but leaves scoring formulas as an implementation choice. External systems can apply their own weighting to the same on-chain data.

Reading Agent Data

Any application can query the registry directly: