jack 6652d1f429 Fix voice recording and notification issues
- Fix mic button gesture handling by removing Button wrapper
  - Use direct gesture on ZStack for more reliable touch detection
  - Add debug logging for recording start/stop

- Fix notification delivery on iOS
  - Change from checking .background to checking != .active
  - Notifications now work when app is inactive or background
  - Add NSUserNotificationsUsageDescription to Info.plist

- Improve voice note fragment transmission
  - Reduce fragment size from 400 to 200 bytes for better reliability
  - Simplify fragment timing from batch-based to linear 100ms delays
  - Lower packet size threshold from 512 to 400 bytes for fragmentation
  - Add peripheral connection state checking before writes
  - Better error logging throughout transmission pipeline

- Add comprehensive debug logging for troubleshooting
  - Log audio file size and duration
  - Log peripheral connection states during broadcast
  - Log fragment send progress with timing info
2025-07-03 23:14:42 +02:00

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

  1. Install XcodeGen if you haven't already:

    brew install xcodegen
    
  2. Generate the Xcode project:

    cd bitchat
    xcodegen generate
    
  3. Open the generated project:

    open bitchat.xcodeproj
    

Option 2: Using Swift Package Manager

  1. Open the project in Xcode:

    cd bitchat
    open Package.swift
    
  2. Select your target device and run

Option 3: Manual Xcode Project

  1. Open Xcode and create a new iOS/macOS App
  2. Copy all Swift files from the bitchat directory into your project
  3. Update Info.plist with Bluetooth permissions
  4. Set deployment target to iOS 16.0 / macOS 13.0

Usage

  1. Launch the app on multiple devices
  2. Choose or modify your nickname
  3. The app will automatically discover nearby peers
  4. 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

  1. Set your development team in project settings
  2. Configure code signing
  3. 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
S
Description
bluetooth mesh chat, IRC vibes
Readme Unlicense
247 MiB
Languages
Swift 99.1%
Shell 0.4%
Rust 0.3%
Just 0.1%