Tema
Build on X Layer

X Layer overview#

X Layer is an Ethereum Layer 2 (L2) network, built by OKX on an enhanced Optimism Stack, designed to provide developers with a superior environment for scaling applications.

Key Developer Advantages

  • Full EVM Equivalence: Deploy your existing Ethereum applications without any code modifications.
  • Exceptional Performance: Achieve massive scalability with support for up to 5,000 TPS and negligible gas fees.
  • Battle-Tested Security: X Layer leverages the robust optimistic rollup architecture, inheriting the security guarantees of Ethereum, but with a simpler, more efficient operational model than ZK rollups.
  • Enterprise-Grade Reliability: Features like the Conductor high-availability cluster ensure sequencer redundancy, offering 99.9% uptime for your production-ready dapps.

X Layer architecture#

The major components of X Layer are:

  • Virtual Machine: EVM‑equivalent
  • Sequencer: Trusted (implemented by op-node in sequencer mode, coordinating with op-geth via Engine API)
  • Gas token: OKB (fixed supply at 21M post-burns/upgrades; L1 OKB phased out)

Background#

X Layer has evolved to adopt the Optimism Stack (OP Stack) framework, a battle-tested and widely adopted Layer 2 scaling solution. In this architecture, L2 operates with optimistic assumptions where transactions are considered valid by default, with a 7-day challenge period for fraud proofs. This provides a more efficient and cost-effective solution while maintaining Ethereum's security guarantees through cryptographic fraud proofs when needed.

Architecture flow (OP Stack + AggLayer mode)#

Phase 1: From L1 to L2

Process of bridging assets from ETH to X Layer

StepActionDescription
1.1User DepositThe user sends assets to the L1 bridge contract.
1.2Event SyncThe Bridge Service monitors (ingests) the L1 contract events.
1.3L2 Claim/MintThe Bridge Service sends an L2 transaction (via RPCs) to claim/mint the asset on X Layer.
1.4Block InclusionThe Sequencer includes this transaction in an L2 block.
1.5User UpdateRPCs expose the updated balance/status to the user.

Phase 2: Execution and withdrawal back to L1

Standard L2 operations and process of initiating withdrawal back to L1

StepActionDescription
2.1Withdrawal TxThe user sends an L2 withdrawal transaction via RPCs.
2.2Block GenerationThe Sequencer continues to generate blocks.
2.3Data PersistenceThe L2BridgeSyncer and L1InfoTreeSyncer persist chain data and L1 info updates needed for the Pessimistic Proof (PP).

Phase 3: Cross-Chain Settlement & Proof (AggLayer)

This phase involves proving and finalizing the withdrawal on L1 using the AggLayer.

StepActionDescription
3.1Certificate PrepThe aggsender fetches blocks, stores certificate metadata, and performs double-checks.
3.2Certificate SubmissionThe aggsender submits the certificate to the AggLayer.
3.3ZK Proof GenerationThe agglayer-prover generates the ZK proof; the AggLayer submits the certificate proof and public inputs to L1.
3.4L1 FinalityAfter L1 verification, withdrawals and messages achieve L1 finality (PP is verified).

Phase 4: Continuous System Synchronization

StepActionDescription
4.1 - 4.2Continuous SyncThe Bridge Service continuously synchronizes both L2 and L1 contract events to maintain state consistency.

Outcome: Fast execution happens on L2 with 2-second block times; for withdrawals, users wait for the 7-day challenge period to ensure security. All L2 data is published to L1, ensuring the system is fully trustless and censorship-resistant.

This flow ensures immediate transaction finality on L2 for most operations while providing cryptographic security for cross-chain operations through the optimistic rollup model.