# ERC-8021: Ethereum Transaction Attribution Standard & x402 Protocol ## Overview ERC-8021 is a standardized method for attributing transactions to applications using x402 protocol logic and structured data suffixes. The x402 protocol enables high-frequency, unidirectional state channels for the API economy on Ethereum. ## Key Concepts ### ERC-8021 Transaction Attribution - Standardizes on-chain attribution for Ethereum transactions - Replaces opaque transaction hashes with readable codes - Enables revenue sharing for builders and applications - Compatible with EIP-5792 and ERC-4337 ### x402 Protocol (HTTP 402 Payment Required) - Implements the dormant HTTP 402 status code for blockchain payments - Enables high-frequency micro-payments without gas fees - Uses cryptographic signatures for off-chain state channels - Consolidates thousands of micro-transactions into single on-chain settlement - Zero protocol fees for merchants and customers - Instant settlement (2 seconds vs T+2 traditional finance) ### ERC-8004 Agent Standard - Extension of Google's Agent-to-Agent (A2A) protocol for on-chain agents - Three core registries: Identity, Reputation, and Validation - Enables trustless verification and cryptographic proofs - Supports autonomous AI agents with on-chain payment flows ## Use Cases - AI agent-to-agent payments and coordination - Cloud storage with pay-per-use pricing - Content creator micropayments ($0.02 per video unlock) - API monetization without subscriptions - DeFi research and analysis services ## Technical Architecture - Layer 1: Ethereum smart contracts (DepositContract, SettlementLogic) - Layer 2: Off-chain communication via cryptographic signatures - State channels for high-frequency transactions - On-chain settlement for final state ## Benefits - Zero gas fees for micro-transactions - Blockchain agnostic (works across EVM chains) - No account creation required - Frictionless developer integration (1 line of middleware) - Trustless and verifiable ## Resources - GitHub: https://github.com/ethereum/EIPs - Discussion: https://ethereum-magicians.org/t/erc-8021-transaction-attribution/25561 - Website: https://erc8021.com ## FAQ **Why not just use L2?** Even L2s cost $0.01-$0.10 per transaction. For AI inference or API calls costing $0.0001, L2 is too expensive. x402 consolidates thousands of calls into ONE on-chain transaction. **Is x402 trustless?** Yes. Users lock funds in smart contracts. Providers cannot take more than what's cryptographically signed. Users can withdraw funds after a timeout if the provider disappears. **What is the difference between ERC-8021 and x402?** ERC-8021 is the transaction attribution standard. x402 is the payment protocol that implements HTTP 402 logic for state channels and micropayments.