0%
Overview page background
HomeOverviewsInfra
How to Create a Private RPC Endpoint

How to Create a Private RPC Endpoint

Alchemy headshot

Written by Alchemy

Brady Werkheiser headshot

Reviewed by Brady Werkheiser

Published on June 21, 20224 min read

RPC nodes provide a link between blockchains and the decentralized applications (dApps) that run on top of them. Web3 wallets have default RPC node providers so users can easily start interacting with web3 applications, however, sometimes these default, public RPC nodes cause problems for everyday users and web3 developers due to slow network speeds, incorrect blockchain data, and unreliable service (uptime).

In this article we’re going to explain why it is a good idea to create a private RPC endpoint instead of using public RPC endpoints, and how to add one to your MetaMask wallet so you can get faster speeds, accurate data, and more reliable service.

In the context of this article, the term “private RPC endpoint” means a personal RPC endpoint that is not publicly available for everyone else to use. We do not mean that the transactions sent through your personal RPC endpoint are private transactions, that they will settle privately, or that they will not appear in the public mempool.

If you are looking to send private transactions, please refer to the Flashbots API.

A private RPC endpoint is an RPC endpoint with a unique URL that only the owner can use to send transactions to the public mempool, providing individuals with a direct connection to a node provider.

Private RPC endpoints enable users to publish transactions through a dedicated endpoint instead of using their wallet’s default, public endpoint which is being used simultaneously by the wallet’s other users.

Using a private RPC endpoint has many benefits including speed, accurate data, more reliable service, and less competition when submitting transactions during periods of high transaction volumes like an exclusive NFT drop.

Here are some of the use cases where traders, developers, and everyday users could benefit from updating their MetaMask wallet from the default RPC endpoint to a personal one:

  • Sending transactions during an exclusive, first-come-first-serve NFT mint

  • Sending transactions to capitalize on time-sensitive arbitrage opportunities

  • Getting reliable service when other node providers experience degraded service during airdrops

There are multiple reasons why web3 users stand to benefit from creating a private RPC endpoint and updating their default web3 wallet settings to send transactions through a personal RPC endpoint.

Alchemy is the leading web3 node infrastructure provider for Ethereum, Polygon, Arbitrum, Optimism, and many more layer 1 and layer 2 blockchains because of their speed (i.e. low latency), data correctness, and reliability (99.99% uptime), compared to other providers like Infura (MetaMask’s default RPC endpoint provider), and Quicknode.

For everyday users it means Alchemy is faster, more accurate, and dependable than alternative providers.

For developers and traders, using Alchemy has many other benefits from their free account including:

  • Webhooks for Ethereum, Polygon, Arbitrum, and Optimism

  • Free archive data

  • Enhanced APIs

  • User-friendly debugging and application monitoring tools

  • A simple-to-use developer dashboard

  • New accounts can be created in a couple minutes

In addition to these benefits, creating a personal RPC endpoint takes just a couple minutes.

We'll use Alchemy to create a personal RPC endpoint. You can create an account for free.

Enter your name, email address, and a password to sign up, or log into your existing account.

After creating a new account, you will be redirected to our dashboard, where we can create a new app by clicking on the Create App button as shown below.

Alchemy dashboard where you can create a new app for a personal RPC endpoint on Ethereum, Polygon, Arbitrum, Optimism, and more.
Alchemy dashboard where you can create a new app for a personal RPC endpoint on Ethereum, Polygon, Arbitrum, Optimism, and more.

Next, input the following app information based on the network for which you want to create a private RPC endpoint. 

For the description, you can write anything you want or leave it blank.

  • Name: Private RPC Endpoint - Ethereum (Mainnet)

  • Chain: Ethereum

  • Network: Mainnet

  • Name: Private RPC Endpoint - Polygon (Mainnet)

  • Chain: Polygon

  • Network: Mainnet

  • Name: Private RPC Endpoint - Arbitrum (Mainnet)

  • Chain: Arbitrum

  • Network: Mainnet

  • Name: Private RPC Endpoint - Optimism (Mainnet)

  • Chain: Optimism

  • Network: Mainnet

Alchemy dashboard interface for creating a new app on the Polygon Mainnet.
Alchemy dashboard interface for creating a new app on the Polygon Mainnet.

Next, copy the RPC URL provided by Alchemy in the app details as shown below.

Alchemy's app dashboard location for viewing keys and copying the RPC URL address for a private endpoint.
Alchemy's app dashboard location for viewing keys and copying the RPC URL address for a private endpoint.

Next, open your MetaMask wallet and connect to a new network using the RPC URL from the previous step.

  1. Open Metamask

  2. Click the network name in the window's upper-right corner, as shown below

MetaMask interface for changing your network.
MetaMask interface for changing your network.

3. At the bottom of the pop-up window, click the Add Network button.

MetaMask interface for adding a new network.
MetaMask interface for adding a new network.

4. Enter the following network details based on the blockchain for which you created your private RPC endpoint

5. Then click Save

  • Network Name: Ethereum Mainnet

  • New RPC URL: 1 https://eth-mainnet.alchemyapi.io/v2/your-api-key

  • Chain ID: 1

  • Currency Symbol: ETH

  • Block Explorer URL: https://etherscan.io  

  • Network Name: Polygon Mainnet

  • New RPC URL: https://polygon-mainnet.g.alchemy.com/v2/your-api-key

  • Chain ID: 137

  • Currency Symbol: MATIC

  • Block Explorer URL: https://polygonscan.com/

For more information, read our guide on how to connect MetaMask to Polygon.

  • Network Name: Arbitrum

  • New RPC URL: https://arb-mainnet.g.alchemy.com/v2/your-api-key 

  • Chain ID: 42161

  • Currency Symbol: AETH

  • Block Explorer URL: https://arbiscan.io/ 

For more information, read our guide on how to connect MetaMask to Arbitrum.

  • Network Name: Optimism

  • New RPC URL: https://opt-mainnet.g.alchemy.com/v2/your-api-key

  • Chain ID: 10

  • Currency Symbol: ETH

  • Block Explorer URL: https://optimistic.etherscan.io

For more information, read our guide on how to connect MetaMask to Optimism.

MetaMask network settings interface where you can add your personal RPC endpoint URL.
MetaMask network settings interface where you can add your personal RPC endpoint URL.

After hitting Save, you’ll be immediately taken to Polygon's Network in the option list!

Private RPC endpoints are a great way for everyday users, builders, and traders to get better performance when trading tokens, minting NFTs, deploying smart contracts, and interacting with dApps on blockchains.

Overview cards background graphic
Section background image

Build blockchain magic

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get your API key