The handshake that turns
402 into a payment rail.
Three layers: an on-chain program for settlement and registry, an SDK for both sides, and an off-chain 402 handshake over HTTP/gRPC. Solana is the settlement layer — sub-second finality and tiny fees make per-call accounting viable.
on-chain program
settlement + registry — PDAs for services, channels, stake, fleets, receipts.
SDK
thin wrappers: a gate middleware for providers, an HTTP client for consumers.
off-chain handshake
the payment challenge / proof exchange that rides on top of normal requests.
Request. 402. Pay. Retry.
The interface borrows HTTP 402 Payment Required. A provider answers an unpaid call with a payment challenge — price, token, recipient, channel, nonce, expiry. The consumer signs a voucher (or sends a tx), retries with proof, and receives the result plus a PurchaseReceipt.
Direct for rare calls. Channels for the firehose.
One tx per call
Every call settles in its own transaction. Ideal for rare or high-value requests. Economical on Solana thanks to low fees, but throughput-bound at hundreds of calls per second.
- + simplest possible flow
- + no channel lifecycle
- − one on-chain tx every call
Each call signs a fresh voucher — the provider accepts it instantly without touching the chain. Reconciliation happens once, at threshold or on close: thousands of calls, one transaction.
Accounts (PDAs)
Security properties
spend limits
per-agent daily caps bound the damage of a bug or hostile provider.
monotonic nonces
vouchers cannot be replayed — each carries a strictly increasing nonce.
close timeouts
a consumer can force-close and reclaim the remainder via a challenge window.
stake slashing
paid-but-unanswered calls are disputable; provider stake is at risk.
encrypted memory
fleet content is encrypted to the fleet key — providers & outsiders can't read it.
on-chain membership
fleet membership is verified on-chain — no free-riding by foreign agents.
receipt TTL
stale fleet receipts expire; fresh data must be re-purchased.
token isolation
users settle in stablecoins, insulated from $VEND volatility.