An RPC, or Remote Procedure Call, is a fundamental communication protocol of Web3 since it allows interaction with blockchains. Surely you have heard of it if you have ever interacted with decentralized applications or with the testnet of a blockchain. But what exactly is an RPC? How is this protocol applied to the blockchain? Are there any risks in using an RPC?
What is an RPC?
A Remote Procedure Call (RPC), or remote procedure call in French, is a communication protocol which allows a program to launch a procedure on another program hosted on another network, without knowing the details of the latter.
The program making the request is the customerwhile the program providing the service is the server. In other words, an RPC allows a client to make a request to a server located remotelyto do something for you.
To simplify as much as possible, let’s imagine that you are the client and the server is your friend. You ask your friend to bake a cake and then send it to you. It works like an RPC.
You give the server a few parameters: the order to make the cake and then send it. Then the server takes over the request (make the cake) and sends you the results (send the cake).
So, like a local procedure call, when an RPC is initiated by the client, procedure parameters are transferred over the network to the server, and the procedure is executed by this server. Once the procedure is completed, the results are transferred in the opposite direction to the client.
The application of RPC in the blockchain
RPC is widely used with blockchain technology. Indeed, it is the protocol that allows decentralized applications (dApps) to interact with a blockchain. If you have ever used a digital wallet like MetaMask, then you have already used an RPC.
When you use a decentralized application like Uniswap, Aave or Curve, you must connect a wallet supporting a compatible network to it. The wallet acts as an intermediary between the actions you do on the dApp’s interface and the blockchain.
The RPC set on the wallet does this communication work between the dApp and the blockchain. Even if you don’t touch anything, each wallet has a default RPC set for the networks it supports, so it works without your intervention.
But more precisely, the interaction with the blockchain is done via communication with an RPC node. These nodes hold a copy of the transaction register (the blockchain), which allows access to it by connecting to it. So in this context:
- Decentralized application: client;
- RPC nodes: server.
An RPC therefore allows the client to make a request to the remote server. Here, the dApp makes a request to a node. Nodes are operated by entities or individuals located anywhere in the world, hence the use of RPC.
Nevertheless, the node must be able to respond to an RPC request, it is therefore necessary to install a software allowing it. This type of node is to be distinguished from mining nodes and validating nodes.
Finally, once the dApp is connected to the node, it can then have access to all the information on the blockchain. So when the dApp initiates a request, the node retrieves the necessary information from the blockchain and sends it to the dApp. This is how transactions are executed, for example.
🎁 cryptonewsherald Research Launch Offer
1st Newsletter Free with the code TOASTNL
Switch RPC to protect yourself
The default RPCs used by digital wallets handle the highest volume of requests, which can cause slowing down of processing. For this reason, changing the RPC can be useful.
Before that, be aware that there are two main ways to use an RPC node:
- Mount your own RPC nodewhether at home or on a rented server;
- Make use of a RPC provider like Infura or Alchemy which operates its own RPC nodes.
The main risk of using an RPC provider is censorship of your transactions. Additionally, these providers can in theory trace every interaction an individual makes with the blockchain to monetize them.
By default, if you have not chosen an RPC on your wallet, you use that of a supplier who potentially collects your data.
Although not all RPC providers engage in these practices, it is nonetheless of a risk to know.
Figure 1: Ethereum network default RPC overview on MetaMask
As you can see in the figure above, ConsenSys, the company behind MetaMask, has set the default Infura RPC for the Ethereum network. This is also the case for other networks that MetaMask supports natively, such as Polygon, Optimism or Arbitrum One.
MetaMask was particularly in the spotlight in November 2022 since it was discovered that ConsenSys collected certain data from users of Infura’s RPC such as IP addresses and wallet addresses.
If you want to avoid this, you can use your own node or use another RPC provider. You just have to change RPC url in the tab ” Networks from the MetaMask settings, as shown in the figure above.
To find other RPC providers on a network compatible with the Ethereum Virtual Machine (EVM), you can for example use chain list, a site that lists them by network. Among the most well-known RPC providers are Alchemy, Ankr and Pokt Network.
Using a testnet
Changing the RPC is also particularly useful when using a blockchain testnet. Indeed, when many people use a testnet at the same time with the default RPC, it may not be no longer possible to interact with the testnet blockchain due to too many requests.
This can happen especially during events that require to perform certain tasks in order to be eligible for an airdropFor example.
In this case, you have the option of change RPC on testnet network in your wallet settings. You can then continue to interact with the testnet blockchain and complete your tasks.
👉 Discover more than 100 summary sheets on cryptocurrencies
Receive a summary of crypto news every Monday by email 👌
What you need to know about affiliate links. This page presents assets, products or services relating to investments. Some links in this article are affiliated. This means that if you buy a product or register on a site from this article, our partner pays us a commission. This allows us to continue to offer you original and useful content. There is no impact on you and you can even get a bonus by using our links.
Investments in cryptocurrencies are risky. cryptonewsherald is not responsible for the quality of the products or services presented on this page and could not be held responsible, directly or indirectly, for any damage or loss caused following the use of a good or service highlighted in this article. Investments related to crypto-assets are risky by nature, readers should do their own research before taking any action and only invest within the limits of their financial capabilities. This article does not constitute investment advice.
AMF recommendations. There is no guaranteed high return, a product with high return potential involves high risk. This risk-taking must be in line with your project, your investment horizon and your ability to lose part of this savings. Do not invest if you are not ready to lose all or part of your capital.
To go further, read our Financial Situation, Media Transparency and Legal Notices pages.