Inspiration
Getting paid for a hard day's work shouldn't be harder than doing the work itself. Freelancers, local merchants, and remittance recipients around the world lose hours in banking queues, bureaucracy, and up to 10% in predatory fees just to receive or move their daily earnings. We created Teranga Pay to bridge that gap—bringing instant, borderless, near-zero-fee Bitcoin Lightning payments to everyday workers without forcing them to surrender custody of their funds.
What it does
Teranga Pay is a non-custodial Progressive Web App (PWA) powered by the Bitcoin Lightning Network and Nostr Wallet Connect (NWC, NIP-47). It enables anyone to:
- Receive Payments Instantly: Generate clean, mobile-compatible BOLT11 QR codes and Lightning invoices in seconds, plus one-tap copy/share options for messaging apps.
- Send Funds Globally: Pay any BOLT11 invoice or Lightning Address (
[email protected]) with near-zero fees and instant settlement. - Stay Protected with Built-In Risk Controls: Server-side per-transaction limits (
MAX_PAY_SATS) and daily spending caps (DAILY_CAP_SATS) protect newcomers from accidental overspending. - Learn with Teranga AI: An integrated AI financial assistant answers questions about Lightning fees, wallet security, and payment workflows in plain language.
- Break Language Barriers: Full interface support in English, French, Spanish, and Wolof.
How we built it
- Backend (Node.js & Express): Built a lightweight, security-hardened API server handling NWC connection lifecycle, invoice generation, payment execution, and rate-limited AI queries.
- Non-Custodial Key Management: Users connect their existing Lightning wallet (Coinos, Alby Hub, or LNbits) via NWC URI. Credentials are encrypted at rest in SQLite using a master Key Encryption Key (
KEK_HEX), so seed phrases are never touched or exposed. - Frontend (Vanilla JS PWA): Crafted a fast, responsive, zero-framework interface with offline service worker caching, client-side QR rendering (
qrcode), and multi-language localization. - AI Integration: Connected OpenRouter LLM APIs to power Teranga AI, grounding financial guidance in safe, beginner-friendly prompts.
- Deployment: Hosted live on Render (
https://teranga-pay-yo5q.onrender.com) and open-sourced under the MIT License (https://github.com/Dfgiraldod14/teranga-pay).
Challenges we ran into
- Mobile QR Scanner Compatibility: Early testing revealed that uppercase BOLT11 strings (
LNBC...) andlightning:URI prefixes caused certain mobile wallets to reject scanned QR codes. We solved this by implementing a strictcleanInvoice()sanitizer
Built With
- bitcoin
- express.js
- javascript
- lightning-network
- node.js
- nostr
- nwc
- pwa
- sqlite
