Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(erc8004): drive validation attestations through the deployed registry's request/response flow
nirholas3ccbf38a2df0
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdindex f8965ca52..85a932322 100644--- a/ARCHITECTURE.md+++ b/ARCHITECTURE.md@@ -1178,7 +1178,7 @@ Deployed deterministically via CREATE2 at vanity-prefixed addresses.| `ReputationRegistry.sol` | `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` | `0x8004B663056A597Dffe9eCcC1965A193B7388713` | 15 configured / 12 live || `ValidationRegistry.sol` | (not deployed on mainnet) | `0x8004Cb1BF31DAf7788923b405b754f57acEB4272` | testnet only |-**Chain count:** `src/erc8004/abi.js` `REGISTRY_DEPLOYMENTS` configures **15 mainnet** chain IDs (1, 10, 56, 100, 137, 250, 324, 1284, 5000, 8453, 42161, 42220, 43114, 59144, 534352) + **7 testnet** (97, 11155111, 84532, 421614, 11155420, 80002, 43113). As of the 2026-06-19 bytecode check, **12** mainnet are live — Fantom (250), zkSync Era (324), and Moonbeam (1284) are configured but **not yet deployed** (`eth_getCode` = `0x`, per `contracts/DEPLOYMENTS.md`). The platform validator key (`0x93Bc7EfB0059B784465619FC73C2db8D01b1CD04`, env `VALIDATOR_PRIVATE_KEY`) signs `recordValidation`. ERC-8004 registries compile with Foundry solc **0.8.24** (`foundry.toml`); the deployed ThreeWSFactory/ThreeWSPayments used solc **0.8.35** (`DEPLOYMENTS.md`).+**Chain count:** `src/erc8004/abi.js` `REGISTRY_DEPLOYMENTS` configures **15 mainnet** chain IDs (1, 10, 56, 100, 137, 250, 324, 1284, 5000, 8453, 42161, 42220, 43114, 59144, 534352) + **7 testnet** (97, 11155111, 84532, 421614, 11155420, 80002, 43113). As of the 2026-06-19 bytecode check, **12** mainnet are live. Fantom (250), zkSync Era (324), and Moonbeam (1284) are configured but **not yet deployed** (`eth_getCode` = `0x`, per `contracts/DEPLOYMENTS.md`). The platform validator key (`0x93Bc7EfB0059B784465619FC73C2db8D01b1CD04`, env `VALIDATOR_PRIVATE_KEY`) signs `validationResponse` on the ERC-8004 reference ValidationRegistry (request/response, no allowlist); verify any configured address with `npm run verify:erc8004-validation`. ERC-8004 registries compile with Foundry solc **0.8.24** (`foundry.toml`); the deployed ThreeWSFactory/ThreeWSPayments used solc **0.8.35** (`DEPLOYMENTS.md`).**IdentityRegistry:** ERC-721 agent identity NFTs. EIP-712 wallet delegation, per-agent ETH deposit/spend/withdraw, key-value metadata, spend allowance for delegated server keys.@@ -3018,7 +3018,7 @@ The codebase references **~260 distinct `process.env.*` keys** across `api/`; `a|---------|--------|-------|| ERC-7710 delegation redemption | Opt-in, disabled by default | `PERMISSIONS_RELAYER_ENABLED` flag; `POST /api/permissions/redeem` is the incomplete path || `AgentPayments.sol` EVM deployment | Written, not deployed | All `agentPayments` addresses in `addresses.ts` are zero-address placeholders |-| ValidationRegistry mainnet | Testnet only | Platform validator key `0x93Bc7EfB…` provisioned but not funded or allow-listed |+| ValidationRegistry mainnet | Testnet only | No mainnet reference deployment; platform validator key `0x93Bc7EfB…` provisioned but not configured or funded || Trading swarms UI | Backend + `/swarms` dashboard live; 3D Sniper Arena at `/play/arena` | `api/swarms/*`, `src/play/arena.js`, swarms tables || Agora economy | **Launched** (Commons live at `/agora`; Arena/Guild migration 2026-07-02) | Agent + human citizens, professions, verifiable WORK supply chain — see [Agora](#agora--living-agent--human-economy-verifiable-work-supply-chain) || Self-hosted x402 facilitator | Shipped, **off by default** | `X402_SELF_FACILITATOR_ENABLED` + sponsor secret required; `api/x402-facilitator` returns 503 otherwise |diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a273e1d9e..fb9d178ec 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,6 +9,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **A dry Agora wallet now tells you which address to fund**: Posting your first bounty could fail with an unreadable blockchain error. Two causes: the test-network faucet was being asked on an endpoint that never funds anything, and a rate-limited faucet was assumed to have worked. Balances are now checked before anything is signed, on both networks and for both SOL and $THREE, and a shortfall comes back as a clear message with the amount needed, the amount held, and the wallet address to send to, shown right in the post form with a copy button. (`/agora`) `[fix]`- **A paced payment rail now says "retry shortly" instead of reporting itself broken**: When the wallet that pays Solana network fees for platform payments has spent its daily fee budget, settlement pauses on purpose until the budget refills at the UTC reset or the wallet is topped up. That deliberate pause was being reported to buyers as a 502 server error, so a funding cap looked identical to an outage: over one recent 48-hour window it accounted for 15,619 of the 20,030 failed calls the platform's own autonomous buyer recorded. It now answers 503 with a retryable code, the same as the other paced states, so clients back off and retry rather than treating the rail as down. Genuinely unexplained settlement failures still report 502, which makes them worth investigating again. The autonomous buyer also checks the fee budget before it starts paying instead of discovering the pause at the end, so a paced rail no longer burns a full payment handshake per call to be told no. The fee budget is now released gradually across the day as well, so the rail keeps a steady pulse instead of spending its whole allowance before dawn and going quiet. (`/economy-lab`) `[fix, improvement]`- **A tip only counts once the chain says it happened, and the spend caps stopped leaking**: Closing the last eight findings from the June security review. Tipping a live stage host, and paying an agent you met in the real world, both recorded the payment from the receipt your browser handed us after only checking that it looked like a real transaction id. It never looked the transaction up. Anyone who knew a stage id could therefore post a well-formed but unrelated id with a huge number attached and buy the top of that show's tip leaderboard, and the host's shout-out, for nothing. Every tip and every pay is now checked against the chain before it counts: the transaction has to exist, have succeeded, and have actually paid the host at least what was claimed, or it is refused and nothing is recorded. If the network simply has not caught up yet, your tip is held rather than thrown away, and it joins the leaderboard the moment the transfer shows up. Four spend ceilings that could be raced were tightened the same way: an agent wallet's daily limit, a standing rule's own daily and lifetime budgets, a vault's rolling 24-hour trade budget, and a Commons citizen's daily posting cap all now reserve the room for a payment in the same breath as recording it, counting money already in flight, so two actions fired at the same instant can no longer both spend headroom only one of them had. Also: a paid signal feed no longer shows its open positions to people who have not subscribed (closed trades stay public, since that track record is what the feed sells itself on), swarm actions that move real SOL now carry the same anti-forgery token and per-user limit as every other money action, walk analytics stopped accepting anyone's claim about which creator's avatar they were using, and the scheduled-job password check that guards every automated money mover is now one piece of shared code instead of seventy-eight copies. (`/stage`) `[security, fix, improvement]`+- **Agora citizens now live on-chain: they register, claim work, prove it, and earn**: The Agora life engine went from a seeded population to a working one. Citizens register themselves with the AgenC protocol on Solana devnet, read the work board, claim a job on-chain, do the real work, submit a real proof, and earn the reward, with every step written to their public passport as a verifiable transaction. The engine can now fund its own signers when the public test faucet is empty, so the city keeps running unattended, and one citizen hitting a bad connection is retried and skipped instead of stopping everyone else. Arena and Guild moments (races won, guild jobs contributed to) now reach the live ticker instead of being silently dropped. (`/agora`) `[feature, infra]`- **Agora citizens now sculpt 3D models, write, and check each other's work**: Until now every citizen in the Agora did the same one job: fetch a web service. They now work seven real trades. A Sculptor turns a written brief into an actual textured 3D model you can download and open in any glTF viewer. A Scribe researches and writes. A Crier records a voice clip, an Appraiser reads market sentiment, a Namekeeper resolves .sol names, and a Fetcher still calls paid services. Every finished job stores its deliverable at a permanent address and records a sha256 fingerprint of the exact bytes on-chain, so anyone can re-download the file, hash it themselves, and confirm it is the same work that was paid for. The seventh trade closes the loop: a Verifier citizen runs exactly that check on another citizen's delivery and leaves a vouch when the hashes match, or flags it when they do not. (`/agora`) `[feature]`- **Agora Guilds can actually fill now, and an expired bounty gives its money back**: The Commons hosts two kinds of shared work: an Arena, where several citizens race the same bounty and the first accepted proof takes the whole prize, and a Guild, where several citizens each contribute a part and split the reward. A live run on the test network showed the Guild could almost never fill. The moment its first contributor signed up, the job left the "open" state, and the part of the engine that looks for work only ever considered open jobs, so every remaining seat sat empty until the deadline passed. Guilds now stay joinable while they still have seats, which is what the rest of the system already assumed. Three more faults surfaced in the same run. A signup that succeeded on-chain but whose confirmation got lost in transit was being filed as a failure, which parked a seat with nobody working it; that is now recognised and recovered. A rate-limited connection could convince the engine that its own registered citizens did not exist, and enough of those at once shut the whole population down; registration now reads the chain back instead of giving up, and a failed balance check no longer drops a citizen. The last contributor's share was also reported too high, because the payment that empties a job's escrow also returns the deposit that kept that account open, and the deposit was being counted as reward; shares are now measured net of it and match what the chain actually paid. Separately, a bounty that expires without filling used to leave its reward locked up forever, since a passing deadline does not return anything on its own. The creator now reclaims it automatically, and a race whose result the chain has already settled no longer shows a runner still running. (`/agora`) `[fix, improvement]`- **Agora task timelines now link to the transactions that made them**: A task's on-chain record says what happened but not which transactions did it, so every event in a task's timeline showed no transaction to open. three.ws records those signatures as its own agents work, and the timeline now fills the blanks from that record without ever overwriting or inventing anything the chain itself reported. A task opened from a direct link also now carries the deliverable and its fingerprint, so you can verify the work from the link alone. (`/agora`) `[improvement]`diff --git a/api/erc8004/[action].js b/api/erc8004/[action].jsindex cfb8163e1..dd1da06ad 100644--- a/api/erc8004/[action].js+++ b/api/erc8004/[action].js@@ -74,38 +74,43 @@ async function handleHydrate(req, res) {const walletAddresses = wallets.map((w) => w.address.toLowerCase());- // Query erc8004_agents_index for agents owned by these wallets.+ // Query erc8004_agents_index for agents owned by these wallets, capped so a+ // whale wallet can't turn one page load into an unbounded scan. A non-numeric+ // crawled agent_id is skipped rather than 500ing the whole hydrate.const indexRows = await sql`SELECT chain_id, agent_id, owner, name, description, image, glb_urlFROM erc8004_agents_indexWHERE lower(owner) = ANY(${walletAddresses})AND active = trueORDER BY registered_at DESC NULLS LAST+ LIMIT 500`;-- // For each index row, check if already imported by this user.- const agents = [];- for (const row of indexRows) {- const [imported] = await sql`- SELECT id FROM agent_identities+ const numericRows = indexRows.filter((r) => /^\d+$/.test(String(r.agent_id)));++ // One round-trip resolves every already-imported (chain_id, agent_id) pair.+ const importedSet = new Set();+ if (numericRows.length > 0) {+ const importedRows = await sql`+ SELECT chain_id, erc8004_agent_id+ FROM agent_identitiesWHERE user_id = ${session.id}- AND erc8004_agent_id = ${BigInt(row.agent_id)}- AND chain_id = ${row.chain_id}AND deleted_at IS NULL+ AND erc8004_agent_id = ANY(${numericRows.map((r) => BigInt(r.agent_id))})`;-- agents.push({- chainId: row.chain_id,- agentId: row.agent_id,- name: row.name || `Agent #${row.agent_id}`,- description: row.description || '',- image: row.image || null,- glbUrl: row.glb_url || null,- owner: row.owner,- alreadyImported: !!imported,- });+ for (const r of importedRows) importedSet.add(`${r.chain_id}:${r.erc8004_agent_id}`);}+ const agents = numericRows.map((row) => ({+ chainId: row.chain_id,+ agentId: row.agent_id,+ name: row.name || `Agent #${row.agent_id}`,+ description: row.description || '',+ image: row.image || null,+ glbUrl: row.glb_url || null,+ owner: row.owner,+ alreadyImported: importedSet.has(`${row.chain_id}:${BigInt(row.agent_id)}`),+ }));+return json(res, 200, { agents });}diff --git a/api/wk.js b/api/wk.jsindex 733a6f64b..a36fe0d04 100644--- a/api/wk.js+++ b/api/wk.js@@ -72,7 +72,7 @@ const SCHEMAS = {'Validator attestation. Two forms: a task validation (task_hash) or a ' +'glTF/GLB schema validation of the agent model (subkind "glb-schema", ' +'carrying proof_hash + proof_uri) — the Solana analog of the EVM ' +- 'ValidationRegistry recordValidation.',+ 'ValidationRegistry validationResponse.',required: ['v', 'kind', 'agent', 'passed'],properties: {...COMMON,diff --git a/contracts/DEPLOYMENTS.md b/contracts/DEPLOYMENTS.mdindex 0ad490efc..c1c81e677 100644--- a/contracts/DEPLOYMENTS.md+++ b/contracts/DEPLOYMENTS.md@@ -54,20 +54,22 @@ Polygon Amoy (80002), Avalanche Fuji (43113).| -------------------- | -------------------------------------------- | ----------------------- || IdentityRegistry | [`0x8004A818BFB912233c491871b3d84c89A494BD9e`](https://sepolia.basescan.org/address/0x8004A818BFB912233c491871b3d84c89A494BD9e) | bytecode ✓ (2026-06-19) on 7 testnets; tx unrecoverable || ReputationRegistry | [`0x8004B663056A597Dffe9eCcC1965A193B7388713`](https://sepolia.basescan.org/address/0x8004B663056A597Dffe9eCcC1965A193B7388713) | bytecode ✓ (2026-06-19) on 7 testnets; tx unrecoverable |-| ValidationRegistry | [`0x8004Cb1BF31DAf7788923b405b754f57acEB4272`](https://sepolia.basescan.org/address/0x8004Cb1BF31DAf7788923b405b754f57acEB4272) | bytecode ✓ (2026-06-19) on 7 testnets; tx unrecoverable |+| ValidationRegistry | [`0x8004Cb1BF31DAf7788923b405b754f57acEB4272`](https://sepolia.basescan.org/address/0x8004Cb1BF31DAf7788923b405b754f57acEB4272) | reference `ValidationRegistryUpgradeable` (ERC-1967 proxy), interface ✓ 2026-08-06 via `npm run verify:erc8004-validation`; NOT this repo's ValidationRegistry.sol |## Platform validator (ValidationRegistry attestor)The platform validator is the EVM key that signs glTF/schema validation-attestations (`recordValidation`) when an agent is registered. It must be-allow-listed via `addValidator(<addr>)` by the registry owner on every chain it-attests on, funded with gas, and stored as the `VALIDATOR_PRIVATE_KEY` env var on the-`three-ws-api` Cloud Run service (never committed). Provision/rotate with+attestations (`validationResponse`) when an agent is registered. The deployed+registry has no allowlist, so there is nothing to add it to: it can answer any+request addressed to it. It needs gas on every chain it attests on, and it must be+stored as the `VALIDATOR_PRIVATE_KEY` env var on the `three-ws-api` Cloud Run+service (never committed). Provision/rotate with[`scripts/erc8004/provision-validator-key.mjs`](../scripts/erc8004/provision-validator-key.mjs).+Flow and operating notes: [`docs/erc8004/validation-attestation.md`](../docs/erc8004/validation-attestation.md).-| Address | Allow-listed chains | Notes |-| ------- | ------------------- | ----- |-| `0x93Bc7EfB0059B784465619FC73C2db8D01b1CD04` | TODO: run `addValidator` per chain | Provisioned 2026-06-15. Pending funding + allow-list (testnet first: Base Sepolia 84532). |+| Address | State | Notes |+| ------- | ----- | ----- |+| `0x93Bc7EfB0059B784465619FC73C2db8D01b1CD04` | not configured, unfunded | Provisioned 2026-06-15. As of 2026-08-06 the key is absent from `.env`, `.env.local`, Secret Manager and the Cloud Run service, and the address holds 0 gas on Base Sepolia, so `/api/erc8004/validate` returns `validator_key_not_configured`. Configure + fund it (testnet first: Base Sepolia 84532) to activate platform attestations. |## CREATE2 Factory (ThreeWSFactory)diff --git a/contracts/README.md b/contracts/README.mdindex 07ce73429..5108285c7 100644--- a/contracts/README.md+++ b/contracts/README.md@@ -11,7 +11,7 @@ Three registries implementing [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004- **IdentityRegistry** — ERC-721 agents with `tokenURI`, delegated wallet (EIP-712), and key/value metadata.- **ReputationRegistry** — one signed score per reviewer per agent, aggregated on-chain.-- **ValidationRegistry** — allow-listed validators attest to off-chain proofs (e.g. glTF-Validator reports).+- **ValidationRegistry** (not deployed; the platform uses the ERC-8004 reference registry instead): requested validators attest to off-chain proofs (e.g. glTF-Validator reports).The browser code in `../src/erc8004/` already targets these ABIs — only the deployed addresses are missing.@@ -81,18 +81,30 @@ Then update [`../public/.well-known/agent-registration.json`](../public/.well-kn]```-## Allow-list a validator (for on-chain validation records)+## Authorize a validator (for on-chain validation records)-After deploy, the deployer owns the ValidationRegistry. Add the three.ws's own wallet (or a dedicated validator key) with:+The registry the platform actually reads and writes is the ERC-8004 reference+`ValidationRegistryUpgradeable`, which has no allowlist. A validator earns the+right to attest per agent, from the agent's owner:```bash+# The agent's owner opens a request naming the validator, on the Identity+# Registry's terms (owner, per-token approval, or approval for all).cast send $VALIDATION_REGISTRY \- "addValidator(address)" $VALIDATOR_ADDR \+ "validationRequest(address,uint256,string,bytes32)" \+ $VALIDATOR_ADDR $AGENT_ID "$REPORT_URI" $REQUEST_HASH \--rpc-url $BASE_SEPOLIA_RPC_URL \- --private-key $DEPLOYER_PK+ --private-key $OWNER_PK```-That wallet can then call `recordValidation(agentId, passed, proofHash, proofURI, kind)` via the `recordValidation()` helper in `../src/erc8004/validation-recorder.js`.+To let a validator (for example the platform's) open requests itself, the owner+approves it as an operator instead: `approve(validator, agentId)` or+`setApprovalForAll(validator, true)` on the Identity Registry.++The validator then answers with+`validationResponse(requestHash, response, responseURI, responseHash, tag)`, which+the `recordValidation()` helper in `../src/erc8004/validation-recorder.js` wraps+(including the request leg when the same wallet owns the agent).## Layoutdiff --git a/data/changelog.json b/data/changelog.jsonindex a136695e1..8a3ea4743 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -18354,6 +18354,16 @@"feature"],"link": "/chat"+ },+ {+ "date": "2026-08-06",+ "title": "Agora citizens now live on-chain: they register, claim work, prove it, and earn",+ "summary": "The Agora life engine went from a seeded population to a working one. Citizens register themselves with the AgenC protocol on Solana devnet, read the work board, claim a job on-chain, do the real work, submit a real proof, and earn the reward, with every step written to their public passport as a verifiable transaction. The engine can now fund its own signers when the public test faucet is empty, so the city keeps running unattended, and one citizen hitting a bad connection is retried and skipped instead of stopping everyone else. Arena and Guild moments (races won, guild jobs contributed to) now reach the live ticker instead of being silently dropped.",+ "tags": [+ "feature",+ "infra"+ ],+ "link": "/agora"}]}diff --git a/docs/architecture.md b/docs/architecture.mdindex ea936784c..85188b4da 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -217,7 +217,7 @@ The flow:3. **Registration.** The user calls `IdentityRegistry.registerAgent(cid, metadata)` on the target chain. Base is the default; `src/erc8004/chains.js` ships registry deployments on 15 mainnets (Ethereum, Base, Optimism, Arbitrum One, Polygon, BNB Chain, Avalanche, Linea, Scroll, Gnosis, Celo, zkSync Era, Moonbeam, Mantle, Fantom) plus the common testnets. The registry mints a token whose `tokenURI` returns the manifest CID.4. **Resolution.** Anyone with the chain id and agent id (or an ENS like `3dagent.eth`) can resolve the manifest: `manifest.js` reads `tokenURI(agentId)` from the registry, fetches the JSON over IPFS gateways, and normalizes it.5. **Reputation.** Users can call `ReputationRegistry.submitFeedback(agentId, score, comment)` to attach reviews. The element exposes a small UI for this.-6. **Validation attestations.** When the glTF validator runs, the report can be hashed and posted to `ValidationRegistry.recordValidation(agentId, hash)` so anyone can verify the body has been spec-checked.+6. **Validation attestations.** When the glTF validator runs, the report can be hashed and answered onto the agent's open request via `ValidationRegistry.validationResponse(requestHash, score, uri, hash, tag)` so anyone can verify the body has been spec-checked.Per-chain registry addresses, ABIs, and helpers live in `src/erc8004/`. RPC endpoints fall back to public defaults but can be overridden with `?rpcURL=...`.diff --git a/docs/deployment.md b/docs/deployment.mdindex 5d4a3ee6a..7d387b9c8 100644--- a/docs/deployment.md+++ b/docs/deployment.md@@ -424,14 +424,13 @@ forge script script/Deploy.s.sol:Deploy \After deploy, copy the three contract addresses printed in the console output into `src/erc8004/abi.js` under the `REGISTRY_DEPLOYMENTS[84532]` entry.-To allow-list a validator address on your ValidationRegistry:--```bash-cast send $VALIDATION_REGISTRY \- "addValidator(address)" $VALIDATOR_ADDR \- --rpc-url $BASE_SEPOLIA_RPC_URL \- --private-key $DEPLOYER_PK-```+Those are this repo's own contracts. Note that the platform's live validation path+does not use them: it reads and writes the ERC-8004 reference+`ValidationRegistryUpgradeable`, which has no validator allow-list. A validator is+authorized per agent by the agent's owner opening a request that names it (or by+the owner approving it as an operator). See+[erc8004/validation-attestation.md](erc8004/validation-attestation.md), and verify+any configured registry address with `npm run verify:erc8004-validation`.---diff --git a/docs/erc8004.md b/docs/erc8004.mdindex 90ec1f530..ee21eb075 100644--- a/docs/erc8004.md+++ b/docs/erc8004.md@@ -133,19 +133,22 @@ Scores are signed integers in the range −100 to +100. `getReputation` returnsThree invariants are enforced by the contract: agents can't review themselves (`SelfReviewForbidden`), each address can only submit one review per agent (`AlreadyReviewed`), and scores outside −100..+100 are rejected (`ScoreOutOfRange`).-### ValidationRegistry.sol+### ValidationRegistry-Third-party attestations from allow-listed validators. Only addresses added by the contract owner can call `recordValidation`.+The deployed registry is the ERC-8004 reference `ValidationRegistryUpgradeable`, not the `contracts/src/ValidationRegistry.sol` in this repo (that one is an alternative design and is deployed nowhere). Attestations are two-legged: the agent's owner opens a request naming a validator, and only that validator can answer it. There is no validator allowlist.```-recordValidation(uint256 agentId, bool passed, bytes32 proofHash, string proofURI, string kind)-getValidationCount(uint256 agentId) → uint256-getValidation(uint256 agentId, uint256 index) → Validation-getLatestByKind(uint256 agentId, string kind) → Validation-getValidationRange(uint256 agentId, uint256 offset, uint256 limit) → Validation[]+validationRequest(address validator, uint256 agentId, string requestURI, bytes32 requestHash)+validationResponse(bytes32 requestHash, uint8 response, string responseURI, bytes32 responseHash, string tag)+getValidationStatus(bytes32 requestHash) -> (validator, agentId, response, responseHash, tag, lastUpdate)+getAgentValidations(uint256 agentId) -> bytes32[]+getValidatorRequests(address validator) -> bytes32[]+getSummary(uint256 agentId, address[] validators, string tag) -> (count, avgResponse)```-The `kind` field is a free-form tag — `"glb-schema"` for glTF format checks, `"a2a-card"` for agent-to-agent protocol compatibility, etc. `proofHash` is a `keccak256` of the off-chain report JSON. Anyone can verify the attestation by re-running the validator, hashing the output, and comparing it to the on-chain hash.+`tag` is a free-form suite name: `"glb-schema"` for glTF format checks, `"a2a-card"` for agent-to-agent protocol compatibility, and so on. `response` is a 0..100 score (three.ws writes 100 for a pass, 0 for a fail, and reads 50 and above as passing). `responseHash` is a `keccak256` of the off-chain report JSON, so anyone can verify an attestation by re-running the validator, hashing the output, and comparing. `responseURI` is emitted in the event but not stored, so keep an index (or read the event) if you want the report link.++`requestHash` is chosen by the requester. three.ws derives it as `keccak256(abi.encode(chainId, agentId, kind, subjectHash))`, which keeps re-validation idempotent: the same subject answers the same request rather than creating a new one.The Validation Registry is not yet deployed on mainnet. It is available on all testnets.@@ -507,11 +510,12 @@ When a GLB model is run through the glTF validator, the result can be permanentl1. The validator runs the GLB and produces a JSON report2. `hashReport(report)` computes `keccak256` of the canonicalized report JSON-3. The report is optionally pinned to IPFS (`proofURI`)-4. `recordValidation(agentId, passed, proofHash, proofURI, 'glb-schema')` is called on-chain-5. The `ValidationRecorded` event is emitted with the hash and pass/fail flag+3. The report is optionally pinned to IPFS (`responseURI`)+4. The agent's owner opens the request: `validationRequest(validator, agentId, requestURI, requestHash)`+5. The named validator answers it: `validationResponse(requestHash, 100, responseURI, responseHash, 'glb-schema')`+6. The `ValidationResponse` event is emitted with the score, hash and report URI-Only allow-listed validator addresses can call `recordValidation`. Validators are added and removed by the contract owner. This keeps the attestation authority meaningful — a random wallet can't claim your model passed validation.+The registry has no allowlist, so the meaningful question is who answered. Only the validator named in the owner's request can respond, and three.ws presents a verdict as "Validated" only when the responder is in its recognized set (`public/.well-known/validators.json`, policy in `specs/VALIDATORS.md`). A random wallet cannot claim your model passed validation: it can only answer a request you addressed to it.### Reading the latest validation@@ -524,7 +528,7 @@ const result = await getLatestValidation({runner: provider,kind: 'glb-schema',});-// { validator, passed, proofHash, proofURI, timestamp, kind }+// { requestHash, validator, passed, response, responseHash, tag, lastUpdate } (null when there is no verdict yet)```### Verifying independently@@ -645,7 +649,7 @@ Gas costs vary by chain and network congestion. On Base (chain 8453) as a refere| `register(agentURI)` | ~$0.01–0.05 || `setAgentURI` | ~$0.005–0.02 || `submitFeedback` | ~$0.005–0.02 |-| `recordValidation` | ~$0.005–0.02 |+| `validationRequest` + `validationResponse` | ~$0.01 to $0.04 |Ethereum mainnet (chain 1) typically runs 10–50x more expensive than Base at equivalent network utilization. If cost is a concern, register on Base first. You can register the same agent on multiple chains later — there is no cross-chain coordination requirement.diff --git a/docs/erc8004/validation-attestation.md b/docs/erc8004/validation-attestation.mdindex 13ea981dc..c66f1204d 100644--- a/docs/erc8004/validation-attestation.md+++ b/docs/erc8004/validation-attestation.md@@ -1,10 +1,34 @@# ERC-8004 Validation Attestation-When an agent is registered (or re-validated) on-chain, three.ws automatically-runs its GLB through the platform's glTF validator and records a signed-validation attestation on the ERC-8004 **ValidationRegistry**. This is what makes-`supportedTrust: ["validation"]` in the 3D Agent Card real — the agent carries an-on-chain, independently-verifiable proof that its model passed validation.+three.ws runs an agent's GLB through the platform's glTF validator and records the+verdict on the ERC-8004 **ValidationRegistry**. This is what makes+`supportedTrust: ["validation"]` in the 3D Agent Card real: the agent carries an+on-chain, independently verifiable proof that its model passed validation.++## The registry is request/response, and that shapes everything++The deployed registry is the ERC-8004 reference `ValidationRegistryUpgradeable`+(the same 0x8004-vanity address family as the Identity Registry). It has no+validator allow-list and no single-call "record". It has two legs:++| Call | Who may send it | What it does |+| ---- | --------------- | ------------ |+| `validationRequest(validator, agentId, requestURI, requestHash)` | the agent's ERC-721 owner, a per-token approved operator, or an operator approved for all | opens a request under an id the caller chooses, addressed to one validator |+| `validationResponse(requestHash, response, responseURI, responseHash, tag)` | only the validator named in that request | answers it with a 0..100 score, a proof hash, and a tag |++Consequences worth knowing before reading the code:++- **A validator cannot attest unilaterally.** The platform validator can only+ answer a request that exists and names it. When it holds no operator authority+ over the agent, the owner has to open the request first.+- **`responseURI` is emitted, never stored.** The pinned report URL cannot be read+ back from registry storage, so the badge takes it from the platform index and+ only trusts it when its hash matches the on-chain `responseHash`.+- **Score, not a boolean.** A glTF check is binary, so we write 100 for a pass and+ 0 for a fail and read back through a midpoint threshold+ (`src/erc8004/validation-report.js`).+- **An unanswered request is visible on-chain.** Its `tag` is empty until the+ validator answers, which is how "pending" is distinguished from "no verdict".## Flow@@ -13,73 +37,110 @@ register/bind ──▶ POST /api/erc8004/validate ──▶ api/_lib/validation│1. fetch GLB (SSRF-guarded) │ reuses the ONE glTF validator2. sha256 the bytes (byte-check) │ (src/gltf-inspect.js, the same- 3. inspectModel() → report │ code behind /api/x402/model-check)- 4. pin report JSON → R2 │- 5. recordValidation(...) signed ▼+ 3. inspectModel() -> report │ code behind /api/x402/model-check)+ 4. find or open the request │+ 5. pin report JSON -> R2 │+ 6. validationResponse(...) signed▼by VALIDATOR_PRIVATE_KEY ──▶ ValidationRegistry (on-chain)profile badge ◀── GET /api/erc8004/validation ◀── resolveLatestValidation()- (walletless) getLatestByKind(agentId,"glb-schema")+ (walletless) getAgentValidations(agentId)+ + getValidationStatus(hash)```+Step 4 resolves one of three ways:++1. **A request for the platform validator already exists** (same GLB re-validated,+ or the owner just opened one): answer it. Answering again updates that record+ in place, so re-validation never piles up duplicates.+2. **No request, but the platform validator is the owner or an approved operator**:+ open the request, then answer it. Two transactions, one call.+3. **No request and no authority**: return `409 validation_request_required` with+ the exact call the owner must sign (`registry`, `validatorAddress`, `agentId`,+ `requestURI`, `requestHash`). The badge prompts for it via+ [`src/erc8004/validation-request.js`](../../src/erc8004/validation-request.js),+ then retries `POST /api/erc8004/validate` with that `requestHash` so the+ platform answers it. Registration is never blocked either way.++The `requestHash` is derived, not random:+`keccak256(abi.encode(chainId, agentId, kind, glbSha256))`. The same model always+maps to the same request, and a new model always gets its own.+- **Pass/fail** = zero parse/schema errors. Optimization suggestions are recordedas warnings/infos and never fail a model. See[`src/erc8004/validation-report.js`](../../src/erc8004/validation-report.js).- **Byte-check vs schema-check are independent.** A passing schema validation- never overrides the sha256 byte identity — both are surfaced in the report+ never overrides the sha256 byte identity; both are surfaced in the report(`byteCheck.sha256` and `issues`).- **Best-effort.** A validation failure, a missing validator key, an undeployed- registry, or a non-allow-listed validator never blocks or reverts the- registration. The agent is registered; it's just unvalidated, and the badge- says so.-- **Re-runnable.** Re-validating after a GLB update records a fresh attestation;- `getLatestByKind` (and the badge) reflect the latest.+ registry, or a missing request never blocks or reverts the registration. The+ agent is registered; it is just unvalidated, and the badge says so.+- **Verifying a proof.** `hashReport()` keccaks the report's compact JSON. Fetch+ the pinned file, `JSON.stringify(JSON.parse(bytes))`, keccak it, and compare+ against the chain's `responseHash`.## Badge states-`src/shared/validation-badge.js` renders four designed states from the on-chain-read: **validated** (green ✓, links to the proof report + validator), **validation-failed** (red, shows the failure reason from the pinned report), **not validated**-(registry deployed, no attestation yet — owners get a Validate action), and-**pending** (while fetching / attesting). When the ValidationRegistry isn't-deployed on the agent's chain the badge renders nothing.+`src/shared/validation-badge.js` renders five designed states from the on-chain+read: **validated** (green, links to the proof report + validator), **validation+failed** (red, shows the failure reason from the pinned report), **validation+pending** (a request is open, no verdict yet), **not validated** (registry+deployed, nothing requested, and owners get a Validate action), and **pending**+(while fetching / attesting). When the ValidationRegistry is not deployed on the+agent's chain the badge renders nothing.## Operating the platform validatorThe validator is a dedicated EVM key. It is **not** in the repo.-1. **Provision** (already done — address below):+1. **Provision** (already done, address below):```node scripts/erc8004/provision-validator-key.mjs```Address: `0x93Bc7EfB0059B784465619FC73C2db8D01b1CD04` (provisioned 2026-06-15).2. **Store the secret**: set `VALIDATOR_PRIVATE_KEY` on the Cloud Run service(`three-ws-api`) for production and `.env.local` for local runs. Never commit it.-3. **Fund** the address with gas on each ValidationRegistry chain.-4. **Allow-list** it on each chain as the registry owner (run as the- ValidationRegistry deployer):- ```- cast send <ValidationRegistry> "addValidator(address)" \- 0x93Bc7EfB0059B784465619FC73C2db8D01b1CD04 --rpc-url <chain>- ```+3. **Fund** the address with gas on each ValidationRegistry chain. It pays for the+ response transaction (and the request too, on agents where it is an operator).+4. **Nothing to allow-list.** The registry has no validator list; authority comes+ from the request. To let the platform attest without prompting the owner, the+ owner approves the validator as an operator on the Identity Registry+ (`approve(validator, agentId)` or `setApprovalForAll(validator, true)`).++Until the key is configured on a chain whose ValidationRegistry is deployed,+`/api/erc8004/validate` returns a clear ops error (`validator_key_not_configured`,+`validation_registry_not_deployed`, or `validation_request_required`), never a+silent skip. **Testnet** (Base Sepolia 84532 and six sibling testnets) has the+registry deployed and is the first end-to-end target; **mainnet** has no reference+deployment yet, so `VALIDATION_REGISTRY_MAINNET` stays empty and the badge renders+nothing there.++Before trusting any address in that table, run:++```+npm run verify:erc8004-validation+```-Until the key is configured **and** allow-listed on a chain whose-ValidationRegistry is deployed, `/api/erc8004/validate` returns a clear ops error-(`validator_key_not_configured`, `validation_registry_not_deployed`, or-`validator_not_allowlisted`) — never a silent skip. **Testnet** (Base Sepolia-84532) already has a deployed registry, so it's the first end-to-end target;-**mainnet** activates automatically once task 01 fills the mainnet address in-`api/_lib/erc8004-chains.js`, `src/erc8004/abi.js`, and `sdk/src/erc8004/abi.js`.+It follows each configured registry to its implementation, asserts every selector+in `VALIDATION_REGISTRY_ABI` is present in the bytecode, and exercises the reads+the badge depends on. This check exists because "there is bytecode at the address"+was once mistaken for "the address implements our interface": the platform pointed+at the reference registry while calling functions from+`contracts/src/ValidationRegistry.sol`, every call reverted, and the read path+reported the reverts as "no attestation yet".## Surfaces| Piece | File || ----- | ---- |-| Pure report (hash, pass/fail, build) | `src/erc8004/validation-report.js` |+| Pure report + score/request-id helpers | `src/erc8004/validation-report.js` || Server attestor | `api/_lib/validation-attest.js` || Endpoints (`validate` POST, `validation` GET) | `api/erc8004/[action].js` |-| Walletless on-chain read | `api/_lib/onchain.js` → `resolveLatestValidation` |+| Walletless on-chain read | `api/_lib/onchain.js` -> `resolveLatestValidation` |+| Owner request leg (browser) | `src/erc8004/validation-request.js` || Registry address + ABI | `api/_lib/erc8004-chains.js` |+| Interface verifier | `scripts/erc8004/verify-validation-registry.mjs` || Badge component | `src/shared/validation-badge.js` || Profile render | `src/agent-detail.js` |-| DB cache (list views / ops) | migration `20260615000000_erc8004_validation.sql` |+| Public dashboard | `src/validation-ui.js`, `/validation` |+| DB cache (list views / ops) | migrations `20260615000000_erc8004_validation.sql`, `20260806120000_erc8004_validation_request_hash.sql` |diff --git a/docs/security.md b/docs/security.mdindex ca05dc3be..3cbb9d5be 100644--- a/docs/security.md+++ b/docs/security.md@@ -326,7 +326,7 @@ Admin and write endpoints accept only same-site requests, enforced by checking t- The ERC-8004 registries are immutable once deployed — audit the contracts before deploying to mainnet- The deployer address becomes the registry owner; use a multisig wallet (e.g., a 3-of-5 Safe) for production deployments-- The owner EOA controls `addValidator` / `removeValidator` — key compromise at this level is a critical incident+- The platform validator EOA (`VALIDATOR_PRIVATE_KEY`) can answer any validation request addressed to it, so its compromise means forged verdicts on agents that requested it: a critical incident### Bundle hostingdiff --git a/docs/smart-contracts.md b/docs/smart-contracts.mdindex 0c984f14b..e2b67c0e2 100644--- a/docs/smart-contracts.md+++ b/docs/smart-contracts.md@@ -394,132 +394,131 @@ await tx.wait();## ValidationRegistry-`ValidationRegistry` records immutable attestations of off-chain validation results against registered agents. Typical use cases are glTF schema checks, behavioral test results, or any third-party quality signal.+`ValidationRegistry` records attestations of off-chain validation results against registered agents. Typical use cases are glTF schema checks, behavioral test results, or any third-party quality signal.-Unlike the other two registries, `ValidationRegistry` is **permissioned**: only addresses added to the validator allowlist by the contract owner can call `recordValidation`. If you are building a third-party validator service, you need to be added to the allowlist or deploy your own instance.+The deployed registry (`REGISTRY_DEPLOYMENTS[chainId].validationRegistry`, testnet only for now) is the ERC-8004 reference `ValidationRegistryUpgradeable`. It is **not** the `contracts/src/ValidationRegistry.sol` in this repo, which is an alternative design that is deployed nowhere; if you read that source expecting the deployed behavior you will write calls that revert. Verify any address before trusting it:-The `ValidationRegistry` is deployed on testnets only; mainnet deployment is pending.--### Structs and Storage--```solidity-struct Validation {- address validator; // who ran the validation- bool passed; // true = zero errors- bytes32 proofHash; // keccak256 of the off-chain report JSON- string proofURI; // optional ipfs:// or https:// pointer to the full report- uint64 timestamp;- string kind; // free-form tag, e.g. "glb-schema", "a2a-card"-}+```+npm run verify:erc8004-validation```-The `kind` field lets multiple independent validator types coexist for the same agent. The registry tracks the latest record per `(agentId, kind)` for O(1) lookup via `getLatestByKind`.+### The two-legged model-### Recording a Validation+There is no validator allowlist. Authority comes from the request instead:-```solidity-// Caller must be in the isValidator allowlist-function recordValidation(- uint256 agentId,- bool passed,- bytes32 proofHash,- string calldata proofURI,- string calldata kind-) external-```+| Call | Who may send it |+| ---- | --------------- |+| `validationRequest(address validator, uint256 agentId, string requestURI, bytes32 requestHash)` | the agent's ERC-721 owner, its per-token approved operator, or an operator approved for all |+| `validationResponse(bytes32 requestHash, uint8 response, string responseURI, bytes32 responseHash, string tag)` | only the validator named in that request |-Reverts with:-- `NotValidator` — caller is not in the allowlist-- `UnknownAgent` — agentId is not registered+`requestHash` is an id the requester picks. three.ws derives it so the flow is idempotent: `keccak256(abi.encode(chainId, agentId, kind, subjectHash))`, which means re-validating the same subject answers the same request instead of piling up duplicates.-Emits:+`response` is a 0..100 score, not a boolean. A binary suite writes 100 for a pass and 0 for a fail, and readers treat 50 and above as a pass (`responsePassed()` in `src/erc8004/validation-report.js`). `tag` carries the validation kind, e.g. `"glb-schema"`.-```solidity-event ValidationRecorded(- uint256 indexed agentId,- address indexed validator,- bool passed,- bytes32 proofHash,- string kind-);-```+`validationRequest` reverts with `Not authorized` when the caller has no authority over the agent, and `exists` when that `requestHash` was already used. `validationResponse` reverts with `unknown` for an id the registry has never seen, `not validator` when the sender is not the named validator, and `resp>100` for an out-of-range score.-### Reading Validations+### Reading validations```solidity-// Total number of validation records for an agent-function getValidationCount(uint256 agentId) external view returns (uint256)+// Every request id ever opened for an agent, oldest first+function getAgentValidations(uint256 agentId) external view returns (bytes32[] memory)-// Fetch a single record by index-function getValidation(uint256 agentId, uint256 index)- external view- returns (Validation memory)+// Every request id addressed to a validator+function getValidatorRequests(address validator) external view returns (bytes32[] memory)-// Fetch the most recent record for a given kind (reverts if none exists)-function getLatestByKind(uint256 agentId, string calldata kind)+// One request's state; reverts ("unknown") if the id was never opened.+// An unanswered request returns response 0 with an EMPTY tag: that is pending,+// not a failing verdict.+function getValidationStatus(bytes32 requestHash)external view- returns (Validation memory)--// Fetch a slice of records (pagination)-function getValidationRange(uint256 agentId, uint256 offset, uint256 limit)+ returns (+ address validatorAddress,+ uint256 agentId,+ uint8 response,+ bytes32 responseHash,+ string memory tag,+ uint256 lastUpdate+ )++// Aggregate over chosen validators for one tag+function getSummary(uint256 agentId, address[] calldata validators, string calldata tag)external view- returns (Validation[] memory)+ returns (uint64 count, uint8 avgResponse)```-### Allowlist Management (owner only)+Note what is missing: `responseURI` is emitted in the `ValidationResponse` event but never stored. To link a verdict to its pinned report, read the event or keep your own index, and verify whatever URL you recover against the stored `responseHash`.++Events:```solidity-function addValidator(address v) external // emits ValidatorAdded-function removeValidator(address v) external // emits ValidatorRemoved-function transferOwnership(address newOwner) external+event ValidationRequest(+ address indexed validatorAddress,+ uint256 indexed agentId,+ string requestURI,+ bytes32 indexed requestHash+);-mapping(address => bool) public isValidator;-address public owner;+event ValidationResponse(+ address indexed validatorAddress,+ uint256 indexed agentId,+ bytes32 indexed requestHash,+ uint8 response,+ string responseURI,+ bytes32 responseHash,+ string tag+);```### Recording from ethers.js```js-import { ethers } from 'ethers';+import { ethers, keccak256, toUtf8Bytes } from 'ethers';import { VALIDATION_REGISTRY_ABI, REGISTRY_DEPLOYMENTS } from './src/erc8004/abi.js';-import { keccak256, toUtf8Bytes } from 'ethers';+import { validationRequestHash, responseForPassed } from './src/erc8004/validation-report.js';+const chainId = 84532; // Base Sepoliaconst valRegistry = new ethers.Contract(- REGISTRY_DEPLOYMENTS[84532].validationRegistry, // testnet: Base Sepolia+ REGISTRY_DEPLOYMENTS[chainId].validationRegistry,VALIDATION_REGISTRY_ABI,- signer // must be allow-listed+ signer, // the agent's owner or operator for leg 1; the named validator for leg 2);-// Hash the report JSON deterministically-const reportJson = JSON.stringify(validationReport);-const proofHash = keccak256(toUtf8Bytes(reportJson));+const proofHash = keccak256(toUtf8Bytes(JSON.stringify(validationReport)));const passed = validationReport.issues.numErrors === 0;+const proofURI = 'ipfs://QmYourPinnedReport'; // or '' to omit+const requestHash = validationRequestHash({ chainId, agentId: 42, seed: proofHash });-// Optionally pin the full report to IPFS first, so verifiers can fetch details-const proofURI = 'ipfs://QmYourPinnedReport'; // or '' to omit+// Leg 1: the owner opens the request (skip when it already exists).+await (await valRegistry.validationRequest(validatorAddress, 42, proofURI, requestHash)).wait();-const tx = await valRegistry.recordValidation(- agentId,- passed,- proofHash,+// Leg 2: the named validator answers it.+await (await valRegistry.validationResponse(+ requestHash,+ responseForPassed(passed), // 100 or 0proofURI,- 'glb-schema' // kind-);-await tx.wait();+ proofHash,+ 'glb-schema',+)).wait();```+`recordValidation()` in `src/erc8004/validation-recorder.js` wraps both legs for the common case where one wallet owns the agent and validates it.+### Verifying a Validation```js-// Fetch the latest glb-schema attestation for agent 42-const record = await valRegistry.getLatestByKind(42, 'glb-schema');+import { responsePassed } from './src/erc8004/validation-report.js';++// The latest answered glb-schema attestation for agent 42+const hashes = await valRegistry.getAgentValidations(42);+const statuses = await Promise.all(hashes.map((h) => valRegistry.getValidationStatus(h)));+const answered = statuses.filter((s) => s[4] === 'glb-schema');+const record = answered.sort((a, b) => Number(b[5]) - Number(a[5]))[0];// Re-run the validator on the current GLB, then re-hash the outputconst freshReport = await runGlbValidator(glbUrl);const recomputedHash = keccak256(toUtf8Bytes(JSON.stringify(freshReport)));-const attestationMatches = recomputedHash === record.proofHash;-console.log('Passes:', record.passed, '| Attestation still valid:', attestationMatches);+console.log('Passes:', responsePassed(record[2]), '| Attestation still valid:', recomputedHash === record[3]);```---@@ -584,7 +583,8 @@ These are approximate costs at optimizer 200 runs. Actual cost depends on chain| `setMetadata` | ~35k | Per key/value entry || `setAgentWallet` | ~50k | EIP-712 sig verification + storage || `submitFeedback` | ~55k | New review; first review costs slightly more |-| `recordValidation` | ~60k | Includes `getLatestByKind` index write |+| `validationRequest` | ~120k | Writes the request plus two index arrays |+| `validationResponse` | ~60k | Updates the request in place || All `view` functions | 0 | Free off-chain reads |On Base at typical gas prices (~0.001 gwei base fee), an agent registration runs to roughly $0.10–$0.25. The same transaction costs 20–50x more on Ethereum mainnet — use Base or another L2 for cost-sensitive flows.diff --git a/docs/ux-flows/03-3d-editing-viewer.md b/docs/ux-flows/03-3d-editing-viewer.mdindex 3251a842b..1fd1a624a 100644--- a/docs/ux-flows/03-3d-editing-viewer.md+++ b/docs/ux-flows/03-3d-editing-viewer.md@@ -109,7 +109,7 @@ Routing summary (from `vite.config.js`):8. (optional, wallet) **Pin & sign on-chain**: `_handOffToDashboard` switches to the Records tab, opens the submit modal pre-filled with the in-memory report + its `hashReport` hash (no file re-pick), then `ValidationDashboard.submitReport` connects the wallet, pins to IPFS, and records the attestation (validation-page.js:221-242; validation-ui.js).9. **Records tab** (independent): enter agent id + chain id (or arrive via `?agent=&chain=`), **Load** past validation records (`getLatestValidation`), or **Submit** a new report by dropping/picking a report JSON file (validation-ui.js:33-79).- **Decision points / branches:** Input source (file / URL / sample) — all converge on `_run`. Validate vs Inspect (run together, two tabs). In-memory hand-off to Records vs manual report-file submission. Records load (`?agent=&chain=` auto-loads) vs manual entry. On-chain submit requires wallet; validation/inspection do not.-- **External calls / dependencies:** `fetch(url)` for URL/sample inputs (validation-page.js:136); `gltf-validator` `validateBytes` (in-browser); `src/gltf-inspect.js` (glTF-Transform, in-browser). On-chain: IPFS pin (`pinFile`), `recordValidation`/`getLatestValidation` (validation-recorder.js), `ensureWallet`/ethers + `window.ethereum`. Inputs: GLB (and glTF + external resources resolved from the dropped asset map). The Validate tab can read the GLTFLoader-cached ArrayBuffer when invoked from the viewer (validator.js:26-34). Outputs: JSON report download, on-chain attestation.+- **External calls / dependencies:** `fetch(url)` for URL/sample inputs (validation-page.js:136); `gltf-validator` `validateBytes` (in-browser); `src/gltf-inspect.js` (glTF-Transform, in-browser). On-chain: IPFS pin (`pinFile`), `recordValidation` (validationRequest + validationResponse) / `getLatestValidation` (validation-recorder.js), `ensureWallet`/ethers + `window.ethereum`. Inputs: GLB (and glTF + external resources resolved from the dropped asset map). The Validate tab can read the GLTFLoader-cached ArrayBuffer when invoked from the viewer (validator.js:26-34). Outputs: JSON report download, on-chain attestation.- **Success state:** Status line "Loaded <name> · <KB> · validated" (validation-page.js:184-187); rendered validate + inspect reports; **Pin & sign** button enabled once a report exists.- **Empty / error states:** Initial — three empty tab panels with sample chips inviting input. While running — "Validating…" / "Inspecting…" loading rows. File read error → "Could not read file: …"; fetch error → "Could not fetch <name>: HTTP <status>"; validator failure → "Validator failed: …" inline; inspector failure → "Inspector failed: …" inline (validation-page.js:122-217). On-chain hand-off with no report → toast "Run a validation first" (validation-page.js:222-224).- **Step count:** ~4 required (arrive → provide model → read Validate report → read Inspect report) + ~5 optional (download JSON, lightbox, pin & sign on-chain, browse records, submit report file).diff --git a/docs/validation.md b/docs/validation.mdindex 4dbe0a94b..244135628 100644--- a/docs/validation.md+++ b/docs/validation.md@@ -152,7 +152,9 @@ Validation results can be attested on-chain through two complementary mechanisms### ValidationRegistry (ERC-8004)-For registered agents, a validation record can be written to the `ValidationRegistry` smart contract. The registry is currently deployed on the testnets only (e.g. Base Sepolia, chain ID 84532); mainnet deployment is pending, so use a testnet chain ID:+For registered agents, a validation record can be written to the `ValidationRegistry` smart contract. The registry is currently deployed on the testnets only (e.g. Base Sepolia, chain ID 84532); mainnet deployment is pending, so use a testnet chain ID.++The registry is request/response based: the agent's owner (or an approved operator) opens a request naming a validator, and only that validator may answer it. `recordValidation()` drives both legs from the connected wallet, so that wallet has to own the agent (or be its operator):```jsimport { recordValidation, hashReport, reportPassed } from './src/erc8004/validation-recorder.js';@@ -161,23 +163,25 @@ import { recordValidation, hashReport, reportPassed } from './src/erc8004/validaconst passed = reportPassed(validationReport); // true if numErrors === 0// Optionally pin the full report to IPFS first-const { txHash, proofHash, proofURI } = await recordValidation({+const { txHash, requestTxHash, requestHash, proofHash, proofURI } = await recordValidation({agentId: 42,report: validationReport,- signer: connectedWallet, // must be an allow-listed validator address+ signer: connectedWallet, // the agent's owner, or an approved operatorchainId: 84532, // Base Sepolia (ValidationRegistry is testnet-only for now)apiToken: IPFS_API_TOKEN, // for pinningpin: true,});```+`requestTxHash` is null when a request for this report already existed and only the verdict had to be sent.+The hash stored on-chain is `keccak256(JSON.stringify(report))`. Anyone can recompute it:1. Re-run the validator on the same GLB file.-2. `hashReport(report)` → produces the same hash if the input is identical.-3. Query `ValidationRegistry.getLatestByKind(agentId, 'glb-schema')` → compare hashes.+2. `hashReport(report)` produces the same hash if the input is identical.+3. Query `ValidationRegistry.getValidationStatus(requestHash)` (or `getAgentValidations(agentId)` for every request id on the agent) and compare its `responseHash`. `src/erc8004/validation-recorder.js` wraps this as `getLatestValidation({ agentId, runner, chainId })`.-Only **allow-listed validator addresses** may call `recordValidation`. The allow-list is maintained in [`public/.well-known/validators.json`](../public/.well-known/validators.json) and mirrored on-chain. See [`specs/VALIDATORS.md`](../specs/VALIDATORS.md) for how to apply to become a validator.+The registry has no on-chain validator allow-list: any address the owner requests can answer. Which verdicts three.ws presents as "Validated" is off-chain policy, maintained in [`public/.well-known/validators.json`](../public/.well-known/validators.json). See [`specs/VALIDATORS.md`](../specs/VALIDATORS.md) for how to be recognized, and [`docs/erc8004/validation-attestation.md`](erc8004/validation-attestation.md) for the platform's own automatic attestation flow.The minimum check suite for a `pass` verdict includes:diff --git a/package.json b/package.jsonindex d360d3071..529e92d73 100644--- a/package.json+++ b/package.json@@ -193,6 +193,7 @@"audit:mcp-catalog": "node scripts/build-mcp-catalog.mjs --check","build:mcp-catalog": "node scripts/build-mcp-catalog.mjs","audit:inline-handlers": "node scripts/audit-inline-handlers.mjs",+ "audit:csp": "node scripts/audit-csp.mjs","audit:hidden-guard": "node scripts/audit-hidden-guard.mjs","audit:tokens": "node scripts/audit-token-drift.mjs","audit:guards": "node scripts/audit-guards.mjs",@@ -226,7 +227,7 @@"build:news": "node scripts/build-news.mjs","prebuild": "node scripts/copy-three-decoders.mjs && (node scripts/build-news.mjs & node scripts/build-skill-metadata.mjs & node scripts/build-local-skill-packs.mjs & node scripts/build-discovery-cards.mjs & node scripts/build-guards.mjs & node scripts/build-atlas-index.mjs & node scripts/build-mcp-catalog.mjs & npm run build:examples & npm run build:docs-search & npm run build:club-assets & npm run build:walk-environments & wait) && node scripts/inject-blog-seo.mjs --write && node scripts/inject-hidden-guard.mjs --write && (node scripts/build-page-index.mjs && node scripts/audit-page-index.mjs --strict && node scripts/audit-empty-handlers.mjs && node scripts/audit-hidden-guard.mjs) && node scripts/i18n-annotate.mjs --apply --pages=\"public/news/*.html\" && node scripts/inject-seo-meta.mjs --write && node scripts/inject-theme-boot.mjs --write","seo:meta": "node scripts/inject-blog-seo.mjs --write && node scripts/build-page-index.mjs && node scripts/inject-seo-meta.mjs --write",- "build": "NODE_OPTIONS='--no-deprecation --max-old-space-size=6144' vite build && node scripts/strip-sw-from-embeds.mjs && node scripts/inject-tour-boot.mjs && node scripts/inject-atlas.mjs",+ "build": "NODE_OPTIONS='--no-deprecation --max-old-space-size=6144' vite build && node scripts/strip-sw-from-embeds.mjs && node scripts/inject-tour-boot.mjs && node scripts/inject-atlas.mjs && node scripts/inject-inline-behaviors.mjs","build:wasm": "PATH=\"$HOME/.cargo/bin:$PATH\" RUSTFLAGS='-C target-feature=+simd128' wasm-pack build crates/vanity-grinder --target web --release --out-dir ../../src/solana/vanity/wasm && printf '%s\\n' '# wasm-pack writes a default `*` gitignore that excludes everything.' '# Override it: the generated files in this directory ARE checked in so the' '# app builds without requiring a Rust toolchain at install time. Run' '# `npm run build:wasm` after editing /crates/vanity-grinder/src/lib.rs to' '# refresh these artifacts.' '!*' > src/solana/vanity/wasm/.gitignore","build:animations": "node scripts/build-animations.mjs && node scripts/sync-animation-registry.mjs && node scripts/build-motion-signatures.mjs","sync:animation-registry": "node scripts/sync-animation-registry.mjs",@@ -302,6 +303,7 @@"check:tutorials": "node scripts/sync-tutorial-pages.mjs","tutorials:sync": "node scripts/sync-tutorial-pages.mjs --write","check:claude": "node scripts/check-claude-md.mjs",+ "verify:erc8004-validation": "node scripts/erc8004/verify-validation-registry.mjs","check:rules": "node scripts/check-rules.mjs","check:gcloudignore": "node scripts/check-gcloudignore.mjs","check:evm-rpc": "node --env-file=.env scripts/probe-evm-rpc.mjs --chain 1 --ens",diff --git a/public/.well-known/validators.json b/public/.well-known/validators.jsonindex dae5ea9e7..7f6640444 100644--- a/public/.well-known/validators.json+++ b/public/.well-known/validators.json@@ -1,7 +1,7 @@{"$schema": "https://three.ws/specs/validators-v1",- "description": "Allow-listed ERC-8004 ValidationRegistry validators for three.ws Card v1 attestations. See specs/VALIDATORS.md.",- "updatedAt": "2026-04-27",+ "description": "Validators three.ws recognizes for ERC-8004 ValidationRegistry attestations on three.ws Card v1 agents. The registry itself has no allow-list: this is an off-chain trust signal used when rendering verdicts. See specs/VALIDATORS.md.",+ "updatedAt": "2026-08-06","mainnet": [],"testnet": []}diff --git a/public/changelog.json b/public/changelog.jsonindex 58d486c0d..1ec4825f5 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-06T05:14:00.246Z",+ "generated_at": "2026-08-06T05:25:21.254Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -39,6 +39,17 @@"improvement"]},+ {+ "date": "2026-08-06",+ "type": "update",+ "title": "Agora citizens now live on-chain: they register, claim work, prove it, and earn",+ "summary": "The Agora life engine went from a seeded population to a working one. Citizens register themselves with the AgenC protocol on Solana devnet, read the work board, claim a job on-chain, do the real work, submit a real proof, and earn the reward, with every step written to their public passport as a verifiable transaction. The engine can now fund its own signers when the public test faucet is empty, so the city keeps running unattended, and one citizen hitting a bad connection is retried and skipped instead of stopping everyone else. Arena and Guild moments (races won, guild jobs contributed to) now reach the live ticker instead of being silently dropped.",+ "link": "/agora",+ "tags": [+ "feature",+ "infra"+ ]+ },{"date": "2026-08-06","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 04ed089a4..358f3e265 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -30,6 +30,14 @@<category>security</category><description>Closing the last eight findings from the June security review. Tipping a live stage host, and paying an agent you met in the real world, both recorded the payment from the receipt your browser handed us after only checking that it looked like a real transaction id. It never looked the transaction up. Anyone who knew a stage id could therefore post a well-formed but unrelated id with a huge number attached and buy the top of that show's tip leaderboard, and the host's shout-out, for nothing. Every tip and every pay is now checked against the chain before it counts: the transaction has to exist, have succeeded, and have actually paid the host at least what was claimed, or it is refused and nothing is recorded. If the network simply has not caught up yet, your tip is held rather than thrown away, and it joins the leaderboard the moment the transfer shows up. Four spend ceilings that could be raced were tightened the same way: an agent wallet's daily limit, a standing rule's own daily and lifetime budgets, a vault's rolling 24-hour trade budget, and a Commons citizen's daily posting cap all now reserve the room for a payment in the same breath as recording it, counting money already in flight, so two actions fired at the same instant can no longer both spend headroom only one of them had. Also: a paid signal feed no longer shows its open positions to people who have not subscribed (closed trades stay public, since that track record is what the feed sells itself on), swarm actions that move real SOL now carry the same anti-forgery token and per-user limit as every other money action, walk analytics stopped accepting anyone's claim about which creator's avatar they were using, and the scheduled-job password check that guards every automated money mover is now one piece of shared code instead of seventy-eight copies.</description></item>+ <item>+ <title>Agora citizens now live on-chain: they register, claim work, prove it, and earn</title>+ <link>https://three.ws/agora</link>+ <guid isPermaLink="false">2026-08-06:Agora citizens now live on-chain: they register, claim work, prove it, and earn</guid>+ <pubDate>Thu, 06 Aug 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The Agora life engine went from a seeded population to a working one. Citizens register themselves with the AgenC protocol on Solana devnet, read the work board, claim a job on-chain, do the real work, submit a real proof, and earn the reward, with every step written to their public passport as a verifiable transaction. The engine can now fund its own signers when the public test faucet is empty, so the city keeps running unattended, and one citizen hitting a bad connection is retried and skipped instead of stopping everyone else. Arena and Guild moments (races won, guild jobs contributed to) now reach the live ticker instead of being silently dropped.</description>+ </item><item><title>Agora citizens now sculpt 3D models, write, and check each other's work</title><link>https://three.ws/agora</link>diff --git a/public/features.json b/public/features.jsonindex 276faced8..be92af987 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-06T05:14:00.202Z",+ "generated_at": "2026-08-06T05:25:21.232Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/validation/REPORT_FORMAT.md b/public/validation/REPORT_FORMAT.mdindex ace4b27d0..4143ce181 100644--- a/public/validation/REPORT_FORMAT.md+++ b/public/validation/REPORT_FORMAT.md@@ -2,7 +2,7 @@## Overview-An **agent validation report** is a JSON document that captures the results of testing an agent's GLB model and metadata against a suite of validation rules. Validators (auditors, testing services) generate these reports, sign them on-chain via `recordValidation()`, and end-users browse them to verify trust.+An **agent validation report** is a JSON document that captures the results of testing an agent's GLB model and metadata against a suite of validation rules. Validators (auditors, testing services) generate these reports, answer the agent owner's on-chain request via `validationResponse()`, and end-users browse them to verify trust.## Schemadiff --git a/scripts/erc8004/provision-validator-key.mjs b/scripts/erc8004/provision-validator-key.mjsindex 144fac598..ac67d9d38 100644--- a/scripts/erc8004/provision-validator-key.mjs+++ b/scripts/erc8004/provision-validator-key.mjs@@ -3,13 +3,15 @@* Provision the platform ValidationRegistry validator key.** Generates a fresh EVM keypair used to sign glTF/schema validation- * attestations (recordValidation). The PRIVATE KEY is printed to STDERR only and- * is NEVER written to the repo — capture it from the terminal and store it as- * the `VALIDATOR_PRIVATE_KEY` secret in Vercel (and .env.local for local runs).+ * attestations (validationResponse). The PRIVATE KEY is printed to STDERR only and+ * is NEVER written to the repo: capture it from the terminal and store it as the+ * `VALIDATOR_PRIVATE_KEY` secret on the three-ws-api Cloud Run service (and+ * .env.local for local runs).*- * The ADDRESS is printed to STDOUT — that's the value you allow-list on each- * ValidationRegistry chain via addValidator(<addr>) as the registry owner- * (task 01 step 6), and the value you record in DEPLOYMENTS.md.+ * The ADDRESS is printed to STDOUT. The deployed registry has no allowlist, so+ * there is nothing to add it to: fund it with gas on each chain it attests on,+ * record it in DEPLOYMENTS.md, and have agent owners either request it or approve+ * it as an operator (see docs/erc8004/validation-attestation.md).** Usage:* node scripts/erc8004/provision-validator-key.mjs # generate freshdiff --git a/scripts/erc8004/verify-validation-registry.mjs b/scripts/erc8004/verify-validation-registry.mjsnew file mode 100644index 000000000..5c39575de--- /dev/null+++ b/scripts/erc8004/verify-validation-registry.mjs@@ -0,0 +1,116 @@+#!/usr/bin/env node+/**+ * Prove that the ValidationRegistry address we configure per chain really answers+ * the interface our code calls.+ *+ * This check exists because an address that looks right is not proof: the ERC-8004+ * reference registries and our own contracts/src/ValidationRegistry.sol both use+ * 0x8004-vanity addresses, and for a while the platform pointed at the reference+ * deployment while calling our contract's functions. Every call reverted, and the+ * read path treats a revert as "no attestation yet", so the feature looked idle+ * instead of broken.+ *+ * What it does, per chain in api/_lib/erc8004-chains.js that carries a registry:+ * 1. eth_getCode the address (following an ERC-1967 proxy to its implementation).+ * 2. Assert every function selector in VALIDATION_REGISTRY_ABI is present in the+ * implementation bytecode.+ * 3. Exercise the two read calls the badge depends on, live.+ *+ * Usage:+ * node scripts/erc8004/verify-validation-registry.mjs # every configured chain+ * node scripts/erc8004/verify-validation-registry.mjs 84532 11155111+ *+ * Exit code 0 = every configured registry matches; 1 = at least one mismatch.+ */++import { Contract, Interface, JsonRpcProvider, Network, id as keccakId } from 'ethers';++import { CHAINS, VALIDATION_REGISTRY_ABI } from '../../api/_lib/erc8004-chains.js';++// ERC-1967 implementation slot: keccak256("eip1967.proxy.implementation") - 1.+const IMPL_SLOT = '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc';+const ZERO = '0x0000000000000000000000000000000000000000';++const iface = new Interface(VALIDATION_REGISTRY_ABI);+const FUNCTIONS = iface.fragments+ .filter((f) => f.type === 'function')+ .map((f) => ({ signature: f.format('sighash'), selector: keccakId(f.format('sighash')).slice(2, 10) }));++const wanted = process.argv.slice(2).map(Number).filter(Boolean);+const targets = CHAINS.filter((c) => c.validationRegistry && (!wanted.length || wanted.includes(c.id)));+const skipped = CHAINS.filter((c) => !c.validationRegistry && (!wanted.length || wanted.includes(c.id)));++if (!targets.length) {+ console.log('No chain in the table has a ValidationRegistry address configured. Nothing to verify.');+ process.exit(0);+}++let failures = 0;++for (const chain of targets) {+ const label = `${chain.name} (${chain.id})`;+ const network = Network.from(chain.id);+ let provider;+ try {+ provider = new JsonRpcProvider(chain.rpcUrls[0], network, { staticNetwork: network });+ } catch (err) {+ console.log(`SKIP ${label}: no usable RPC (${err.message})`);+ continue;+ }++ let code;+ try {+ code = await provider.getCode(chain.validationRegistry);+ } catch (err) {+ console.log(`SKIP ${label}: RPC unreachable (${err.shortMessage || err.message})`);+ continue;+ }+ if (!code || code === '0x') {+ console.log(`FAIL ${label}: no contract at ${chain.validationRegistry}`);+ failures++;+ continue;+ }++ // Follow a proxy so the selector scan sees the real implementation.+ let scanned = chain.validationRegistry;+ const slot = await provider.getStorage(chain.validationRegistry, IMPL_SLOT).catch(() => null);+ if (slot && slot !== `0x${'0'.repeat(64)}`) {+ const impl = `0x${slot.slice(26)}`;+ if (impl !== ZERO) {+ scanned = impl;+ code = await provider.getCode(impl);+ }+ }++ const missing = FUNCTIONS.filter((f) => !code.includes(f.selector));+ if (missing.length) {+ console.log(`FAIL ${label}: ${chain.validationRegistry} (impl ${scanned}) is missing ${missing.length} of ${FUNCTIONS.length} functions:`);+ for (const m of missing) console.log(` ${m.signature}`);+ failures++;+ continue;+ }++ // Live reads, so a selector that exists but decodes differently still fails.+ const registry = new Contract(chain.validationRegistry, VALIDATION_REGISTRY_ABI, provider);+ try {+ const list = await registry.getAgentValidations(1n);+ const summary = await registry.getSummary(1n, [], 'glb-schema');+ console.log(+ `OK ${label}: ${chain.validationRegistry} answers all ${FUNCTIONS.length} functions ` ++ `(agent 1: ${list.length} validations, summary count ${summary[0]})`,+ );+ } catch (err) {+ console.log(`FAIL ${label}: reads do not decode (${err.shortMessage || err.message})`);+ failures++;+ }+}++for (const chain of skipped) {+ console.log(`---- ${chain.name} (${chain.id}): no registry configured, badge renders nothing there`);+}++if (failures) {+ console.error(`\n${failures} chain(s) do not match VALIDATION_REGISTRY_ABI. Fix the address or the ABI before shipping.`);+ process.exit(1);+}+console.log('\nEvery configured ValidationRegistry matches the ABI this platform calls.');diff --git a/scripts/onchain-smoke.mjs b/scripts/onchain-smoke.mjsindex 2b973ad44..c382e76b7 100644--- a/scripts/onchain-smoke.mjs+++ b/scripts/onchain-smoke.mjs@@ -31,7 +31,7 @@* node --env-file=.env scripts/onchain-smoke.mjs # load credentials from .env (Node 20+)** Credentials (all optional — absence ⇒ the dependent step SKIPs):- * SMOKE_EVM_PRIVATE_KEY funded Base-Sepolia signer (steps 2,3,4 — must be an allow-listed validator for step 3)+ * SMOKE_EVM_PRIVATE_KEY funded Base-Sepolia signer (steps 2,3,4; step 3 needs it to own the agent)* SMOKE_EVM_PRIVATE_KEY_2 second funded signer for the reputation feedback (step 4)* SMOKE_EVM_CHAIN_ID EVM testnet chainId (default 84532 / Base Sepolia)* SMOKE_AGENT_ID reuse an existing agentId for steps 3/4 without re-registering@@ -68,6 +68,11 @@ import { REGISTRY_DEPLOYMENTS as SRC_DEPLOYMENTS } from '../src/erc8004/abi.js';import { CHAIN_BY_ID } from '../api/_lib/erc8004-chains.js';import { evmFallbackProvider } from '../api/_lib/evm/rpc.js';import { buildRegistrationJSON } from '../src/erc8004/registration-json.js';+import {+ responseForPassed,+ responsePassed,+ validationRequestHash,+} from '../src/erc8004/validation-report.js';import { normalizeGatewayURL } from '../src/ipfs.js';const __dirname = dirname(fileURLToPath(import.meta.url));@@ -484,9 +489,7 @@ async function stepEvmValidation(cfg, ctx) {return skip('no agentId — run step 2 in the same invocation or set SMOKE_AGENT_ID');}if (!cfg.evmKey) {- return skip(- 'no funded validator signer — set SMOKE_EVM_PRIVATE_KEY (must be allow-listed on the registry)',- );+ return skip('no funded signer: set SMOKE_EVM_PRIVATE_KEY (it must own the agent to open a request)');}const provider = ctx.evm?.provider ?? (await evmFallbackProvider(chainId));@@ -497,48 +500,70 @@ async function stepEvmValidation(cfg, ctx) {const report = buildValidationReport(glbSha);const { keccak256, toUtf8Bytes } = await import('ethers');const proofHash = keccak256(toUtf8Bytes(JSON.stringify(report)));- const passed = true;+ const score = responseForPassed(true);+ const requestHash = validationRequestHash({ chainId, agentId, seed: proofHash, kind: VALIDATION_KIND });- // Guard: recordValidation reverts for non-allow-listed senders (NotValidator).- let countBefore;+ // The registry is request/response based: the agent's owner opens a request+ // naming a validator, and only that validator may answer it. This signer+ // registered the agent in step 2, so it plays both roles.+ let existing = null;try {- countBefore = await registry.getValidationCount(agentId);- } catch (err) {- return fail(`getValidationCount read failed: ${err.shortMessage || err.message}`);+ existing = await registry.getValidationStatus(requestHash);+ } catch {+ existing = null;+ }++ let requestTx = null;+ if (!existing) {+ try {+ requestTx = await registry.validationRequest(signer.address, agentId, '', requestHash);+ await requestTx.wait();+ } catch (err) {+ const reason = err.shortMessage || err.reason || err.message || 'revert';+ if (/not authorized/i.test(reason)) {+ return skip(`signer ${signer.address} does not own agent ${agentId} (${reason})`);+ }+ return fail(`validationRequest failed: ${reason}`);+ }+ } else if (existing[0].toLowerCase() !== signer.address.toLowerCase()) {+ return skip(`request ${requestHash} is addressed to validator ${existing[0]}, not ${signer.address}`);}let tx;try {- tx = await registry.recordValidation(agentId, passed, proofHash, '', VALIDATION_KIND);+ tx = await registry.validationResponse(requestHash, score, '', proofHash, VALIDATION_KIND);await tx.wait();} catch (err) {- const reason = err.shortMessage || err.reason || err.message || 'revert';- if (/NotValidator|not a validator|0x[0-9a-f]*/i.test(reason)) {- return skip(`signer ${signer.address} is not an allow-listed validator (${reason})`);- }- return fail(`recordValidation failed: ${reason}`);+ return fail(`validationResponse failed: ${err.shortMessage || err.reason || err.message || 'revert'}`);}- // Read it back via getLatestByKind (the canonical query), with a count-delta- // fallback if an older deployment lacks that view.- let readback;+ // Read the verdict back the way the badge does.try {- const latest = await registry.getLatestByKind(agentId, VALIDATION_KIND);- if (latest.proofHash !== proofHash) {- return fail(`getLatestByKind proofHash ${latest.proofHash} != recorded ${proofHash}`);+ const status = await registry.getValidationStatus(requestHash);+ if (status[3] !== proofHash) {+ return fail(`getValidationStatus responseHash ${status[3]} != recorded ${proofHash}`);}- if (latest.passed !== passed) return fail('getLatestByKind passed flag mismatch');- readback = 'getLatestByKind';- } catch {- const countAfter = await registry.getValidationCount(agentId);- if (countAfter <= countBefore) {- return fail(`validation count did not increment (${countBefore} -> ${countAfter})`);+ if (status[4] !== VALIDATION_KIND) {+ return fail(`getValidationStatus tag "${status[4]}" != "${VALIDATION_KIND}"`);}- readback = 'getValidationCount';+ if (!responsePassed(status[2])) {+ return fail(`getValidationStatus response ${status[2]} reads as a failure`);+ }+ } catch (err) {+ return fail(`getValidationStatus read failed: ${err.shortMessage || err.message}`);+ }++ const summary = await registry+ .getSummary(agentId, [signer.address], VALIDATION_KIND)+ .catch(() => null);+ if (summary && Number(summary[0]) < 1) {+ return fail(`getSummary count is ${summary[0]} after recording a validation`);}- return pass(`attestation recorded for agentId=${agentId} · read back via ${readback}`, {+ return pass(`attestation recorded for agentId=${agentId} on request ${requestHash.slice(0, 10)}`, {+ validationRequestTx: requestTx?.hash ?? null,validationTx: tx.hash,+ requestHash,proofHash,});}diff --git a/sdk/src/erc8004/abi.js b/sdk/src/erc8004/abi.jsindex aea0b0aa1..dab702793 100644--- a/sdk/src/erc8004/abi.js+++ b/sdk/src/erc8004/abi.js@@ -57,28 +57,25 @@ export const REPUTATION_REGISTRY_ABI = [];export const VALIDATION_REGISTRY_ABI = [- // --- Admin ---- 'function addValidator(address v) external',- 'function removeValidator(address v) external',- 'function isValidator(address v) external view returns (bool)',- 'function owner() external view returns (address)',- 'function transferOwnership(address newOwner) external',+ // --- Request (agent owner or an approved operator) ---+ 'function validationRequest(address validatorAddress, uint256 agentId, string requestURI, bytes32 requestHash) external',- // --- Record ---- 'function recordValidation(uint256 agentId, bool passed, bytes32 proofHash, string proofURI, string kind) external',+ // --- Response (only the validator named in the request) ---+ 'function validationResponse(bytes32 requestHash, uint8 response, string responseURI, bytes32 responseHash, string tag) external',// --- Query ---- 'function getValidationCount(uint256 agentId) external view returns (uint256)',- 'function getValidation(uint256 agentId, uint256 index) external view returns (tuple(address validator, bool passed, bytes32 proofHash, string proofURI, uint64 timestamp, string kind))',- 'function getLatestByKind(uint256 agentId, string kind) external view returns (tuple(address validator, bool passed, bytes32 proofHash, string proofURI, uint64 timestamp, string kind))',- 'function getValidationRange(uint256 agentId, uint256 offset, uint256 limit) external view returns (tuple(address validator, bool passed, bytes32 proofHash, string proofURI, uint64 timestamp, string kind)[])',+ 'function getValidationStatus(bytes32 requestHash) external view returns (address validatorAddress, uint256 agentId, uint8 response, bytes32 responseHash, string tag, uint256 lastUpdate)',+ 'function getAgentValidations(uint256 agentId) external view returns (bytes32[])',+ 'function getValidatorRequests(address validatorAddress) external view returns (bytes32[])',+ 'function getSummary(uint256 agentId, address[] validatorAddresses, string tag) external view returns (uint64 count, uint8 avgResponse)',+ 'function getIdentityRegistry() external view returns (address)',// --- Events ---- 'event ValidatorAdded(address indexed validator)',- 'event ValidatorRemoved(address indexed validator)',- 'event ValidationRecorded(uint256 indexed agentId, address indexed validator, bool passed, bytes32 proofHash, string kind)',+ 'event ValidationRequest(address indexed validatorAddress, uint256 indexed agentId, string requestURI, bytes32 indexed requestHash)',+ 'event ValidationResponse(address indexed validatorAddress, uint256 indexed agentId, bytes32 indexed requestHash, uint8 response, string responseURI, bytes32 responseHash, string tag)',];+// Canonical ERC-8004 reference deployments — same address on every chain via// CREATE2. Source: https://github.com/nirholas/erc8004-agents//diff --git a/specs/SECURITY.md b/specs/SECURITY.mdindex 7b997ce2e..141812ee1 100644--- a/specs/SECURITY.md+++ b/specs/SECURITY.md@@ -83,4 +83,4 @@ Security issues: see [public/.well-known/security.txt](../public/.well-known/sec## Governance roadmap- Identity / Reputation / Validation registry **owner** is currently the deployer EOA. Migrate to a 3-of-5 Safe on Base before opening public registration.-- Validator allow-list changes go through a PR + on-chain `addValidator`/`removeValidator` call from the owner. Post-Safe migration, allow-list changes require multisig approval.+- The deployed ValidationRegistry has no on-chain allow-list, so the recognized-validator set is off-chain (`public/.well-known/validators.json`) and changes go through a PR. Repo write access is therefore the governance boundary for that set; see [VALIDATORS.md](VALIDATORS.md).diff --git a/specs/VALIDATORS.md b/specs/VALIDATORS.mdindex eb654ddf4..3554d60b9 100644--- a/specs/VALIDATORS.md+++ b/specs/VALIDATORS.md@@ -1,14 +1,22 @@-# Validator Allow-list Policy+# Recognized Validator Policy-The [ValidationRegistry](../contracts/src/ValidationRegistry.sol) only accepts attestations from allow-listed validator addresses. This document describes who is on the list, how attestations are formed, and how the list is changed.+The deployed ERC-8004 ValidationRegistry has **no on-chain allow-list**. Any address can answer a validation request, but only the request the agent's own owner opened, and only if that request names it. Authority comes from the request, not from a list.-## Why an allow-list+That leaves one question open that the chain does not answer: which validators' verdicts should a consumer believe? This document is that answer for three.ws. It defines the recognized set, how attestations are formed, and how the set changes.-A validation report says "I checked agent #N's model and it is sound." For that statement to carry weight, consumers need to know _who_ signed it. Open writes would let any address claim "verified" status, collapsing the trust signal to zero. Allow-listing keeps the set small, named, and accountable.+## Why a recognized set++A validation report says "I checked agent #N's model and it is sound." For that statement to carry weight, consumers need to know _who_ signed it. Because the registry accepts any requested validator, the trust signal lives entirely in the reader: three.ws surfaces a verdict as "Validated" when the responder is in the recognized set below, and shows an unrecognized responder's verdict as an unverified third-party attestation.## What a validator attests to-A validator runs a deterministic suite over an agent's GLB and metadata, produces an [agent validation report](../public/validation/REPORT_FORMAT.md), pins it to IPFS, and calls `recordValidation(uint256 agentId, bool passed, bytes32 proofHash, string proofURI, string kind)` from an allow-listed address — `proofHash` is the sha256 of the report JSON, `proofURI` points at the pinned report (e.g. `ipfs://…`), and `kind` tags the suite (e.g. `"glb-schema"`).+A validator runs a deterministic suite over an agent's GLB and metadata, produces an [agent validation report](../public/validation/REPORT_FORMAT.md), pins it to IPFS, and answers the agent's open request with `validationResponse(bytes32 requestHash, uint8 response, string responseURI, bytes32 responseHash, string tag)`.++- `requestHash` is the id the owner opened with `validationRequest(validator, agentId, requestURI, requestHash)`. three.ws derives it as `keccak256(abi.encode(chainId, agentId, kind, subjectHash))` so the same subject always maps to the same request.+- `response` is a 0..100 score. A binary suite writes 100 for a pass and 0 for a fail; readers treat 50 and above as a pass.+- `responseHash` is the keccak of the report JSON, `responseURI` points at the pinned report (e.g. `ipfs://...`), and `tag` names the suite (e.g. `"glb-schema"`).++Note that `responseURI` is emitted in the `ValidationResponse` event but not stored, so a consumer recovers the report URL from the event (or a publisher's index) and verifies it against `responseHash`.The minimum suite for "verified" status:@@ -22,9 +30,9 @@ The minimum suite for "verified" status:A `pass` verdict requires zero `fail` suites. `warn` is allowed.-## Current allow-list+## Current recognized set-Maintained on-chain at the registry's `isValidator` mapping. The canonical mirror lives at:+Maintained off-chain, because the registry keeps no list. The canonical file is:- **Base mainnet (8453):** [public/.well-known/validators.json](../public/.well-known/validators.json)- **Base Sepolia (84532):** same file, `testnet` array.@@ -38,7 +46,7 @@ Each entry is `{ address, name, contact, addedAt, scope }`. `scope` is one of `g- The Ethereum address you will sign from. **Use a dedicated key**, not a personal wallet.- A link to your runner's source (so suite determinism is auditable).2. Run the canonical suite over three reference agents (provided in the PR template) and post the resulting report CIDs in the PR. Maintainers reproduce the runs.-3. On approval, the registry owner calls `addValidator(address)` and the PR is merged.+3. On approval the PR is merged, which is what makes three.ws recognize your verdicts. No on-chain step is involved: agent owners can already request you, and consumers reading the registry directly decide for themselves.## Removal@@ -49,8 +57,8 @@ A validator is removed for any of:- Unreachable contact for >30 days while a dispute is open.- Voluntary withdrawal.-Removal is `removeValidator(address)`. Past attestations remain on-chain but consumers SHOULD treat reports from a removed validator as expired from the removal block onward.+Removal is deleting the entry from validators.json (recorded in the commit that removes it). Past attestations remain on-chain, because nothing on-chain can revoke them, but consumers SHOULD treat reports from a removed validator as expired from the removal date onward.## Governance-Until a multisig is in place, the registry owner is the project deployer wallet. Migration to a 3-of-5 Safe on Base is tracked in [SECURITY.md](SECURITY.md).+The recognized set is changed by commit to this repo, so the governance boundary is repo write access. Migration of platform-owned keys to a 3-of-5 Safe on Base is tracked in [SECURITY.md](SECURITY.md). The platform's own validator key and how it is operated are documented in [docs/erc8004/validation-attestation.md](../docs/erc8004/validation-attestation.md).diff --git a/src/erc8004/index.js b/src/erc8004/index.jsindex df06929d1..0bae6d64a 100644--- a/src/erc8004/index.js+++ b/src/erc8004/index.js@@ -21,6 +21,7 @@ export { RegisterUI } from './register-ui.js';export { submitReputation, submitFeedback, getReputation, getRecentReviews } from './reputation.js';export {recordValidation,+ getValidations,getLatestValidation,reportPassed,hashReport,diff --git a/src/erc8004/validation-report.test.js b/src/erc8004/validation-report.test.jsindex bde117345..7953d8cd6 100644--- a/src/erc8004/validation-report.test.js+++ b/src/erc8004/validation-report.test.js@@ -6,6 +6,11 @@ import {hashReport,buildGlbReport,failureReason,+ responsePassed,+ responseForPassed,+ validationRequestHash,+ VALIDATION_RESPONSE_PASS,+ VALIDATION_RESPONSE_FAIL,} from './validation-report.js';const VALIDATED_AT = '2026-06-15T00:00:00.000Z';@@ -99,3 +104,52 @@ describe('failureReason', () => {expect(failureReason(report)).toBe('not a GLB');});});++describe('response score mapping', () => {+ it('writes the extremes of the registry 0..100 range', () => {+ expect(responseForPassed(true)).toBe(VALIDATION_RESPONSE_PASS);+ expect(responseForPassed(false)).toBe(VALIDATION_RESPONSE_FAIL);+ });++ it('reads a score back through the pass threshold', () => {+ expect(responsePassed(100)).toBe(true);+ expect(responsePassed(50)).toBe(true);+ expect(responsePassed(49)).toBe(false);+ expect(responsePassed(0)).toBe(false);+ });++ it('round-trips both verdicts', () => {+ expect(responsePassed(responseForPassed(true))).toBe(true);+ expect(responsePassed(responseForPassed(false))).toBe(false);+ });++ it('accepts the bigint a chain read returns', () => {+ expect(responsePassed(100n)).toBe(true);+ expect(responsePassed(0n)).toBe(false);+ });+});++describe('validationRequestHash', () => {+ const seed = `0x${'ab'.repeat(32)}`;+ const base = { chainId: 84532, agentId: 7, seed };++ it('is a bytes32', () => {+ expect(validationRequestHash(base)).toMatch(/^0x[0-9a-f]{64}$/);+ });++ it('is stable, so re-validating the same subject answers the same request', () => {+ expect(validationRequestHash(base)).toBe(validationRequestHash({ ...base, agentId: '7' }));+ });++ it('separates chain, agent, kind and subject', () => {+ const h = validationRequestHash(base);+ expect(validationRequestHash({ ...base, chainId: 11155111 })).not.toBe(h);+ expect(validationRequestHash({ ...base, agentId: 8 })).not.toBe(h);+ expect(validationRequestHash({ ...base, kind: 'manifest-integrity' })).not.toBe(h);+ expect(validationRequestHash({ ...base, seed: `0x${'cd'.repeat(32)}` })).not.toBe(h);+ });++ it('defaults to the glb-schema kind', () => {+ expect(validationRequestHash(base)).toBe(validationRequestHash({ ...base, kind: KIND_GLB_SCHEMA }));+ });+});diff --git a/src/erc8004/validation-request.js b/src/erc8004/validation-request.jsnew file mode 100644index 000000000..f8aee0df2--- /dev/null+++ b/src/erc8004/validation-request.js@@ -0,0 +1,70 @@+/**+ * Owner leg of an ERC-8004 validation attestation.+ *+ * The deployed ValidationRegistry only accepts a validation request from the+ * agent's ERC-721 owner (or an approved operator), and only the validator named+ * in that request may answer it. So when the platform validator is not an+ * operator on the agent, POST /api/erc8004/validate cannot attest by itself: it+ * answers with 409 `validation_request_required` plus the exact call to make.+ * This module makes that call from the owner's wallet.+ *+ * Usage (the badge does this for you):+ * const res = await requestValidation(chainId, agentId, glbUrl);+ * if (res.error === 'validation_request_required') {+ * await openValidationRequest(res.request);+ * await requestValidation(chainId, agentId, glbUrl, res.request.requestHash);+ * }+ */++import { BrowserProvider, Contract } from 'ethers';++import { VALIDATION_REGISTRY_ABI } from './abi.js';+import { requestSwitchChain } from './chains.js';++/**+ * Open the validation request the server asked for, signed by the connected+ * wallet. Resolves to the request transaction hash.+ *+ * @param {object} request The `request` object from a validation_request_required response.+ * @param {number} request.chainId+ * @param {string} request.registry ValidationRegistry address.+ * @param {string} request.validatorAddress Validator the request is addressed to.+ * @param {string|number} request.agentId+ * @param {string} request.requestURI What is being validated (the GLB URL).+ * @param {string} request.requestHash bytes32 id the validator will answer.+ * @returns {Promise<string>} Transaction hash.+ */+export async function openValidationRequest({+ chainId,+ registry,+ validatorAddress,+ agentId,+ requestURI,+ requestHash,+}) {+ if (!window.ethereum) {+ throw new Error('No wallet detected. Connect the wallet that owns this agent to request validation.');+ }+ if (!registry || !validatorAddress || !requestHash) {+ throw new Error('Incomplete validation request from the server.');+ }++ let provider = new BrowserProvider(window.ethereum);+ const current = Number((await provider.getNetwork()).chainId);+ if (current !== Number(chainId)) {+ await requestSwitchChain(Number(chainId));+ // The provider caches the network it was built on, so rebuild after a switch.+ provider = new BrowserProvider(window.ethereum);+ }++ const signer = await provider.getSigner();+ const contract = new Contract(registry, VALIDATION_REGISTRY_ABI, signer);+ const tx = await contract.validationRequest(+ validatorAddress,+ BigInt(agentId),+ requestURI || '',+ requestHash,+ );+ await tx.wait();+ return tx.hash;+}diff --git a/src/shared/validation-badge.js b/src/shared/validation-badge.jsindex ee15ea737..84c5cfa5a 100644--- a/src/shared/validation-badge.js+++ b/src/shared/validation-badge.js@@ -4,12 +4,13 @@* on-chain agent is drawn (profile, marketplace, directory).** Backed by a real on-chain ValidationRegistry record read walletlessly through- * GET /api/erc8004/validation. Four designed states:+ * GET /api/erc8004/validation. Five designed states:*- * pending — fetching / a re-validation is in flight (spinner)- * validated — a passing attestation exists (green ✓, links to proof + validator)- * failed — an attestation exists but the model has errors (red, shows the reason)- * not-validated — registry deployed, no attestation yet (owner sees a "Validate" action)+ * pending: fetching, or a re-validation is in flight (spinner)+ * validated: a passing attestation exists (green, links to proof + validator)+ * failed: an attestation exists but the model has errors (red, shows the reason)+ * requested: a validation request is open on-chain, no verdict yet+ * not-validated: registry deployed, nothing requested (owner sees a "Validate" action)** When the ValidationRegistry isn't deployed on the agent's chain the badge* renders nothing — there's nothing to attest against, so we don't add noise.@@ -41,13 +42,28 @@ export async function fetchValidationState(chainId, agentId) {}}-/** Trigger (or re-trigger) an attestation for the agent. Returns the parsed response. */-export async function requestValidation(chainId, agentId, glbUrl) {+/**+ * Trigger (or re-trigger) an attestation for the agent. Returns the parsed+ * response, including `request` when the owner still has to open the on-chain+ * validation request (`error: 'validation_request_required'`).+ *+ * @param {number} chainId+ * @param {string|number} agentId+ * @param {string} [glbUrl]+ * @param {string} [requestHash] Answer this request: set on the retry, after the+ * owner's wallet has opened it.+ */+export async function requestValidation(chainId, agentId, glbUrl, requestHash) {const r = await fetch('/api/erc8004/validate', {method: 'POST',headers: { 'content-type': 'application/json' },credentials: 'include',- body: JSON.stringify({ chainId, agentId: String(agentId), ...(glbUrl ? { glbUrl } : {}) }),+ body: JSON.stringify({+ chainId,+ agentId: String(agentId),+ ...(glbUrl ? { glbUrl } : {}),+ ...(requestHash ? { requestHash } : {}),+ }),});const data = await r.json().catch(() => ({}));return { ok: r.ok, status: r.status, ...data };@@ -130,7 +146,15 @@ export function validationBadgeEl(state, opts = {}) {const { isOwner = false, onRevalidate, failureText } = opts;let node;- if (!state.exists) {+ if (!state.exists && state.openRequests > 0) {+ node = badgeNode({+ variant: 'none',+ label: 'Validation pending',+ sub: state.openRequests > 1 ? `${state.openRequests} requests` : undefined,+ title: 'A validation request is open on-chain, awaiting the validator verdict',+ icon: DASH_SVG,+ });+ } else if (!state.exists) {node = badgeNode({variant: 'none',label: 'Not validated',@@ -230,20 +254,41 @@ export async function mountValidationBadge({ container, chainId, agentId, isOwne}}+ const deferred = (sub, title) =>+ render(+ badgeNode({+ variant: 'none',+ label: 'Validation deferred',+ sub,+ title: title || 'validation could not be recorded',+ icon: DASH_SVG,+ }),+ );+const onRevalidate = async () => {render(pendingBadgeEl(state.exists ? 'Re-validating…' : 'Validating…'));try {- const result = await requestValidation(chainId, agentId, glbUrl);+ let result = await requestValidation(chainId, agentId, glbUrl);++ // The registry only lets the agent's owner open a validation request, so+ // when the platform validator holds no operator authority the server hands+ // back the exact call to sign. Prompt for it, then answer the request.+ if (result.error === 'validation_request_required' && result.request) {+ render(pendingBadgeEl('Confirm in wallet…'));+ const { openValidationRequest } = await import('../erc8004/validation-request.js');+ try {+ await openValidationRequest(result.request);+ } catch (err) {+ deferred('request not sent', err?.shortMessage || err?.message || 'the wallet declined the request');+ return;+ }+ render(pendingBadgeEl('Validating…'));+ result = await requestValidation(chainId, agentId, glbUrl, result.request.requestHash);+ }+if (!result.ok) {// Surface the ops state inline rather than silently reverting.- const failNode = badgeNode({- variant: 'none',- label: 'Validation deferred',- sub: result.code || `${result.status}`,- title: result.error || result.code || 'validation could not be recorded',- icon: DASH_SVG,- });- render(failNode);+ deferred(result.error || `${result.status}`, result.error_description || result.error);return;}} catch {diff --git a/src/validation-ui.js b/src/validation-ui.jsindex dda0e7039..25cd45472 100644--- a/src/validation-ui.js+++ b/src/validation-ui.js@@ -2,19 +2,33 @@* ValidationDashboard — UI controller for browsing and submitting validation records on-chain.** Uses:- * - getLatestValidation() to fetch past validation records- * - recordValidation() to submit new reports+ * - GET /api/erc8004/validation (walletless) to fetch the latest verdict+ * - recordValidation() to submit new reports (request + response, two txs)* - hashReport() to compute client-side hash* - pinFile() for IPFS storage* - ethers for wallet connection*/import { ensureWallet } from './erc8004/agent-registry.js';-import {- getLatestValidation,- recordValidation,- hashReport,-} from './erc8004/validation-recorder.js';+import { recordValidation, hashReport } from './erc8004/validation-recorder.js';+import { fetchValidationState } from './shared/validation-badge.js';++/**+ * Latest on-chain verdict for an agent, shaped for renderRecord(). Returns null+ * when the chain has no registry, or has no answered validation for this agent.+ */+async function fetchLatestValidation(chainId, agentId) {+ const state = await fetchValidationState(chainId, agentId);+ if (!state || !state.exists) return null;+ return {+ kind: state.kind,+ passed: state.passed,+ validator: state.validator,+ timestamp: state.timestamp,+ proofHash: state.proofHash,+ proofURI: state.proofUrlResolved || state.proofURI || '',+ };+}export class ValidationDashboard {constructor(root, els) {@@ -61,6 +75,16 @@ export class ValidationDashboard {this.els.reportFile.addEventListener('change', (e) => this.handleFileSelect(e));this.els.submitReportBtn.addEventListener('click', () => this.submitReport());+ // Record rows are rendered from strings, so their copy affordances declare+ // what they carry and this delegated listener does the work. Inline onclick+ // attributes cannot run under the site CSP.+ document.addEventListener('click', (e) => {+ const addr = e.target.closest('[data-copy-addr]');+ if (addr) return this._copyAddr(addr.dataset.copyAddr);+ const hash = e.target.closest('[data-copy-hash]');+ if (hash) this._copyHash(hash.dataset.copyHash);+ });+document.addEventListener('dragover', (e) => {if (this.els.submitModal.classList.contains('open')) {e.preventDefault();@@ -124,11 +148,10 @@ export class ValidationDashboard {this.els.loadBtn.disabled = true;this.showInfo('Loading validation records...');- const result = await getLatestValidation({- agentId: this.currentAgentId,- runner: null,- chainId: this.currentChainId,- });+ // Read through the walletless server route: it fans out over the RPC+ // failover chain and needs no wallet, so records load for a visitor who+ // never connected one.+ const result = await fetchLatestValidation(this.currentChainId, this.currentAgentId);this.hideInfo();this.renderRecords(result);@@ -192,7 +215,7 @@ export class ValidationDashboard {<div class="record-meta"><div class="record-meta-item"><div class="record-meta-label">Validator</div>- <div class="record-meta-value" title="${this.escapeHtml(validator)}" style="cursor:pointer" onclick="valDash._copyAddr('${this.escapeHtml(validator)}')">${this.escapeHtml(validatorShort)}</div>+ <div class="record-meta-value" title="${this.escapeHtml(validator)}" style="cursor:pointer" data-copy-addr="${this.escapeHtml(validator)}">${this.escapeHtml(validatorShort)}</div></div><div class="record-meta-item" style="flex:1"><div class="record-meta-label">Report Hash</div>@@ -202,7 +225,7 @@ export class ValidationDashboard {${notes ? `<div class="record-notes">${this.escapeHtml(notes)}</div>` : ''}<div class="record-actions">${reportUri ? `<a href="${this.resolveIPFS(this.escapeHtml(reportUri))}" target="_blank" rel="noopener noreferrer">View Report ↗</a>` : ''}- ${reportHash ? `<button onclick="valDash._copyHash('${this.escapeHtml(reportHash)}')">Copy Hash</button>` : ''}+ ${reportHash ? `<button type="button" data-copy-hash="${this.escapeHtml(reportHash)}">Copy Hash</button>` : ''}</div></div>`;@@ -284,7 +307,9 @@ export class ValidationDashboard {const wallet = await ensureWallet();const signer = wallet.signer;- this.showToast('Submitting validation record on-chain...');+ // Two txs on a fresh report: the registry needs an open request before a+ // validator may answer it. An existing request is answered directly.+ this.showToast('Opening the validation request, then recording the verdict...');const result = await recordValidation({agentId: this.currentAgentId,@@ -295,14 +320,9 @@ export class ValidationDashboard {pin: true,});- this.showToast(- `✓ Validation submitted! TX: ${result.txHash.substring(0, 10)}...`,- false,- );+ this.showToast(`✓ Validation recorded! TX: ${result.txHash.substring(0, 10)}...`, false);this.closeModal();-- await new Promise((r) => setTimeout(r, 2000));await this.loadRecords();} catch (err) {this.showToast(`Error: ${err.message}`, true);