Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Project516/p2p-chat/llms.txt

Use this file to discover all available pages before exploring further.

p2p-chat lets two people chat directly over TCP with end-to-end encryption. There is no central server, no sign-up, and no message storage — just two peers connecting directly, with every message encrypted using NaCl box (X25519 key exchange + XSalsa20-Poly1305 authenticated encryption).

Quickstart

Install Go and start chatting in under two minutes.

CLI reference

Every command, subcommand, and in-chat slash command documented.

Encryption

Learn how NaCl box keeps every message private and authenticated.

Architecture

Understand the host/connect model and message framing internals.

Key features

No central server

Peers connect directly over TCP. Nothing is routed through a third party.

End-to-end encrypted

NaCl box encrypts every message with a per-session shared key derived via X25519.

Ephemeral keys

A fresh key pair is generated for every connection — no key material persists to disk.

Simple CLI

Two subcommands (listen and connect) and four in-chat slash commands cover everything.

How it works

One peer runs listen to wait for an incoming connection. The other runs connect to dial in. Once the TCP connection is established, both sides perform an X25519 key exchange and derive a shared encryption key before any chat messages are sent.
1

Host starts listening

Run go run . listen localhost:5555 to bind a TCP listener on the chosen address.
2

Peer connects

Run go run . connect localhost:5555 to dial the host.
3

Keys are exchanged

Both sides generate an ephemeral X25519 key pair, exchange public keys, and derive a shared NaCl box key. No key touches disk.
4

Chat begins

Every message is encrypted before it leaves your machine and decrypted on arrival. Use /nick, /help, /version, or /quit at any time.

License

p2p-chat is released under the AGPL-3.0 license.

Build docs developers (and LLMs) love