XLayer is OKX's zkEVM rollup built on Polygon CDK, with Chain ID 196 and gas paid in OKB — not ETH. That last part is the number-one integration surprise: if you see "insufficient funds" errors on a freshly deployed wallet, make sure it holds OKB, not just ETH. NodeFlare runs a dedicated XLayer node across multiple regions; you can connect in under a minute.
XLayer RPC URLs
Public endpoint — no API key:
https://rpc.nodeflare.app/xlayer/publicKeyed endpoint (free account — higher limits, heavy methods):
https://rpc.nodeflare.app/xlayer/v1/{YOUR_KEY}Get your free key → — no credit card.
Quick start
curl https://rpc.nodeflare.app/xlayer/public \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'import { ethers } from 'ethers';
const provider = new ethers.JsonRpcProvider(
'https://rpc.nodeflare.app/xlayer/public'
);
console.log('XLayer block:', await provider.getBlockNumber());XLayer at a glance
| Parameter | Value |
|---|---|
| Chain ID | 196 (0xc4) |
| Gas token | OKB |
| Type | zkEVM (Polygon CDK / validity-proof rollup) |
| Block time | ~1 s |
| Finality | Soft ~1 s · hard on validity proof to Ethereum L1 |
| WebSocket | Not yet (use HTTPS polling) |
| Explorer | oklink.com/x-layer |
OKB gas — what that means in practice:
eth_getBalancereturns OKB (in wei), not ETH- Fund test wallets with OKB from the official XLayer bridge
- Gas prices are very low and stable —
eth_gasPriceis a reliable default; there is no meaningful priority-fee market to outbid
Because XLayer is a zkEVM (Polygon CDK lineage), standard EVM tooling works unchanged at the RPC layer. Pin a block number when making multiple related reads — "latest" changes every ~1 second.
Free tier
- 2,000,000 compute units/month — no credit card
eth_getLogs(75 CU),trace_*/debug_*(100 CU) included on free- All 23 supported chains under one key — XLayer, Ethereum, Base, Arbitrum, Optimism and more
- Multi-region routing with automatic failover
Add XLayer to MetaMask
| Field | Value |
|---|---|
| Network name | XLayer |
| RPC URL | https://rpc.nodeflare.app/xlayer/public |
| Chain ID | 196 |
| Currency symbol | OKB |
| Block explorer | https://www.oklink.com/x-layer |
FAQ
What is the XLayer RPC URL?
https://rpc.nodeflare.app/xlayer/public — no API key required, rate-limited per IP. A free key unlocks higher limits and heavy methods (eth_getLogs, debug_*, trace_*).
Is the XLayer RPC free? Yes. The public endpoint needs no sign-up; a free account raises your limit to 2M compute units/month with no credit card.
Does eth_getLogs work on XLayer? Yes — on the free keyed endpoint. XLayer activity concentrates around DEX and bridge contracts; tight address + topic filters help, and each call costs 75 CU against your quota.
Is XLayer the same as OKC / OKTC? No. OKC/OKTC (Chain ID 66) is OKX's older chain. XLayer (Chain ID 196) is the newer zkEVM rollup — they are separate networks built on different technology.
Is WebSocket available on XLayer? Not yet. WebSocket is live on Ethereum, Base, BNB Chain, Arbitrum, Optimism, HyperEVM, and Avalanche. Use HTTPS polling on XLayer for now.
Building on XLayer? Get your free NodeFlare key → — covers XLayer plus all 23 supported chains.