Tuesday, July 8, 2025

BitChat: Building a Decentralized Chat App with Bluetooth Mesh Networks

I recently discovered a fascinating project on GitHub called 'BitChat' - a chat app built on Bluetooth mesh networking. What makes this project particularly noteworthy is its implementation of a completely decentralized messaging system that works without any internet connection.


Communication in a World Without Internet

BitChat's most distinctive feature is that itrequires absolutely no internet connection. There's no server, no phone number verification, and you don't even need to create an account. It uses only Bluetooth LE (Low Energy) to form mesh networks with nearby devices and exchange messages through this network.

This approach could be incredibly useful in disaster situations, regions with heavy internet censorship, or simply for users who prioritize privacy. Just like how mesh networking apps like FireChat gained attention during the Hong Kong protests, this technology goes beyond mere technical curiosity and can have real social significance.

IRC Nostalgia Meets Modern Security

I found it particularly interesting how the project description mentions "IRC vibes." BitChat actually borrows IRC's command structure directly. You join channels with `/j #channel`, send private messages with `/m @name message`, and check online users with `/w`.

However, the security level is completely different from IRC. Private messages use X25519 key exchange and AES-256-GCM encryption, while channel messages combine Argon2id password derivation with AES-256-GCM. For message authentication, it uses Ed25519 digital signatures. This is a combination of the most recommended algorithms in modern cryptography.

Technical Implementation Depth

Looking at the code, this isn't just a simple prototype but shows careful design considerations for actual use. The battery optimization features are particularly impressive. The app adjusts scan intervals based on battery level, automatically switching to performance mode when charging or above 60% battery, and power-saving mode when below 30%.

Message compression is also implemented using the LZ4 algorithm, automatically compressing messages over 100 bytes. According to the documentation, this achieves 30-70% bandwidth savings for typical text messages. This is a crucial optimization considering Bluetooth LE's limited bandwidth constraints.

Privacy-Centered Design

BitChat's approach to privacy is remarkably thorough. By default, all messages exist only in device memory and aren't stored unless explicitly enabled by the channel owner. There's even an "Emergency Wipe" feature that instantly deletes all data when you tap the logo three times.

Even more intriguing is the "Cover Traffic" feature. To prevent traffic analysis, it intentionally sends dummy messages and obfuscates timing patterns. This is an advanced technique typically seen in military communication systems.

Mesh Networking Challenges and Limitations

However, Bluetooth mesh networking has clear limitations. Bluetooth LE typically has a range of about 10-30 meters, and messages can only be relayed up to 7 hops. This means it would only work effectively in fairly dense environments.

iOS background limitations also pose a significant obstacle. iOS apps have many restrictions on performing Bluetooth operations in the background, which could impact actual usability. The developer seems aware of this and has mentioned plans for an Android version.

Open Source and Public Domain

What's particularly noteworthy is that this project is released under the Unlicense into the public domain. This means anyone can freely use and modify it. It's a choice that aligns with the project's philosophy of pursuing privacy and decentralization.

The code quality is also quite high. Written in Swift, it's implemented as a universal app supporting both iOS and macOS. The use of XcodeGen for project setup and systematic documentation is also impressive.

Practicality and Future Prospects

Realistically, BitChat won't replace conventional messaging apps. However, it could be very useful in specific situations. For example, communication among participants at large events or festivals, group communication in offline environments like hiking or camping, or emergency communication during crisis situations.

It's also technically fascinating as an experiment. As a comprehensive project combining Bluetooth mesh networking, modern encryption, and battery optimization, it has high educational value.

Wrapping Up

BitChat isn't just a simple chat app - it's an intriguing experiment that demonstrates the possibilities of decentralized communication. The idea of a messaging system that doesn't depend on the internet is refreshing, and the implementation level is quite sophisticated. While there are limitations in terms of practicality, I think it's a meaningful project given the current heightened interest in privacy and decentralization.

For open source developers especially, this could serve as an excellent reference for learning Bluetooth LE programming, mesh networking, and modern cryptographic implementation. It will be interesting to see how these decentralized technologies evolve in the future.

*Source: [GitHub - jackjackbits/bitchat](https://github.com/jackjackbits/bitchat)*.

Share: