The project aims to implement libp2p to unlock building .NET peer-to-peer applications using a battle-tested specification of network communication of the new age.
The docs from the application developer perspective: quick start, sessions, discovery, and pubsub. As a libp2p protocol implementer, you may be interested in more advanced tutorials. You can rewire and reconfigure the library in any way you want!
Contributions are welcome, kindly check the issues tab, everything there if not assigned to a person can be taken into work. More details in CONTRIBUTING.md.
dotnet add package Nethermind.Libp2pgit clone https://github.com/NethermindEth/dotnet-libp2p.git
cd ./dotnet-libp2p/
dotnet build
dotnet testThe root solution builds the shipping libraries and Core unit tests. Other test runners, sample applications, and benchmarks have separate solutions so they do not load or build with the default entry point. CI combines all three solutions before restore, build, and test discovery.
The MAUI chat sample is visible in the samples solution but excluded from its default restore and build. Only building that sample requires the MAUI workload.
For focused development, choose a solution or filter:
| Entry point | Scope |
|---|---|
| Libp2p.slnx | Shipping libraries and Core unit tests |
| Tests.slnx | Protocol, integration, and sample protocol tests |
| Samples.slnx | Sample applications and benchmarks |
| Core.slnf | Core library and its unit tests |
| Library.slnf | Shipping libraries, excluding tests, samples, and benchmarks |
The filters reference the root solution. Every solution or filter includes its selected projects' dependencies through their project references. Run these commands from the repository root:
dotnet build solutions/Core.slnf
dotnet test --project libp2p/Libp2p.Core.Tests/Libp2p.Core.Tests.csproj
dotnet build solutions/Library.slnf
dotnet build solutions/Tests.slnx
dotnet build solutions/Samples.slnxSee the CI helper commands for the complete build and test inventories.
The current implementation supports the protocols marked ✅ below. The roadmap tracks ongoing protocol coverage and improvements.
The target is to provide a performant well-tested implementation of a wide range of protocols that works on multiple platforms, with high throughput and low memory profile.
| Protocol | Version | Status | Package |
|---|---|---|---|
| TCP | tcp | ✅ | included |
| QUIC | quic-v1 | ✅ | included |
| multistream-select | /multistream/1.0.0 | ✅ | included |
| plaintext | /plaintext/2.0.0 | ✅ | included |
| noise | /noise | ✅ | included |
| yamux | /yamux/1.0.0 | ✅ | included |
| mplex | /mplex/6.7.0 | ✅ | Nethermind.Libp2p.Protocols.Mplex |
| tls | /tls/1.0.0 | ✅ | included |
| WebSockets | /ws, /wss | ✅ | Nethermind.Libp2p.Protocols.WebSockets |
| WebRTC Direct | /webrtc-direct | 🚧 | Nethermind.Libp2p.Protocols.WebRtc |
| Circuit Relay | /libp2p/circuit/relay/0.2.0/* | 🚧 | included |
| WebTransport | ⬜ help wanted | ||
| hole punching | ⬜ help wanted | ||
| auto-tls | 🚧 | Nethermind.Libp2p.Protocols.AutoTls |
|
| Application layer | |||
| Identify | /ipfs/id/1.0.0 | ✅ | included |
| ping | /ipfs/ping/1.0.0 | ✅ | included |
| Identify push | /ipfs/id/push/1.0.0 | ✅ | included |
| pubsub | /floodsub/1.0.0 | ✅ | included |
| /meshsub/1.0.0 | ✅ | ||
| /meshsub/1.1.0 | ✅ | ||
| /meshsub/1.2.0 | ✅ | ||
| /meshsub/1.3.0 | ✅ | ||
| /meshsub/2.0.0 | ⬜ help wanted | ||
| request-response | ✅ | included | |
| perf | /perf/1.0.0 | ✅ | sample |
| Discovery | |||
| mDns | basic w/o DNS-SD | ✅ | included |
| pubsub peer discovery | pubsub-peer-discovery | ✅ | included |
| Kademlia DHT | /ipfs/kad/1.0.0 | ✅ | Nethermind.Libp2p.Protocols.KadDht |
"included" protocols ship in the Nethermind.Libp2p package. Add the named package to use the other protocols.
⬜ - not yet implemented
🚧 - work in progress
✅ - basic support implemented
No plans for: quic-draft-29
dotnet-libp2p is an open-source software licensed under the MIT.