ERC-8478: x402 Payee Verification for ERC-8004 Agents

when an agent pays another agent over x402, the payTo comes from the 402 answer, and nothing ties it to the paid agent’s ERC-8004 identity. whoever controls that HTTP answer (a hijacked domain, a proxy in the path, an instruction injected into a tool result) chooses where the money goes. the payment still settles, the resource may even be delivered, and the funds are gone.

ERC-8004 already has the right anchor: agentWallet, which can only be set with a signature of that wallet, so it is the one address proven to be under the agent’s control. today no rule says a payer should compare it with payTo.

what we measured

on robinhood chain (4663), 2026-10-28: 20,046 registered ERC-8004 agents. 5,575 of them answer with an x402 payment requirement. in only 5 of those is payTo the agent’s registered agentWallet.

most of the mismatches come from one operator that runs many agents and receives into one treasury. that is a legitimate setup, and it is exactly the case a standard has to cover: a payer needs to tell a treasury the agent authorised from an address nobody authorised.

the draft

· naming the seller. a payment requirement names the seller’s identity in extra.erc8004: the identity registry as a CAIP-10 account id, and the agentId. existing clients ignore it and keep working.

· the binding. a payTo is bound to the identity when it equals the agentWallet, or when the agentWallet signed an EIP-712 payee delegation for that exact payTo, network, asset and origin. delegations are time-limited, and rotating the agentWallet revokes every delegation it signed. contract wallets sign through ERC-1271.

· the endpoint. the resource’s origin must be listed in the agent’s registration file. without this, any server could name a well-known agent’s identity, set payTo to that agent’s wallet, pass the payee check and serve nothing.

· one fixed outcome. a checker (the payer, its wallet, the facilitator or a third party) returns exactly one of: verified-wallet, verified-delegation, mismatch, invalid-delegation, endpoint-unlisted, no-agent-wallet, no-identity, not-read. it states the block it read. no score, and not-read is never reported as verified.

· the signed payment. when the payment is already signed, the checker also compares the signed recipient and amount with the requirement, so a payment built from a different requirement is caught.

a payer SHOULD sign only on verified-wallet or verified-delegation, and MUST NOT rely only on a facilitator named by the same 402 answer it is checking.

reference implementation

