x402-coffer Architecture π‘ Beta
βββββββββββββββββββββββββββββββ
/verify ββββββΆβ Verification Pipeline β
β 1. decode payment payload β
β 2. schema + expiry check β
β 3. signature recovery β
β 4. nonce/replay cache β
ββββββββββββββββ¬βββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββ
/settle ββββββΆβ Settlement Engine β
β chain adapter (base, solana)β
β broadcast + confirm + receiptβ
ββββββββββββββββ¬βββββββββββββββ
βΌ
Postgres (payment ledger)
Design rulesβ
- Verification is pure β no side effects, safe to call speculatively.
- Settlement is idempotent β same payload twice = same receipt, one transfer.
- Replay protection before signature math β cheap rejects first.
- Ledger is append-only β disputes resolve from the ledger, not logs.
Failure handlingβ
RPC failure during settle β coffer returns a retryable error; the payment payload remains valid until its expiry, and idempotency guarantees no double-charge on retry.