// the find
libp2p/rust-libp2p
The Rust Implementation of the libp2p networking stack.
The Rust implementation of libp2p — the peer-to-peer networking stack used by IPFS, Ethereum (Lighthouse), Polkadot/Substrate, and a dozen other blockchain projects. It handles transport negotiation, multiplexing, peer identity, and application protocols (Kademlia DHT, gossipsub, relay, hole-punching) behind a `NetworkBehaviour` trait. This is the library you reach for when you need serious P2P networking in Rust and don't want to invent it yourself.
The layered architecture (core → transport → muxer → swarm → protocol) is genuinely clean — each layer has a well-defined trait boundary, so you can swap yamux for mplex or add QUIC without touching application code. QUIC transport is first-class, not bolted on, which matters for NAT traversal in 2026. The interop test suite runs against other libp2p implementations (Go, JS) in CI, so cross-language compatibility bugs get caught before release. Production adoption across Lighthouse, Substrate, and Forest means the panic-in-production edge cases have largely been found and fixed already.
The `NetworkBehaviour` derive macro and `ConnectionHandler` trait have a steep learning curve — the ping example is simple but anything real requires understanding the `ToSwarm` event model, which isn't intuitive and the docs don't bridge the gap well. Only two listed maintainers for a codebase this size is a bus-factor concern; PR velocity has historically been slow for non-blockchain-ecosystem contributors. mplex is still present but effectively deprecated in favor of yamux — the deprecation is soft and underdocumented, so new users still reach for it. WebRTC browser transport works but is experimental and the API surface changes across minor versions without much warning.