|
1 | 1 | --- |
2 | 2 | title: "Identify" |
3 | | -description: "A way for nodes in libp2p to query and inform other nodes about their metadata." |
| 3 | +description: "A way for nodes in libp2p to query and inform remote nodes about their metadata." |
4 | 4 | weight: 23 |
5 | 5 | --- |
6 | 6 |
|
7 | | -Coming soon! |
| 7 | +The libp2p Identify protocol allows nodes in the libp2p network to share |
| 8 | +and query information about each other. It is usually run right after a new libp2p |
| 9 | +connection has been established and, at certain times, during the lifetime of the |
| 10 | +connection. |
| 11 | + |
| 12 | +The information exchanged includes: |
| 13 | + |
| 14 | +- the protocol version: a network identifier, e.g. `/my-network/0.1.0`. |
| 15 | +- the user agent: a free-form string identifying the local node's implementation, usually |
| 16 | + in the format "agent-name/version". |
| 17 | +- the public key: cryptographic identifier of the local node in the format of a peer ID. |
| 18 | +- the observed address: the remote node's public IP address as observed by the local node. |
| 19 | +- the listen addresses: the multiaddresses at which the local node can be reached. |
| 20 | +- the list of [protocols](/concepts/introduction/protocols/overview) that the |
| 21 | + local node supports. |
| 22 | + |
| 23 | +There are two variations of the protocol: `identify` and `identify/push`. |
| 24 | + |
| 25 | +The Identify protocol, for historical reasons identified by the protocol ID `/ipfs/id/1.0.0`, |
| 26 | +is used to actively query a remote node for its metadata. The identify/push protocol, identified |
| 27 | +by the protocol ID `/ipfs/id/push/1.0.0`, allows a node to push Identify data to the remote node |
| 28 | +without querying. This is used whenever changes to the data sent in Identify happen, |
| 29 | +e.g., when the node starts listening on a new address and adds or removes support |
| 30 | +for a protocol. |
| 31 | + |
| 32 | +{{< alert icon="" context="note">}} |
| 33 | +It's worth noting that go-libp2p used to include a feature called 'Identify Delta' |
| 34 | +(<insert protocol ID>) for some time. This protocol was used to reduce the size of |
| 35 | +Identify Pushes, but proved to be less useful (and a lot more complex) than expected. |
| 36 | +It has since been deprecated, but many nodes on the IPFS network still support |
| 37 | +this protocol. |
| 38 | +{{< /alert >}} |
| 39 | + |
| 40 | +{{< alert icon="💡" context="note" text="See the Identify <a class=\"text-muted\" href=\"https://github.com/libp2p/specs/tree/master/identify\">technical specification</a> for more details." />}} |
0 commit comments