Inspiration
What it does
How we built it## Inspiration
During a music festival last summer, I watched vendors turn away customers because the cellular network was overloaded. Bitcoin payments failed. Traditional cards failed. Cash was running out. That's when it hit me: what if payments could travel through people's phones like a mesh network?
Lightning Network is amazing for instant Bitcoin payments, but it has one critical dependency: internet connectivity. In rural areas, disaster zones, crowded events, or regions with unreliable infrastructure, this dependency becomes a barrier. We're building for the 2.5 billion people without reliable internet access.
What it does
Mesh Lightning enables offline Lightning Network payments using Bluetooth mesh networking. Here's how it works:
- A vendor generates a Lightning invoice (works offline)
- The invoice travels via Bluetooth through nearby devices (peer-to-peer relay)
- When it reaches someone with internet, the payment settles on Lightning Network
- Confirmation travels back through the mesh to the vendor
No internet required for the vendor. Payments just work.
How we built it
Tech Stack:
- React Native + Expo for cross-platform mobile
- LDK Node for Lightning Network integration (testnet)
- Bluetooth LE for peer discovery and messaging
Architecture:
- Bluetooth service handles peer discovery and message relay
- Lightning service manages invoice generation and payment processing
- Payment queue system stores offline transactions
- Network monitor triggers sync when connectivity returns
We started with the core mesh networking, then integrated Lightning, and finally connected the two with an intelligent queueing system. Each component was tested independently before integration.
Challenges we faced
Bluetooth advertising complexity: BLE advertising in mobile environments is notoriously difficult. Different devices behave differently, iOS restricts background scanning, and auto-discovery requires careful permission handling. We iterated through multiple approaches before finding a reliable solution.
State synchronization: Keeping payment state consistent across offline/online transitions was tricky. We needed to handle edge cases like: what if the vendor goes offline before confirmation? What if multiple devices try to settle the same payment? We solved this with idempotent payment handling and proper state machines.
Testing mesh relay: Testing multi-hop routing required multiple physical devices and creative scenarios. We couldn't use simulators (no Bluetooth). This meant constant builds and physical device testing, which slowed iteration but ensured real-world reliability.
Lightning integration on mobile: Getting LDK Node running smoothly on React Native involved navigating native dependencies, storage path configurations, and proper initialization sequences. The documentation helped, but we had to dig into source code for edge cases.
What we learned
Resilient systems require rethinking assumptions. We're so used to always-connected applications that we forget how to build for intermittent connectivity. This project forced us to think differently about state, timing, and user expectations.
P2P networking is powerful but complex. Mesh networking unlocks amazing possibilities, but it introduces challenges around trust, routing efficiency, and failure modes that centralized systems avoid.
Bitcoin's layer 2 solutions are ready. Lightning Network isn't just a concept anymore—it's production-ready technology that can be integrated into novel use cases like mesh payments.
What's next
V1 - Post-Hackathon:
- Enhanced mesh routing with intelligent path selection
- End-to-end encryption using Noise Protocol
- Multi-hop optimization (currently 2-3 hops, can scale to 7+)
V2 - Future Vision:
- Blockchain proxy: online nodes serve as Esplora gateways for offline nodes
- Incentive layer: reward relay nodes with satoshis for forwarding messages
- Cross-platform: iOS full support with MultipeerConnectivity
- LSP integration: automatic channel opening via LSPS2
V3 - Dream State:
- Integration with Nostr for encrypted backups
- BOLT12 offers for recurring payments
- Payjoin for privacy-preserving channel opens
- Mesh-native marketplace for offline commerce
This is just the beginning. We're building the infrastructure for unstoppable Bitcoin payments.
Built With
- asyncstorage
- bluetooth
- bolt11
- esplora-api
- expo.io
- ldk-node
- lightning-network
- netinfo
- react-native
- react-navigation
- typescript
- zustand
Log in or sign up for Devpost to join the conversation.