Skip to content
chrisballinger edited this page Oct 14, 2014 · 13 revisions

Bluetooth LE Mesh Chat Spec

All text fields are UTF-8 and padded with " " if shorter than the max length. All protocol data is always versioned, timestamped and signed in its entirety by your private key. For version 1, all data after the version byte is compressed with zlib before being sent over the wire.

All data packets follow this format:

[[version=1][timestamp=8][sender_public_key=32][data=n]][signature=64]
signature = sign(version + timestamp + sender_public_key + data, sender_private_key)

Definitions

Global

  • version: Spec version, 1 byte
  • timestamp: Current 64-bit Unix timestamp, 8 bytes
  • signature: 512-bit Ed25519 signature, 64 bytes
  • sender_public_key: Your 256-bit Ed25519 public key, 32 bytes
  • sender_private_key: Your 512-bit Ed25519 private key, 64 bytes

Identity

  • display_name: desired nickname, 35 bytes

Messaging

  • message: UTF-8 message body, 140 bytes
  • reply_signature: signature of message you're replying to, 64 bytes

Identity

Your identity is revealed on the first read to the identity characteristic. Subsequent reads give other people's identities signed by your own.

Your Identity (140-bytes):

[[version=1][timestamp=8][sender_public_key=32][display_name=35]][signature=64]

Propagated Identities (245-bytes):

[[version=1][timestamp=8][sender_public_key=32][others_identity=140]][signature=64]

Public Messages

If message is less than 140 characters, pad with " ". Messages without a reply can pad reply_signature with null bytes.

[[message=140][timestamp=8][reply_signature=64]][signature=64]

signature = sign(display_name + timestamp + reply_signature)

Public Replies

[[message=140][timestamp=8][original_signature=64]][signature=64][public_key=32]

Direct Messages

TBD

Clone this wiki locally