#instant-messaging #node #protocols #encryption #distributed #client #networking

bin+lib zacstewart/comm

A hypothetical, distributed, encrypted, instant messaging protocol

1 unstable release

Uses old Rust 2015

0.1.0 Feb 14, 2018

#7 in #instant-messaging

61 stars & 4 watchers

250KB
5.5K SLoC

Comm

A hypothetical, distributed, encrypted, instant messaging protocol.

Project Goals

  • No centralized server
  • Messages should be stored in the network for some reasonable amount of time until recipient is available
  • It should be difficult for an adversary to silence a participant (prevent them from sending messages)
  • It should be difficult for an adversary to deafen a participant (prevent them from receiving messages)

What the what

  1. Client relays a message to the network
  2. Network nodes store and re-relay messages they receive
  3. Network nodes drop messages that they've relayed for a reasonable amount of time, and a reasonable number of times
  4. Recipient finally gets message, relays acknowledgement
  5. Network nodes drop messages after verifying their acknowledgement
  6. Network nodes re-relay acknowledgement to nodes that need to stop relaying the message

Please read the protocol for a more detailed overview.

Development

comm targets Rust stable (currently 1.30). It depends on protobuf being installed.

Usage

You can fire up a CLI chat client by running

cargo run comm -- $SECRET 0.0.0.0:$PORT [1.2.3.4:$OTHER_NODE_PORT]

Where SECRET is a word that will be SHA1 hashed into your node's address, PORT is the local port you want to run on, and then third argument is the address and port of another node. This other node is a "bootstrap node" and will be your entrypoint into the network. It can be another comm client running without a bootstrap router of it's own.

An interactive CLI will start, and you can send a message to another node by entering its address, followed by a message:

44751799925b964a00bae3863cc4236f9bb8d519 Hi there!

Documentation

Documentation is still forthcoming, but many of the modules have doc comments. I'm still trying to figure out a good way to host rust docs out of GitHub Pages.

Similar Projects

Dependencies

~29–40MB
~766K SLoC