What Is The Peer Protocol?
Peer Protocol is the main mode of communication between servers on the XRPL. It precedes the XRPL consensus protocol by efficiently connecting ‘acquainted’ servers to one another which facilitates the flow of information about the behaviour, progress, and overall connectivity of the blockchain. In this article, we will explore the protocol and its varying constituents – peer discovery, private peers, and node key repairs.
Peer discovery can best be described as a way for servers to efficiently connect to each other in the XRPL network. This is conducted by the appropriately named “gossip” protocol, which allows servers to attach themselves to previously identified or ‘peered’ server addresses. In other words, when a server boots up, rather than arbitrarily searching for another server, it attempts to find peers based on saved server addresses. Once interconnected, the server begins to request more information from that peer such as the IP address and port of other XRPL servers that may be looking for peers as well. This cycle is repeated until enough peers have been established for the network to maintain stability, regardless of whether or not a server loses connection.
The benefit of this protocol is that, if a server does reboot, it only needs to be connected for a short while before reestablishing a link with its known peers and therefore the network. Although this method increases the likelihood of forming well-organized and efficient interconnectivity, it may not be as optimal for more important servers such as validators. The high-value nature of these servers requires a more trustful approach that can be configured if needed. In come the private peers.
Private peers are essentially configured rippled servers operating on a private server. This is usually done by trusted validator servers as it allows them to hide their IP address from the public as a precautionary measure against service attacks or hacks. However, for this private peer-to-peer network to function properly, the private server must still be connected to at least one non-private server that relays messages to the rest of the network.
To ensure the server does not connect to an untrusted non-private peer, the protocol allows servers to allocate fixed peers or peer reservations. Fixed peers, as the name suggests, are trusted peers selected by private servers that reside outside of the private server configuration. These will always remain connected to the private network if they have a fixed IP address. Peer reservations, on the other hand, are a broader set of peers that allow rippled servers to allocate a group of peers to have priority connections over other peers in the network. This means that the server will always accept connection requests from this set, even if the server is at a max capacity.
Although configuring your server to a private peer is recommended for maximum security, there are several things that can be affected if not configured properly:
- Servers might not make outgoing connections to other servers.
- Servers may not always accept incoming connections.
Node Key Pair
The moment a server starts up, it creates what is known as a node key pair. This key allows the server to identify itself in Peer Protocol communications subsequently granting it the right to sign its Peer Protocol communications. This ensures the proper identification and verification of the messages from other servers within the peer-to-peer network, even if messages may be transmitted by untrusted peers.
Want to know more, head over to xrpl.org for a more in-depth explanation about Peer Protocol & XRPL Servers.