kcolbchain/switchboard

programmable payments for agents.

One Python library, one contract suite, one binary wire — so two AI agents from different teams can pay each other for work, without a human in the loop.

post-quantum chain-agnostic token-agnostic agent-native HTTP 402 · MPP · AP2 · ZAP wire
live payment flow

at a glance

v0.1.1 · active
modules
0
11 shipped, 1 in PR
PRs merged
0
x402 · MPP · MPC · PQ · escrow · oracle
lab scenes
0
animated, fork-and-extend
chains targeted
0
LUX · ETH · Base · AVAX · TRON

modules

one library, twelve pieces

Each module ships independently and is composable with the rest. Pick the ones you need — gate an HTTP route, hold funds in escrow, sign a payment with a post-quantum key, or write your own adapter. The contract surface is small, the wire format is open, and every piece is auditable.

x402_middleware

shipped
Server-side HTTP 402 gate. Drop into FastAPI or Flask; verifies X-PAYMENT signatures and emits the standard accepts[] envelope.

zap_transport

in PR
Binary wire for PaymentOffer/PaymentProof over luxfi/zap. Zero-allocation, ~10× smaller than JSON.

gas_tracker · gas_budget

shipped
Hard gas budgets — per-hour, per-day — so a runaway agent loop can't drain its own treasury. Closes the #1 footgun of autonomous on-chain agents.

nonce_manager

shipped
Client-side nonce manager with reorg protection. The piece every shipping agent eventually has to write — written once, here.

AgentEscrow.sol

shipped
Trustless escrow with timeout, challenge period, and mutual cancel. Solidity contract + Python client + CLI. The native-ETH variant is drafted as an EIP.

pq · post-quantum

north star
liboqs wrapper for PQ signatures (Dilithium / Falcon / SPHINCS+). Every PaymentProof carries a signature_alg; the wire format is PQ-ready out of the box.

a2a_x402 adapter

shipped
Adapter between Google's A2A framework and x402. Lets an A2A agent be paid in the open x402 protocol.

multi-chain settlement

design v0.1
The chain-agnostic settlement surface. Notary attestation for v1, ZK-relay for v2, native PQ verification on LUX.

mpc_wallet

shipped
Multi-party-computation wallet — threshold signatures across an agent fleet, no single key on any one machine.

mpp/session

shipped
Streaming payment sessions — open a channel under a budget cap, settle on close. The Stripe-style rail for long-running agent work.

adapters/lucidly

shipped
syUSD auto-park for idle agent balances. Any USDC the agent isn't actively using earns yield by default; pulled back when needed.

OracleAggregator

shipped
Oracle-mediated escrow release — releaseByAttestation lets a designated oracle aggregate sign off on delivery, settling without on-chain dispute.

multi-chain · LUX-settled

#59 resolved · design v0.1

Switchboard is chain-agnostic and token-agnostic: agents transact on whichever chain fits the job, with whichever asset both sides agree on. LUX is the preferred settlement layer — PQ-signed receipts anchor on LUX regardless of where the underlying transfer happened.

execution chains

TRON TRC-20 · sub-cent fee
Avalanche C EVM · USDC.e
Base EVM · USDC native
Ethereum L1 native-ETH escrow

settlement

LUX C-chain PQ receipt anchor
SettlementRegistry hash + envelope
ZAP wire format canonical receipt
Dispute evidence on-chain on LUX

Design v0.1 landed (PR #71, closing #59). Notary attestation for v1, upgradable to ZK-relay as Groth16 matures on LUX. Full spec in docs/multi-chain-settlement.md.

rails compatibility

x402 · MPP · AP2 · Circle · escrow

The four open agent-payment rails of 2026, plus on-chain escrow. Switchboard speaks all of them — same module surface, same wire envelope, same agent identity.

capabilityx402MPPAP2Circle NanoAgentEscrow
HTTP 402 paywall✓ nativevia sessionvia card
streaming micropaymentsper-call✓ nativecard auth✓ native
trustless escrow✓ native
refund / disputeoff-chainoff-chain✓ chargebackoff-chain✓ on-chain
chain-agnosticn/a (card)USDC only✓ (with #59)
PQ-signed✓ via switchboard✓ via switchboard✓ via switchboard
binary wire (ZAP)n/an/a

what's novel

we think nobody else is doing these

Open questions and proposals switchboard is pushing into agent payments. Each is filed as a research issue. PRs and counter-proposals welcome.

native-ETH A2A escrow

EIP draft
Trustless agent-to-agent escrow in native ETH (no token wrapper). Formalized as a Standards-Track ERC. Are we the only ones?

composable refund policies

innovation
Refund logic as on-chain plugins. Compose pro-rata, gated, time-decay, slashing — every contract gets the policy it needs without forking the escrow.

adversarial conformance harness

shipped
A test corpus every implementation must reject. The negative space defines the protocol as much as the positive space.

private x402

innovation
Pay an agent without revealing the amount. Range proofs on the payment envelope; the server learns "yes, paid above threshold," nothing more.

receipt aggregation

innovation
N off-chain micropayments collapse into 1 on-chain settlement. Save gas on the boring stretch; settle when stakes cross a threshold.

.well-known/agent-payment.json

shipped
Discoverable agent identity hub at a well-known URL. Pay-to address, accepted assets, PQ key, ZAP endpoint — one fetch, one source of truth.

post-quantum, by default

PQ-0 → PQ-5 · in flight

Every PaymentOffer and PaymentProof carries an explicit signature_alg. Dilithium is the default; Falcon and SPHINCS+ are first-class. When NIST adds a Round-4 winner, the registry adds an entry; the protocol doesn't change.

# two-line PQ signing on a payment offer
from switchboard import PaymentOffer
from switchboard.pq import sign, ALG_DILITHIUM3

offer = PaymentOffer(
    pay_to="0xYourTreasury...",
    asset="0x036Cb...e7e",
    network="base-sepolia",
    amount="1000",           # 0.001 USDC
    signature_alg=ALG_DILITHIUM3,
)
offer.signature = sign(offer.canonical(), pq_key)

the lab · 16 scenes

single-file canvas, no build

Animated scenes that play out every protocol switchboard documents. space / n / r to control playback.

Open the full lab → · Canvas playground →

30-second quickstart

one route, one middleware

Gate any HTTP route behind on-chain payment. The middleware does the rest.

from fastapi import FastAPI
from switchboard.x402_middleware import X402Middleware

app = FastAPI()
app.add_middleware(
    X402Middleware,
    pay_to="0xYourTreasury...",
    asset="0x036CbD53842c5426634e7929541eC2318f3dCF7e",  # USDC on Base Sepolia
    network="base-sepolia",
    price="1000",           # 0.001 USDC per call
    paths=["/agent-only"],
)

@app.get("/agent-only")
def agent_only():
    return {"ok": True, "payload": "this cost the caller 0.001 USDC"}

Full backend reference at docs · install via pip install switchboard[pq].