Passer au contenu principal

X Layer RPC

With Quicknode, you get access to our global X Layer network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.

What is X Layer?

X Layer is a zero-knowledge rollup (zkRollup) Layer 2 solution for Ethereum, built on zkEVM technology. It uses a hybrid proof approach — generating STARK proofs for execution and then recursively wrapping them into a SNARK for efficient on-chain verification. This ensures transactions are mathematically valid while inheriting Ethereum’s security.

Unlike optimistic rollups, X Layer does not require challenge periods for withdrawals because validity proofs provide cryptographic certainty once submitted. Finality depends on proof submission intervals — typically minutes rather than days — but is still faster than optimistic rollups. Transaction costs are significantly reduced compared to Ethereum mainnet, with savings coming from transaction batching and calldata compression.

X Layer achieves bytecode-level compatibility with the Ethereum Virtual Machine (EVM). This zkEVM architecture supports nearly all EVM opcodes and precompiles, with only minor differences in edge cases such as gas costs. This ensures that most existing Ethereum smart contracts and applications can be deployed without modification, preserving broad compatibility with Ethereum's execution environment, tooling, and developer ecosystem while providing zero-knowledge security guarantees.

Interacting with X Layer

X Layer fully supports the standard Ethereum JSON-RPC interface while also providing additional Layer 2–specific functionality. This ensures complete compatibility with existing Ethereum tooling, so developers can use X Layer seamlessly with tools such as MetaMask, Hardhat, Foundry, and Web3 libraries without code changes.

With the X Layer API, you can:

  • Execute all standard Ethereum JSON-RPC methods (eth_call, eth_sendTransaction, eth_getBalance)
  • Access X Layer–specific methods for rollup operations (e.g., querying proof status and bridge interactions)
  • Query bridge activity, batch submissions, and proof verification status
  • Subscribe to real-time L2 events via WebSocket connections
  • Use available tracing and inspection utilities for deeper blockchain debugging

You can connect to the API by:

  • Running a local X Layer node
  • Using a hosted provider such as a Quicknode X Layer endpoint, which provides access to X Layer Mainnet with high reliability, archive data, and enhanced performance

Réseaux pris en charge

Quicknode donne accès aux réseaux X Layer suivants :

Mainnet
Type :Production
ID de chaîne :
196
HTTP :
WSS :
Archive :Oui
Élagage :Aucun
Testnet
Type :Testnet
ID de chaîne :
1952
HTTP :
WSS :
Archive :Oui
Élagage :Aucun
Remarque :

XLayer utilise une « re-genèse » au niveau du bloc 42,810,021. Les données historiques antérieures à ce bloc sont disponibles, mais elles sont stockées sur des nœuds hérités et acheminées automatiquement lorsque vous indiquez un numéro de bloc spécifique pour des méthodes telles que eth_getBlockByNumber, eth_getBalance, et debug_trace*.

Le bloc 42 810 021 lui-même est introuvable et pourrait réapparaître {"code":4444,"message":"pruned history unavailable"}.

Exigences relatives aux nœuds de transaction

X Layer utilise deux clients de nœuds distincts , séparés à la frontière de la régénèse (bloc 42 810 021) :

  • Bloc 42,810,021 et auparavant — Nécessite un cdk-Erigon nœud. Les nœuds Geth renvoient null pour ces opérations historiques.
  • Après le bloc 42,810,021 — Nécessite un Geth nœud. Les nœuds Erigon renvoient null pour ces opérations en cours.

Pour interroger les données antérieures à la régénération, incluez le x-qn-height en indiquant dans votre requête le numéro du bloc cible afin qu'elle soit acheminée vers le cdk-Erigon nœud. Sans cet en-tête, les requêtes sont redirigées par défaut vers le Geth nœud ; l'en-tête n'est donc pas nécessaire pour les blocs postérieurs à la régénération.

Exemple antérieur à la Régénèse (cdk-Erigon, bloc ≤ 42 810 021) :

curl --location 'https://docs-demo.xlayer-mainnet.quiknode.pro/' \
--header 'Content-Type: application/json' \
--header 'x-qn-height: 42810020' \
--data '{"method":"eth_getBlockByNumber","params":["0x28D3AA4",false],"id":1,"jsonrpc":"2.0"}'

Exemple post-Regenesis (Geth, bloc > 42 810 021) :

curl --location 'https://docs-demo.xlayer-mainnet.quiknode.pro/' \
--header 'Content-Type: application/json' \
--data '{"method":"eth_getBlockByNumber","params":["0x28D3AA6",false],"id":1,"jsonrpc":"2.0"}'
Partager ce document