Тема
Build on X Layer

X Layer overview#

X Layer is a cutting-edge Ethereum layer 2 (L2) network built by OKX and Polygon using Polygon's CDK. Following the PP upgrade completed on August 5, 2025, it now supports throughput of up to 5,000 TPS with negligible gas fees. It offers full compatibility with the Ethereum Virtual Machine (EVM), enabling developers to deploy existing Ethereum applications and develop new, innovative projects at a fraction of the cost compared to doing so on Ethereum. X Layer also enables users to use dapps at significantly lower gas fees and faster speed compared to Ethereum.

X Layer executes and validates transactions on an EVM, with state and data maintained off‑chain. Routine L2 execution is EVM‑native; Polygon’s Pessimistic Proof (PP) is invoked only for bridging/cross‑domain settlement to provide verifiable finality on L1 or other domains. This contrasts with ZK/OP rollups where L1 data publication is part of the base protocol.

For more detailed information, you can check out the X Layer architecture below.

X Layer architecture#

The major components of X Layer are:

  • Virtual Machine: EVM‑equivalent
  • Consensus: Polygon Pessimistic Consensus (PolygonPessimisticConsensus.sol)
  • Sequencer: Trusted
  • Gas token: OKB (fixed supply at 21M post-burns/upgrades; L1 OKB phased out)
  • Additional Features: AggSender for AggLayer interoperability, SP1 Prover for pessimistic proofs

Background#

X Layer has migrated to the Pessimistic Proof (PP) mode introduced by Polygon. In this mode, L2 runs with trusted sequencers and off‑chain state/data storage; PP is used only for cross‑chain settlement (e.g., withdrawals) to provide verifiable finality on L1.

Architecture flow (PP 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 Proxyd → Erigon RPCs
    • 1.4 RPCs route Tx to Pool Manager; Pool Manager pushes Tx to the Sequencer pool
    • 1.5 The Sequencer includes the Tx in a block
    • 1.6 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 Proxyd; RPCs forward to Pool Manager/Sequencer
    • 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: execution/finality happens quickly on L2; for cross‑chain actions, a certificate + PP is produced and verified on L1 to finalize withdrawals/messages.

This flow ensures fast execution on L2 while providing cryptographic settlement for cross‑chain operations without publishing full L2 data to L1.

Pessimistic Proofs (PP) overview#

X Layer is built with Polygon CDK, an open‑source framework for EVM L2s on Ethereum. For cross‑chain operations (e.g., withdrawals and bridge messages), X Layer leverages Polygon's Pessimistic Proof (PP). PP produces a succinct proof that the claimed state transition is valid with respect to L2, enabling secure settlement on L1 without publishing full L2 transaction data.

How L1 settlement works#

A verifier/bridge smart contract is deployed on Ethereum. For cross‑chain operations, the Polygon‑side agglayer submits a PP (ZK) certificate/proof to this contract on behalf of X Layer. The proof attests to the L2 state transition result but not the full transaction data. The verifier contract checks the validity of the submitted PP; invalid submissions are rejected and not processed on Ethereum.

Consensus & finality#

Transactions are executed by the EVM and finalized on L2 by the trusted sequencer set. Cross‑chain finality is handled by the Polygon‑side agglayer subsystem: xlayer generates and stores certificate data (metadata/epochs), aggsender syncs and submits certificates to agglayer, and agglayer/agglayer‑prover submits PP proofs on L1. The two key flows are: L2 block production & data writes and cross‑chain certificate + PP submission. Participants include Sequencer and the aggsender/agglayer pipeline.

Sequencer: responsible for batching transactions on L2, producing blocks, and writing chain data.

aggsender/agglayer: aggsender fetches blocks/certificates from the node side, performs double‑check, and syncs the certificate to agglayer; agglayer (with agglayer‑prover) submits PP proofs on L1 to complete cross‑chain settlement.

Data model and settlement#

X Layer stores transaction data and state off‑chain and uses PP only to settle cross‑chain operations on L1. This design keeps fees low and throughput high while still providing verifiable finality for bridge operations via proofs.

X Layer node#

The X Layer node (based on xlayer-erigon) syncs with the L2 state. Trusted sequencers are responsible for managing L2 state and batching, while cross‑chain finality is handled by PP.

Note
For node internals and configuration, see the xlayer-erigon repository.

Pessimistic Proofs (PP) for cross‑chain#

For bridging and cross‑domain settlement, X Layer integrates Polygon's Pessimistic Proofs. During a withdrawal or cross‑chain message, an aggregator produces a PP that attests to the L2 state at a given checkpoint. This proof is verified by the L1 bridge/verifier contract before funds/messages are released on L1. PP is not used for day‑to‑day L2 transaction execution.

Transactions on X Layer#

Layer 2 transactions:

  • A user sends a transaction from their wallet to the network via Proxyd/RPC; the Sequencer includes it in an L2 block.
  • Once the Sequencer commits the block, the transaction is finalized on L2 (execution and fees are enforced on L2).
  • For cross‑chain actions (withdrawals, bridge messages), xlayer produces a certificate; aggsender submits the certificate to agglayer.
  • agglayer/agglayer‑prover generates a Pessimistic Proof (PP) and submits it to the L1 verifier/bridge contract.
  • After the PP is verified on L1, the cross‑chain operation reaches L1 finality. Day‑to‑day L2 transactions do not require PP.