Transaction Life Cycle

Understanding the components of Layer4 Network becomes simpler when we approach them through the context of a transaction.

1. Creating a Transaction

Just like with any blockchain, users usually initiate their interactions with Layer4 Network through a dApp. The dApp suggests a transaction for users to sign using their wallet, and once signed, the transaction is forwarded to an RPC node.

RPC nodes encompass diverse APIs based on the specific blockchain. For instance, EVM chains commonly incorporate the Ethereum JSON-RPC. Given Layer4 Network's support for EVM chains, we must manage various transaction types.

To manage EVM transactions, proxy nodes are employed. These proxy nodes implement the Ethereum JSON-RPC to receive EVM transactions and then relay them to Layer4 nodes that are equipped with the Ethereum JSON-RPC functionality. EVM wallets can directly send transactions to Layer4 full nodes.

2. Sequencing Transactions

Upon receiving a transaction, the necessity arises to arrange it in relation to other transactions. The significance of this arrangement lies in its capacity to provide opportunities for arbitrage, commonly referred to as miner extractable value (MEV), based on the sequence of transactions. The responsibility of managing this sequencing task is assigned to a logical entity termed the sequencer.

Various methods exist for sequencing transactions, each with its own unique approach. The simplest approach, which is widely adopted by most rollups, employs a centralized sequencer. More advanced strategies encompass shared sequencers, where a single sequencer orchestrates transaction sequencing for multiple chains, and decentralized sequencers, which involve incorporating a consensus mechanism within a group of sequencers dedicated to a single chain.

3. Block Production

Upon sequencing transactions, a commitment is established for the transaction sequence, which is then fed into an executor, often referred to as "L3." This executor is tasked with calculating the resulting blockchain state.

Until this stage, the process in Layer4 Network bears resemblance to typical rollup mechanisms. Transactions arrive, undergo execution, and culminate in a block containing transactions and an associated (untrusted) state root. State root commitments are cryptographic assertions of a blockchain's state following transaction execution, enabling selective verification of parts of the state without the need for complete local state information.

In Layer4 Network, block production primarily hinges on the sequencer's role, which serves the network by:

  • Furnishing transaction confirmations and state updates

  • Creating and executing rollup blocks

  • Transmitting rollup blocks to the settlement layer, where they are subsequently transferred to the consensus layer

4. Finalizing a Transaction

Ensuring the accuracy of the computed state is a fundamental aspect of all rollups. This process, known as settlement, varies based on whether the rollup is optimistic or zero-knowledge. In either scenario, the executor's block of transactions is forwarded to the chosen data availability (DA) layer of the rollup. Layer4 Network leverages the settlement layer as an intermediary for posting blocks to the DA layer, offering the advantage of compressing multiple blocks and maintaining lightweight rollup nodes, as only the Layer4 settlement layer needs to run DA layer light clients.

Optimistic Settlement

In the case of optimistic rollups on Layer4 Network, a state root commitment and bounty are also posted to the settlement layer. This facilitates challenges from verifiers to the computed state. Verifiers are full nodes that retrieve transaction blocks from the data availability layer and re-execute them. They compare their derived state root with the one posted to the settlement layer and initiate a challenge if inconsistencies arise. Challenges can be raised during a defined challenge period. Upon the completion of the challenge period without any challenges, the transaction achieves finality, signifying that Layer4 Network will not reverse it. Challenges prompt the verifier to identify the last agreed-upon state root. If no challenges are raised, full nodes on the settlement layer re-execute the disputed transaction on-chain to determine the correctness of the original state root. If discrepancies are confirmed, the executor faces a penalty (slashing), and the chain is reverted.

Zero-Knowledge Settlement

For zero-knowledge rollups on Layer4 Network, transactions are re-executed using zero-knowledge proofs (zk-proofs). The computed proof is then posted to the settlement layer for verification. Immediate finalization of the transaction occurs upon successful zk-proof verification.

5. Protecting a Transaction Using Fraud Proof

When it comes to ensuring the validity of a transaction within the Layer4 Network, fraud proofs play a pivotal role. These proofs act as defensive measures to counter any attempt at manipulating the system or introducing fraudulent activities. If any malicious behavior or erroneous data is detected within the network, fraud proofs provide a way to validate the transaction's legitimacy and protect the overall integrity of the blockchain. This protective layer enhances the security and reliability of transactions, reinforcing the trustworthiness of the Layer4 Network's ecosystem.

Last updated