VeilMesh Whitepaper
Version 1.3. Last updated: July 2026.
A deep dive into the zero-knowledge architecture, offline mesh routing protocols, and cryptographic primitives powering the VeilMesh core. Built for true privacy, network resilience, and uncensorable peer-to-peer communication.
1. Executive Summary & Philosophy
VeilMesh is a decentralized, privacy-first mesh messenger built with a secure Rust core. The philosophy driving VeilMesh is Zero-Trust & Zero-Knowledge. There is no central identity—users are identified strictly by their Ed25519 public keys, meaning no phone numbers, emails, or central registries are required. Our server architecture functions purely as a "blind relay" that routes opaque binary blobs and has zero cryptographic capability to read content. Furthermore, communication defaults to direct peer-to-peer (via WebRTC or local networks) whenever possible, bypassing central infrastructure entirely.
2. Network Topology & Trust Model
VeilMesh operates in a hybrid topology consisting of legitimate peers and an untrusted signaling server. When devices are physically proximate, packets are flooded via BLE or Local Wi-Fi. This Direct Mesh protocol is designed to withstand Sybil and Eclipse attacks by treating all incoming packets as untrusted until the cryptographic signature and Proof-of-Work (PoW) are validated. If direct communication is impossible, packets are wrapped in secure WebSockets and routed through the relay as a fallback.

3. Cryptographic Architecture
We employ industry-standard, auditable cryptographic primitives including Ed25519 (Signatures), X25519 (Key Agreement), and XChaCha20-Poly1305 (AEAD). Initial key exchange utilizes the Extended Triple Diffie-Hellman (X3DH) protocol for perfect forward secrecy and mutual authentication. Post-handshake, direct 1-on-1 messaging flows through the Double Ratchet Algorithm, ensuring Post-Compromise Security (PCS). For group conversations, VeilMesh utilizes the state-of-the-art Messaging Layer Security (MLS, RFC 9420) protocol via a native OpenMLS integration. MLS provides efficient E2EE group management, secure member additions/removals, and linear scaling for group chat state updates while maintaining strict forward secrecy and post-compromise security. Out-of-order delivery is handled correctly up to a strict skip limit, preventing memory exhaustion attacks.
4. Metadata Protection & Privacy Layers
While payload data is secured by end-to-end encryption, network-level privacy layers completely obfuscate metadata and defend against traffic analysis. VeilMesh integrates three primary defense mechanisms:
- Sealed Sender: Hides the sender's public key from the relay by wrapping it inside an encrypted envelope, making messages anonymous to transport intermediaries.
- VOPRF Rate Limiting (Ristretto255): Prevents spam on the relay without compromising user anonymity, using blind token signatures to decouple message delivery from user identities.
- Mesh Onion Routing & Guard Nodes: Off-grid multi-hop routing using layered AEAD encryption (X25519 + ChaCha20Poly1305) and dynamically rotated HMAC-SHA256 daily seeds. This ensures intermediate nodes only know their immediate predecessor and successor in the mesh path, hiding the network topology from passive observers.
- Proof-of-Work (PoW): Instantly rejects signature-verification spam packets at the edges of the network, dropping invalid frames in O(1) time.

5. Data at Rest
When the core runs on a physical device, all data must be protected against physical extraction. The local SQLite database storing chats and contacts is encrypted using SQLCipher. Crucially, the SQLCipher keys and the user's root Ed25519/X25519 private keys are stored entirely within the hardware-backed Secure Enclave (iOS) or Keystore (Android). Media attachments are symmetrically encrypted before transmission and remain encrypted on the local file system.
6. Censorship Circumvention & Future Proofing
With Sealed Sender, VOPRF rate limiting, and local Mesh Onion Routing fully active, VeilMesh's active roadmap focuses on bypassing state-level internet blocking and quantum resilience:
- Internet-Level Anti-Censorship (Medium-term): Integrating TLS 1.3 with Encrypted Client Hello (ECH) and lightweight VLESS/Shadowsocks traffic obfuscation inside the core. This will allow clients to connect to central relays by mimicking regular secure web traffic, bypassing ISP-level domain and IP blocking with minimal latency.
- Cooperative WebRTC Proxy Tunnels (Long-term): Enabling internet-connected users to act as decentralized bridges, tunneling traffic for censored users over standard WebRTC streams that cannot be blocked without disrupting public calling infrastructure.
- Post-Quantum Cryptography (PQC): Preparing for "Store Now, Decrypt Later" quantum threats by planning hybrid key encapsulation mechanisms (X25519 + ML-KEM) to guarantee long-term confidentiality.