The Dart libp2p stack
dart_libp2p is a libp2p implementation in pure Dart, so the same peer code
runs in a Flutter app, a CLI tool or a server. It speaks the libp2p wire
protocols, so a Dart peer can connect directly to a go-libp2p peer.
dependencies: dart_libp2p: ^2.0.0The core
Section titled “The core”| Layer | What ships |
|---|---|
| Transports | TCP and UDX |
| Security | Noise |
| Multiplexing | Yamux |
| Connectivity | Circuit Relay v2, AutoRelay, hole punching, mDNS discovery |
| Core protocols | Ping, Identify |
| Operations | Resource manager, peerstore, event bus |
Getting startedCreate two hosts and connect them.
ArchitectureHost, swarm, upgrader, transports: how the layers fit.
Circuit Relay v2Run a relay, and reach peers behind NAT.
CookbookRecipes for common tasks.
Built on top
Section titled “Built on top”| Package | What it does |
|---|---|
dart_libp2p_pubsub |
GossipSub v1.1, FloodSub and RandomSub, with peer scoring and message validation |
dart_libp2p_kad_dht |
Kademlia DHT for peer routing, content routing and signed records, with client, server and auto modes |
dart_libp2p_bitswap |
Bitswap 1.2.0: exchange content-addressed blocks with peers |
merkledag |
Merkle-CRDTs: Merkle-DAGs combined with CRDTs for strong eventual consistency |
dart_libp2p_merkle_crdt |
Replicates Merkle-CRDTs across peers, announcing heads over GossipSub and fetching DAG nodes over streams |