Protocol Specifications
Detailed protocols covering key exchanges and envelope data schemas.
1. X3DH Key Agreement
Extended Triple Diffie-Hellman (X3DH) establishes a shared session key between two nodes directly without an online directory server. Proximity key handshakes happen using Bluetooth advertisements containing prekey bundles.
2. Serverless Double Ratchet
Once keys are exchanged, messages are encrypted using the double-ratchet model, generating new ephemeral keys for every single message. Because no server tracks logs, nodes use an out-of-order queue mapping transaction hashes to prevent packet loss.
3. BLE Frame Specifications
To fit inside standard BLE advertisement limits, GhostMesh packets are compressed into 31-byte advertising payload slices. The payload layout is strictly packed:
| Offset (Bytes) | Length | Field | Description |
|---|---|---|---|
| 0 - 1 | 2 | 0xF1CA | GhostMesh Protocol Header |
| 2 - 9 | 8 | route_hash | Ephemeral target recipient identifier |
| 10 - 29 | 20 | payload_cipher | Encrypted AES-GCM segment slice |
| 30 | 1 | ttl_hop | Remaining hop counts |