$ show permissionlesstech/bitchat
BiTchat is a native Swift messaging application for iOS and macOS that provides secure, decentralized communication over Bluetooth Low Energy (BLE) mesh, with optional Nostr and Tor transport. The codebase implements end-to-end encryption using the Noise protocol (XChaCha20-Poly1305), Ed25519 signatures, prekey forward secrecy, and a vouching trust model. It includes rotating peer IDs, fingerprint verification, recognition tags that avoid leaking social graphs, and panic-wipe capabilities. The app is structured around SwiftUI views, view models, and coordinators, with a central ChatTransportEventCoordinator routing inbound transport events (messages, noise payloads, delivery status, verification, peer lifecycle) to the UI layer.
The LLM identified 5 files worth highlighting for reuse:
Central inbound transport event router that decodes and dispatches messages, noise payloads, delivery status, verification events, peer connect/disconnect, and stable-ID migration. It depends on minimal @MainActor protocols rather than a concrete view model, which enables mock-based unit testing and makes the routing pattern reusable across transport types.
Demonstrates the context protocol pattern: depends on minimal @MainActor protocols instead of ChatViewModel, enabling mock-based unit tests. Explicitly documented as an exemplar for decoupling coordinators from concrete view models and system services.
Three-layer identity architecture (network, cryptographic, social) with a trust ladder that supports vouching and backward-compatible cache decoding. The model cleanly separates stable cryptographic identity from social verification and network presence, and its migration-safe decoding pattern is applicable to other identity or account systems.
Strict validator for a curated CSV of georelay URLs and coordinates. Enforces size caps, DNS rules, baseline retention >=50%, <=2x growth, and SHA-256 output. This is a reusable data-quality gate for any curated dataset that must be reviewed before deployment, and it is wired into CI.
Safety guard around destructive 'just clean' operations, preventing accidental loss of build artifacts or local state. Demonstrates a lightweight, reusable pattern for adding guardrails to destructive developer commands in CI or local tooling.