X Layer logo

X Layer Mainnet

RPC Endpoints

Chain ID: 0xc4 · OKB

Other X Layer networks:Testnet
How to add X Layer to MetaMask or other wallets

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

StatusRPC EndpointChain IDCurrencyExplorerWallet
Checking
https://rpc.xlayer.tech
0xc4OKBExplorer
Checking
https://xlayerrpc.okx.com
0xc4OKBExplorer

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 — common questions

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.