DEV Community

Cover image for ---
Michael Muriithi
Michael Muriithi

Posted on

---

title: "Why We Built GhostWire: Infrastructure for Human Dignity"
published: false
tags: rust, p2p, opensource, privacy

description: "A decentralized, censorship-resistant communication mesh built in Rust. No servers. No owners. Built for when the internet goes dark."

The internet was supposed to be decentralized. Instead, we got walled gardens that can shut you off with a button press.

GhostWire started with a question: what happens when the infrastructure you depend on decides you shouldn't exist?

The Problem

Every major communication platform has the same failure mode. Centralized servers mean centralized control. Account bans, API restrictions, DNS blocks, payment cuts — the list of pressure points is long and well-documented.

This isn't hypothetical. It happens to activists, journalists, dissidents, and ordinary people in authoritarian regimes. It happens during natural disasters when cell towers go down. It happens when a platform changes its terms of service overnight.

The tools that exist today have tradeoffs:

  • Signal/WhatsApp: E2E encrypted, but centralized servers. Blockable.
  • Briar: P2P, works over Tor, but limited transport options.
  • Meshtastic: LoRa mesh, but range-limited and no encryption by default.
  • Tor: Anonymous routing, but needs internet infrastructure.

GhostWire doesn't replace these. It fills a gap none of them cover: a full-stack communication protocol that works over any transport, routes around damage, and can't be turned off.

What GhostWire Actually Is

GhostWire is a protocol, not an app. Think of it as the TCP/IP of mesh communication — a stack that other tools build on top of.

The stack has five layers:

┌─────────────────────────────────────┐
│         Application Layer           │
│    (apps built on GhostWire)        │
├─────────────────────────────────────┤
│         Crypto Layer                │
│  XChaCha20-Poly1305 + ML-KEM-768   │
├─────────────────────────────────────┤
│         Routing Layer               │
│  Sphinx onion routing + AI routing  │
├─────────────────────────────────────┤
│         Transport Layer             │
│  TCP, WebRTC, BLE, LoRa, obfs4     │
├─────────────────────────────────────┤
│         Network Layer               │
│  Delay-tolerant epidemic routing    │
└─────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Each layer is independent. You can swap transports without touching the crypto. You can change routing algorithms without rearchitecting the application layer.

The Design Principles

1. No servers. Ever.

Every node is equal. There's no master, no coordinator, no bootstrap server that can be seized. Discovery happens through mDNS on local networks and through relay nodes on the internet — but relay nodes are stateless and can't censor content.

2. Work with what you have.

GhostWire doesn't assume you have a fast, stable internet connection. It works over Bluetooth when you're in the same room. It works over LoRa when you're miles apart. It works over Tor when you need anonymity. It works over the internet when it's available.

If one transport fails, it automatically falls back to another. If all transports fail, it stores messages and delivers them when connectivity returns (delay-tolerant networking).

3. Cryptography is not optional.

Every message is encrypted. Every key exchange is forward-secret. Post-quantum key exchange is built in, not bolted on. There's no "send unencrypted" option because there shouldn't be one.

4. Coercion resistance.

A duress PIN wipes the device. A panic mode destroys all keys. A dead man's switch can automatically delete data if you don't check in. These aren't edge cases — they're core features for people who actually need them.

Why Rust

We evaluated Go, Zig, and C++ before choosing Rust.

The decision came down to three things:

  1. Memory safety without garbage collection. Mesh networking means running on constrained devices (ESP32, Raspberry Pi). GC pauses cause dropped packets.
  2. The type system catches entire classes of bugs at compile time. When your routing layer handles onion-encrypted packets across unreliable transports, you want the compiler catching null pointers and data races.
  3. The ecosystem. tokio for async networking, x25519-dalek for key exchange, aes-gcm for authenticated encryption, sphinx-packet for onion routing. The crates exist and they're audited.

What's Next

GhostWire is at v0.2.0. The core protocol is functional. The cryptographic stack is implemented. The transport layer handles TCP, WebRTC, BLE, LoRa, and obfs4.

What we're building next:

  • Phase 2: Mesh topology optimization — gossipsub-based peer discovery, adaptive routing
  • Phase 3: Application protocols — messaging, file transfer, voice
  • Phase 4: Hardware integration — ESP32 firmware for dedicated mesh nodes

The code is open source under AGPL-3.0. If this kind of infrastructure matters to you, we'd love your help.

GitHub: github.com/Phantomojo/GhostWire-secure-mesh-communication

Website: ghostwire.cc


Built from Nairobi, under RVC.

Top comments (0)