Skip to content

Add registrations as known spec field #4

Description

@a6b8

Problem

The RegistrationValidator does not recognize registrations as a valid field. It gets flagged as:

  • REG-040: registrations: Unknown field not defined in ERC-8004 spec

But registrations is defined in the ERC-8004 spec as an optional array field.

Impact

  • 9,072 false REG-040 warnings for registrations field alone

Spec Definition

From ERC-8004:

"registrations": [
  {
    "agentId": 22,
    "agentRegistry": "{namespace}:{chainId}:{identityRegistry}"
  }
]

Each registration object contains:

  • agentId (number): ERC-721 token ID
  • agentRegistry (string): Format {namespace}:{chainId}:{identityRegistry} (e.g., eip155:1:0x8004...)

Required Changes

In RegistrationValidator.mjs:

  1. Add registrations to KNOWN_SPEC_FIELDS array
  2. Add #validateRegistrations() method that validates:
    • Field is an array
    • Each entry has agentId (number) and agentRegistry (string)
    • agentRegistry format matches {namespace}:{chainId}:{address} pattern
  3. Call #validateRegistrations() from validate()

Current KNOWN_SPEC_FIELDS:

const KNOWN_SPEC_FIELDS = [
    'type', 'name', 'description', 'image', 'services',
    'x402Support', 'active', 'supportedTrust'
]

Should be:

const KNOWN_SPEC_FIELDS = [
    'type', 'name', 'description', 'image', 'services',
    'x402Support', 'active', 'registrations', 'supportedTrust'
]

Validation Data

Validated against ~69,000 Dune-downloaded on-chain registration events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions