testnet
GitHub

Agent Precompile

component identity

EVM-callable view layer over the ERC-8004 IdentityRegistry — agent lookup, owner resolution, and indexed search.

The Agent precompile is one of Maroo's four core static precompiles (alongside OKRW, PCL, and EAS). It exposes read-only views over the ERC-8004 IdentityRegistry preinstall contract so Solidity callers can efficiently look up agent metadata, resolve agent → owner relationships, and enumerate agents owned by a given address. State changes (registering, updating, or revoking an agent) go directly through the IdentityRegistry contract; the precompile is purely an indexed query surface.

Why a separate precompile (not just direct Registry calls)?

ERC-8004's standard contract interface is read-friendly for individual lookups but expensive for enumeration (e.g., "list all agents owned by 0x..."). The Agent precompile + the x/agent Cosmos module maintain an off-chain-style index that's regenerated from chain state, exposing it through low-gas view methods. This separation is the same pattern as the EAS precompile + x/eas module.

Writes still go through the Registry contract — that keeps the canonical state on-chain and ERC-8004–compliant. The precompile is a performance helper, not an authority.

Read methods (abstract)

The exact ABI is in the source repo; conceptually:

  • getAgent(agentId) — returns the agent's address, owner, registration block, current attestation/delegation hash, status.
  • getAgentsByOwner(ownerAddr) — returns the list of agentIds registered to that owner.
  • getOwner(agentAddr) — reverse lookup; returns the owner's address (or zero if unknown).


These are pure view calls and consume only the gas needed for ABI encoding plus a small fixed cost; they read from the x/agent module's index, not by traversing Registry contract storage.

Relationship to KYA enforcement

PCL's KYA-related policy templates (e.g. ones requiring an agent's owner to hold a specific EAS attestation) call this precompile during transaction evaluation. The flow:

1. Sender of tx is agentAddr — PCL's PclAnteDecorator calls Agent.getOwner(agentAddr) to resolve the human/corporate owner.
2. PCL then calls the EAS precompile to read the owner's KYC/KYB attestations.
3. PCL evaluates configured policies against (agent identity, owner attestations, delegation scope).

Without the Agent precompile this lookup would require traversing IdentityRegistry storage, which is impractical inside the AnteHandler.

V1 scope

Per the Maroo whitepaper §6.3, V1 implements only the Identity Registry portion of ERC-8004. The Reputation Registry and Validation Registry parts of ERC-8004 are deferred to V2+ and are not exposed by this precompile in V1.
Source: maroo
ESC
Type to search