Transactions are fundamental to any blockchain, acting as cryptographically signed instructions that initiate a change in the network's state. On Scroll, a zk-rollup designed for scaling Ethereum, a transaction can range from a simple transfer of assets to a complex smart contract interaction. This guide provides a comprehensive overview of how transactions function within the Scroll ecosystem, detailing their types, life cycle, and underlying batching mechanics.
Core Transaction Types on Scroll
Scroll currently supports three distinct types of transactions, each serving a specific purpose within its architecture.
- Pre-EIP-155 Transaction: This legacy format is primarily supported to ensure compatibility with the Singleton Factory contract (EIP-2470).
- Legacy Transaction: This type follows the standard defined in Ethereum's EIP-155, which introduced a simple chain ID replay protection mechanism.
- L1MessageTx (Type: 0x7E): This is a new EIP-2718 typed transaction unique to Scroll. It is designed specifically for messages that are initiated on Ethereum Layer 1 (L1) and subsequently executed on Scroll Layer 2 (L2).
It is important to note that Scroll does not currently support EIP-2930 (Access Lists) or EIP-1559 (dynamic fee market) transaction types. However, the network plans to reintroduce support for these in a future update.
The L1 Message Transaction Explained
The L1MessageTx is a critical innovation for cross-domain communication. When a user initiates an action on an L1 Scroll bridge contract, a message is placed in the L1MessageQueue. The Scroll sequencer then picks up this message and creates a corresponding L1MessageTx to be included in an L2 block.
A key characteristic of this transaction type is that it lacks a signature. The user's authorization was already implicitly verified when the original transaction was submitted and validated on the L1 blockchain.
The structure of an L1MessageTx is defined as follows:
QueueIndex: The unique index of the message in the L1 queue.Gas: The gas limit for the L2 execution.To: The recipient address on L2 (contract creation from L1 is not permitted).Value: The amount of ether to be transferred.Data: The input data for the call.Sender: The address of the sender on L1.
This transaction type is RLP-encoded according to EIP-2718 rules: TransactionType || TransactionPayload, where the type is 0x7E.
Notable behaviors of L1MessageTx:
- The
QueueIndexis used instead of the sender's account nonce, though the sender's nonce on L2 will still increment after execution. - These transactions do not pay L2 or L1 gas fees on Scroll. The cost for L2 execution is covered when the user pays for the initial L1 transaction. The L1 data fee is waived because the transaction data is already available on L1. For a deeper dive into fee mechanics, you can 👉 explore more about transaction fee structures.
The Journey of a Scroll Transaction
Every transaction on the Scroll network progresses through three distinct phases before it is considered an immutable part of the chain's history.
- Confirmed: A transaction reaches the
Confirmedstate once it has been executed and included in a new L2 block. This provides users with initial execution certainty on L2. - Committed: Next, the L2 blocks containing the transaction are grouped into a batch. The data for this batch is then submitted to Ethereum L1 via a commit transaction. Once this commit transaction is finalized on L1, the transaction's status becomes
Committed. At this point, the transaction data is publicly available on Ethereum, allowing anyone to reconstruct the L2 state. - Finalized: The final stage involves generating a validity proof for the batched transactions. This cryptographic proof is verified on the L1 Scroll contract through a finalize transaction. Once this verification is successful and the finalize transaction is confirmed, the transaction status changes to
Finalized. It is now a canonical and trustless part of the Scroll L2 chain.
How to Submit a Transaction
Users and smart contracts can interact with Scroll through two primary entry points.
The first method is to submit a transaction directly to an L2 sequencer. This is the standard method for most L2-native actions and requires users to simply configure their wallet (like MetaMask) to connect to a Scroll RPC endpoint.
The second method is to initiate a transaction from Ethereum L1. The Scroll L1 bridge contracts provide three main gateways for this:
- Token Deposits: The
ScrollGatewayRouterand standard token gateways allow users to deposit tokens like ETH and ERC-20s from L1 to L2. - Arbitrary Messages: The
L1ScrollMessengercontract enables users and smart contracts to send any arbitrary data or call to L2. - Enforced Transactions: The
EnforcedTxGatewayallows Externally Owned Accounts (EOAs) to initiate a transaction from the same address on L2, commonly used for withdrawals.
All messages sent via these L1 gateways are appended to the L1MessageQueue, from which the sequencer processes them into L2 blocks.
The Commit and Finalize Process
The rollup node plays a crucial role in the transaction life cycle. It packs confirmed L2 blocks into chunks and batches. Periodically, it submits a commit transaction to L1, posting the data of an entire batch to the ScrollChain contract. This action moves all transactions in that batch to the Committed state.
Subsequently, after a validity proof is generated for the batch, the rollup node submits a finalize transaction. This transaction includes the proof and the new state root for on-chain verification. Its success transitions the batch's transactions to the Finalized state, providing strong, math-backed finality.
How Scroll Batches Transactions for Efficiency
To optimize gas costs and proof verification on Ethereum, Scroll employs a sophisticated multi-tier batching schema.
- Blocks: Individual transactions are ordered and packaged into L2 blocks.
- Chunks: A series of contiguous blocks are grouped into a chunk. The chunk is the fundamental unit for generating zero-knowledge proofs in the zkEVM circuit.
- Batches: Multiple contiguous chunks are grouped into a batch. The batch is the base unit for both data commitment (via the commit transaction) and proof verification (via the finalize transaction) on L1. The proof for a batch is an aggregation of all the proofs from its constituent chunks.
This hierarchical approach allows Scroll to amortize the fixed cost of L1 operations over a large number of L2 transactions, significantly reducing the overall cost per transaction and enhancing scalability. Upon chunk creation, a proving task is sent to a prover. When a batch is created, its data is committed to L1, and an aggregator prover begins the task of creating a single, aggregated validity proof for the entire batch.
Frequently Asked Questions
What is the main difference between a confirmed and a finalized transaction?
A confirmed transaction has been included in an L2 block and provides fast, pre-confirmation. A finalized transaction has had its validity cryptographically proven and verified on Ethereum L1, offering the highest level of security and finality equivalent to Ethereum itself.
Can I cancel a transaction after I submit it to Scroll?
Once a transaction is submitted to the network and included in a block, it cannot be canceled. For transactions stuck in a pending state (e.g., due to low gas), users can sometimes attempt to replace them by submitting a new transaction with the same nonce and a higher gas price.
Why are some transaction types like EIP-1559 not supported yet?
Scroll prioritizes security and stability. As a new zk-rollup, it launched with a core set of robust features. Support for more advanced transaction types like EIP-1559 is on the roadmap and will be integrated after thorough testing to ensure a seamless user experience.
How long does it take for a transaction to finalize?
The time to finality can vary. While confirmation on L2 is nearly instantaneous, finalization depends on the time it takes to generate the validity proof and for the finalize transaction to be processed on Ethereum, which is influenced by L1 network congestion.
Do I need to do anything special to send a transaction from L1 to L2?
Yes, you must interact with the correct Scroll bridge contracts on Ethereum L1. You cannot send funds directly to an L2 address from an L1 wallet; you must use the official bridge interfaces or supported third-party bridges. To 👉 view the real-time bridge interface, check the official Scroll documentation for the most up-to-date links and guides.