Pay-per-call for agents, a fraction of a cent at a time
Every door on this wall is a paid service. Knock, and it answers 402 Payment Required with its price. An agent in this page pays, asks again, and the door opens.
After its first payment to a shop the agent pays through a channel: each call reveals one more link of a hash chain, the shop checks it with one SHA-256, and the ledger hears nothing until the shop cashes up. That is penny 0.1.0, an open-source library, running here.
Click a door to buy it yourself. Your purse: $1.00.
2
The 402 counter
One call, slowed down: the question, the price, the agent's limits, the payment, the shop's check, the answer.
Agentlimits $0.004 a call, $0.05 a shop, $0.10 a day
Shoppenny's demo shop, eight services
The ledger so far
Pick something on the menu and press Next step.
3
The fee ruler
Slide the cursor to a price. Three ways to pay for it, read off one rule.
Card: $0.30 + 2.9% on every payment. Ledger: one transaction per payment at $0.0001. Channel: two transactions in all, whatever the number of calls. The shaded part of each scale is where the fee is 5% of the payment or more. The fee figures are assumptions you can change in the library (FEES).
A payment channel is a roll of pennies made of hashes. Spend them, forge one, spend one twice, then cash the roll.
····The root, given to the ledger when the roll is opened
The shop's check appears here.
Pennies the shop accepted
0
Refused
0
Hashes the shop computed
0
Ledger transactions
0
6
A day at the automat
178 agents, 166 paid services, 216,145 calls, put through the same library in your browser.
calls paid
ledger transactions
ledger fees, dollars
the same calls on a card, dollars
The doors are shut. Choose and open the automat.
Runs so far
Bars: ledger transactions, longest run is full width. Same seed every time, so the same choices give the same day.
7
The agent's purse
Limits the agent checks before a single micro-dollar moves.
The errand
8
Engineering bulletin No. 10
The paper: what penny does, how a channel works, and what a day of traffic costs.
Engineering Bulletin No. 10October 2026
Pennies for Agents: HTTP 402 and Hash-Chain Channels for Payments Below a Cent
The penny contributors. Library: penny 0.1.0, MIT licence.
Abstract
Software agents increasingly buy small things from other software: a quote, a search, a translation, priced at a fraction of a cent. A card payment costs about $0.30 plus 2.9%, which on a $0.001 call is a fee of 30,003%; one ledger payment per call, at an assumed $0.0001, is 10.0%. We describe penny, a small open-source library that implements the whole loop: a server that answers 402 Payment Required with a price, an agent that checks the price against spending limits and pays, and a server that checks the payment and serves. penny adds payment channels built from hash chains, in which a call is paid by revealing one more link and checked with one SHA-256 per unit.
In a simulated day of 216,145 calls from 178 agents to 166 services, paying per call takes 216,145 ledger transactions and 5.9% of the money moved in fees. Opening a channel from the second call to a service takes 63,970 transactions and 1.8%. Channels only help when calls repeat: in an hour of the same traffic, channels alone take more transactions than plain transfers.
1The fee floor
A payment method with a fixed part cannot carry small payments. Table 1 puts three on the same scale: a card at $0.30 + 2.9%, a ledger transfer for every payment at $0.0001 each, and a channel, which costs two ledger transactions however many payments it carries. Each figure is the fee as a share of the money moved, for 1,000 payments to one shop.
Table 1. Fees on 1,000 payments, as a share of the money moved. Computed in this page by overhead().
Price per call
Card
Ledger, each call
Channel
The smallest single payment whose fee stays under 5% is $14.29 on a card and $0.00200 on the ledger. A channel has no such floor; it needs enough calls to the same shop to spread its two transactions over.
The card figures are the common rate for card payments. The ledger fee is an assumption for illustration, not any particular network's price; the library takes either as an argument.
2The protocol
HTTP has reserved status code 402, Payment Required, since its early versions, without saying how to pay [3]. penny gives it a body. A request without payment gets 402 and a requirement: the path, the price in micro-dollars, who to pay, on which network, and the schemes the shop accepts. The agent decides, pays, and repeats the request with an x-penny-payment header. The shop checks the payment, serves, and answers with an x-penny-receipt header.
Figure 1. The second call to /weather by a fresh agent, made in this page. The first call was paid by a transfer; this one opens a channel.
Two schemes are accepted. exact names a ledger transfer of at least the price to the shop; the ledger lets each transfer pay for one call only. channel names an open channel, the index of the new link, and the link itself.
3Channels made of hashes
A chain of n links is made from a secret seed: the last link is H("penny:" + seed) and each link before it is the hash of the one after, linki = H(linki+1), with H = SHA-256 [4]. Link0, the root, goes to the ledger with a deposit of unit × n when the channel opens. Paying k units means revealing the link k places further along; the shop hashes it k times and must land on the last link it accepted. The idea is Lamport's one-time passwords [2] used as money, as in PayWord [1].
Figure 2. A five-link chain from the seed "bulletin", computed in this page. Each H is one SHA-256.
Nobody can compute a later link from an earlier one, so a link cannot be forged. The index must move forward, so a link cannot be spent twice. To cash up, the shop sends only its last link; the ledger walks it back to the root, pays the shop and, with settle, returns the rest of the deposit in the same transaction. A shop's unit is the largest amount all its prices are a whole number of. A new channel holds 64 units or 16 calls, whichever is more, twice as much when one runs out, and never more than the agent's limits allow.
4A day of traffic
simulate() runs real requests through real merchants, agents and a ledger. 178 agents call 166 services 216,145 times; which service a call goes to follows a Zipf curve with exponent 1.1 [8], and prices are drawn from $0.0001 to $0.005. Each agent starts with $100 and may spend at most $0.01 a call, $20 at one service and $40 a day. The counts match one public day of agent payments (§8); everything else is invented.
Table 2. One day, seed 1. Fees at $0.0001 a ledger transaction; $365.52 moved in all.
Scheme
Ledger transactions
of which during the day
Fees
Share
exact
216,145
216,145
$21.61
5.9%
auto
63,970
44,537
$6.40
1.8%
channel
51,686
25,843
$5.17
1.4%
a card
—
—
$64,854.11
17,743%
The figures above come from node bin/penny.js simulate; three days take about half a minute here.
With channels, the 216,145 payments were checked by hashing alone (216,145 SHA-256 operations under channel); the ledger saw only the openings and the settlements. Its log is hash-linked, and verify() checks it after the day.
5When channels lose
A channel costs two transactions and a transfer costs one, so a channel wins from the third call to the same shop. In an hour of the same traffic most agent–service pairs meet once:
Table 3. One hour (9,006 calls), seed 1.
Scheme
Ledger transactions
Share
exact
9,006
5.9%
auto
7,498
4.9%
channel
9,468
6.2%
Channels alone lose here, and auto, which pays the first call to a shop by transfer and opens a channel at the second, wins at both lengths. It is penny's default. Micali and Rivest [5] make the same point another way: a small payment is cheap only if most of them never reach the processor one by one.
6Spending limits
An agent that pays by itself needs a purse with a clasp. penny's agent checks four things before any money moves: an allow list of shops, a ceiling per call, a limit per shop and a daily budget. A declined call costs nothing and leaves a reason. A channel's deposit is capped by what the limits still allow, so a roll is never larger than the agent may spend.
7What penny is not
The ledger is in memory: accounts, fees and a hash-linked log, but no network, no consensus and no signatures. A real deployment puts a ledger with signed transactions behind the same five calls.
close has no timeout. On a real ledger the payer may take a deposit back only after a waiting period in which the payee can still cash its last link.
The fees are assumptions, and the day is a model: the prices, the Zipf curve and who calls whom are invented.
8Background, from the news
On 10 October 2026 The Crypto Basic reported [7] that agents had made more than 13.4 million payments with the HTTP 402 protocol x402 on the XRP Ledger: 13,417,943 at press time by on-chain data from t54, an average of 216,145 a day over seven days, from 178 active agents paying 166 merchants and 2,289 payable services, about a quarter of all ledger activity. J. Ayo Akinyele, Head of Engineering at RippleX, announced the figures on X; the first million was reached on 8 July 2026.
Two days earlier The Crypto Times reported [6] on a Coinbase Institute paper, Machine-to-machine payments in the AiFi era, which Coinbase's Chief Policy Officer Faryar Shirzad highlighted on 7 October: a $0.30 fee on a $0.001 request is a 30,000% cost, and with conventional methods the smallest viable payment is several dollars to over $10 if costs are to stay under 5%. Its example is 0.01 USDC for market data on Base, settled in about two seconds for under $0.001.
Not connected. penny and $PENNY are not connected to Ripple, RippleX, the XRP Ledger, t54, Coinbase or the Coinbase Institute, and none of them has seen this bulletin. penny does not speak x402 and uses no blockchain; it borrows the shape of the idea and the size of that day.
References
R. L. Rivest and A. Shamir. PayWord and MicroMint: two simple micropayment schemes. Security Protocols, LNCS 1189, Springer, 1997.
L. Lamport. Password authentication with insecure communication. Communications of the ACM 24(11), 770–772, 1981.
R. Fielding, M. Nottingham, J. Reschke (eds.). HTTP Semantics, §15.5.3, 402 Payment Required. RFC 9110, IETF, 2022.
National Institute of Standards and Technology. Secure Hash Standard. FIPS PUB 180-4, 2015.
S. Micali and R. L. Rivest. Micropayments revisited. CT-RSA 2002, LNCS 2271, Springer, 2002.