DEV Community

estell
estell

Posted on

Your AI Agent Just Sent an Invoice (ERC-8004 + x402 in 5 Minutes)

TL;DR

- ERC-8004: Gives AI agents an on-chain identity, reputation, and proof of work so you know who you’re dealing with.
- x402 / 402: Turns 402 Payment Required into “pay me in USDC right now,” so agents can pay and get paid per request with zero signup.
- Together: ERC-8004 handles trust, x402 handles money — that combo is basically the rails for the AI agent economy.

Part 1: What ERC-8004 actually is

ERC-8004 (“Trustless Agents”) is a proposed Ethereum standard for AI agents. The goal: let software agents work with each other across company boundaries — discover each other, hire each other, and verify each other — without needing pre-existing trust.

Today, most AI “agents” still live inside someone’s closed platform. You can’t easily compare two agents, you can’t audit their track record, and you basically have to trust whoever hosts them. ERC-8004 tries to break that. It treats agents more like independent economic actors you can look up on-chain.

How it works under the hood is actually pretty clean. ERC-8004 defines three lightweight on-chain registries:

1. Identity Registry – Each agent receives an on-chain identity (implemented as an NFT-style record) that points to metadata, including its capabilities, invocation methods, and execution environment. That gives agents portable, verifiable identities.

2. Reputation Registry – After one agent pays another agent for work, the buyer can publish structured feedback linked to that payment. Because reviews are tied to actual economic interactions, it’s much harder to fake a 5-star reputation.

3. Validation Registry– High-stakes claims (“I ran this model,” “I followed this trading strategy,” etc.) can be backed by cryptographic proof, hardware attestation, or even economic staking so that you can slash liars. In other words, it’s not just “trust me, bro,” it’s “prove it.”

If you zoom out, ERC-8004 is building reputation, verification, and audit trails for autonomous agents, the same way smart contracts made on-chain finance auditable. That’s why it keeps getting framed as the trust layer for AI agents on Ethereum.

Part 2: Why payments are still the bottleneck

Cool, now assume Agent A finds Agent B and wants something: market data, GPU time, an analysis report, an LLM answer tuned to a specific domain, etc.
There’s still a missing piece: how do they pay each other?
Credit cards don’t work here. AI agents don’t have bank accounts, can’t pass KYC selfies, and shouldn’t wait days for settlement. They need to say “send $0.12 for this request right now,” get the result, move on. That’s where x402 (also written 402 or “the 402 standard”) shows up.

Part 3: x402 in plain language

The web has an HTTP status code called 402 Payment Required. It’s been in the spec for decades, but it was basically unused. x402 revives it and gives it real meaning.

Here’s the flow, simplified:

  1. Your agent (the “client”) hits an API endpoint.
  2. The server replies with HTTP 402 Payment Required, and inside that response it includes all the payment terms: price, currency (usually USDC), destination, etc.
  3. Your agent signs and submits a tiny on-chain payment authorization — basically “yes, pay this exact amount to that address.”
  4. The request is retried, the server verifies the payment cleared on-chain (settlement is seconds, not days), and then returns the data / model output / computation.

No account creation. No OAuth dance. No monthly subscription. It’s “pay per call” built straight into HTTP itself, using crypto rails. Coinbase has been pushing this as a chain-agnostic open protocol for AI agents, API providers, and data services.

This is blowing up fast because it unlocks actual microtransactions: charge a few cents for a single inference, a single dataset slice, or a single high-value API hit — something legacy payment rails hate. Recent coverage points out that AI agents using x402-style flows are already transacting autonomously and growing usage at triple-digit weekly rates.

Part 4: ERC-8004 + x402 = machine commerce

Put these two pieces together and you basically get autonomous machine commerce:

- Discovery + trust (ERC-8004):
Agent A can search on-chain registries for Agent B, see what B claims to do, inspect proof that B actually ran the model it says it runs, and read reputation from paying clients — not random sockpuppets.

- Pay-per-request (x402):
Once Agent A decides “yeah, I’ll hire you,” it just calls B’s endpoint, gets a 402 Payment Required quote, pays in stablecoins, and instantly unlocks the result. No platform middleman, no legal invoicing loop.

- Proof loops back into reputation:
Because payment and delivery are both verifiable on-chain, Agent A can now leave a signed review of Agent B that’s tied to a real transaction. That review goes into ERC-8004’s Reputation Registry, which makes B more trustworthy for the next buyer.

That flywheel — trustable identity → instant payment → reputation update — is why people keep saying AI agents are about to become actual economic actors, not just chatbots.

Why this matters (even if you’re not deep in crypto)

- This is bigger than infra:
New pricing model: Instead of $499/month SaaS, it turns expertise into on-demand microservices: “I’ll pay €0.09 for a tax summary,” “€3 to analyze this contract,” “€0.02 for real-time on-chain liquidity.” That’s way closer to how agents actually consume data and compute.

- Portable reputation: If an “AI CFO agent” builds a six-month track record of accurate forecasting and keeps that record on-chain, that reputation is an asset. You can hire that agent without caring which company is hosting it.

- Less platform lock-in: Markets for AI work start looking more like open marketplaces (agents competing in public) instead of walled SaaS dashboards.

The takeaway

ERC-8004 is the trust layer: identity, proof, and reputation for AI agents.
x402 is the checkout button: native, per-request stablecoin payments over plain HTTP.

Once those two pieces harden, you’re looking at agents that can market themselves, negotiate price, deliver work, get paid, and build public reputation — all with almost no human in the loop. That’s not sci-fi. That’s literally what these standards are trying to ship right now.

Top comments (0)