Skip to content

cryptopeer.net

Open-source P2P libraries for Dart, Go and TypeScript

Secure peer-to-peer networking, from transport to messaging.

Connect devices directly, with no central server in the path. cryptopeer provides a UDP transport, a complete libp2p stack for Dart and Flutter, and store-and-forward messaging for peers that are offline.

pubspec.yamldart_libp2p: ^3.0.0
main.dart
const udx = '/ip4/0.0.0.0/udp/0/udx';
final a = await createHost(listen: udx);
final b = await createHost(listen: udx);
// Authenticated with Noise, multiplexed over UDX
await a.connect(AddrInfo(b.id, b.addrs));
print('Connected to ${b.id}');

Three families of libraries. Each builds on the one below it, and each can be used on its own.

The same stack exists in Dart and in Go. A Flutter app and a Go server speak the same transport and protocols, so they connect directly. In Node.js, js-udx brings the UDX transport to js-libp2p, so js-libp2p nodes join them.

LayerDartGoTypeScript
ApplicationsRicochet clientRicochet servergo-p2p-forge
ProtocolsGossipSubKademlia DHTBitswapMerkle-CRDTgo-libp2p pubsub, kad-dht upstreamjs-libp2p pubsub, kad-dht upstream
libp2pdart_libp2pgo-libp2p upstreamjs-libp2p upstream
Transportdart_udxgo-udxUDX transportjs-udx
NetworkUDP, secured with Noise. Dart, Go and Node.js peers connect to each other directly.

Authenticated by default

Every peer is an Ed25519 key. Each connection runs a Noise handshake that proves both identities, with no accounts or certificate authorities.

Built for mobile networks

Phones sit behind carrier NATs and change networks mid-session. Connection migration, relays and hole punching keep them reachable.

Delivery when peers are offline

Ricochet servers hold messages and documents for peers that are offline. Payloads can be end-to-end encrypted so the server never reads them.

Dart, Go and TypeScript interoperate

All three share the wire formats. Where the formats must match byte for byte, the repositories test against the same vectors, and against each other over real UDP.

Built by Stephan Februarygithub.com/stephanfebLinkedIn