# libp2p/rust-libp2p

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/libp2p-rust-libp2p).**

5,556 stars · 1,228 forks · Rust · MIT

## Links

- GitHub: https://github.com/libp2p/rust-libp2p
- Homepage: https://libp2p.io
- awesome-repositories: https://awesome-repositories.com/repository/libp2p-rust-libp2p.md

## Topics

`decentralization` `libp2p` `networking` `peer-to-peer` `rust`

## Description

rust-libp2p is a modular peer-to-peer networking library written in Rust, implementing the libp2p specification. It provides a composable stack of transport, security, and discovery protocols that can be mixed and matched to build decentralized applications, with a central swarm manager coordinating all active connections, protocol negotiation, and peer lifecycle.

The library distinguishes itself through a pluggable transport abstraction that supports TCP, QUIC, WebSocket, WebRTC, and WebTransport, enabling cross-platform operation across browsers, mobile devices, and servers. It secures every connection by default using Noise-based authenticated encryption or TLS 1.3, and provides decentralized peer discovery through Kademlia DHT, mDNS, and rendezvous points without central coordination. NAT traversal and circuit relay connectivity allow peers behind firewalls and routers to establish direct connections, while UPnP automatic port mapping makes peers reachable from the internet.

The stack includes GossipSub mesh propagation for scalable publish-subscribe messaging, multiplexed stream muxing for running multiple logical substreams over a single transport connection, and multiaddress network addressing for identifying peers and their locations. It supports custom protocol implementation on top of the swarm, request-response messaging, peer ping for connectivity checks, and metrics export in OpenMetrics format. The library also enables browser-to-browser P2P connections, light client node operation, and resource-constrained device deployment.

## Tags

### DevOps & Infrastructure

