Agent Identity

This guide covers on-chain identity registration for AI agents using the ERC-8004 standard. For complete API details and code examples, see the Identity Skill documentation.

Overview

ERC-8004 (Trustless Agents) provides a standard for verifiable AI agent identity on Ethereum-compatible chains. On Starknet, agents can register identities, build reputation through feedback, and receive third-party validation.

RegistryPurpose
IdentityERC-721 NFT representing the agent with key-value metadata
ReputationCryptographically authorized feedback from clients
ValidationThird-party assessments (zkML, TEE, human reviewers)

Why On-Chain Identity?

  • Verifiable History - Immutable record of agent behavior and reputation
  • Trustless Interactions - Other agents can verify identity before transacting
  • Portable Reputation - Identity NFT can be transferred, reputation follows
  • A2A Discovery - Combine with Agent Cards for discoverability

Register an Agent

import { Account, RpcProvider, CallData, constants } from "starknet";

const metadata = [
  { key: "agentName", value: "MyTradingAgent" },
  { key: "agentType", value: "defi-trader" },
  { key: "version", value: "1.0.0" },
  { key: "model", value: "claude-opus-4-5" },
  { key: "status", value: "active" },
];

const { transaction_hash } = await account.execute({
  contractAddress: identityRegistryAddress,
  entrypoint: "register_with_metadata",
  calldata: CallData.compile({
    token_uri: "ipfs://QmYourAgentSpecHash",
    metadata: metadata,
  }),
});

Metadata Schema

KeyDescriptionExample
agentNameDisplay name"MyTradingAgent"
agentTypeCategory"defi-trader", "nft-curator"
versionSemantic version"1.0.0"
modelLLM model"claude-opus-4-5", "gpt-4o"
statusCurrent status"active", "paused"
a2aEndpointAgent Card URL"https://agent.example.com"

Reputation System

The reputation system prevents spam through cryptographic authorization:

  1. Agent owner authorizes - Signs who can give feedback and limits
  2. Client submits feedback - Scored feedback (0-100) with optional tags
  3. On-chain verification - Contract verifies signature and records feedback
// Query reputation summary
const [count, avgScore] = await reputationRegistry.get_summary(
  agentId,
  [],  // all clients
  0,   // all tags
  0,
);

Validation System

Third-party validators can assess agents:

// Request validation
await account.execute({
  contractAddress: validationRegistryAddress,
  entrypoint: "validation_request",
  calldata: CallData.compile({
    validator_address: validatorAddress,
    agent_id: agentId,
    request_uri: "ipfs://QmValidationRequestDetails",
  }),
});

Validator Types

Validators can be zkML provers, TEE attesters, staking-based reviewers, or human auditors. The validation registry is agnostic to the validation method.

Security Considerations

  • Only the agent owner can update metadata and authorize feedback
  • Self-feedback and self-validation are prevented
  • Signatures include chain ID and expiry to prevent replay attacks
  • Agent identity (NFT) is transferable - new owner inherits reputation

Next Steps