Tema
Build on X Layer

X Layer overview#

An Ethereum Layer 2 network built by OKX on the Optimism Stack.

Build on X Layer and deploy Ethereum apps with full EVM equivalence, low-cost transactions, and the security of Ethereum.

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)#

Starting from the user deposit on L1:

  • 1.x L1 deposit → credit on L2 (bridge in)
    • 1.1 User deposits asset on L1 bridge contract
    • 1.2 Bridge Service syncs L1 contract events (listen/ingest)
    • 1.3 Bridge Service writes to DB and sends an L2 claim/mint Tx via RPCs
    • 1.4 The Sequencer includes the Tx in a block
    • 1.5 RPCs expose the updated balance/status to users
  • 2.x L2 user Tx & withdrawal (L2 → L1)
    • 2.1 User sends an L2 withdraw Tx via RPCs
    • 2.2 Sequencer generates blocks
    • 2.3 L2BridgeSyncer / L1InfoTreeSyncer persist chain data and L1 info tree updates for PP
  • 3.x Certificate & PP settlement on L1
    • 3.1 aggsender fetches blocks/epochs, stores certificate metadata (sqlite), and performs double‑check
    • 3.2 aggsender submits the certificate to agglayer; agglayer syncs L1 info
    • 3.3 agglayer‑prover generates the ZK proof; agglayer submits the certificate proof + public inputs to L1
    • 3.4 After L1 verification, withdrawals/messages achieve L1 finality (PP verified)
  • 4.x Contract event sync (continuous)
    • 4.1 Bridge Service syncs L2 contract events
    • 4.2 Continuously sync L1 contract events

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.