Libp2p
-
State
stable
-
Theory Audit
wip
-
Edit this section
-
section-libraries.libp2p
-
State
stable
-
Theory Audit
wip
- Edit this section
-
section-libraries.libp2p
Libp2p is a modular network protocol stack for peer-to-peer networks. It consists of a catalogue of modules from which p2p network developers can select and reuse just the protocols they need, while making it easy to upgrade and interoperate between applications. This includes several protocols and algorithms to enable efficient peer-to-peer communication like peer discovery, peer routing and NAT Traversal. While libp2p is used by both IPFS and Filecoin, it is a standalone stack that can be used independently of these systems as well.
There are several implementations of libp2p, which can be found at the libp2p GitHub repositoriy. The specification of libp2p can be found in its specs repo and its documentation at https://docs.libp2p.io.
Below we discuss how some of libp2p’s components are used in Filecoin.
DHT
-
State
stable
-
Theory Audit
wip
-
Edit this section
-
section-libraries.libp2p.dht
-
State
stable
-
Theory Audit
wip
- Edit this section
-
section-libraries.libp2p.dht
The Kademlia DHT implementation of libp2p is used by Filecoin for peer discovery and peer exchange. Libp2p’s PeerID is used as the ID scheme for Filecoin storage miners and more generally Filecoin nodes. One way that clients find miner information, such as a miner’s address, is by using the DHT to resolve the associated PeerID to the miner’s Multiaddress.
The Kademlia DHT implementation of libp2p in go can be found in its GitHub repository.
GossipSub
-
State
stable
-
Theory Audit
wip
-
Edit this section
-
section-libraries.libp2p.gossipsub
-
State
stable
-
Theory Audit
wip
- Edit this section
-
section-libraries.libp2p.gossipsub
GossipSub is libp2p’s pubsub protocol. Filecoin uses GossipSub for message and block propagation among Filecoin nodes. The recent hardening extensions of GossipSub include a number of techniques to make it robust against a variety of attacks.
Please refer to GossipSub’s Spec section, or the protocol’s more complete specification for details on its design, implementation and parameter settings. A technical report is also available, which discusses the design rationale of the protocol.