Chat protocol for secure communication over a mesh network over the internet.
Routing Across the Mesh Network
Message Types
Server/Node List Sync
Require Commands
Clients have been built in multiple languages. Interpretations between these clients are very unique, but the mesh-chat
protocol is always consistent.
- PyÑa Colada v0.9.0 (Python 3.4)
- Spiced Rumby (Ruby 2.3), based on MeshChat Core (Ruby 2.3)
- Otra Vez Gose (Go 1.6.2)
- Mule (Node.js)
- Emberclear (Ember 3.17)
There is currently only one server-side relay. All clients can connect to this server. Many instances of this server across the internet are vital to the survival of a mesh-network and allow p2p communication across the globe.
- mesh-relay (Ruby on Rails 5)
The client is responsible for sending all messages to servers. It is only permitted to send messages on its own behalf, and not for any other party. It will keep track of the active list of authorized servers.
The server is responsible for configuration of authorized servers and handling of all message receipts. When a message arrives, it is then relayed to the local client for display. In Milestone 2, the server will also handle authorization and server exchange.
Each message will be a serialized JSON hash. Every hash must include:
{
type: <MessageClassName>, # This will tell each client how to read the rest of the keys
client: <String>, # name of the client that sent the message
client_version: <String>, # version of the client that sent the message
time_sent: <UTC DateTime String>, # time at the packaging of this message
sender: {
name: <String>,
location: <IpAddress>,
uid: <String> # Uinque ID generated by your client
},
message: <Indeterminant> # Variable type, can be string or json object (see below)
}
A receiving client deserializes the JSONized hash, and can do whatever with it.
mesh-chat
applications should use the NaCl library's public key encryption algorithms. Nodes which are new to the system must generate a public/private key pair, and have imported one other node's identity before it can begin participating in the mesh network.
Note that NaCl is an opinionated crytography library whos public key encryption consists of
Encryption: XSalsa20 stream cipher Authentication: Poly1305 MAC Public Keys: Curve25519 high-speed elliptic curve cryptography
See the RbNaCl public key encryption overview for details, explanation and usage.