X Layer logoX Layer Mainnet RPC Endpoints

X Layer Mainnet uses OKB as its native currency. Its Chain ID is 196 (0xc4). Below are 2 public RPC endpoints you can use to connect wallets, dApps, and developer tools to X Layer Mainnet.

Other X Layer Networks:

dRPC Logo

dRPC

Decentralized RPC Network

100+ blockchain RPCs

No rate limits

For builders and traders

Connect via dRPC
BlockchainRPC URLChain IDNative CurrencyBlock ExplorerActions
X Layer

https://rpc.xlayer.tech

0xc4OKBhttps://www.okx.com/web3/explorer/xlayer
X Layer

https://xlayerrpc.okx.com

0xc4OKBhttps://www.okx.com/web3/explorer/xlayer

Connect to X Layer Mainnet with ethers.js

import { ethers } from "ethers";

const provider = new ethers.JsonRpcProvider("https://rpc.xlayer.tech");

const network = await provider.getNetwork();
console.log(network.chainId); // 196n

X Layer Mainnet FAQ

What is the RPC URL for X Layer Mainnet?

There are 2 public RPC endpoints for X Layer Mainnet, including https://rpc.xlayer.tech. See the full list in the table above.

What is the Chain ID for X Layer Mainnet?

The Chain ID for X Layer Mainnet is 196 (0xc4 in hexadecimal).

What is the native currency of X Layer Mainnet?

The native currency of X Layer Mainnet is OKB.

How do I add X Layer Mainnet to MetaMask?

Use the "Add to Wallet" button on this page to add X Layer Mainnet to MetaMask automatically, or follow our step-by-step guide for X Layer.