Open In App

Use of Ethereum’s RLPx in Ethereum Ecosystem

Last Updated : 02 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Ethereum’s RLPx is a set of protocols called RLPx. By employing a modified version of the Kademlia node discovery protocol, it maintains the P2P overlay network (using UDP messages). The protocol could be known as RLPx node discovery. When two peers first encounter one another, they ought to shake hands in two phases (i.e. two different handshakes). The article focuses on discussing the use of Ethereum’s RLPx in the Ethereum Ecosystem.

What is Ethereum?

By market capitalization, Ethereum is the second-largest cryptocurrency behind Bitcoin. Additionally, it is a platform for decentralized computing that supports a wide range of applications, including a number of decentralized financial (or Defi) apps and services. It establishes a peer-to-peer network that securely executes and verifies the application code, called smart contracts.

  • Ethereum has a native cryptocurrency ether (ETH).
  • Ethereum is designed to be decentralized, scalable, programmable, and secure.
  • Ethereum changed from PoW to PoS in September 2022.
  • Ethereum exists solely through the decentralized participation and cooperation of the community.

What is RLPx?

RLPx implements node discovery on the basis of the routing algorithm of Kademlia to build an efficient network with a topology of low diameter. It is also known as the Node discovery protocol. Below are some of the differences between RLPx and Kademlia:

Parameters RLPx Kademlia
Data Storage It does not support data storage/ retrieval. RLPx is for node discovery and routing. It supports data storage and retrieval.
Node IDs RLPx uses 512-bit node IDs. It uses 160-bit node IDs.
Distance calculation It performs distance calculation on the Keccak-256 hash of the node ID. It calculates XOR distance directly on node IDs.
Distance metric RLPx uses the floor of log2(a XOR b) as its distance metric, which corresponds to 257 distinct node buckets. It uses the integer value of the bitwise XOR distance.
Public keys Node IDs are used as public keys to establish an authenticated TCP connection.  It does not use node IDs as public keys. 

Use of Ethereum’s RLPx

On the Ethereum blockchain, everything from financial tools and games to sophisticated databases is now operational. Its potential for the future is only constrained by developers’ creativity. “Ethereum is for more than just payments,” the nonprofit Ethereum Foundation declares. It is a marketplace for financial services, games, and applications that won’t censor you or steal your data. There are three protocols on Ethereum’s P2P network, RLPx is for node discovery, DEVp2p is for session establishment, and the Ethereum subprotocol is for Ethereum-specific operation. 

The RLPx session between two nodes begins with an initial cryptographic handshake:

1. In the first handshake, the two nodes begin with a cryptographic handshake and involve the node sending an auth message which is verified by the peer. On successful verification, the peer generates an auth-acknowledgment message to return to the initiator node. 

2. A successful cryptographic handshake triggers both nodes to send a “hello” message to one another. The hello message includes:

  • Protocol version.
  • Client ID.
  • Port.
  • Node ID.
  • List of supported sub-protocols.

Along with the hello message, a disconnect message can also be sent that gives a warning to a peer that the connection will be closed. The wire protocol also supports PING and PONG messages that are required for keeping the session open. 

Conclusion

  • RLPx messages are authenticated and encrypted, and you can communicate with other protocols on top of them. Devp2p and its subprotocols are application-level protocols, whereas RLPx is the transport layer protocol.
  • eth, the Ethereum wire subprotocol is used to exchange information about the blockchain, and les the light Ethereum subprotocol is the protocol designed for the light clients

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads