テーマ
Build on X Layer

X Layer overview#

X Layer is a cutting-edge Ethereum layer 2 (L2) network built by OKX using the Optimism Stack (OP Stack) framework. Through extensive optimization and enhancement of the standard OP Stack, X Layer now supports throughput of up to 5,000 TPS with negligible gas fees. It offers full EVM equivalence (not just compatibility), enabling developers to deploy existing Ethereum applications without any modifications and develop new, innovative projects at a fraction of the cost compared to doing so on Ethereum. X Layer also enables users to interact with dapps at significantly lower gas fees and with faster transaction confirmation compared to Ethereum. X Layer leverages the battle-tested optimistic rollup architecture, where transactions are executed and sequenced on L2 with periodic batch submission to L1 Ethereum. The system assumes transactions are valid by default, with a 7-day challenge period for fraud proofs to ensure security. Unlike ZK rollups that require complex cryptographic proofs for every state transition, X Layer's optimistic approach allows for simpler and more efficient operation while maintaining the security guarantees of Ethereum. The implementation includes enterprise-grade enhancements such as the Conductor high-availability cluster for sequencer redundancy, ensuring 99.9% uptime for production environments. For more detailed information, you can check out the X Layer OP Stack architecture documentation.

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.