All packages
erc8004_identity

erc8004_identity

thecatblake
v0.1.1/0 downloads/Repository

Package ref

erc8004-identity@v0.1.1

Run package

CLI

Run map_uri_drift from the command line.

substreams run erc8004-identity@v0.1.1 map_uri_drift -e base-sepolia
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

erc8004-identity

General-purpose Substreams module for the ERC-8004 Identity Registry — an ERC-721 agent registry deployed at the same address on every EVM chain that carries it. Decodes every registry-level event — agent registration, agent URI updates, ERC-721 ownership transfers and metadata writes — and derives an on-chain-drift stream from them, independent of any particular downstream sink.

Reused across chains by swapping network and the map_registry_events param only — no code changes; the Identity Registry contract is identical on every chain, so one WASM binary works everywhere.

Substreams modules can only read a Block, another module's output, or params — never an HTTP endpoint. That means this package can tell you an agent has a URI registered; it can't tell you that URI actually serves a live agent-card (that needs a real HTTP fetch, done by something outside Substreams). A sibling package, erc8004-identity-registered, imports this package's store_agent_state and filters down to agents with a non-empty URI — the on-chain-verifiable half of that question — without re-reading a single block.

Modules

ModuleKindOutput
map_registry_eventsmaperc8004.identity.v1.Events — every Registered, URIUpdated, Transfer and MetadataSet this block
store_agent_statestoreagent:{agentId}:uri / agent:{agentId}:owner, latest value only
map_uri_driftmaperc8004.identity.v1.UriDrifts — agents whose URI changed to a different non-empty value this block

Build

cargo build --target wasm32-unknown-unknown --release
substreams pack substreams.yaml

Run

substreams run substreams.yaml map_registry_events -e <firehose-endpoint> -s 36304145 -t +100

Modules

Execution graph

3 modules
mapMain

map_uri_drift

On-chain drift: agents whose `:uri` key changed from one non-empty value to a different one. First-ever registration (empty -> non-empty) is not drift, so it's excluded here.

from #36304145

Inputs

sf.substreams.v1.Clockstore_agent_state
map

map_registry_events

Decodes every IdentityRegistry event in the block: `Registered`, `URIUpdated`, ERC-721 `Transfer` and `MetadataSet`. `params` is the registry contract address (0x-prefixed hex, case-insensitive) -- the only thing that changes between chains.

from #36304145
store

store_agent_state

Latest known state per agent, keyed `agent:{agentId}:uri` and `agent:{agentId}:owner`. Deliberately bounded to "one string per agent per field" -- Substreams stores are meant to hold current state, not history, so a growing log of past values belongs in whatever subgraph or database sinks `map_registry_events` instead.

from #36304145

Store value

string

Update policy

set