In this post I want to respond to a recent debate on Twitter, started by this Tweet.
Before I start, for those that don’t know me, I am Max, libp2p maintainer, working at Protocol Labs, focusing on protocol design (GitHub - libp2p/specs: Technical specifications for the libp2p networking stack) and the libp2p implementation in Rust (GitHub - libp2p/rust-libp2p: The Rust Implementation of the libp2p networking stack.). As a disclaimer, before working at Protocol Labs, I worked at Parity and I’ve been part of the libp2p ecosystem for ~3 years.
I think the debate touches many problems that are worth further discussing. I hope to help these discussions by adding more context. But also I would like to use the chance to share my more positive view on these aspects of libp2p.
I would appreciate and encourage people to join the discussion in the comments below. My only ask is to do so in a constructive manner. I look forward to your feedback on how libp2p can improve.
Modularity in libp2p
Yes, one of the core principles of libp2p is modularity. Contrary to seeing it as a downside, I see it as one of libp2p’s greatest strengths.
Modularity has its costs and challenges. It adds confusion, e.g. when having to choose which protocols to use in which scenario and how to integrate them into a larger application. It adds complexity, e.g. when wrapping a hash into a multihash, then a multibase and then a multiaddr. It adds overhead, e.g. when negotiating the set of supported protocols via multistream-select instead of just using a fixed set.
That said, I think it also has many upsides. Multistream-select allowed us to deprecate SecIO and adopt Noise with zero downtime or breaking changes across the networks. Multiaddr allows implementations to select transports based on context (QUIC, TCP, WS), and it even allows us to adopt new ones (e.g., WebTransport, WebRTC) in the future without breaking compatibility with older versions. The modularity on protocols allows the many users of libp2p (e.g., Ethereum2, Polkadot, IPFS, Filecoin) to use different sets of protocols, while sharing the same network core. It even allows them to communicate with each other.
Overall I am convinced that the modularity of libp2p is net positive.
libp2p specifications
- “Still no precise specs on many aspects after 5 years of shouting that a spec is needed”
Yes, we could do better specifying libp2p, especially for projects in the past that predated the spinoff from IPFS (e.g., Kademlia). I know what it feels like to work on libp2p while at the same time not working at Protocol Labs (see disclaimer above).
I think we have been improving here in recent times, setting a good precedent on projects like GossipSub andCircuit Relay v2. These examples were spec first and have had active community engagement with the specs and implementations.
There are no plans to back down from the specs-first approach (see the WebRTC and WebTransport protocols).
I know most of the contributions on GitHub - libp2p/specs: Technical specifications for the libp2p networking stack are from Protocol Labs folks - but that definitely isn’t the desired state. I think we at Protocol Labs need to be more inviting to the community, encouraging others to contribute to the specification. Suggestions on how we can make it easier for others to contribute here very welcome too!
libp2p as an open project
- “Talking to the people who decide is like talking to a deaf person”
I can see why Pierre feels this way. Still I don’t think it is correct. What I think he confuses here is the difference between ignoring someone and hearing someone’s arguments but deciding against it. Two recent examples:
-
Pierre has argued for not embedding the WebRTC TLS fingerprint in a multihash and multibase. Everyone layed out their argument. His advice was heard and addressed, but still, we will most likely go with multihash and multibase to enable smooth upgradability for things we can not foresee in the future https://github.com/multiformats/rust-multiaddr/pull/59#discussion_r920874077
-
Pierre has argued for using a static TLS certificate in libp2p’s WebRTC, double encrypting the connection with an additional Noise layer. He argues that this simplifies the operation of libp2p nodes. His argument has been heard and many counter arguments have been layed out. We have decided against his suggestion and instead don’t double encrypt (apart from an initial additional handshake) webrtc/: Add libp2p WebRTC browser-to-server spec by mxinden · Pull Request #412 · libp2p/specs · GitHub
I am generally trying to reply to every comment on the various GitHub repositories. I don’t think anyone from the community is being ignored. Please share in case you disagree or I am missing something.
DoS defense in libp2p
- Several protocols don’t understand anything about DoS resilience
I don’t think DoS resilience has gotten as much attention in libp2p as it should have. That said, I think we made a lot of progress here, e.g. see the Gossipsub v1.1 evaluation. I would even go as far as saying that libp2p does a decent job on the very hard problem of DoS prevention in a p2p setting.
I think it is fine to discuss this on a high level. What do people think? How can we further improve? Though dear reader, in case you are aware of concrete issues, please responsibly disclose to security@libp2p.io instead.
multistream-select v2 or large changes at libp2p’s core
If you want to make a libp2p person sweat, just say the words “multistream-select v2”
Yes. multistream-select v2 has been a failed project again and again. I have to be honest, the Tweet made me smirk.
I don’t think postponing multistream-select v2 in itself is bad, i.e. we have to choose our battles and I think we have chosen wisely. That said I think we could have done a far better job on expectation management, e.g. being very explicit on early stage drafts being early staged drafts.
I encourage everyone interested to get involved on https://github.com/libp2p/specs/pull/349. Though disclaimer, it is very early stage and only a specification for now.
Closing
That is all from my end for now. Thanks for reading. Thanks for your interest in libp2p. I encourage folks to share their thoughts below. Also feel free to contact me directly in case that is preferred.
Max