Inspiration
Communication has become an essential part of our daily lives, but most modern communication platforms depend heavily on internet connectivity. In situations such as natural disasters, network outages, remote locations, or emergencies, losing internet access can make it difficult for people to stay connected.
We started thinking about a simple question:
What if devices could communicate directly with one another, even when the internet is unavailable?
That question inspired us to build GhostNet, an offline communication system designed to explore direct device-to-device communication using Bluetooth Low Energy (BLE).
Our vision is to create a decentralized communication network where nearby devices can exchange messages without depending on traditional internet infrastructure.
What It Does
GhostNet is a prototype for offline, device-to-device communication.
Its main objectives include:
- Offline Communication: Enable nearby devices to exchange messages without requiring an internet connection.
- Bluetooth Low Energy: Use BLE for wireless device discovery and communication.
- Device Identity: Give devices unique identities so they can be recognized within the network.
- Secure Messaging: Develop security mechanisms involving encryption, authentication, and replay protection.
- Mesh Networking Foundation: Build the networking components needed to support communication across multiple devices.
- Android Integration: Provide an Android application to interact with the BLE communication system.
Our long-term goal is to make communication more resilient by reducing dependence on centralized servers and internet connectivity.
How We Built It
We developed GhostNet by combining networking, security, and Android development into a single project.
1. Core Networking
We developed the networking foundation using TypeScript. This includes communication-related modules, message handling, and offline networking components.
We also worked on an offline outbox mechanism to support message handling when immediate delivery is not possible.
2. Bluetooth Communication
We developed an Android BLE application to explore direct communication between nearby devices.
The Android implementation includes components for:
- Bluetooth device discovery.
- BLE advertising and scanning.
- Device identification.
- Connection and subscription handling.
- Message transmission and reception.
3. Security Implementation
Security was an important part of our development process.
We developed security modules covering:
- Device identity management.
- Cryptographic operations.
- Message authentication.
- Replay protection.
- Device trust management.
These components are intended to make communication more reliable and secure.
4. Android Application
We integrated the BLE functionality into an Android application using Kotlin.
The application acts as the interface for interacting with nearby GhostNet devices and testing Bluetooth communication.
5. Integration and Testing
We organized development into multiple phases, gradually building the networking, security, and Android components.
Integration was particularly important because individual modules needed to work together as one system rather than remain isolated implementations.
Challenges We Faced
Building GhostNet was not straightforward. We encountered several technical challenges throughout development.
1. Bluetooth Low Energy Limitations
BLE communication behaves differently from traditional internet-based networking. Device discovery, advertising, connections, and subscriptions required careful implementation.
We also encountered Bluetooth advertising failures and connection-related issues during testing.
2. Integrating Multiple Technologies
Combining TypeScript networking modules with an Android application written in Kotlin required us to think carefully about architecture, protocols, and integration boundaries.
3. Security Implementation
Implementing cryptographic functionality, device identity, authentication, and replay protection required us to understand how security mechanisms fit into a communication system.
4. Build and Compatibility Issues
We encountered Kotlin compilation errors, Gradle configuration issues, and dependency compatibility problems while developing the Android application.
Resolving these issues required repeated debugging and integration testing.
5. Making Offline Communication Reliable
Our biggest challenge was moving beyond the idea of offline communication and developing a working implementation that could be tested across physical devices.
What We Learned
GhostNet taught us much more than just application development.
During this project, we learned:
- How Bluetooth Low Energy works, including advertising, scanning, and connections.
- How device-to-device communication can be designed without internet connectivity.
- The importance of modular architecture when developing complex systems.
- How cryptography, authentication, and replay protection contribute to communication security.
- How to integrate TypeScript-based networking components with native Android development.
- How to debug Gradle, Kotlin, and Android integration problems.
- Why testing on physical devices is essential for applications involving hardware capabilities.
Most importantly, we learned that building a decentralized communication system involves much more than sending a message. Reliability, device discovery, security, and interoperability are equally important.
What's Next?
GhostNet is a foundation that we want to continue improving.
Our future plans include:
- Improving BLE communication reliability.
- Expanding communication to multiple Android devices.
- Implementing and validating multi-hop message forwarding.
- Improving message delivery and offline storage.
- Conducting more extensive security testing.
- Developing a more polished and user-friendly Android application.
We also want to explore how GhostNet could be useful in locations where conventional communication infrastructure is unavailable.
Final Thoughts
GhostNet started with a simple idea: communication should not always depend on the internet.
Building this project challenged us to work across networking, cybersecurity, Bluetooth technology, and Android development.
Although there is still room to improve and validate the system, GhostNet represents our effort to explore a more decentralized and resilient approach to communication.
No internet. No central server required for direct communication. Just nearby devices finding ways to connect.
That's the idea behind GhostNet.
Built With
- android
- bluetooth
- gradle
- indexeddb
- javascript
- kotlin
- lora
- next.js
- node.js
- react
- rest-api
- sqlite
- tcp
- typescript
- udp
- web-crypto-api