
BSV Micropay is a TypeScript toolkit that lets any web service charge sub-cent fees per API call using Bitcoin SV, with zero billing infrastructure and zero human interaction in the payment loop.

Be the first to ask Ruth Designs Digital something.
What do you think? ...
BSV Micropay is a TypeScript toolkit that lets any web service charge sub-cent fees per API call using Bitcoin SV, with zero billing infrastructure and zero human interaction in the payment loop.
It ships as two npm packages:
@ruthheasman/bsv-micropay-middleware— one line of Express middleware that gates any endpoint behind a 402 Payment Required response. The 402 carries a machine-readable invoice; the server verifies the payment transaction on-chain and lets the request through.
@ruthheasman/bsv-micropay-client — a fetch wrapper for the caller side. It catches the 402, pays via a pluggable wallet adapter (BRC-100 wallets, HandCash, Yours, Metanet, or a programmatic agent key from @bsv/sdk), and retries automatically.
It supports two modes: a quick address-basedflow for shipping fast, and a fully BRC-121 standards-compliant mode for ecosystem interop. It exposes a .well-known/bsv-micropay-infodiscovery manifest so agents can crawl pricing and capabilities without any prior knowledge of the service.
The whole thing is documented at a live demo site https://bsvmicropay.com (how-it-works, interactive demo, full docs, and a specification section with a comparison table against x402 Agency, Coinbase x402, and Stripe metered billing) and the source is open on GitHub at Ruthheasman/Bsv-Micropay-Middleware.
Use case in one sentence: an AI agent needs data from your API, hits the endpoint, gets quoted a sub-cent price, pays it from its own wallet, and gets the response — all in a single round trip, no sign

Earn XP for sharing
Sign in to get a personal referral link and earn XP every time someone visits through your link.
npm install @ruthheasman/bsv-micropay-middlewarenpm install @ruthheasman/bsv-micropay-middleware @ruthheasman/bsv-micropay-clientNo reviews yet — be the first.
npm install @ruthheasman/bsv-micropay-middleware