
End-to-end encrypted messaging across five languages. No infrastructure required to get started.
A single protocol for direct, encrypted communication between peers -- regardless of language or platform.
Rust, TypeScript, Go, Python, and PHP implementations that fully interoperate over the same wire protocol.
Noise XX handshake with Double Ratchet for forward secrecy. Encryption is always on, not opt-in.
Start peer-to-peer with zero servers. Add signaling and relay only when your deployment needs it.
Pair two nodes, establish a session, and start sending messages.
use cairn_p2p::{Node, CairnConfig, create};
let node = create(CairnConfig::default())?;
node.start().await?;
let pairing = node.pair_generate_pin().await?;
println!("PIN: {}", pairing.pin);
// Responder enters PIN, then:
let session = node.connect(&peer_id).await?;
session.send("chat", b"hello").await?;
import { Node } from 'cairn-p2p';
const node = await Node.create();
const { pin } = await node.pairGeneratePin();
console.log(`PIN: ${pin}`);
// Responder enters PIN, then:
const session = await node.connect(peerId);
await session.send('chat', Buffer.from('hello'));
import cairn "github.com/moukrea/cairn/packages/go/cairn-p2p"
node, _ := cairn.Create()
data, _ := node.PairGeneratePin()
fmt.Println("PIN:", data.Pin)
// Responder enters PIN, then:
session, _ := node.Connect(peerId)
session.Send("chat", []byte("hello"))
from cairn import create
node = await create()
data = await node.pair_generate_pin()
print(f"PIN: {data.pin}")
# Responder enters PIN, then:
session = await node.connect(peer_id)
await session.send("chat", b"hello")
use Cairn\Node;
$node = Node::create();
$data = $node->pairGeneratePin();
echo "PIN: " . $data->pin . "\n";
// Responder enters PIN, then:
$session = $node->connect($peerId);
$session->send('chat', 'hello');
Deploy what you need. Each tier builds on the previous one.