OffGrid Pay

Offgrid Pay: a truly decentralized, peer-to-peer offline crypto transfer network.

OffGrid Pay

Created At

ETHGlobal New Delhi

Winner of

Flow Foundation

Flow - Best Killer App on Flow 3rd place

Project Description

Mainstream digital payment systems still fail millions of people whenever the internet is unreliable - whether due to poor infrastructure, censorship, or natural disasters. Offgrid Pay changes this by enabling true peer-to-peer ERC-20 token transfers that work offline. By turning everyday smartphones into part of a Bluetooth mesh, Offgrid Pay brings cash-like, resilient crypto payments to anyone, anywhere, without depending on constant connectivity.

Why offline crypto?

Accessible: Send, receive, and store tokens on any basic smartphone — no internet or bank account required. Affordable: Low-cost transfers, ideal for remittances and local exchanges. Secure & transparent: Transactions are signed locally, immutable once relayed to Ethereum. Empowering: Individuals and communities in disconnected regions can participate in the global economy with full control of their funds.

Offgrid Pay is our step toward answering these questions - building a payments network that doesn’t wait for the internet.

Offgrid Pay is an app that enables offline ERC-20 token transfers by forming a Bluetooth Low Energy (BLE) mesh between nearby smartphones. Transactions are signed locally, gossiped across the mesh, and submitted on-chain by the first device with internet; confirmations are relayed back through the mesh.

Welcome to a new era of offline crypto payments.

How it's Made

Technologies Used • React Native Framework: Built on React Native for cross-platform mobile development, allowing shared codebase between iOS and Android while maintaining native performance for BLE operations • TypeScript: Comprehensive TypeScript implementation throughout the entire codebase for type safety, better developer experience, and reduced runtime errors in critical financial operations • Redux Toolkit: State management using Redux Toolkit with organized slices for wallet, transactions, mesh topology, and UI state - providing predictable state updates across the complex mesh network • React Navigation: Navigation system with tab-based main navigation and stack-based onboarding flow, handling the transition from wallet setup to main application functionality • Jest Testing Framework: Extensive test coverage with unit tests, integration tests, and component tests - critical for a financial application handling token transfers • Bluetooth Low Energy (BLE): Core technology enabling device-to-device communication without internet connectivity, forming the foundation of the mesh network architecture

Architecture Integration • Service Layer Architecture: Clean separation of concerns with dedicated services for each major functionality - ConnectionManager, DeviceDiscoveryService, TransactionManager, EncryptionService, and RelayerService • Mesh Network Implementation: Custom gossip protocol implementation for transaction propagation across the BLE mesh, with topology management and automatic relayer detection for network resilience • Secure Storage Integration: Multi-layered storage approach using both secure storage for sensitive data (private keys, wallet information) and local storage for application state and mesh topology data • Error Handling System: Centralized error handling with specific error types for BLE operations, transaction failures, and network connectivity issues - essential for debugging mesh network problems • Factory Pattern Implementation: RelayerServiceFactory for dynamic service instantiation based on device capabilities and network conditions, allowing adaptive behavior in different mesh scenarios • Event-Driven Architecture: Asynchronous event handling throughout the BLE stack, transaction processing, and mesh communication to maintain responsive UI during network operations

Partner Technologies Benefits • React Native BLE Manager: Leveraged existing BLE libraries to handle low-level Bluetooth operations, saving significant development time on platform-specific implementations while ensuring reliable device discovery and connection management • Crypto Libraries: Integration with established cryptographic libraries for transaction signing and message encryption, providing battle-tested security implementations rather than custom crypto code • Redux DevTools: Development tooling integration for debugging complex state changes across mesh network operations, transaction flows, and wallet management - invaluable for troubleshooting distributed system behavior • React Native Keychain/Keystore: Platform-specific secure storage solutions ensuring private keys and sensitive wallet data are protected using hardware-backed security when available • Metro Bundler: React Native's bundler optimized for mobile development, enabling fast refresh during development and efficient code splitting for production builds • Native Module Integration: Seamless integration with platform-specific BLE capabilities and security features through React Native's bridge architecture

Notable Hacks and Innovations • BLE Message Chunking: Implemented custom message fragmentation and reassembly to handle transaction data larger than BLE's MTU limits, with sequence numbering and timeout handling for reliable large message transmission • Adaptive Mesh Topology: Dynamic relayer detection and promotion system that automatically identifies devices with better connectivity or battery levels to serve as mesh relayers, optimizing network efficiency • Transaction Gossip Protocol: Custom implementation of gossip-based transaction propagation with duplicate detection, TTL management, and selective forwarding to prevent network flooding while ensuring transaction delivery • Offline-First Design: Complete transaction creation, signing, and queuing system that works without internet connectivity, with automatic synchronization when mesh connectivity is restored • Battery-Aware Networking: Intelligent connection management that adjusts BLE advertising intervals and connection parameters based on device battery levels and mesh role (relayer vs. client) • Cryptographic Message Routing: End-to-end encryption with forward secrecy for mesh messages, using ephemeral keys and secure key exchange protocols to protect transaction privacy across multi-hop mesh paths

The most technically challenging aspect was creating a reliable gossip protocol that could handle the unreliable nature of BLE connections while ensuring transaction integrity and preventing double-spending in a distributed, offline-capable system.

background image mobile

Join the mailing list

Get the latest news and updates