mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-24 22:45:19 +00:00
3c894bcb2fb9f3f4855d13e8bf67e47ad8632f40
- Filter cached messages by recipient (only send to intended peer) - Remove messages from cache after successful delivery - Stop caching broadcast messages (they're not targeted) - Add safety check to never cache broadcasts - Messages are now delivered exactly once per recipient The store-and-forward system now correctly: 1. Stores only private messages for specific recipients 2. Delivers only to the intended recipient when they connect 3. Removes messages after delivery to prevent duplicates 4. Preserves original timestamps throughout the process
bitchat
A secure, end-to-end encrypted Bluetooth mesh chat application with an IRC-style interface.
Features
- End-to-end encryption using Curve25519 and AES-GCM
- Bluetooth mesh networking with automatic peer discovery
- Message relay capability (TTL-based flooding)
- IRC-style terminal interface
- Persistent nickname storage
- Universal app (iOS and macOS)
- No internet connection required
Setup
Option 1: Using XcodeGen (Recommended)
-
Install XcodeGen if you haven't already:
brew install xcodegen -
Generate the Xcode project:
cd bitchat xcodegen generate -
Open the generated project:
open bitchat.xcodeproj
Option 2: Using Swift Package Manager
-
Open the project in Xcode:
cd bitchat open Package.swift -
Select your target device and run
Option 3: Manual Xcode Project
- Open Xcode and create a new iOS/macOS App
- Copy all Swift files from the
bitchatdirectory into your project - Update Info.plist with Bluetooth permissions
- Set deployment target to iOS 16.0 / macOS 13.0
Usage
- Launch the app on multiple devices
- Choose or modify your nickname
- The app will automatically discover nearby peers
- Start chatting! Messages are relayed through the mesh network
Security
- All messages are end-to-end encrypted
- Public key exchange happens automatically on connection
- Messages are signed to prevent tampering
- TTL prevents infinite message loops
Protocol
The bitchat protocol uses JSON-encoded packets with the following structure:
- Packet versioning for future compatibility
- Message types: handshake, message, ack, relay, announce, keyExchange
- TTL-based flooding for mesh relay
- Signature verification for authenticity
Building for Production
- Set your development team in project settings
- Configure code signing
- Archive and distribute through App Store or TestFlight
Android Compatibility
The protocol is designed to be platform-agnostic. An Android client can be built using:
- Bluetooth LE APIs
- Same packet structure and encryption
- Compatible service/characteristic UUIDs
Languages
Swift
99.1%
Shell
0.4%
Rust
0.3%
Just
0.1%