ERC-8004 + feedbackAuth
Agent registration (EIP-7702) and feedbackAuth generation for on-chain reputation
The facilitator extends the x402 payment flow with ERC-8004 identity and reputation primitives:
Agent registration: mint/register an agent identity on-chain (ERC-8004 Identity Registry)
Feedback authorization (
feedbackAuth): enable authenticated, client-submitted on-chain feedback after a paid request settles
Contracts
The facilitator needs contract addresses via env:
ERC8004_IDENTITY_REGISTRY_ADDRESS: ERC-8004 Identity RegistryDELEGATE_CONTRACT_ADDRESS: EIP-7702 delegation contract (seemonorepo/facilitator/contracts/AgentRegistrationDelegate.sol)
ABIs are defined in monorepo/facilitator/src/config/contracts.ts.
Agent registration flow (EIP-7702)
Implementation: monorepo/facilitator/src/services/registerService.ts
Agent signs authorization delegating to the delegate contract (EIP-7702).
Example client code lives in
monorepo/facilitator/examples/v1-server/index.tsandexamples/v2-server/index.ts.
Client calls
POST /registerwith:agentAddress(the delegated EOA)authorization(the signed authorization)optional
tokenURI+metadata
Facilitator sends an on-chain tx with:
authorizationList: [authorization]to: agentAddressdata: encodeFunctionData(delegate.register(...))
Facilitator waits for receipt and decodes the
Registeredevent to returnagentId.
feedbackAuth flow (x402 v2 extension)
Implementation: monorepo/facilitator/src/services/feedbackService.ts plus the feedback extension hook in monorepo/facilitator/index.ts.
To request feedback auth generation, the paid resource should include an x402 v2 extension like:
After a successful v2 settlement, the facilitator:
Extracts the payer address from the payment payload (
authorization.from).Reads
ownerOf(agentId)from the Identity Registry to determine the signer address.Builds a
FeedbackAuthstruct and computes the EIP-191 message hash.Requests a signature from the agent server (intended via
feedbackAuthEndpoint).Stores
{ agentId, feedbackAuth }in-memory keyed by client address.
What is feedbackAuth?
feedbackAuth?In this implementation, feedbackAuth is encoded as:
abi.encode(FeedbackAuthStruct)followed by a
65-byteECDSA signature (r || s || v)
The struct fields (and ordering) are:
agentId(uint256)clientAddress(address)indexLimit(uint64)expiry(uint256)chainId(uint256)identityRegistry(address)signerAddress(address)
Current limitations (implementation notes)
The facilitator repo’s TODO.md calls out a few important gaps:
The v2
feedbackAuthis generated and stored in-memory, but not returned to the client yet.The facilitator will only request a signature from the agent server when it can derive an origin from
paymentPayload.resource.url. If that URL is missing/invalid, it falls back to local signing.If the agent server can’t be reached, it falls back to signing with
FACILITATOR_PRIVATE_KEY, which will not matchownerOf(agentId)unless the facilitator key is the agent owner key (and would produce an invalid signature on-chain).
Last updated