Overview
Valeo Stratum is a clearing and settlement layer for x402 AI agent payments. Facilitators submit verified payments to Stratum. Stratum batches them into 60-second windows, computes multilateral netting, and executes USDC settlements on-chain automatically.
Stratum solves the problem Stripe identified in their 2025 Annual Letter: current blockchains cannot handle the 1M–1B transactions per second that AI agents will generate. Rather than building a new blockchain, Stratum applies the same clearing/netting model that traditional finance has used for decades (DTCC, CLS Bank, Visa) to compress millions of logical transactions into minimal on-chain settlements.
What Stratum Does
- Accepts payment instructions. Facilitators submit verified x402 payments via
POST /v1/settle/submit. Stratum records each as a signed receipt. - Batches and nets. Every 60 seconds, Stratum closes a settlement window and computes multilateral netting across all counterparties. 10,000 bilateral payments collapse into ~50 net transfers.
- Settles on-chain. Stratum executes USDC transfers on Solana and Base from its own settlement wallet. Each payment is tracked with an on-chain txHash as proof.
- Anchors Merkle proofs. A Merkle root covering every receipt in the window is anchored on Solana for public verifiability.
Architecture
The system flow:
Agent → Facilitator (verifies x402 payment) → Stratum (netting + settlement) → Chain (Solana/Base)Stratum sits behind the facilitator, not in front of the agent. The facilitator verifies the x402 payment (signature check, amount check, etc.), then submits it to Stratum for batched settlement.
Core Components
Stratum Gateway — The clearing and settlement engine at gateway.stratumx402.com. Accepts payment submissions, runs netting, executes USDC transfers, and anchors Merkle roots.
Receipt Ledger — An event-sourced ledger (Redis-backed or in-memory) that records every signed receipt within a settlement window. Provides idempotency, position tracking, and window-scoped queries.
Netting Engine — Computes multilateral net positions across all counterparties. Verifies the sum-to-zero invariant and produces a minimal set of USDC transfers.
Merkle Tree — RFC 6962 compliant append-only tree. Every receipt is hashed into a leaf. The root is anchored on Solana for public verifiability.
Settlement Executor — Executes USDC transfers on Solana (SPL Token transferChecked) and Base (ERC-20 transfer) from Stratum's settlement wallet. Creates destination token accounts automatically if they don't exist.
Integration Guide
For Facilitators (Primary Integration)
Facilitators verify x402 payments, then submit them to Stratum for batched settlement.
- Get an API key at stratumx402.com/facilitators
- Install the SDK:
npm install @v402valeo/facilitator - Submit verified payments to Stratum
- Query settlement status with on-chain txHash proof
const { Stratum } = require('@v402valeo/facilitator');
const stratum = new Stratum({ apiKey: 'sk_live_...' });
// After you verify an x402 payment, submit it to Stratum:
await stratum.submit({
from: 'agent_wallet_address',
to: 'service_wallet_address',
amount: '5000', // micro-USDC ($0.005)
chain: 'solana',
reference: 'your-internal-id'
});
// Check settlement status:
const status = await stratum.status('your-internal-id');
// { status: 'settled', txHash: '4PxAjv...', settledAt: '...' }For Sellers / API Providers
Sellers register their service and receive USDC automatically. No code changes needed.
- Get an API key at stratumx402.com/facilitators
- Register your service with a wallet address
- USDC arrives every 60 seconds
POST https://gateway.stratumx402.com/admin/services
Content-Type: application/json
X-API-KEY: sk_live_your_key
{
"slug": "my-api",
"name": "My API",
"walletAddress": "your_solana_wallet_address",
"pricePerRequest": 5000
}The pricePerRequest is in USDC base units (6 decimals). 5000 = $0.005 USDC per request.
Receipt Format
A receipt is the core clearing primitive. It records that a payer owes a payee a specific amount for a resource within a settlement window.
Receipt Fields
| Field | Type | Description |
|---|---|---|
| version | number | Schema version (currently 1) |
| receipt_id | ReceiptId | Unique identifier for this receipt |
| window_id | WindowId | Settlement window this receipt belongs to |
| sequence | number | Monotonically increasing within a window |
| payer | AccountId | Account paying for the resource |
| payee | AccountId | Account receiving payment |
| amount | bigint | Amount in smallest unit (e.g., USDC micro-cents) |
| asset | string | Asset identifier (e.g., "USDC") |
| resource_hash | Uint8Array | SHA-256 hash of the resource being paid for |
| idempotency_key | Uint8Array | SHA-256(payer + payee + resource_hash + amount + nonce) |
| timestamp | number | Unix millisecond timestamp |
| facilitator_id | FacilitatorId | Which facilitator submitted this payment |
| nonce | string | Client-supplied nonce for idempotency |
Signed Receipt
A SignedReceipt wraps a receipt with an Ed25519 signature and the signer's public key. The signature is computed over the canonical encoding of the receipt (sorted keys, deterministic BigInt and Uint8Array serialization).
interface SignedReceipt {
version: number
receipt: Receipt
signature: Uint8Array // Ed25519 signature
signer_public_key: Uint8Array // 32-byte public key
}Merkle Proofs
Stratum uses an RFC 6962 compliant Merkle tree to provide cryptographic proof that every receipt in a settlement window is included in the on-chain commitment.
Hashing Rules
Leaf hash: SHA-256(0x00 || leaf_data)
Node hash: SHA-256(0x01 || left || right)
The 0x00/0x01 prefix prevents second-preimage attacks by making leaf and internal node hashes distinguishable.
Inclusion Proof
An inclusion proof demonstrates that a specific receipt hash is a leaf of the Merkle tree with a known root. The proof contains the sibling hashes along the path from the leaf to the root. Verification recomputes the root by hashing up the path and comparing.
Consistency Proof
A consistency proof demonstrates that a smaller tree (from an earlier point in the window) is a prefix of the larger tree. This proves the tree is append-only: no receipt can be removed or modified after inclusion.
Settlement Windows
A settlement window is a 60-second period during which payments accumulate. When a window closes, netting runs, USDC settles on-chain, and a Merkle root is anchored. A new window opens immediately — zero downtime.
Payments submitted during settlement of the old window go into the new one. No payments are ever dropped.
Window Lifecycle
Netting
Multilateral netting compresses bilateral obligations into a minimal set of net transfers.
Worked Example
Consider 5 agents making API calls to 3 services during a window:
Gross bilateral positions:
Agent A → Service X: $500
Agent A → Service Y: $200
Agent B → Service X: $300
Agent B → Service Z: $400
Agent C → Service Y: $150
Net positions after aggregation:
Agent A: -$700 (owes $700 net)
Agent B: -$700 (owes $700 net)
Agent C: -$150 (owes $150 net)
Service X: +$800 (owed $800 net)
Service Y: +$350 (owed $350 net)
Service Z: +$400 (owed $400 net)
Sum of all net positions: $0 ✓ (invariant holds)
USDC transfers executed by Stratum (4 instead of 5):
→ Service X: $800
→ Service Y: $350
→ Service Z: $400In production, 10,000 bilateral payments compress to ~50 net transfers. The sum-to-zero invariant is always verified before settlement proceeds.
API Reference
The Stratum Gateway at gateway.stratumx402.com exposes these endpoints:
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /v1/settle/submit | API Key | Submit payments for batched settlement |
| GET | /v1/settle/status/:reference | API Key | Check settlement status by reference |
| POST | /v1/settle/batch-status | API Key | Check multiple references at once |
| GET | /v1/settle/recent | API Key | Your last 50 settled payments |
| POST | /admin/services | API Key | Register a service |
| GET | /v1/analytics | Public | Live analytics and stats |
| GET | /health | Public | Gateway health check |
Request Headers
X-API-KEY: sk_live_your_key
Content-Type: application/jsonFAQ
Is Stratum a blockchain?
No. Stratum is an off-chain clearing and settlement layer. It does not produce blocks, run consensus, or maintain a distributed ledger. It uses existing blockchains (Solana, Base) to execute USDC transfers and anchor Merkle roots.
Is Stratum a facilitator?
Stratum is a clearing coordinator. It sits behind facilitators, not in front of agents. Facilitators verify x402 payments and submit them to Stratum for batched settlement. Stratum handles netting and on-chain USDC settlement automatically.
What happens if Stratum goes down?
Queued payments are persisted in Redis and recovered on restart. No payments are lost. Settlement resumes from the last checkpoint.
How is privacy handled?
Individual receipts are stored off-chain. Only net settlement amounts and a single Merkle root hash appear on-chain. Bilateral transaction details are not publicly visible.
What chains does Stratum support?
Solana (mainnet) and Base (mainnet) for USDC settlement. Merkle roots are anchored on Solana.
How fast is receipt signing?
Ed25519 signing takes microseconds. There is zero on-chain interaction during receipt creation. Receipts are processed entirely in-memory.
Can receipts be forged or replayed?
No. Every receipt has an idempotency key derived from SHA-256(payer + payee + resource_hash + amount + nonce). Duplicate keys are rejected. Ed25519 signatures prevent forgery.
How do I verify a receipt?
Use the Explorer at stratumx402.com/explorer. Paste a receipt hash to see the Merkle inclusion proof and verify it against the on-chain anchor.
What is the compression ratio?
In production: typically 100:1 to 10,000:1. 10,000 bilateral payments compress to ~50 net USDC transfers, plus 1 Merkle root anchor transaction.
