# bitchat Privacy Assessment Last reviewed: November 2026 ## Scope - BLE discovery, mesh routing, gossip sync, private delivery, and courier behavior - Nostr private fallback (NIP-17 / NIP-44 v2 / NIP-59 and legacy `v2:`), bridge courier drops, mesh bridging, geohash channels, and notices - Opt-in zero-knowledge APNs push gateway (`bitchat-push.fly.dev`) and `bitchatNotificationServiceExtension` - Offline Crew Mode (opt-in encrypted GPS pins and check-ins), CoreLocation, and reverse geocoding - Optional Cashu ecash wallet and local device linking / encrypted recovery kits - Local persistence, panic wipe, logging, and App Store privacy manifests The user-facing contract is `PRIVACY_POLICY.md`. This document records implementation-level behavior and residual risks that should be re-audited when storage or transport semantics change. ## Current Posture - Permissionless Tech operates no account system, analytics pipeline, advertising SDK, or plaintext messaging backend. The only project-operated endpoints are the optional, opt-in zero-knowledge APNs push gateway (`https://bitchat-push.fly.dev`, hosted on Fly.io) and the static Universal Link host `bitchat.free` (serving `apple-app-site-association` and the `/invite` / `/crew` fallback page; in-person friend QR codes use offline `bitchat://`, while Universal Links currently emit `?` query parameters for released-client compatibility and accept client-only `#` fragments ahead of migrating emission to `#`). - Tor defaults **ON** in both Everyday Mode and Stealth Mode; disabling Tor requires an explicit opt-out in Everyday Mode's Connectivity settings. - Mesh transport is peer-to-peer. Optional internet features use third-party Nostr relays, Blossom media servers, and Cashu mints, which can observe public content, coarse geohashes, timing, relay, and (if Tor is turned off) network metadata. - Private payloads (including Offline Crew Mode GPS pins) are end-to-end encrypted, but public mesh, board, bridge, and geohash content is intentionally visible to its participants. - Local storage is bounded where practical and included in panic wipe, but it is not wholly ephemeral. The app persists the stores listed below. - The main app, Share Extension, and Notification Service Extension each bundle a `PrivacyInfo.xcprivacy` manifest declaring their required-reason API use; the main app manifest also declares the opt-in push gateway's collected identifiers (`DeviceID`, `UserID`) to match App Store Connect. - A locked device discloses less than an unlocked one, but not nothing. Notification previews are hidden by default, and the iOS app-switcher snapshot is covered by default (opt-out in Everyday Mode when private history is enabled; always on in Stealth Mode or when chat history is RAM-only); see "Locked and Seized Devices". ## BLE Discovery and Metadata Signed announces can expose: - Nickname, persistent Noise public key, and Ed25519 signing public key - Capability flags - A bounded set of short direct-neighbor identifiers - A coarse rendezvous geohash when the bridge capability is enabled The app does not advertise the device's assigned name. iOS manages BLE address randomization; bitchat does not attempt to create a stable MAC address. That randomization does not deliver the unlinkability it might suggest, because the application layer publishes stable identifiers above it. The 8-byte peer ID in every packet header is the first 8 bytes of the Noise static key fingerprint, so it does not rotate; announces carry the static keys themselves; and the fixed service UUID makes any bitchat device detectable as such by a passive scanner. A receiver in radio range can therefore recognise a specific device across sessions and locations, and detect that the app is in use at all. RSSI, timing, traffic volume, and radio fingerprints remain observable as well. Ingress validates announce structure, sender binding, signatures, payload sizes, and freshness. Current-link Noise authentication is required before destructive courier handoff or strict directed delivery. Floods, queues, fragments, ingress work, and per-peer state are bounded. ## Private Messaging and Courier Delivery - Direct mesh sessions use Noise XX with X25519, ChaCha20-Poly1305, and SHA-256. - In Everyday Mode (fresh 2.0 default), private direct-message and private-group timelines persist in `EncryptedHistoryStore` (`private-chats.sealed`), sealed with ChaCha20-Poly1305 under a device-only keychain key, with per-conversation disappearing timers (24h, 7d, or RAM-only ephemeral). Stealth Mode disables local history and deletes the file immediately; 1.x upgrades preserve RAM-only behavior until the user chooses Everyday Mode. Public mesh and geohash timelines are never stored in `EncryptedHistoryStore`. - Undelivered outgoing private messages remain in a bounded, ChaChaPoly-sealed outbox for at most 24 hours. Its key is stored in the keychain. - Physical couriers store opaque Noise-sealed envelopes, not plaintext. Deposits have trust-tier quotas, per-depositor caps, a global cap, and at most a 24-hour lifetime. - Spray-and-wait copies are bounded and progress cannot be replenished by replaying a deposit. - Delivery status advances only after real transport admission or explicit relay acceptance; late failure cannot downgrade a delivered/read message. - Panic wipe deletes the outbox, courier mail, keys, dedup state, and active transport state. Residual risk: private-message metadata such as timing, radio adjacency, ciphertext size, rotating recipient tags, and relay connections remains observable. A compromised recipient device can disclose plaintext. ## Public Gossip, Boards, and Media - Recent signed public mesh messages are archived in Application Support for up to 6 hours so gossip sync survives a relaunch and can cross mesh partitions. - Signed public board posts and tombstones persist until author-selected expiry, at most seven days. Stores are bounded by global and per-author quotas. - Group metadata (name, roster, creator, epoch) persists as protected JSON; group keys live in the keychain until leave/removal/wipe. - Voice notes and images are stored in Application Support. Incoming media has a 100 MB oldest-first quota, and all managed media — incoming and outgoing — is additionally bounded by age: a launch-time sweep deletes anything older than seven days. In-flight live captures and files reserved by a delivery or deletion in progress are exempt regardless of age. Panic wipe invalidates detached preparation work, cancels active transfers, closes live capture files, and removes the managed media tree before returning. Public archives contain content already intended for public mesh/board distribution, but a seized unlocked device can reveal it. Group metadata and media can reveal relationships or content even when the in-memory chat timeline has gone away. ## Nostr, Push Gateway, Cashu, and Mesh Bridge - Private Nostr envelopes support both standard **NIP-17 / NIP-44 v2 / NIP-59** (secp256k1 ECDH, HKDF-SHA256, padded ChaCha20 + HMAC-SHA256) for cross-client interoperability and linked-device self-copies, and BitChat's legacy `v2:` (XChaCha20-Poly1305) format for backward compatibility. Neither provides forward secrecy against later compromise of the recipient's static Nostr private key. Relays still see the recipient public-key tag (`#p`), event timing and size, and (if Tor is disabled) network metadata. - **Opt-in Push Gateway (`https://bitchat-push.fly.dev`, operated by Permissionless Tech on Fly.io):** Strictly opt-in in Everyday Mode, hard-disabled in Stealth Mode, and pinned to the default URL in Release builds (custom URLs are `#if DEBUG` only because APNs requires the publisher's `.p8` key). Registration/unregistration uses NIP-98 HTTP auth bound to origin, payload hash, and single-use replay protection, routed over an isolated Tor circuit by default. The gateway persists `pubkeyHex -> [DeviceRegistration]` (up to 8 tokens/pubkey, globally bounded) in `/data/registrations.json` with a **30-day inactivity TTL** (active clients auto-refresh every 7 days) and persists up to **8,192** seen event IDs (72-hour TTL) so restarts and failovers never re-push old messages. It subscribes to default DM relays for `kind 1059` `#p` filters, verifies canonical NIP-01 event IDs and BIP-340 Schnorr signatures (enforcing single-recipient `#p` tags), and forwards generic alerts plus opaque `gw: {p, c}` ciphertext (≤2,600 B) to Apple APNs for on-device decryption in `bitchatNotificationServiceExtension`. Inside the shared App Group container, both pending authenticated handoffs (`pushExt.pendingHandoffs`) and contact/blocklist metadata (`pushExt.sealedMetadata`: peer display names, peer IDs, blocked pubkeys, and muted pubkeys) are sealed with ChaCha20-Poly1305 under distinct HKDF-SHA256 subkeys derived from the shared Keychain Nostr private key, with legacy plaintext keys scrubbed on sync. Disabling push, activating Stealth Mode, replacing identity, or triggering panic wipe clears the shared Keychain/App Group bridge, calls `unregisterForRemoteNotifications()`, and sends a best-effort `POST /v1/unregister`. Uninstalled or offline-wiped tokens are dropped automatically on APNs `410`/`Unregistered`/`BadDeviceToken` or after the 30-day TTL. - **Cashu ecash wallet (optional):** Contacts only user-supplied or token-embedded third-party mint URLs via fail-closed Tor (when Tor is enabled) using blinded signatures (NUT-01/02/03/07/09/12). Local proofs and wallet state are cleared on panic wipe. - **Portable identity backups & device linking:** `IdentityRecoveryKit` encrypts exported identity backups (`bitchat-backup-v1:`) locally using **600,000 PBKDF2-HMAC-SHA256 iterations** (with a random 16-byte salt) and ChaCha20-Poly1305 AEAD; backups are never uploaded to Permissionless Tech servers. `DeviceLinkingService` transfers identity material locally via a short-lived encrypted pairing code. - **Universal invite links (`bitchat.free`):** `FriendInvite.parse` and `CrewInvite.parse` accept client-only URL fragments (`https://bitchat.free/invite#...` and `https://bitchat.free/crew#...`), preserve `?` query parsing, and reject cleartext `http://` links. For Phase-1 compatibility with released query-only v2.1.x clients, `universalURL` currently continues to emit `?` query parameters until `#`-capable clients are live on the App Store, so query-string links can still expose invite parameters to HTTP hosts and link previewers when opened outside the app. In-person friend QR codes (`AddFriendSheet`) emit `bitchat://invite?...` directly so scanning never requires a network lookup. The static fallback page (`docs/universal-links/invite.html`) allowlists known invite keys, sets `no-referrer` and a restrictive CSP, and leaves the address bar unchanged, so reloads and copied links keep the form that released clients can read. - Bridge courier drops use a throwaway publisher key, an opaque Noise-sealed envelope, and a day-rotating recipient tag. Only a party already holding the recipient's Noise static key can compute candidate tags. - Relay publication is considered successful only after an explicit NIP-01 `OK true` from at least one target relay. Rejected, disconnected, timed-out, or merely socket-written events stay retryable. - When mesh bridge is enabled, public mesh messages not marked “nearby only” are signed under a per-cell Nostr identity and published to a neighborhood rendezvous geohash. Presence and public bridge traffic therefore expose a coarse area to relays and participants. - A bridge gateway can carry signed bridge/location events and opaque courier drops for nearby mesh-only peers. It cannot validly publish a neighbor's radio-only message because the author must first sign the bridge event. - Relays added by hand persist in local preferences (`nostr.customRelays`, at most 8, normalized on read) and are wiped on panic. An added relay names an operator someone chose to route through, so it is treated as sensitive local state rather than inert configuration. Custom `wss://` relays (and `ws://` or `wss://` `.onion` relays when Tor is active, as the bundled Arti build enables `onion-service-client` with `allow_onion_addrs(true)`) let users bypass filters blocking the four built-in clearnet hostnames. `TorURLSession` assigns distinct RFC 1929 SOCKS5 circuit-isolation contexts across Nostr relays, relay directories, Blossom media, Cashu mints, and push gateway traffic, rotating the isolation epoch on Tor rebuilds and panic wipes. - Fresh 2.x installs start in Everyday Mode with **Tor ON by default** (no network connection opens before the user uses an internet feature or chooses a mode in onboarding). Stealth Mode enforces fail-closed Tor routing. Upgrades from 1.x run `PrivacyModeSettings.migrateLegacyInstallIfNeeded()` before network startup, preserving each install's existing Tor behavior and RAM-only history until the user explicitly chooses a mode. Explicitly turning Tor off in Everyday Mode routes relay sockets, relay-directory fetches, Blossom media, Cashu mint requests, and push gateway registration directly, disclosing the device IP to each contacted server. The settings UI states this while the preference is off. Residual risk: Nostr relay, Blossom server, and Cashu mint retention and logging are outside project control. Public events may be copied indefinitely. Timing, coarse location, and participation can be correlated even when content is encrypted or per-cell identities are used. ## Location and Offline Crew Mode - When-in-use CoreLocation access computes geohash choices, bridge cells, friendly place labels, and opt-in Offline Crew Mode pins. Permission revocation stops live sampling and releases subscriptions. - Exact coordinates are never persisted to disk by bitchat and are never placed into public mesh, geohash, Place Feed, or bridge payloads. - **Offline Crew Mode (opt-in per private group, hard-disabled in Stealth Mode):** When a member explicitly shares a Crew Radar pin or attaches location to a Crew Check-In, exact coordinates (microdegree precision), accuracy, optional heading, battery %, and TTL (default 30 min) are sealed inside an Ed25519-signed ChaCha20-Poly1305 `GroupMessageEnvelope` and sent over BLE mesh and Nostr (per-member `kind 1059` gift wraps). Received pins live in RAM only (`CrewRadarStore`), auto-expire after their TTL, and clear immediately on Stealth Mode, group removal, or panic wipe. Check-in status text (without coordinates) is appended to the group timeline. - Selected/bookmarked geohashes, teleport flags, and display names persist in local preferences; a fine geohash can identify a small area. - Friendly place names use `CLGeocoder.reverseGeocodeLocation`. Apple may process the supplied location under its own privacy terms, so this operation is not accurately described as wholly on-device. - Automatic presence is limited to lower-precision geohashes; precise posts occur through user-selected channels, notes, notices, or the bridge behavior presented in the UI. ## Logging and Telemetry - In Release builds, all `SecureLogger` calls (`debug`, `info`, `warning`, `error`, and `SecurityEvent` logging) are compiled out to empty `@inlinable` stubs (`#if DEBUG`), and `bitchatNotificationServiceExtension`'s `NotificationService` logging is likewise `#if DEBUG`-only. In Debug builds, `SecureLogger` sanitizes likely secrets (`String.sanitized()`) before emitting to `os_log` and its debug-only in-memory ring buffer. - No project analytics or telemetry endpoint exists. - Apple system logs, Nostr relays, network providers, and nearby radios can still observe operational metadata outside the project's logging layer. ## Privacy Manifests `bitchat/PrivacyInfo.xcprivacy` declares: - Collected data types (for opt-in Background Notifications via Permissionless Tech's push gateway): `NSPrivacyCollectedDataTypeDeviceID` (APNs device token) and `NSPrivacyCollectedDataTypeUserID` (Nostr public key), both `NSPrivacyCollectedDataTypePurposeAppFunctionality`, `Linked = false` (*Data Not Linked to You*), `Tracking = false` - UserDefaults: `CA92.1` for app-only preferences and `1C8F.1` for the shared app group - File timestamps/metadata: `C617.1` for app-container files and `3B52.1` for user-granted files - System boot time: `35F9.1` for elapsed-time deadlines and timers `bitchatShareExtension/PrivacyInfo.xcprivacy` and `bitchatNotificationServiceExtension/PrivacyInfo.xcprivacy` each declare app-group UserDefaults reason `1C8F.1`, no tracking domains, and no direct data collection. All three manifests must remain bundled in their respective executable targets. ## Locked and Seized Devices The realistic compromise for many of the people this app is built for is not interception but a phone taken and, often, unlocked under coercion. - Notification content is rendered by the system on the lock screen, so it is readable without unlocking. Message previews are therefore hidden by default: alerts state that a direct message, mention, or location-channel activity arrived, and withhold the message body, the sender's nickname, and the geohash until the app is opened. `userInfo` still carries the routing peer ID and deep link, neither of which the system displays. The preference is `notifications.hideMessagePreviews`; turning it off restores full previews. In Stealth Mode, unsolicited nearby-peer alerts (`network-available`) are suppressed and any delivered nearby-peer alert is removed on activation so a nearby BLE advertiser cannot light up a locked screen without messaging you. Panic wipe removes bitchat's notifications from Notification Center and fences in-flight posts. That is removal, not erasure: the system can keep its own record of notifications it has shown, out of the app's reach, so with previews on their text can outlive the wipe. - App-switcher snapshot cover (`PrivacyScreen`): on by default (`bitchat.hideAppSwitcherScreen` defaults to `true`, opt-out for standard persisted chats in Everyday Mode when private history is enabled), and always on in Stealth Mode, whenever private history is RAM-only (`persistPrivateHistory == false`), whenever a per-conversation RAM-only (`.ephemeral`) chat is open or holds in-memory messages shown in the Chats inbox, while persisted disappearing timers are still loading (fail closed), and while sensitive Everyday sheets (`CrewRadarSheetView`, `IdentitySyncSheetView`) are presented. When active, an opaque placeholder covers each window synchronously on `didEnterBackground` (with synchronous layout before UIKit's snapshot pass) and is removed on `willEnterForeground` so temporary system overlays (Control Center, alerts) do not flash the cover and returning to bitchat does not stall. First launch after upgrading with the cover active (retrying on transient filesystem errors), enabling the cover, switching to Stealth Mode, disabling history persistence, switching a conversation to RAM-only (`.ephemeral`), and panic wipe all perform best-effort per-item cleanup of cached snapshots under both `Library/SplashBoard/Snapshots` and `Library/Caches/Snapshots` and call `ignoreSnapshotOnNextApplicationLaunch()`. - Lock-Screen Push-to-Talk (`SystemPTTChannelManager`): opt-in per session. Switching into Stealth Mode leaves any active Lock-Screen PTT channel so an unredacted Everyday Mode label does not linger on the Lock Screen or Dynamic Island; pinning Lock-Screen PTT while in Stealth Mode uses generic redacted channel and speaker labels rather than peer nicknames or group names. Panic wipe leaves both active and iOS-restored PTT channels and clears the in-memory channel-name restoration cache. - Clearing a mesh timeline erases the on-disk gossip archive behind it, so cleared public history is deleted rather than hidden. The echo watermark still suppresses pre-clear messages this device hears again from peers. - Managed media is bounded by age as well as size, so a received photo does not outlive its conversation indefinitely. Not addressed, and deliberately out of scope here: - **No duress mechanism.** There is no decoy passphrase, no wipe-on-failed-authentication, and no biometric or passcode lock on the app itself. A coerced unlock discloses everything the device still holds. Adding one is a product decision as much as an engineering one: in some jurisdictions destroying data on demand is itself an offence, so a mode that *hides* may protect someone better than one that *destroys*, and the choice should be made deliberately rather than by default. - **macOS gets no file-protection classes.** Every `FileProtectionType` application is inside `#if os(iOS)`; Data Protection on macOS additionally requires an entitlement. The Mac app also has no app-switcher equivalent. - **Media is not sealed at the app layer.** It relies on the platform default protection class, which is readable once the device has been unlocked since boot. Sealing under a key with the same accessibility would not change that; only a key gated on user authentication would, and that conflicts with receiving media while locked. ## Panic Wipe Coverage The panic action clears identity/session state, encrypted private chat history (`EncryptedHistoryStore`), preferences, location state, Offline Crew Mode pins and coordinate capture (`CrewRadarStore` / `LocationStateManager`), Tri-Band Radio state (`TriBandRadioCoordinator`: active UWB `NISession`s and RAM-only ranging samples, ephemeral P2P Wi-Fi listeners/connections, paired LoRa BLE radio connections, LoRa queues/dedup/reassembly buffers, and `TriBandRadioSettings`), groups, prekeys, outbox mail, courier mail, bridge dedup state, gossip archive, board data, Cashu wallet proofs/history, linked-device records, shared push extension Keychain/App Group state (`PushNotificationExtensionBridge`), managed media, hand-added relays, bitchat's notifications in Notification Center (removal only; see Locked and Seized Devices), and active subscriptions/transports, while calling `unregisterForRemoteNotifications()` synchronously and dispatching a pre-signed best-effort `/v1/unregister` revocation to the push gateway. Managed media deletion completes synchronously, after active media work has been invalidated. In Stealth Mode (and on 1.x upgrades until changed), triple-tapping the top header bar triggers the panic confirmation dialog and panic reset preserves the Stealth/Tor posture rather than reverting to disk-persisted Everyday Mode. Keychain secrets use device-only accessibility, and an install marker detects and clears app keys that survive uninstall before a later reinstall can use them. New persistent stores must add an explicit wipe hook and a regression test. ## Release Review Checklist - Reconcile every new Application Support, UserDefaults, keychain, cache, push gateway, or relay write with this assessment and `PRIVACY_POLICY.md`. - Re-scan required-reason APIs and validate all three bundled `PrivacyInfo.xcprivacy` files (`bitchat`, `bitchatShareExtension`, `bitchatNotificationServiceExtension`) before archive submission. - Verify panic wipe reaches any newly added persistent store. - Treat geohash precision, bridge-cell changes, new relay tags, and announce fields as privacy-surface changes. - Re-run real-device Bluetooth, background/locked-device recovery, location revocation, and audio-route checks; simulators cannot validate the physical side of those behaviors. - Check what a new notification discloses on a locked screen, and that the app-switcher snapshot is covered, whenever notification or scene-lifecycle code changes.