X Layer RPC: A Developer's Guide (Chain ID 196)

By John Sullivan · October 10, 2026 · 6 min read · #xlayer #x layer rpc #okx #okb #op stack #developer guide

X Layer is OKX's Ethereum layer 2. It pays gas in OKB and is closely tied to OKX's exchange and wallet. It has also run on two different stacks. It launched in 2024 on Polygon CDK and moved to the OP Stack in October 2025, and both eras still live in one chain with one block history. Most of the time that history is invisible. It matters when you read old blocks, trace old transactions or index the chain from genesis.

This guide is measured against the live chain on October 10, 2026, through the same endpoint SwiftNodes customers use.

The endpoint

https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY
wss://rpc.swiftnodes.io/ws/xlayer?key=YOUR_API_KEY

With viem:

import { createPublicClient, defineChain, http } from "viem";

const xlayer = defineChain({
  id: 196,
  name: "X Layer",
  nativeCurrency: { name: "OKB", symbol: "OKB", decimals: 18 },
  rpcUrls: { default: { http: ["https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY"] } },
});

const client = createPublicClient({ chain: xlayer, transport: http() });

What we measured

Property Value
Chain ID 196 (0xc4)
Client an X Layer build of reth (web3_clientVersion ends in xlayer/v0.1.0)
Block time 1.000 s (1,000-, 10,000-, 100,000- and 1,000,000-block averages)
Gas limit 210,000,000 per block
Base fee 20,000,000 wei (0.02 gwei), in OKB
eth_maxPriorityFeePerGas 1 wei
L1 data fee 0
OKB transfer 21,000 gas, ~0.00000044 OKB
safe behind head 173 blocks, ~3 minutes
finalized behind head 1,325 blocks, ~22 minutes
eth_getLogs range 100 blocks
Historical state full archive, back to the CDK era
Tracing debug_* and trace_* for OP Stack-era blocks

Fees: a fixed floor and no L1 charge

The base fee was 20,000,000 wei in every block of a 1,024-block eth_feeHistory window. It was the same in every sample we took at three-day intervals over the past 30 days. Blocks were between 0.2% and 1.8% full, so nothing pushes the fee up. The block header shows why it can't move much anyway. OP Stack chains store their fee parameters in extraData, and X Layer's current value decodes as:

Field Value
Version 1
Base fee change denominator 50
Elasticity 1
Minimum base fee 20,000,000 wei

With an elasticity of 1, the gas target equals the full 210M gas limit, so the base fee only rises if blocks fill completely. The minimum base fee then sets the floor it sits on. In practice the base fee is a constant 0.02 gwei.

The second difference is the L1 data fee. On most OP Stack chains it is the bigger part of a transfer's cost; on Hemi, for comparison, it was 88% of the total. X Layer's fee oracle at 0x420000000000000000000000000000000000000F returns 0 for both baseFeeScalar and blobBaseFeeScalar, and receipts report l1Fee of 0. A transfer we sampled paid exactly gasUsed × effectiveGasPrice:

21,000 gas × 21,000,000 wei = 441,000,000,000 wei ≈ 0.00000044 OKB ≈ $0.00006

That sender added a 1,000,000-wei tip. The median tip in eth_feeHistory was 1 wei, which is also what eth_maxPriorityFeePerGas suggests. Because the L1 fee is zero, a wallet that shows gasUsed × effectiveGasPrice shows the real cost here, unlike on most OP Stack chains.

Receipts still carry the OP Stack fields (l1Fee, l1GasUsed, l1GasPrice), all reporting no charge. They also include two newer fields, daFootprintGasScalar (400) and blobGasUsed, from the OP Stack's Jovian upgrade. Decoders that reject unknown receipt fields should allow them.

One chain, two stacks

X Layer's genesis block is dated March 30, 2024. The OP Stack era begins at block 42,810,021 (October 27, 2025, 15:30:57 UTC). That is the first block with OP Stack fee parameters in extraData and the 0x4200…0011 fee vault as miner. Block 42,810,022 is the first to carry the usual deposit transaction (type 0x7e). The parent hashes link straight through, so it is one continuous chain.

Blocks from the CDK era look different, and code that assumes OP Stack shapes will trip on them:

CDK era (blocks 0 to 42,810,020) OP Stack era (42,810,021 on)
baseFeePerGas absent present
gasLimit 1,125,899,906,842,624 (2^50) 210,000,000 today
Transactions legacy (type 0x0) in our samples deposit 0x7e first, then mostly 0x2
Block timing irregular: 100 blocks took 298 s in May 2024, 42 s in June 2025 1 block per second

If your indexer computes fees from baseFeePerGas, or estimates time from block numbers, branch on the block number.

