Skip to content

# [Feature Proposal] Four-Layer Mesh Architecture: BLE + LoRa + Tor + Nostr for Global Resilient Network #1062

Description

@Sbauermaner

Problem
BitChat currently works well in dense urban areas where many users have the app installed. However, the network dies wherever user density drops. A single user in a city cannot receive messages if there's no chain of BitChat nodes around them — even if millions of phones with Bluetooth are physically present.
Proposed Architecture
Four layers working together as one system:
Layer 1 — Local (no internet, no infrastructure)
BLE mesh: phone → phone, ~300m radius
Already in BitChat ✅

Layer 2 — Regional (no internet, hardware relay)
LoRa via Meshtastic: relay → relay, up to 10km
Already exists in Meshtastic ✅
BitChat → Meshtastic integration: partial ✅

Layer 3 — Anonymous global backbone (when internet available)
Tor → Nostr relays → other continent
Already in BitChat ✅

Layer 4 — Passive background relay
BLE advertiser/scanner running as Android foreground service
Starts on boot, invisible to user, minimal battery via BLE low power mode
NOT YET IMPLEMENTED ❌
The Key Insight
Layers 1, 2, and 3 already exist in BitChat or in compatible open source projects. The missing piece is Layer 4 — an always-on background relay that turns every installed device into an automatic node without the user actively opening the app.
This is architecturally similar to how Apple's Find My works — every device passively participates in relaying packets using a registered BLE UUID, without user interaction.
Prior Art — COVID Exposure Notifications
This architecture has already been proven at global scale. During COVID-19, Apple and Google implemented the Exposure Notifications system which:
Ran on every iOS and Android device without user interaction
Used BLE Advertisement with a registered UUID (0xFD6F) at OS level
Each device passively scanned and rebroadcast tokens in background
Required zero user action after initial permission grant
Consumed minimal battery via BLE low power mode
The technical mechanism is identical to what Layer 4 proposes. The difference:
COVID EN
BitChat Layer 4
Centralized — tokens sent to Apple/Google servers
Decentralized — packets relayed peer to peer
Single purpose — exposure detection
General purpose — message relay
Built into OS by Apple/Google
Implemented as always-on foreground service
Requires OS partnership
Works with public BLE API available to any app
The COVID system proved that BLE-based passive relay works reliably on billions of devices simultaneously. BitChat can achieve the same relay behaviour using the same public BLE APIs — without requiring OS-level integration.
Implementation Suggestion for Layer 4 (Android)
// 1. Register custom UUID for passive relay
val BITCHAT_RELAY_UUID = UUID.fromString("YOUR-UUID-HERE")

// 2. Boot receiver — start relay on device boot
class BootReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == Intent.ACTION_BOOT_COMPLETED) {
context.startForegroundService(
Intent(context, BitchatRelayService::class.java)
)
}
}
}

// 3. Passive relay logic
// Scan for packets with BITCHAT_RELAY_UUID
// If hop counter < MAX_HOPS → rebroadcast and forget
// No storage, no logging, pure relay
Result
Once critical mass is reached in a region — the network becomes impossible to shut down without physically removing every device. No servers. No central point of failure. Works during protests, blackouts, natural disasters.
The four layers together mean:
Local coverage — BLE between phones
City/regional coverage — LoRa relays
Cross-continent — Tor + Nostr when internet is available
Always on — passive background relay, zero user interaction required
References
Apple Find My network architecture
Google/Apple Exposure Notifications API specification
Meshtastic LoRa protocol

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions