RLPx

Return to Glossary

RLPx is a protocol suite and not a single protocol. On the one hand it maintains the p2p overlay network with the means of a modified version of the kademlia node discovery protocol (using UDP messages). We could name it RLPx Node Discovery Protocol.

The first time two peers meet each other, they should perform a two-phase handshake (i.e. two different handshakes). In the first handshake, they exchange some cryptographic secrets (the details are explained here (in the RLPx specification)) that are used for the subsequent communications between them. The subsequent messages are therefore encrypted and authenticated.

In the second handshake, they exchange their capabilities, i.e. which devp2p subprotocols they support (the peers can support multiple protocols). This second handshake could be considered already part of devp2p wire protocol (the Hello message). The documentation says that:

the ÐΞVp2p nodes communicate by sending messages using RLPx(this time using TCP messages). I list some devp2p wire subprotocols that are widely used:

, the Ethereum wire subprotocol used to exchange the information about the blockchainwhisperles the light ethereum subprotocol is the protocol designed for the light clients ...If you want you can write your own subprotocol https://github.com/ethereum/go-ethereum/wiki/Peer-to-Peer.Therefore, RLPx messages are encrypted and authenticated and on top of them you can communicate with different protocols. We can say that RLPx is the transport layer protocol and devp2p and its subprotocols are the application level protocols.

Source: https://stackoverflow.com/questions/49029311/what-is-the-use-of-ethereums-rlpx-and-how-do-they-use-it-in-ethereum-ecosystem