CHAPTER 10 of 11

Micropayment Channels

Charge a tenth of a cent per paragraph, then settle the whole session in one on-chain transaction.
A static explanation. This chapter's live demo ran a reading session against the gateway's ledger and risk services, which the public gateway does not run. Chapters 1 to 3 run live on Solana devnet; this page explains how the channel works and why the fee math matters.

The problem

On Solana, every transaction pays a fixed network fee: 5,000 lamports per signature. That is a fraction of a cent, but a fixed fraction. Charge a reader $0.001 per paragraph and settle each read on-chain, and the fee can equal or exceed the payment itself.

The shipped fixes for this, x402 batch settlement and Circle Nanopayments, use off-chain vouchers and batched settlement, but when we built this chapter neither covered Solana.

The move: an off-chain debit ledger

Open a payment channel with a prepaid spending cap. Each paragraph you read is a tiny off-chain debit, recorded against a signed, tamper-evident voucher that advances a sequence number and a running total. Nothing goes on-chain while you read. When you are done, the channel settles once.

open channel → read · read · read … (all off-chain) → settle once (1 network fee)
  1. Open. The server opens a channel with a cap (for example $0.05) and returns the first voucher.
  2. Read. Each paragraph request carries the latest voucher. The server checks its HMAC signature and sequence number, debits the paragraph's price (set by the server, never by the client), and returns the paragraph with the next voucher. A replayed or out-of-order voucher is refused, and the cap is never exceeded.
  3. Settle. The whole session collapses into one net amount and one on-chain transfer.

The fee math

An example session: 8 paragraph reads, $0.021 in total, at an illustrative SOL price of $150 (5,000 lamports is about $0.00075).

If each read settled on-chain
8 fees
about $0.0060, or 28.6% of the revenue
Batched in one channel
1 fee
about $0.00075, or 3.6% of the revenue

87.5% less in network fees for the same 8 reads.

Trust and risk

The channel serves on trust: no account, no held balance. Each request records a few anonymous datapoints about the device (sessions started, reads taken, reads paid, reads abandoned). A device is flagged when it keeps taking reads it never pays for:

A flagged device is asked for one more step before the next read: sign a free message to prove it is the same wallet, or pay for that read up front. Everyone else reads without friction. It is a soft signal: it catches the common read-and-drift-off pattern, not a determined evader.

The honest catch: this is an open tab. The reader reads before paying, and nothing on-chain forces the tab to settle. That is fine for a trusted session or an agent with a budget, and it is exactly what Chapter 11 removes with an on-chain escrow.

Why it matters for agents

An AI agent can pre-authorize a reading budget, consume dozens of paragraphs across a session, and settle the whole run in one transaction. The buyer's experience is instant; the on-chain footprint is one fee.

Network fee: 5,000 lamports per signature, per Solana's fee documentation. Voucher integrity uses HMAC-SHA256, the same primitive as the gateway's access cookies.