Back to feed
Dev.to
Dev.to
7/9/2026
Self-hosting an x402 facilitator: the EIP-3009 gotchas that almost cost us money

Self-hosting an x402 facilitator: the EIP-3009 gotchas that almost cost us money

Short summary

A founder shares four critical engineering gotchas from self-hosting an x402 payment facilitator that lets AI agents pay per action in USDC via EIP-3009 signatures. The most dangerous trap: trusting payer-controlled nonce state instead of verifying actual Transfer events on-chain, which adversarial agents could exploit to get tool outputs for free. Additional lessons cover idempotency via a unique-nonce claim table, multi-chain complexity (especially Solana's lack of EIP-3009), and measuring real demand by splitting the funnel from manifest fetches to settled transfers.

  • Verify on-chain Transfer events, not nonce state — payers can burn their own nonce to fake settlement
  • Use a UNIQUE-constrained claim table keyed by EIP-3009 nonce to prevent double-execution of side-effecting tools
  • Start with Base only; multi-chain USDC introduces contract-address, bridged-vs-native, and Solana incompatibility headaches

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more