Friends

P2P chat powered by the web

What?

Friends is like Slack except P2P, offline friendly and open source. We transmit data over secure channels and authenticate messages. It's made by a group of open source developers who are motivated to make a public chat platform that is easy to use but isn't centrally controlled, and where data is owned by its users.

It's a work in progress, but give it a go if this sounds interesting! :-) Note: It requires a `git clone` and `npm install` at the moment.

Messages are not end-to-end encrypted, and this is not an anonymous system. See below for more details. We use the term 'secure' here to mean that we do not use plaintext transports.

View on GitHub

How does it work?

If you use Github, you're already logged in when you open the app. It uses your .gitconfig to find your email and github username. When you send messages, they're signed with your SSH key. Other users verify that messages are really from you by checking your list of public keys on Github (example: here are my public keys).

We connect to peers over WebRTC for reliable connectivity across NATs. We also want to build a browser client so it's easy for users to pop into a channel without installing anything :-) Using WebRTC means that web peers are just like desktop clients.

All the data for the channels/rooms you've joined is replicated using hyperlog, a merkle DAG that replicates based on scuttlebutt logs. It's a gossip protocol, so your messages can still reach people you're not connected to, as long as there's a path through the network to them. You don't need to be directly connected to someone to talk to them. Messages are "gossiped" around the network until everyone has received the message.

What if there's no Internet connection?

We support multicast DNS, also known as Bonjour, to send messages to anyone on your local network.

What if there's no Wi-Fi router?

Or what if your friend's device isn't on the same network? We support BlueTooth Low Energy, so you can just send messages / transfer files to anyone physically near you. (this is still a proof-of-concept, working on it)

We connect over all transports and just use the best one.

If a few folks are physically near each other and go offline together, they can continue to chat over mDNS or BlueTooth LE and their messages will be merged back into the channel when they reconnect with the rest of the network.

Is it end-to-end encrypted?

Not yet, but we want to add support in the future when solid approaches emerge. There are many schemes for encrypted private chat groups that you can build on top of Friends.

What if I can't connect to anyone?

P2P apps are great until you can't find another peer. To ensure there is always a peer to connect to we make it easy to run server-side "peer bots" that simply act as seeds in a channel. Peer bots are like servers in that they are publicly accessible on the Internet so there is no NAT traversal needed.