The stickers.cash site is a working example of a BCH-only shop. The whole thing is a static HTML, CSS, and JavaScript site hosted on GitHub Pages, with a small Cloudflare Worker that derives a fresh BCH address for each order. There is no database, no payment processor, and no monthly subscription to an e-commerce platform. The total infrastructure cost is a domain name and a few dollars a month for the worker.
What you need
A BCH wallet that supports xpub (extended public keys) โ Selene, Electron Cash, or similar. The xpub lets the website derive new addresses without being able to spend funds. It is watch-only. You keep the private keys offline where they belong.
A Cloudflare Worker (or similar edge function) that takes an order ID, increments a counter, and derives the next address from your xpub using the standard BIP44 path. The worker stores only the counter in a small database โ no payment amounts, no customer data, no secrets beyond the xpub itself.
A static website that displays products, calculates totals, fetches the current BCH/USD rate from a public API, locks that rate for a fixed window (stickers.cash uses 15 minutes), and shows the customer a QR code with the exact amount and address. When the timer expires, the quote refreshes.
The checkout flow
The customer adds items to the cart, enters shipping details, and clicks checkout. The site calls the worker to get a fresh address for that order. It shows a QR code encoding a bitcoincash: URI with the address and amount, plus a countdown timer. The customer scans the QR with their wallet, sends the payment, and the site displays a confirmation screen asking them to email a screenshot or transaction ID.
Payment detection is manual. You check your wallet, match the amount and address to the order, and ship. For a small shop, that is honest and simple. The customer gets a clear confirmation, and you get a direct settlement with no middleman taking a cut.
Address reuse and privacy
Using a fresh address per order improves privacy and makes reconciliation unambiguous. Each order has its own address, so when a payment arrives, you know exactly which order it is for. There is no guessing.
The worker derives addresses sequentially from your xpub. Wallets like Selene scan ahead (typically 20 addresses) to find your funds. If abandoned checkouts create gaps, you may need to trigger a rescan in your wallet to see the newer addresses. The worker README documents this and how to set the starting index.
Cost and complexity
The stickers.cash worker is open source. You can read the code, fork it, and adapt it to your own products. The main moving parts are:
- A static site (GitHub Pages, Cloudflare Pages, Netlify, or any host)
- A Cloudflare Worker with D1 for the address counter (free tier is plenty)
- A BCH wallet with xpub support
- A public BCH/USD price API (there are several)
There is no payment gateway, no merchant account, no chargeback risk, and no monthly fee. The only cost is your time to build the site and the few dollars a month for hosting. For a shop selling physical goods at low prices, that is a meaningful difference compared to card fees that eat 3% of every sale.
Build it with an AI agent
You do not have to write this from scratch. Copy the prompt below into any AI coding agent โ Claude, Cursor, Codex, Copilot โ and it will have enough context to scaffold the entire shop. Adapt the product list, the wallet address, and the branding to your own business.
Build a BCH-only e-commerce storefront. It is a static website (HTML/CSS/JS) with
a Cloudflare Worker backend for per-order Bitcoin Cash address derivation. No payment
processor, no database for orders, no user accounts.
## Architecture
### Static storefront (hosted on GitHub Pages, Cloudflare Pages, or similar)
1. **Product catalog** โ a JavaScript array of objects, each with: id, name,
category, price (in USD), product image path, short description.
2. **Cart** โ stored in localStorage. Customers choose product variants (size,
finish), add to cart, adjust quantities. Show subtotal, bundle discounts
(e.g. 5+ items saves 10%), shipping, and total.
3. **Shipping** โ flat rates: $2 domestic (free over $25), $6 international
(free over $50). A <select> in the cart drawer lets the customer choose.
4. **Checkout (3-step modal)**:
- Step 1 โ Shipping details form (name, email, address, country select,
shipping method). Validate client-side. Show an order summary sidebar.
- Step 2 โ Payment. Fetch the current BCH/USD rate from a public API
(e.g. CoinGecko /api/v3/simple/price?ids=bitcoin-cash&vs_currencies=usd).
Lock the rate for 15 minutes with a countdown timer. Call the Worker
(POST /address with { orderId }) to get a fresh BCH address. Show a QR
code encoding a bitcoincash: URI (bitcoincash:<address>?amount=<bch>).
Include copy buttons for the address and amount.
- Step 3 โ Confirmation. Show order ID. Ask the customer to email their
wallet receipt/txid to the shop email. Provide a mailto: link with the
order ID in the subject.
5. **QR codes** โ generate client-side using a library like qrcode (or a
simple QR endpoint). The URI format is: bitcoincash:<address>?amount=<bch>
6. **Design** โ mobile-first, responsive. Light and dark theme via
prefers-color-scheme. Clean card-based layout. Sticky header with cart
button.
### Cloudflare Worker (per-order address derivation)
A small Worker with a D1 database that stores an address counter:
- Table: counter(id INTEGER PRIMARY KEY, next_index INTEGER DEFAULT 1)
- Table: orders(order_id TEXT, address_index INTEGER, created_at TEXT)
Endpoints:
- POST /address โ body: { orderId }. Idempotent per orderId. Derives the next
BCH address from a watch-only xpub (stored as a Worker secret, never
committed). Uses BIP44 path m/44'/145'/0'/0/<index>. Increments the
counter atomically. Returns { address, index }.
- GET /health โ returns { ok: true, xpubConfigured: true/false }.
Address derivation uses @scure/bip32 (or similar) to derive from the xpub.
The xpub must be at account depth (m/44'/145'/0'). Validate and reject xprv,
tpub, ypub, zpub, and xpubs at wrong depths.
The Worker has CORS headers allowing the storefront origin. If the Worker is
unreachable, the storefront falls back to a single hardcoded BCH address.
### Exchange rate
Fetch BCH/USD from a public API at checkout time. Cache for ~60 seconds to
avoid hammering the endpoint. Show the locked rate and a countdown. Refresh
the quote when the timer expires. The fallback rate is hardcoded as a last
resort.
### Key constraints
- BCH only. No credit cards, no PayPal, no other payment methods.
- No payment detection automation. The shop owner checks their wallet
manually and matches payments to orders.
- The xpub is watch-only. The Worker can derive addresses but cannot spend.
- All customer data stays in the browser (localStorage). Nothing is sent to
a server except the address request (orderId only โ no name, no address,
no email).
- The entire site must work without JavaScript for basic browsing
(progressive enhancement for the cart/checkout).
### Deployment
- Storefront: GitHub Pages or Cloudflare Pages. Custom domain.
- Worker: npx wrangler deploy. The workers.dev URL is set in the storefront
config.
- Secrets: the xpub is stored as a Cloudflare Worker secret (wrangler secret
put XPUB). Never in source control.
- Database: Cloudflare D1. Run schema.sql once to create the tables.
### Reference
The stickers.cash site (https://stickers.cash) is a working example of this
exact architecture. Its Cloudflare Worker is open source and documented at
https://github.com/ripekern/stickers-cash/tree/main/worker
That prompt covers the architecture, the checkout flow, the address derivation, and the deployment. An AI agent with access to a code editor can scaffold the whole thing in a sitting. From there, swap in your own products, your own wallet, and your own branding.