X Layer RPC
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 :
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"}.
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,021et auparavant — Nécessite un cdk-Erigon nœud. Les nœuds Geth renvoientnullpour ces opérations historiques. - Après le bloc
42,810,021— Nécessite un Geth nœud. Les nœuds Erigon renvoientnullpour 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"}'
Complete reference for developers building on X Layer with Quicknode:
Démarrage rapide
Get started with X Layer quickly. Follow our step-by-step quickstart to set up your endpoint and make your first API request.
Points d'accès du fournisseur
Learn how to configure and manage your X Layer endpoints for optimal performance and reliability.
Présentation de l'API
Explorez les API, réseaux, produits Quicknode pris en charge et les fonctionnalités API améliorées pour créer des applications puissantes.
Marketplace
Découvrez et intégrez des modules complémentaires et des outils puissants du Quicknode Marketplace pour améliorer vos applications web3.
Sécurité des points de terminaison
Sécurisez vos points d'accès avec l'authentification, la liste blanche et les meilleures pratiques de sécurité.
Codes d'erreur
Understand common error codes and troubleshooting steps for X Layer API requests.