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)LengthFieldDescription
0 - 120xF1CAGhostMesh Protocol Header
2 - 98route_hashEphemeral target recipient identifier
10 - 2920payload_cipherEncrypted AES-GCM segment slice
301ttl_hopRemaining hop counts