u402 — Private Agent Payments

u402 — Private Agent Payments

A compliance-ready, post-quantum private payment protocol for AI agents — extending x402 with zero-knowledge proofs.

u402

u402 extends the x402 protocol with private payments. Where x402 uses plaintext EIP-3009 signatures that expose sender, recipient, and amount on-chain, u402 replaces the signature with a zero-knowledge proof — the proof itself is the payment authorization.

Draft Specification

u402 is under active development. The specification is stable in structure but subject to revision. Feedback welcome via GitHub or Telegram.

Why u402?

AI agents make payments programmatically, at high frequency, to many services. On a public blockchain, this creates a complete map of every agent's:

  • Vendor relationships — which APIs, data providers, and services it uses
  • Spending patterns — budget, frequency, price sensitivity
  • Operational activity — when it's active, what it's working on

u402 eliminates this leakage. Payments settle through the Universal Private Pool (UPP), where a ZK proof proves the payment is valid without revealing who paid.

How It Compares

x402b402 (ClawPay)z402 (Zcash)u402
PrivacyNoneRailgun-basedZcash shieldedPrivacy pool + ZK
Open specYesNo (proprietary)YesYes (x402 v2 plugin)
Key handlingClient-side signingPrivate key sent to serverClient-sideClient-side proof generation
ComplianceNoneNoneNoneASP proofs built into ZK circuit
Audit trailPublic chainNoneNoneViewing keys (selective disclosure)
Post-quantumNoNoNoYes (circle-stark proof system)
Token supportAny ERC-20Railgun tokensZECAny ERC-20 in UPP pool

The Core Insight

UPP's transfer() and withdraw() functions don't check msg.sender. They verify a ZK proof. This means the proof itself is the payment authorization — a server can settle the payment on-chain without ever touching the client's private keys.

Agent                              Server (x402)                    Pool Contract
  │                                    │                                │
  │ GET /api/data                      │                                │
  │──────────────────────────────────→ │                                │
  │                                    │                                │
  │ 402 + PaymentRequired              │                                │
  │ { scheme: "private", ... }         │                                │
  │←────────────────────────────────── │                                │
  │                                    │                                │
  │ Generate ZK proofs client-side     │                                │
  │ (keys never leave the agent)       │                                │
  │                                    │                                │
  │ Retry with Payment header:         │                                │
  │ { proofs, nullifiers, ... }        │                                │
  │──────────────────────────────────→ │                                │
  │                                    │ Verify proof format            │
  │                                    │ Check amount >= required       │
  │                                    │ Submit proofs to pool          │
  │                                    │──────────────────────────────→ │
  │                                    │                                │
  │                                    │ ← tx receipt                   │
  │ 200 OK + data                      │                                │
  │←────────────────────────────────── │                                │

Pluggable Proof Systems

u402 is proof-system agnostic. The proofSystem field in the payment header tells the server which verifier to use:

Proof SystemCurveSecurityProof SizeGasPost-Quantum
plonkBLS12-381128-bit~1.4 KB~200-250KNo
circle-starkM31128-bit~5 KB~20MYes

Both are supported by the same pool contract — transfer() / withdraw() for PLONK, transferSTARK() / withdrawSTARK() for Circle STARK. PLONK and STARK notes live in separate Merkle trees but the protocol handles both transparently.

Agents that choose circle-stark get protection against "harvest now, decrypt later" quantum attacks on their payment history.

Next Steps

On this page