← Sat, Nov 14 digest

How to Create Your Own Decentralized Messenger Protocol

read article ↗ hn thread ↗

A guide to designing a simplified, federated, end-to-end encrypted messaging protocol using HTTP, discovery files, HPKE, and server request signatures.

summary is enough It offers a clean architectural blueprint for a federated protocol, but the comments provide the real value by arguing for email-based alternatives.

summary

The article walks through building a toy federated chat protocol from scratch, covering domain-based identities, .well-known server discovery, HPKE encryption, and Ed25519 request signing. It strips away complex features to focus purely on the core mechanics of server-to-server text exchange. Commenters quickly note that existing systems like Delta Chat already achieve decentralized chat over SMTP without inventing a new protocol.

key points

  1. Federated protocols rely on domain-based user identities and .well-known JSON files to locate server endpoints and public keys.
  2. End-to-end encryption uses HPKE to encrypt message bodies with a per-message symmetric key wrapped in the recipient's public key.
  3. Server-to-server requests are authenticated using Ed25519 signatures over canonical request texts and body hashes to prevent spoofing and replays.

who should read it

Backend and protocol engineers interested in the mechanics of decentralized communication systems.

discussion mixed

consensus

Commenters widely agree that while the walkthrough is educational, inventing a custom protocol is unnecessary because email infrastructure already provides a robust, decentralized messaging layer.

pushback

A few commenters suggest alternative mesh or non-IP decentralization stacks like Reticulum and LXMF.

best comment by vidarh ↗

I find it funny that it starts with email and then proceed to dismiss it in favour of building a bunch of things from scratch.

I have used email as a decentralised messaging protocol for software.

It works just fine, and we got a lot for free, including queueing, retries, federated lookup etc.

And it made debugging so easy: Just Cc: messages, or send messages from your email client.

It underpinned part of the initial infrastructure for the demo registrar platform and the email forwarding for the .name top level domain.

It points out the humor in using email as the conceptual foundation only to discard it and build a custom protocol from scratch.

Generated by an LLM from the article and thread. Check the sources before relying on it.