State from the CDK era is readable. eth_call on WOKB (0xe538…9b2b) returned totalSupply at block 1,000,000, at block 20,000,000 and on both sides of the switch. Values at 42,810,020 and 42,810,022 were identical, so balances carried over unchanged. Receipts for CDK-era transactions also work.

Tracing is where the two eras split. debug_traceBlockByNumber with callTracer and trace_block both returned full traces for OP Stack-era blocks, as far back as block 43,000,000 in our tests. For a CDK-era block the upstream answered rpc method is not whitelisted, and debug_traceTransaction on a CDK-era transaction returned transaction not found. Plan on traces from block 42,810,021 onward only.

eth_getLogs: 100 blocks at a time

This is the limit most likely to break an indexer that works on other chains. OKX's own nodes reject any eth_getLogs request where toBlock - fromBlock is more than 100:

-32602 block range greater than 100 max

Our endpoint returns the same error, because the cap is set by the nodes behind it. OKX's public RPC URLs (rpc.xlayer.tech and xlayerrpc.okx.com) answered the same way when we called them directly.

X Layer emits about 16 logs per block, so the cap keeps responses manageable. A 101-block query (toBlock - fromBlock = 100) returned 1,631 logs, 0.98 MB, in 2.8 seconds. Page in fixed windows:

async function getLogsPaged(from: bigint, to: bigint, filter: { address?: `0x${string}` }) {
  const logs = [];
  for (let start = from; start <= to; start += 101n) {
    const end = start + 100n > to ? to : start + 100n;
    logs.push(...(await client.getLogs({ ...filter, fromBlock: start, toBlock: end })));
  }
  return logs;
}

At one block per second, 101 blocks is under two minutes of chain time, so a day of history takes about 860 requests. Filter by contract address whenever you can, and run backfills in parallel within your rate limit rather than one window at a time. More on chain-by-chain limits in our getLogs range cap survey.

Blocks and activity

In a 60-block receipt sample there were 421 transactions. 60 were the per-block deposit transactions and 361 were user transactions: 345 EIP-1559 (0x2) and 16 legacy (0x0). That is about six user transactions a second. In our halt survey across 110 chains, X Layer had no gap of 10 minutes or more between August 25 and October 6.

Finality

safe trailed the head by 173 blocks (about 3 minutes) and finalized by 1,325 blocks (about 22 minutes). These have the usual OP Stack meaning: finalized means the block's data is in a finalized Ethereum block. For the general picture, see soft vs hard finality on L2s.

Summary

  • OP Stack chain, chain ID 196, OKB for gas, 1-second blocks.
  • Base fee pinned at 0.02 gwei by an elasticity of 1 and a minimum base fee; tips of 1 wei are normal.
  • No L1 data fee: a transfer costs about 0.00000044 OKB, roughly $0.00006.
  • Blocks before 42,810,021 are from the Polygon CDK era: no baseFeePerGas, irregular timing, state readable, no traces.
  • eth_getLogs is capped at 100 blocks per request; page and filter by address.
  • finalized is about 22 minutes behind the head.

X Layer endpoints and status are on our X Layer RPC page, alongside the rest of the 128 chains on one key. SwiftNodes has a free tier to try it.

J
John Sullivan
Infrastructure Writer, SwiftNodes

John Sullivan covers RPC infrastructure, node operations, and multi-chain development at SwiftNodes — what it actually takes to keep endpoints fast, fresh, and reliable across EVM and non-EVM networks.

Related posts

  • Ink RPC: A Developer's Guide (Chain ID 57073)

    Ink is Kraken's OP Stack chain. Measured: 1 s blocks, a base fee near 280 wei, a suggested tip roughly 300 times what transactions actually pay, a transfer costing ~$0.002 at the median tip, dense logs that hit a 20,000-result eth_getLogs cap within a few hundred blocks, and full tracing.

  • BOB RPC: A Developer's Guide (Chain ID 60808)

    BOB is an OP Stack rollup for Bitcoin assets that pays gas in ETH. Measured: 2 s blocks, a 252 wei base fee, a transfer costing ~$0.0007 (92% of it L1 data), safe and finalized moving together 29 to 55 minutes behind, a 2,000-block eth_getLogs cap, and no tracing at any public RPC we tested.

  • Hemi RPC: A Developer's Guide (Chain ID 43111)

    Hemi is an OP Stack chain whose EVM can read Bitcoin. Measured: 12 s blocks, a 252 wei base fee, a transfer costing ~0.00000018 ETH (88% of it L1 data), the hVM Bitcoin precompiles in practice, ~20 min to finalized, full archive and eth_getLogs limits.

Try SwiftNodes free — multi-chain RPC across 83 networks, flat-rate pricing, pay by card or crypto, no KYC. Get an API key in 30 seconds →