Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.
libp2p uses cryptographic key pairs to sign messages and derive unique peer identities (or "peer ids")
Where are keys used?
Keys are used in two places in libp2p. The first is for signing messages. Here are some examples of messages we sign:The second is for generating peer ids
What are the different types of keys?
There are two types of keys in libp2p: asymmetric and symmetric.
Asymmetric keys
Asymmetric keys are used for signing messages and generating peer ids. There are four types of asymmetric keys in libp2p:
Symmetric keys
Symmetric keys are used for encrypting messages. There are two types of symmetric keys in libp2p:
Ethereum Node Records (ENR) usually contains the network endpoints of a node, i.e. the node's IP addresses and ports. It also holds information about the node's purpose on the network so others can decide whether to connect to the node
The components of a node record are:
signature: cryptographic signature of record contents seq: The sequence number, a 64-bit unsigned integer. Nodes should increase the number whenever the record changes and republish the record. The remainder of the record consists of arbitrary key/value pairs
Example:
enr:-IS4QJ4X...-iB