The process of validating a specific transaction within the batch typically involves three steps:
Transactions on the X Layer network have a typical flow starting from the users’ interactions with their wallet on X Layer, to how the transactions are batched, sequenced, and aggregated on Ethereum layer 1:
As a user, you submit transactions by signing transactions and sending them through the JSON-RPC interface.
The transactions are then stored in the pending transaction pool, where the sequencer node running the ZKEVM software picks these transactions up and decides which ones it wants to process or discard. The sequencer will do a few of the following checks to see if the transaction should be discarded or processed:
Once the transaction is considered valid, the sequencer will update the X Layer state. Users will experience transactions going through almost instantly. From here onwards, the user remains engaged in the X Layer layer 2 state. Everything that follows involves sharing transaction data back to Ethereum layer 1, but this step is only important for users who wish to transfer their funds from X Layer layer 2 back to Ethereum layer 1.
The sequencer combines multiple transactions into a single batch and sends them to the ZkEVM.sol
smart contract. This contract is stored on Ethereum mainnet and also has a separate version on the Ethereum Sepolia testnet.
Batches are not necessarily validated or confirmed at this stage.
Using ZKPs, the ZkEVM.sol
smart contract acts as a verifier in verifying transactions. It verifies whether the batch just received is valid or not, through sending the batch to an aggregator node.
The ZkEVM.sol
smart contract sends the batch it just received to an aggregator node, which is a machine running ZKEVM software that communicates with a ZKProver. The flow is as follows:
ZkEVM.sol
smart contractZkEVM.sol
verifies the validity proof
Finally, DApps read information from X Layer through the synchronizer. It reads events from the Ethereum smart contract(s), storing knowledge of both the ZK-validity proofs from the aggregator, and the batches submitted from the sequencer. This way, DApps can easily get a view of the state of X Layer via JSON-RPC.