-
-
jaay: sell without signal. Offline-first Lightning point of sale in XOF (SANDBOX demo, no real bitcoin)
-
Sell: a 2,500 F sale with its LNURL-pay QR and the server host the customer pays to
-
Check code: the merchant types the customer's 6-digit code, checked on the device, 3 attempts max
-
Wallet: receive-only, server totals in XOF and sats, no way to spend from the phone
-
Customer receipt: the code appears only after the invoice is paid
-
Sales ledger: every sale grouped by day, kept offline on the phone and reconciled with the server
-
SANDBOX customer simulator: plays the customer's Lightning wallet for the demo
SANDBOX demo: simulated payments, no real bitcoin, fixed demo exchange rate. Real Lightning was exercised on regtest only. Jaay never accepts mainnet invoices.
Live demo: merchant app · customer wallet simulator (free hosting: the first visit may take a moment to wake up) Code: github.com/lijnati/Jaay (MIT)
Inspiration
Selling over Lightning usually needs a data connection on the selling phone, or a dedicated hardware device. Sellers whose data drops or runs out mid-sale are the case we designed for. LNURLPoS showed that the burden of connectivity can be taken away from the point of sale and given to the phone. Its author also lists offline sats pricing as too volatile, and that is the open problem we wanted to solve. Jaay is Wolof for "to sell".
What it does
The merchant types a price in XOF and the phone shows an LNURL-pay QR, even in airplane mode. The customer scans with any LNURL-pay wallet, and the server converts XOF to sats at scan time with a 120 s quote lock. The invoice is created on the merchant's own wallet through a receive-only connection. After payment the wallet shows a receipt link (LUD-09), and the receipt page shows a 6-digit code only once the invoice has settled. The merchant types the code, the phone checks it with its own key (at most 3 attempts per sale), and when online the phone reconciles every sale and flags any sale confirmed without a payment.
How we built it
A TypeScript pnpm monorepo: a pure Web Crypto protocol package, a Hono server on Node with SQLite, an offline-first Vite PWA and a customer wallet simulator. The QR carries an AES-256-GCM sealed payload with a random 96-bit IV and the device id as AAD. The server talks to the merchant wallet over Nostr Wallet Connect (NIP-47), an LNbits invoice key, or a labeled SANDBOX backend. The phone keeps an IndexedDB sale ledger with non-extractable keys and signs its API calls with HMAC. We wrote the tests first for protocol, crypto and server logic.
Challenges we ran into
Offline pricing is hard because a sats price goes stale, so the payload carries XOF and the server prices at scan time. Confirming a payment with no network means trusting a code, so the code is gated by settlement, derived on the device, limited to 3 attempts, and backed by reconciliation. Proving receive-only was tricky, so enrollment refuses any NWC connection that grants pay_invoice and the server re-checks the live permissions on every Wallet refresh. Getting real Lightning on regtest took a custom stack (Alby Hub on regtest LND). Whether real wallets show the LUD-09 receipt link was researched but tested only with the simulator.
Accomplishments that we're proud of
- The merchant app's first load is 32.4 KB gzipped; the receipt page is about 1.4 KB with no JavaScript.
- The point of sale works offline after the first load, including a cold start in airplane mode (Playwright test).
- 475 unit and property tests (127 protocol, 169 server, 146 PWA, 33 simulator), fast-check fuzz tests with a fixed seed, and 14 Playwright end-to-end checks at 320, 360 and 412 px in English and French.
- A threat model of 27 threats where every row names its tests, checked in CI by
pnpm security:matrix. - A receive-only wallet view with no send button anywhere.
What we learned
Receive-only is enforced by the wallet service, so the app can only refuse and warn, not guarantee. A security claim is more convincing when a test is named next to it. Prior art matters: the confirm-code idea comes from the LNURLPoS lineage, and saying so is part of the design. Honest labels (SANDBOX, fixed demo rate, not yet tested) cost little and keep trust. The next step is to check these assumptions with merchants in person.
What's next for jaay
Pilot with one Bitcoin-accepting merchant in Dakar. Test real wallets on signet with the receipt link. Add device revocation and a passcode-protected key. Have Wolof strings reviewed by a native speaker. Stretch: a signed receipt as a Nostr event.
Built With
- bitcoin
- hono
- lightning-network
- lnurl
- node.js
- nostr
- playwright
- render
- sqlite
- typescript
- vite