toll (ERC-8004 agent #20030 on robinhood chain) runs this check today as part of its pre-sign check: an agent sends the 402’s payment requirement and gets the payee outcome before it signs. its agent census reads every registered agent’s registration file and 402 daily, and any agent can show the result as a badge.

this is a companion to ERC-8470 (launch observations): the same family of facts an agent reads before money moves.

questions for this thread

  1. is extra.erc8004 the right place for the identity, or should it live in the registration file only?
  2. the delegation is off-chain EIP-712 with no revocation list (rotation is the revocation). is short validity enough, or does anyone need per-delegation revocation?
  3. for a payee on another network than the registry: we accept the agentWallet only when it has no contract code on the registry’s chain, and require a delegation otherwise. too strict?

the PR follows shortly; the link will be posted here.

3 Likes

PR : Add ERC: x402 Payee Verification for ERC-8004 Agents by soli0x · Pull Request #2132 · ethereum/ERCs · GitHub

proposed change before the next push, from census data: on robinhood chain 5,583 x402 sellers pay to their identity’s owner and have no agentWallet registered. today that reads as no-agent-wallet, same as an identity paying a stranger.

proposal: a ninth outcome, owner-only (payTo = ownerOf(agentId), no agentWallet). still not verified (an owner can be a marketplace or a cold key), but a payer can tell “pays the agent’s owner” from “pays someone unknown”, and the fix for the seller is one setAgentWallet.

the first outside implementation (x402 doctor) returns the current eight, so feedback welcome before it changes.

1 Like

Two points from reading the deployed IdentityRegistryUpgradeable (registry proxy 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432, implementation 0x7274e874ca62410a93bd8bf61c69d8045e399c02, the same pair on Ethereum and on Robinhood Chain 4663) against the draft.

  1. “agentWallet can only be set with a signature of that wallet” holds for setAgentWallet, but register() (all three overloads) writes agentWallet = msg.sender with no signature, and mints the NFT to the same address. So right after registration, payTo = ownerOf(agentId) already satisfies the agentWallet check with no proof from that wallet, and verified-wallet covers two different strengths: a signed binding and an unsigned default. The MetadataSet event is identical in both paths, so telling them apart needs transaction-level context (the default is emitted next to Registered). The default is used at scale: on Ethereum mainnet, tx 0x778b713868dd34ee04f507da1a12bf589006ecc1e4dfad1db6d7bd1079881865 registered 34 agents (ids 1160 to 1193) from one Safe, each with agentWallet = that Safe and no signature from it. Could the spec say whether a registration default counts as verified-wallet or a weaker outcome?

  2. On the proposed owner-only outcome: in this implementation agentWallet is never “unset” at birth, because register() always fills it. It is empty only after a transfer (which clears it) or after unsetAgentWallet. So the same payTo (the owner) reads as verified-wallet if the NFT never moved and as owner-only after it did. It may help to say that explicitly, since owner-only after a transfer also means the identity changed hands.

A trust assumption worth stating: the binding is only as strong as the registry, and on Ethereum and on 4663 the proxy is UUPS with one plain-address owner that signed the upgrade itself. The checker could report the registry address and implementation it read next to the outcome.

1 Like

thanks, all three check out against the deployed source (register() writes agentWallet = msg.sender in all three overloads, _update clears it on transfer).

  1. registration default. we’d keep it as verified-wallet: msg.sender sent the registration transaction, so control of that address is proven by the tx itself, just not by an EIP-712 signature. the draft’s wording is wrong though, and we’ll change it to “set by the registering account, or later by a signature of the wallet”. what does differ is what the binding means (an owner key that registered vs a dedicated payee key that was set on purpose), so instead of a tenth outcome we’d add a field next to the outcome: binding source, registration or set-agent-wallet, read from the transaction that last emitted MetadataSet for agentWallet. a payer that wants only deliberate bindings can require set-agent-wallet. does that cover the Safe case you found?

  2. owner-only. agreed, and it’s useful to say: with this implementation an empty agentWallet means the identity was transferred (or the wallet was unset), so owner-only reads as “this identity changed hands and the new owner bound no wallet”. that matches what we see on robinhood chain: most of the 5,583 are agents minted by a platform and then transferred to users. we’ll add that sentence, and note that the same payTo reads verified-wallet before a transfer and owner-only after it.

  3. registry trust. agreed. the checker will report the registry address and the implementation it read (EIP-1967 slot) at the block it states, next to the outcome, and the security considerations will say the binding is only as strong as the registry’s upgrade key.

these go into the next push of the PR, with test vectors for a registration default, a transfer and an unset.

Yes, that covers the Safe case, and a binding-source field is cleaner than a tenth outcome. One detail for the test vectors: keying on “the transaction that last emitted MetadataSet” is not enough, because a Safe can batch register() and setAgentWallet() in one transaction. Log position works better. Only four paths emit MetadataSet for agentWallet (setMetadata and register(uri, metadata) reject that key): register() in its three overloads, setAgentWallet, unsetAgentWallet and a transfer. In the reference implementation the registration default is emitted directly after the Registered log (the ERC-8004 text does not fix that order, so it is a property of the implementation), which makes the last agentWallet MetadataSet a usable signal: right after Registered means the registration default, otherwise set-agent-wallet (an empty value for unset or transfer).

But the logs alone are not enough. register() writes the default wallet and then calls _safeMint, whose onERC721Received callback runs before the Registered and MetadataSet logs are emitted. A contract recipient can call setAgentWallet, unsetAgentWallet or transfer the token inside that callback, and register() then still emits Registered and MetadataSet(agentWallet = msg.sender), so the last log disagrees with storage (and with ownerOf in the transfer case). So the value has to come from getAgentWallet, and the source should read “registration” only if the last agentWallet log both sits right after Registered and carries the same value as getAgentWallet; otherwise the logs are not a reliable source for that agent.

I ran these vectors against the registry source on a local network, with a contract wallet (the IdentityRegistryUpgradeable source verified on Etherscan for the Ethereum implementation is identical to the repository file). Register plus setAgentWallet in one transaction reads set-agent-wallet by log position, where a rule keyed on the transaction would say registration. Register, transfer, then setAgentWallet by the new owner reads set-agent-wallet. The three callback cases (set, unset, transfer inside onERC721Received) all end with the last log different from getAgentWallet.

1 Like

both right, thanks for running them. our checker keyed on the transaction, so the batched Safe case would have read registration.

pushed to the PR and to our checker, same rule in both:

· the logs count only when the last agentWallet MetadataSet carries the value getAgentWallet returns at B. otherwise binding source is null: the onERC721Received cases you found leave the logs disagreeing with storage, and we’d rather say not read than guess.
· when the values match: registration only if that log is the next log after Registered in the same transaction, set-agent-wallet otherwise.
· the order is stated as a property of the reference implementation, not of ERC-8004, so a checker on another registry reports null unless it knows that registry’s order.

your vectors are in the draft’s test cases now: register, register + setAgentWallet in one transaction, register + transfer + setAgentWallet, and the three callback cases. live on our agent: Registered at log 2, the agentWallet MetadataSet at log 3 with the value storage holds, so it reads registration.

1 Like

Does wallet rotation permanently revoke a delegation or only invalidate it while another wallet is registered? Suppose wallet A signs a delegation and the agent rotates to B before later restoring A. Would the old delegation become valid again if it has not expired? A test covering A → B → A would help clarify whether revocation needs a binding epoch rather than just a current-wallet equality check.

2 Likes

good catch, you’re right. as written it’s a current-wallet equality check, so A → B → A revives an unexpired delegation from A

fix going into the draft: the delegation binds the block where its agentWallet was set (walletSetAt). it’s valid only if the latest agentWallet MetadataSet at or before B is that same event. rotating away and back gives a new event, so the old delegation stays dead. no new contract storage, one log read the checker already does adding A → B → A to the test cases with the expected outcome (invalid-delegation)

1 Like

Thanks, that reads right. If the vectors and the callback note stay in the draft, an acknowledgment line for it44 would be appreciated.

done, the test cases section now credits you for the registration, batched and onERC721Received cases, and SergeevDmitry for A → B → A. thanks again for running them against the source