This repository was archived by the owner on Apr 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 335
Transaction Finality Explainer #987
Merged
Changes from 12 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
a6ac1ab
Initial commit
krofax 0b36071
updated docs
krofax 10bac65
updated the docs and added image
krofax 2063c26
updated the docs
krofax 880a3eb
fix lint issues
krofax 7cbd715
updated finality docs
krofax f35ba6c
fix linting errors
krofax 0b66134
fix conflict
krofax e87c41b
updated few grammar errors
krofax d1003e6
updated the tones
krofax 5d50382
updated some concepts
krofax 96d6722
removed duplications
krofax 565bc82
Updated structure
krofax 1a136d6
resolved suggestions
krofax 16f6052
fix lint errors
krofax 0139df2
Update pages/stack/transactions/_meta.json
krofax 186d941
Update pages/stack/transactions/_meta.json
krofax 4eced45
Update pages/stack/transactions/_meta.json
krofax 062aa1a
Update pages/stack/transactions/_meta.json
krofax fc42888
Update pages/stack/transactions/transaction-finality.mdx
krofax c1ebce7
Update pages/stack/transactions/transaction-finality.mdx
krofax 2b3e7ed
Update pages/stack/transactions/transaction-finality.mdx
krofax 965f8b9
Update pages/stack/transactions/transaction-finality.mdx
krofax 8cf8f59
Update pages/stack/transactions/transaction-finality.mdx
krofax 60e3688
Update pages/stack/transactions/transaction-finality.mdx
krofax a19a677
Update pages/stack/transactions/transaction-finality.mdx
krofax 6340edd
Update pages/stack/transactions/transaction-finality.mdx
krofax ce345b5
Update pages/stack/transactions/transaction-finality.mdx
krofax 1d70689
Update pages/stack/transactions/transaction-finality.mdx
krofax b9acf97
Update pages/stack/transactions/transaction-finality.mdx
krofax f6f4a38
resolved comments
krofax 376a990
fix conflict
krofax 867fb4c
Update pages/stack/transactions/transaction-finality.mdx
krofax 8a9ecd0
Update pages/stack/transactions/transaction-finality.mdx
krofax b2cac6a
Update pages/stack/transactions/transaction-finality.mdx
krofax f5929b5
updated content
krofax d27bae6
updated the docs
krofax b71df34
removed wrong word
krofax aacd64f
resolved comments
krofax 71ea8fc
Used sentence case in meta json file
krofax d7bec26
Update pages/stack/transactions/transaction-finality.mdx
sbvegan 04bb7e9
Update pages/stack/transactions/transaction-finality.mdx
krofax e755619
Update pages/stack/transactions/transaction-finality.mdx
krofax f9a4bb0
updated text
krofax 4513c5c
fix merge conflict
krofax 99abedd
fix merge conflcits
krofax 8c54927
feat: miscellanous improvements to finality doc
smartcontracts eda6ab7
Removed passive tones, and rephrased contents
krofax 4c88d3a
replaced image with a mermaid diagram
krofax 241c587
update meta.json
krofax 1a13d97
Fix merge conflict
krofax c8c3d52
updated meta.json
krofax 76396df
Update pages/stack/transactions/transaction-finality.mdx
krofax 47ad29d
Update pages/stack/transactions/transaction-finality.mdx
krofax 71774a7
Update pages/stack/transactions/transaction-finality.mdx
krofax 816ac38
Update pages/stack/transactions/transaction-finality.mdx
krofax 45a3248
Update pages/stack/transactions/transaction-finality.mdx
krofax 1186141
remove todo
krofax 4460b89
Update pages/stack/transactions/transaction-finality.mdx
krofax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| --- | ||
| title: Transaction Finality | ||
| lang: en-US | ||
| description: Learn about finality in OP Stack and the steps to achieve transaction settlement. | ||
| --- | ||
|
|
||
| import Image from 'next/image' | ||
| import { Callout } from 'nextra/components' | ||
|
|
||
| # Overview | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| This guide explains how transaction finality works in OP Stack, covering the fundamental concepts of Fault Proofs and Challenges. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
|
krofax marked this conversation as resolved.
|
||
| OP Stack is an extension of Ethereum's consensus mechanism. Instead of running an entirely separate consensus protocol, the OP Stack leverages Ethereum's consensus. | ||
| This enables it to take advantage of Ethereum's transaction ordering mechanism and finalize its own blocks without requiring a new consensus layer. | ||
|
|
||
| ## State Machines and Transaction Processing | ||
|
|
||
| State machines, such as the Ethereum Virtual Machine (EVM), rely on input lists (transactions) to evolve from one state to another. The order of the transactions is critical because incorrect ordering can lead to an invalid state. | ||
|
|
||
| For example, if a user attempts to send 1 ETH to two different parties at the same time, only one transaction can be valid. The order determines which transaction succeeds, making transaction ordering an essential aspect of consensus. | ||
|
|
||
| ## Commutative vs. Non-Commutative Operations | ||
|
|
||
| Commutative operations allow the order of inputs to change without affecting the outcome. However, non-commutative operations (like sending funds) require strict ordering. Therefore, both the availability and the order of the transaction list are fundamental to ensuring the system's integrity. | ||
|
|
||
| ## Consensus and Ordering | ||
|
|
||
| Consensus determines the valid chain or list of transactions. In the OP Stack, Ethereum's Proof of Stake (PoS) consensus mechanism is used to achieve transaction ordering and finality. | ||
|
|
||
| ## Why Use Ethereum's Consensus? | ||
|
|
||
| By publishing blocks on Ethereum, the OP Stack effectively outsources its consensus mechanism. Instead of creating a separate consensus protocol, the OP Stack relies on Ethereum's ordering and finality guarantees. | ||
|
|
||
| ### Key benefits of this approach: | ||
|
|
||
| * OP Stack inherits Ethereum's security and transaction ordering properties. | ||
| * It simplifies the design and development process by eliminating the need for a separate consensus protocol. | ||
| * Attack vectors, such as double-spends, are mitigated by Ethereum's security mechanisms. | ||
|
|
||
| ## Sequencer Operations | ||
|
|
||
| The sequencer (block producer) processes transactions in the following steps: | ||
|
|
||
| 1. Pre-publishing Distribution: | ||
| * The sequencer receives transactions from users. | ||
| * It creates blocks containing these transactions. | ||
| * It distributes these blocks to network nodes before L1 publication. | ||
| * Nodes mark these blocks as "unsafe." | ||
|
|
||
| 2. L1 Publication: | ||
| * The sequencer publishes the blocks to Ethereum (L1). | ||
| * Once included in L1, the blocks are marked as "safe." | ||
| * Blocks achieve "finalized" status after L1 finalization (approximately 20 minutes). | ||
|
|
||
|
krofax marked this conversation as resolved.
Outdated
|
||
| ### Sequencer Trust Assumptions | ||
|
|
||
| The sequencer operates with the following trust assumptions: | ||
|
|
||
| * It can temporarily withhold transactions. | ||
| * It may attempt to reorder transactions before L1 publication. | ||
| * Once transactions are published on L1, the sequencer cannot modify or censor them. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
| * The sequencer cannot affect finalized transactions. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Transaction Finality States | ||
|
|
||
| In the OP Stack, transaction finality progresses through three key stages: | ||
|
|
||
| 1. **Unsafe:** The L2 sequencer creates a block containing the transaction, but the transaction data has not yet been posted to Ethereum (L1). The block is circulated within the L2 network for speed. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| 2. **Safe:** The sequencer's batcher posts the transaction data to L1. At this point, any L2 node can derive the transaction. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| 3. **Finalized:** Transactions are finalized once more than 65 Ethereum blocks (approximately 20 minutes) have passed, ensuring that the L1 data is secure and cannot be reorganized. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| <Image src="/img/op-stack/protocol/tx-finality.png" alt="Transaction Finality Diagram." width={0} height={0} sizes="100vw" style={{ width: '100%', height: 'auto' }} quality={100} /> | ||
|
|
||
| ## Block and Transaction Validity in the OP Stack | ||
|
|
||
| When a block is submitted to Ethereum, it is either valid or invalid. If the block is valid, the state is updated accordingly. If it is invalid, the block is discarded. Nodes execute valid blocks and update the state as required. | ||
|
|
||
| ### Reorgs and Finality | ||
|
|
||
| Once a block is included in a finalized Ethereum block, it cannot be reorganized. Therefore, blocks enjoy the same finality guarantees as Ethereum blocks, and this finality is managed by the OP Stack architecture. | ||
|
|
||
|
krofax marked this conversation as resolved.
Outdated
|
||
| ### Handling Reorgs | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| If an Ethereum reorganization (reorg) occurs: | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| 1. L2 nodes detect the L1 reorg. | ||
| 2. Affected L2 blocks revert to an "unsafe" status. | ||
|
sbvegan marked this conversation as resolved.
Outdated
|
||
| 3. The sequencer typically republishes the same transactions. | ||
| 4. The system returns to a consistent state after reprocessing. | ||
|
|
||
| ## The Role of the Proof System | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| The proof system is entirely separate from the core OP Stack protocol. It is an application-level validation system designed to ensure the accuracy of certain claims about the transaction state. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### What Is a Claim? | ||
|
|
||
| A claim in the context of OP Stack is a statement asserting the state of the system at a specific block height. For instance, a claim might assert that at block 1,000,000, the state hash is `XYZ`. If other participants believe this claim to be incorrect, they can challenge it. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Fault Proofs and Challenges | ||
|
|
||
| Challenges focus on proving whether a given claim is valid. The outcome of a challenge does not impact the underlying chain. For example, if a claim about the transaction state at a specific block is proven wrong, it only affects the app-level functionality and does not alter the OP Stack protocol. | ||
|
|
||
| ### Bridge Independence | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| Key aspects of bridge systems include: | ||
|
|
||
| * Bridges are application-level constructs. | ||
| * They operate independently from the core OP Stack protocol. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
| * Bridge security does not affect the validity of L2 transactions. | ||
| * Bridge failures do not cause L2 reorgs or state changes. | ||
|
|
||
| ### Example: Custom Bridges in OP Stack | ||
|
|
||
| A custom bridge might be developed by a user to allow ERC-20 tokens to move between layers. However, this bridge is application-level and not native to the OP Stack. If there is an issue with the bridge, such as incorrect proof validation, it does not impact the protocol itself but affects the subjective value of the bridged assets. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## 7-Day Challenge Period in OP Stack | ||
|
|
||
| The 7-day challenge period provides time for challenges to be raised and resolved. | ||
| Although OP Stack finalizes transactions quickly (within 20 minutes), withdrawals from L2 are delayed to allow for fault-proof validation. | ||
| This delay ensures that any malicious activity can be detected and addressed before it impacts the system. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Why Seven Days? | ||
|
|
||
| The 7-day challenge period is a reasonable time frame that allows participants to organize a response, potentially even initiating a L1 hard fork to address critical issues. In the OP Stack, this challenge period also serves as a safeguard for app-level bridges and custom designs that may be built on top of the core protocol. | ||
|
|
||
| ### Withdrawal Delays vs. Finality | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| One common misconception is confusing withdrawal delays with transaction finality: | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| * Transaction finality occurs in approximately 20 minutes. | ||
| * Withdrawal delays (often 7 days) are separate from transaction finality. | ||
| * Withdrawal delays are application-level security features. | ||
| * These delays affect only L1 withdrawals, not L2 transaction finality. | ||
|
|
||
| ## Conclusion | ||
|
|
||
| Transaction finality in the OP Stack relies on Ethereum's consensus mechanism. The OP Stack inherit Ethereum's finality guarantees, while the proof system adds an additional layer of validation for app-level functionality. While blocks finalize quickly, the proof system introduces a delay for withdrawals to ensure the security of bridging mechanisms. | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.