- [libp2p Implementations](https://awesome-repositories.com/f/devops-infrastructure/release-automation/plugin-extensibility/plugin-extensible-runtimes/go-implementations/libp2p-implementations.md) — The Rust port of the libp2p specification, providing peer identity, multiaddresses, and protocol multiplexing.
- [Cross-Platform Runtimes](https://awesome-repositories.com/f/devops-infrastructure/cross-platform-deployments/cross-platform-runtimes.md) — Operates across browsers, mobile devices, and servers with support for multiple transport protocols. ([source](https://libp2p.io))

### Networking & Communication

- [Modular](https://awesome-repositories.com/f/networking-communication/network-stacks/modular.md) — Provides a modular peer-to-peer networking stack with composable transport, security, and discovery protocols.
- [Peer-to-Peer Networking Libraries](https://awesome-repositories.com/f/networking-communication/peer-to-peer-networking-extensions/peer-to-peer-networking-libraries.md) — Provides a modular P2P networking library with interchangeable transport, security, and discovery protocols. ([source](https://libp2p.io/docs/))
- [Publish-Subscribe Messaging](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/messaging-notification-systems/messaging-services/message-broker-infrastructure/publish-subscribe-messaging.md) — Implements GossipSub mesh propagation for scalable publish-subscribe messaging across the peer-to-peer network. ([source](https://libp2p.io/docs/))
- [Transport Negotiators](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/communication-protocols-standards/transport-protocols/transport-negotiators.md) — Negotiates and selects the best transport protocol for each peer connection environment. ([source](http://libp2p.io/))
- [Connection Multiplexing](https://awesome-repositories.com/f/networking-communication/connection-multiplexing.md) — Provides multiplexed stream muxing to run multiple logical substreams over a single transport connection. ([source](https://cdn.jsdelivr.net/gh/libp2p/rust-libp2p@master/README.md))
- [GossipSub Protocols](https://awesome-repositories.com/f/networking-communication/mesh-networking/gossipsub-protocols.md) — Implements the GossipSub protocol for scalable publish-subscribe messaging in blockchain networks.
- [Multi-Transport Connectivity](https://awesome-repositories.com/f/networking-communication/multi-network-connectivity-tools/multi-transport-connectivity.md) — Connects peers over TCP, QUIC, WebSocket, WebRTC, and WebTransport transports. ([source](https://libp2p.io))
- [NAT Traversal Mechanisms](https://awesome-repositories.com/f/networking-communication/nat-traversal-mechanisms.md) — Traverses NATs using hole punching, automatic detection, and circuit relay fallback. ([source](https://libp2p.io))
- [Pluggable Transport Backends](https://awesome-repositories.com/f/networking-communication/network-transport-protocols/pluggable-transport-backends.md) — Provides a pluggable transport abstraction supporting TCP, QUIC, WebSocket, WebRTC, and WebTransport.
- [Swarm Managers](https://awesome-repositories.com/f/networking-communication/peer-connection-management/swarm-managers.md) — Provides a central swarm manager that coordinates all active connections, protocol negotiation, and peer lifecycle.
- [Peer-to-Peer Networking](https://awesome-repositories.com/f/networking-communication/peer-to-peer-networking.md) — Locates peers and routes messages without relying on a central directory or server. ([source](https://libp2p.io/docs/))
- [Pluggable Transport Connections](https://awesome-repositories.com/f/networking-communication/peer-to-peer-networking-extensions/peer-to-peer-networking-libraries/pluggable-transport-connections.md) — Opens and manages raw peer connections using pluggable transport protocols like TCP. ([source](https://cdn.jsdelivr.net/gh/libp2p/rust-libp2p@master/README.md))
- [Peer Discovery](https://awesome-repositories.com/f/networking-communication/peer-to-peer-networking/peer-discovery.md) — Discovers peers via DHT, mDNS, and rendezvous points without a central registry. ([source](https://libp2p.io/docs/getting-started/))
- [Decentralized Discovery Methods](https://awesome-repositories.com/f/networking-communication/peer-to-peer-networking/peer-discovery/decentralized-discovery-methods.md) — Ships Kademlia DHT, mDNS, and rendezvous point discovery for finding peers without central servers.
- [Peer Data Stream Exchanges](https://awesome-repositories.com/f/networking-communication/peer-to-peer-networking/peer-discovery/peer-list-exchange/peer-data-stream-exchanges.md) — Exchanges arbitrary data streams between peers over multiplexed connections. ([source](https://libp2p.io/docs/getting-started/))
- [Distributed Hash Table Discovery](https://awesome-repositories.com/f/networking-communication/peer-to-peer-protocols/http-to-p2p-translation/distributed-hash-table-discovery.md) — Implements a Kademlia-based distributed hash table for decentralized peer discovery and provider records.
- [Stream Multiplexers](https://awesome-repositories.com/f/networking-communication/stream-multiplexers.md) — Implements stream multiplexing to run multiple logical substreams over a single transport connection.
- [Swarm-Based Coordination](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/connection-state-management/swarm-based-coordination.md) — Coordinates transports, protocols, and peer connections through a central swarm manager. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))
- [TCP Transport Connections](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/tcp-client-connections/webassembly-tcp-connections/tcp-transport-connections.md) — Establishes reliable connections between peers using the TCP transport protocol. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))
- [Secure P2P Connection Establishment](https://awesome-repositories.com/f/networking-communication/webrtc-media-orchestration/peer-connectivity/secure-p2p-connection-establishment.md) — Encrypts and authenticates all connections using Noise or TLS 1.3 with automatic certificate management.
- [Multi-Transport Frameworks](https://awesome-repositories.com/f/networking-communication/websocket-transports/multi-transport-frameworks.md) — Supports TCP, QUIC, WebSocket, WebRTC, and WebTransport for cross-platform peer connectivity.
- [Connection Upgraders](https://awesome-repositories.com/f/networking-communication/connection-management/websocket-connection-managers/connection-upgraders.md) — Applies protocol negotiation and encryption to upgrade raw connections or substreams. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))
- [Custom Protocol Implementations](https://awesome-repositories.com/f/networking-communication/custom-protocol-implementations.md) — Supports custom protocol implementation on top of the swarm by defining network behaviours and connection handlers. ([source](https://cdn.jsdelivr.net/gh/libp2p/rust-libp2p@master/README.md))
- [Browser-Based Connectivity](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/peer-to-peer-networking/browser-based-connectivity.md) — Enables browser-to-browser P2P connections using WebRTC, WebTransport, and circuit relaying. ([source](https://libp2p.io/reports/annual-reports/2025/))
- [mDNS Service Discovery](https://awesome-repositories.com/f/networking-communication/mdns-service-discovery.md) — Discovers nearby peers on the local network using multicast DNS announcements. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))
- [Multiaddress Formats](https://awesome-repositories.com/f/networking-communication/network-address-formats/multiaddress-formats.md) — Provides a multiaddress format for identifying peers and their locations in the network.
- [Automatic Port Mapping](https://awesome-repositories.com/f/networking-communication/network-port-configuration/automatic-port-mapping.md) — Supports automatic port mapping via UPnP to make peers reachable from the internet without manual configuration.
- [Peer Metadata Exchanges](https://awesome-repositories.com/f/networking-communication/peer-to-peer-networking/peer-discovery/peer-metadata-exchanges.md) — Exchanges peer metadata including public keys and supported protocols after connection. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))
- [Rendezvous Point Discovery](https://awesome-repositories.com/f/networking-communication/peer-to-peer-networking/peer-discovery/rendezvous-point-discovery.md) — Uses rendezvous points for peers to register and discover each other without central coordination. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))
- [GossipSub Mesh Propagation](https://awesome-repositories.com/f/networking-communication/pubsub-message-propagation/gossipsub-mesh-propagation.md) — Implements GossipSub mesh propagation for scalable publish-subscribe messaging in blockchain networks. ([source](https://libp2p.io/reports/annual-reports/2025/))
- [Circuit Relay Hosting](https://awesome-repositories.com/f/networking-communication/remote-access-control/relay-server-management/circuit-relay-hosting.md) — Provides circuit relay functionality to route traffic between peers that cannot connect directly. ([source](https://libp2p.io/reports/annual-reports/2025/))
- [Circuit Relay Connections](https://awesome-repositories.com/f/networking-communication/webrtc-media-orchestration/peer-connectivity/circuit-relay-connections.md) — Routes traffic through an intermediary node to connect peers that cannot directly reach each other. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))

### Data & Databases

- [Encrypted Connections](https://awesome-repositories.com/f/data-databases/database-connectivity/encrypted-connections.md) — Secures every peer connection by default using Noise or TLS 1.3 encryption protocols. ([source](https://libp2p.io))
- [Peer-to-Peer](https://awesome-repositories.com/f/data-databases/redis-clients/cluster-connectivity/message-broker-connectivity/mqtt-broker-connections/websocket-connections/peer-to-peer.md) — Provides WebSocket transport for browser-based peer-to-peer connections. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))

### Security & Cryptography

- [Noise Protocol Handshakes](https://awesome-repositories.com/f/security-cryptography/encrypted-tunneling-protocols/noise-protocol-handshakes.md) — Implements the Noise protocol framework for authenticated key exchange and encrypted peer-to-peer data transport. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))
- [Noise Protocol Frameworks](https://awesome-repositories.com/f/security-cryptography/key-agreement-protocols/noise-protocol-frameworks.md) — Secures all connections using the Noise protocol framework for authenticated key exchange and encrypted transport.
- [Peer Communication Security](https://awesome-repositories.com/f/security-cryptography/network-infrastructure-security/peer-communication-security.md) — Authenticates peers using public-key cryptography and encrypts all traffic with modern cryptographic algorithms. ([source](https://libp2p.io/docs/))
- [SSL/TLS Connection Security](https://awesome-repositories.com/f/security-cryptography/ssl-tls-connection-security.md) — Encrypts and authenticates all traffic using noise handshakes or TLS to prevent eavesdropping and tampering. ([source](https://libp2p.io/docs/getting-started/))
- [Automatic TLS Negotiations](https://awesome-repositories.com/f/security-cryptography/ssl-tls-connection-security/automatic-tls-negotiations.md) — Automatically negotiates TLS certificates for browser-native peer-to-peer connectivity without manual setup. ([source](https://libp2p.io/reports/annual-reports/2025/))
- [Transport Layer Encryption](https://awesome-repositories.com/f/security-cryptography/transport-layer-encryption.md) — Upgrades raw transports with authenticated encryption and compression to secure peer communications. ([source](https://cdn.jsdelivr.net/gh/libp2p/rust-libp2p@master/README.md))

### Web Development

- [Encrypted Peer-to-Peer Transfers](https://awesome-repositories.com/f/web-development/peer-to-peer-transfer-engines/encrypted-peer-to-peer-transfers.md) — Encrypts and authenticates all peer traffic using Noise protocol or TLS 1.3 by default.

### Software Engineering & Architecture

- [Request-Response Exchanges](https://awesome-repositories.com/f/software-engineering-architecture/request-response-exchanges.md) — Provides a request-response messaging protocol for exchanging messages over dedicated streams between peers. ([source](https://libp2p.github.io/rust-libp2p/libp2p/))
