erc8004-identity-viewer

ERC-8004 identity viewer (static page)

Browse source · Live demo · erc8004-identity-viewer.tar.gz · erc8004-identity-viewer.bundle
commit 564f8f6 · 564f8f64bdbd60ab2697a0f4ccba42394ff68549
Clone: curl -O https://agentgate-source.pages.dev/erc8004-identity-viewer/erc8004-identity-viewer.bundle && git clone erc8004-identity-viewer.bundle erc8004-identity-viewer
Mirror note: this repo used to live on GitHub under the agentgate-builder account (suspended Oct 21, 2026). Links in the README below were rewritten for this mirror: source links point here, GitHub Pages demos to /erc8004-identity-viewer/demo/ where one exists, npx github: installs to the tarball on this site, and CI badges became a "tests passing locally" note. The tarball, bundle and raw files are unmodified.

ERC-8004 identity viewer

A static page that shows an AI agent's ERC-8004 identity (owner, tokenURI, registration file) and its reputation feedback, on Base and Base Sepolia. HTML, CSS and JavaScript only: no backend, no wallet, no dependency. The page calls the chain with eth_call through a public RPC.

Live demo: https://agentgate-source.pages.dev/erc8004-identity-viewer/demo/ (try https://agentgate-source.pages.dev/erc8004-identity-viewer/demo/?network=base&agent=1, or Base Sepolia agent 1, which has reputation feedback: https://agentgate-source.pages.dev/erc8004-identity-viewer/demo/?network=base-sepolia&agent=1).

Tests: npm test runs the offline A1 to A6 tests with a fake RPC (no network). VIEWER_LIVE=1 npm test adds one live read from Base.

Use it

Open index.html from any static host (GitHub Pages works), or run npm run serve and open http://localhost:8080. Deep links: ?network=base&agent=1 or ?network=base-sepolia&agent=1. The Advanced panel takes your own RPC URL and IPFS gateway.

Library

viewer.js is an ES module that runs in the browser and in Node 20.

import { loadAgent, httpRpc, httpFetchJson, REGISTRIES } from './viewer.js';

const cfg = REGISTRIES['base-sepolia'];
const agent = await loadAgent({
  agentId: 1,
  network: 'base-sepolia',
  identityRegistry: cfg.identity,
  reputationRegistry: cfg.reputation, // optional
  rpc: httpRpc(cfg.rpcUrl),           // rpc(method, params) -> Promise
  fetchJson: httpFetchJson(),         // fetchJson(url) -> Promise
});
// { status: 'ok' | 'empty' | 'error', agentId, owner, tokenURI, registration, feedback, error? }

Registries (config.js)

Network Identity registry Reputation registry
base (8453) 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
base-sepolia (84532) 0x8004A818BFB912233c491871b3d84c89A494BD9e 0x8004B663056A597Dffe9eCcC1965A193B7388713

Source: the ERC-8004 reference deployment, https://github.com/erc-8004/erc-8004-contracts (README, Contract Addresses), cross checked with the QuickNode ERC-8004 explorer contract list (https://erc-8004.quicknode.com/docs/contracts).

Tests

npm test runs the offline suite with Node's built in runner. Each test is named after the acceptance item it proves (A1 to A6), and every test passes its own rpc and fetchJson. ABI fixtures in test/fixtures.json were produced with an independent encoder (ethers v6), so the decoder is checked against a second implementation.

npm run test:live also reads real agents on Base and Base Sepolia (set KOGNAI_TEST_AGENT_ID for the Kognai test identity).

Notes

MIT licence.


agentgate-source: code mirror on Cloudflare Pages. All repos