Protocol Compatibility

Comparison of T402 with other x402 protocol implementations.

Overview

The x402 payment protocol ecosystem has multiple implementations. All share the same core concept — using HTTP 402 status codes for payment negotiation — but differ in chain support, features, and wire format.

Implementations

T402Coinbase x402SemanticPay
BaseOriginal protocol@x402/facilitatorBuilt on @x402/*
Chains25 EVM + 12 non-EVM4 EVM2 EVM (Plasma, Stable)
Schemesexact, exact-legacy, exact-direct, uptoexactexact
TokensUSDT, USDT0USDCUSDT0
SDKsTypeScript, Go, Python, JavaTypeScriptTypeScript

Feature Comparison

FeatureT402Coinbase x402Notes
HTTP 402 Status CodeSame semantics
Payment-Required Header✅ (V2)✅ (V1)Wire format differs
X-PAYMENT HeaderCompatible
EIP-3009 SignaturesSame on-chain mechanism
CAIP-2 Network IDsT402 uses CAIP-2 standard
Non-EVM Support✅ (Solana, TON, TRON, …)
ERC-8004 IdentityAgent identity verification
MCP Tools✅ (16 TS + 18 Java)AI agent integration
Gasless PaymentsERC-4337 paymaster

Known Facilitators

FacilitatorEndpointChainsTokens
T402facilitator.t402.io37 networksUSDT, USDT0
SemanticPayapi.semanticpay.ioPlasma, StableUSDT0
Self-hostedYour infrastructureConfigurableConfigurable

Any implementation can use any facilitator. The facilitator is selected via the facilitatorUrl field in PaymentRequirements.

Wire Format

T402 (V2) PaymentRequirements

T402 V2 uses CAIP-2 network identifiers and extended fields:

{
  "x402Version": 2,
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "maxAmountRequired": "1000000",
      "resource": "https://api.example.com/premium",
      "payTo": "0x...",
      "extra": {
        "name": "Base USDT0",
        "token": {
          "address": "0x...",
          "decimals": 6,
          "symbol": "USDT0"
        }
      }
    }
  ]
}

Coinbase x402 (V1) PaymentRequirements

Coinbase x402 uses chain name strings and a simpler format:

{
  "x402Version": 1,
  "accepts": [
    {
      "scheme": "exact",
      "network": "base-sepolia",
      "maxAmountRequired": "1000000",
      "resource": "https://api.example.com/premium",
      "payTo": "0x...",
      "extra": {
        "name": "USDC on Base Sepolia",
        "token": "0x..."
      }
    }
  ]
}

Key Differences

FieldT402 V2Coinbase V1
networkCAIP-2 (eip155:8453)Chain name (base-sepolia)
extra.tokenObject with address, decimals, symbolString (address only)
schemeexact, exact-legacy, exact-direct, uptoexact

Migration Guide

For projects currently using Coinbase x402 (@x402/* packages) that want T402 features:

1. Install T402 packages

npm install @t402/core @t402/express

2. Update server middleware

// Before (Coinbase x402)
import { paymentMiddleware } from '@x402/express';
 
app.use(paymentMiddleware(facilitatorUrl, {
  '/api/resource': { price: '$0.01', network: 'base-sepolia' }
}));
 
// After (T402)
import { paymentMiddleware } from '@t402/express';
 
app.use(paymentMiddleware({
  '/api/resource': {
    accepts: {
      scheme: 'exact',
      network: 'eip155:8453',
      payTo: address,
      price: '$0.01'
    }
  }
}));

3. Update client code

// Before (Coinbase x402)
import { paymentFetch } from '@x402/fetch';
const response = await paymentFetch(url, { wallet });
 
// After (T402)
import { t402Fetch } from '@t402/fetch';
const response = await t402Fetch(url, { wallet });

4. Benefits after migration

  • More chains — 37 networks instead of 4
  • Multiple schemes — exact, upto, direct, gasless
  • CAIP-2 standard — Future-proof network identifiers
  • Non-EVM — Solana, TON, TRON, and more
  • ERC-8004 — AI agent identity verification
  • Multi-SDK — Go, Python, Java in addition to TypeScript
⚠️

T402 V2 and Coinbase V1 wire formats are not directly compatible. Clients must match the facilitator’s expected version.