-
Notifications
You must be signed in to change notification settings - Fork 277
interop explainers #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
interop explainers #825
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9867427
interop explaienrs
cpengilly 73211a6
Apply suggestions from code review
cpengilly d559fdf
spelling fix
cpengilly a3844e3
Merge branch 'interop-part1' of https://github.com/ethereum-optimism/…
cpengilly eef4aa3
Merge branch 'main' into interop-part1
cpengilly f9f6af9
Apply suggestions from code review
cpengilly 6ead180
review updates
cpengilly f07d645
grammar batch
cpengilly fc628e6
add feedback
cpengilly 2233337
Update words.txt
cpengilly e51a164
image updates
cpengilly 7e79f7a
lang updates + mark feedback
cpengilly 74e1a78
Apply suggestions from code review
cpengilly 418508d
Update explainer.mdx
cpengilly 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,4 @@ | ||
| { | ||
| "explainer": "Interop Explainer", | ||
| "cross-chain-message": "Anatomy of Cross-Chain Message" | ||
| } | ||
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,36 @@ | ||
| --- | ||
| title: Anatomy of a Cross-Chain Message | ||
| lang: en-US | ||
| description: Learn how cross-chain messaging works with OP Stack interoperability. | ||
| --- | ||
|
|
||
| import { Callout } from 'nextra/components' | ||
| import Image from 'next/image' | ||
|
|
||
| # Anatomy of a Cross-Chain Message | ||
|
|
||
| A cross-chain message applies to any message sent across a chain. This applies to asset transfers using the [SuperchainERC20](https://specs.optimism.io/interop/token-bridging.html) token standard. | ||
|
|
||
| ## How It Works | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| To send a cross-chain message on the Superchain using [native OP Stack interoperability](explainer), these two aspects must be in place: | ||
|
|
||
| 1. Each interoperable chain runs a verifying node for each chain in the interoperable set. | ||
| 2. Each cross-chain message has an **initiating transaction** on the source chain and a **finalizing transaction** on the destination chain. | ||
| * **First/initiating transaction:** is submitted to the source chain and emits an event that can be consumed on a destination chain. | ||
| * **Second/finalizing transaction:** is submitted to a destination chain, where the block builder should only include it if certain that the first transaction was included in the source chain. The block builder can use OP-Supervisor to determine the integrity of the initiating message. Anyone can submit the second transaction. | ||
| <Callout type="default"> | ||
| There is no strict requirement that the executing message is ever submitted. See the specs for details on tracing the [executing message event](https://specs.optimism.io/interop/predeploys.html#executingmessage-event). | ||
| </Callout> | ||
|
|
||
| <br /> | ||
|
|
||
| <Image src="/img/op-stack/protocol/cross-chain-message.png" alt="Anatomy of Cross-Chain Message with Interop" width={700} height={500} /> | ||
|
|
||
| In the example above, `Ox123` sends 1 OP from OP Mainnet to Base, but this applies to any asset using the SuperchainERC20 token standard. | ||
|
|
||
| ## Next Steps | ||
|
|
||
| * More questions? Check out the FAQ section in the [OP Stack's Native Interop Explainer](explainer#faqs) or check out this [interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). | ||
| * Ready to get started? Use [SuperSim](https://github.com/ethereum-optimism/supersim), a local dev environment that simulates interop for testing applications against a local version of the Superchain. | ||
| * For more info about how OP Stack interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). | ||
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,79 @@ | ||
| --- | ||
| title: Interoperability Explainer | ||
| lang: en-US | ||
| description: Learn the basics of interoperability on the OP Stack. | ||
| --- | ||
|
|
||
| import { Callout } from 'nextra/components' | ||
| import Image from 'next/image' | ||
|
|
||
| # Interoperability Explainer | ||
|
|
||
| Interoperability is the ability for a blockchain to securely read the state of another blockchain. | ||
| Native OP Stack interoperability provides the ability to read messages and transfer assets across the Superchain (without having to go through L1) via secure message passing. This results in the following benefits: | ||
| * fungible and portable assets and liquidity | ||
| * lower fees and lower latency | ||
| * less fragmentation across the Superchain | ||
| * improved user experience for developers on the Superchain | ||
|
|
||
| ## Secure Message Passing | ||
| Native interop includes both the protocol layer message passing and the Superchain ERC20 token specification. | ||
|
|
||
| * **Message passing protocol:** the initial + finalizing/executing [message](https://specs.optimism.io/interop/messaging.html) that fire events to be consumed by the chains in the [dependency set](https://specs.optimism.io/interop/dependency-set.html) | ||
| * **SupERC20 token specification**: the [SuperchainERC20](https://specs.optimism.io/interop/token-bridging.html) turns message passing into asset transfer between chains in the interop set | ||
|
|
||
| This means ETH and ERC-20s can seamlessly and securely move across L2s, and intent-based protocols (i.e., bridges) can build better experiences on top of the message passing protocol. | ||
|
|
||
| ## Low Latency | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Interoperability allows for horizontally scalable blockchains, a key feature of the Superchain. With native interop, latency can be low (~2 seconds) by optimistically accepting cross-chain messages. | ||
| The fork choice rule enforces eventual consistency, meaning that if an invalid cross-chain message is accepted, it will be reorganized out eventually. | ||
| The fault proof guarantees that all of the cross-chain messages are accounted for from the perspective of handling withdrawals through the bridge to L1. | ||
|
|
||
| ## Permissionless Chain Set | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| It is permissionless to define a dependency on a chain, so chain operators will be able to choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Chain operators can add or remove chains from the dependency set through the `SystemConfig`. For example, the dependency set for OP Mainnet is managed by Optimism Governance. | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| However, since the nature of defining a dependency is one way, it is impossible for a chain to know of all of the other chains that depend on it. | ||
|
|
||
| ## Considerations | ||
| Chain operators will need to run additional infrastructure to be part of the interoperable set. | ||
| * The Superchain-backend service, `op-supervisor`, will be a requirement for running an OP Stack chain that has interop enabled. | ||
| `op-supervisor` is responsible for validating all cross-chain messages and will need to have an RPC configured for each chain in the dependency set. | ||
| * In the future, to reduce infrastructure costs, `op-supervisor` will rely on the P2P network and cryptographic schemes for validating cross-chain messages. | ||
|
|
||
| <Callout type="info"> | ||
| For additional considerations, join the [Interop discussion](https://github.com/ethereum-optimism/specs/discussions/128) in our specs repo. | ||
| </Callout> | ||
|
|
||
| ## Next Steps | ||
| * Want to learn more? Read our guide on the anatomy of a [cross-chain message](cross-chain-message) or check out this [interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). | ||
| * Ready to get started? Use [SuperSim](https://github.com/ethereum-optimism/supersim), a local dev environment that simulates interop for testing applications against a local version of the Superchain. | ||
| * For more info about how OP Stack interoperability works under the hood, [check out the specs](https://specs.optimism.io/interop/overview.html). | ||
|
|
||
| ## FAQs | ||
|
|
||
| ### What is the latency/security tradeoff? | ||
| If a sequencer does not want to trust another sequencer at all, they can choose to only accept executing messages where the initiating message has been finalized with L1 levels of security. This demonstrates the difference in latency vs speed. The L2 data must be submitted to L1 and then the L1 block containing the transaction with the L2 data must be finalized. It takes about 15 minutes for an L1 block to finalize, and higher throughput OP Stack chains like Base and OP Mainnet submit a batch about every 5 minutes. This means that it could take about 20 minutes for an L2 transaction to be considered final and be able to be trustlessly consumed by another chain. At lower latencies, the sequencer accepting the executing message takes on some amount of equivocation risk. It could be possible to build a bonding system to add economic security to prevent equivocation, but that is not in the scope of the first release. | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| See this [dune dashboard](https://dune.com/oplabspbc/op-stack-chains-l1-activity#submission-frequency) to see how often OP Stack chains submit batches. | ||
|
|
||
| <br /> | ||
|
|
||
| <Image src="/img/op-stack/protocol/safe-unsafe.png" alt="Safe and Unsafe Security Diagram" width={700} height={500} /> | ||
|
|
||
| ### What is stopping a sequencer from censoring a cross-chain message? | ||
| There is nothing stopping a sequencer from censoring a transaction when it is sent directly to the sequencer. This does not mean the network has no censorship resistance, users can always send a deposit transaction for censorship resistance as strong as L1 guarantees. The tradeoff here is the latency, instead of being confirmed in ~2 seconds, the transaction can be confirmed at the rate of L1 block production. It may be possible to adopt something like [EIP-7547](https://eips.ethereum.org/EIPS/eip-7547) in the future to enable low latency censorship resistance. | ||
|
|
||
| ### Are callback style transactions possible? | ||
| If two blocks are being built at the same time with shared knowledge of their contents, it is possible to build blocks where a transaction calls to another chain, does compute and then a transaction calls back with the results. This requires no protocol level changes, it just requires more sophisticated block builder infrastructure. | ||
|
|
||
| ### What is stopping a shared sequencer from including just the executing message and not the initiating message? | ||
| The protocol enforces the fact that all executing messages are valid. It does this by reorganizing out executing messages that have invalid initiating messages. Running software that does not enforce this would be non-standard behavior and would leave yourself at risk of accepting an invalid executing message and therefore running on a forked chain. | ||
|
|
||
| ### What is the trust/verification model? Do sequencers that opt into this interop system have to trust each other fully? | ||
| Sequencers only have to trust each other, if they are accepting executing messages where the initiating message is unsafe. This is because the sequencer's ability to equivocate on unsafe data, i.e., batch submit something different from what they gossip over the p2p network. Once data is submitted to L1, it is considered final relative to the L2 and therefore there is no longer an equivocation risk. | ||
|
|
||
| ### Is interop different between chains with non-fungible blockspace? | ||
| Chains that have non-fungible blockspace are chains that have different features - it could be that they use Plasma for data availability, a custom gas paying token or have a large execution gas limit. As long as the chain can be fault proven, it can work with native interoperability. At the application layer, it is important for chains to have legibility into the type of chain that the message originated from. This ensures that applications do not accept messages from chains they consider not secure enough. See this [discussion](https://github.com/ethereum-optimism/specs/issues/121) for additional thoughts. | ||
|
|
||
| When it comes to chains that have different gas limits that are interoperable, it creates a set of transactions that can execute on one chain but not the other. This happens when the transaction consumes more than the gas limit of the smaller chain but less than of the bigger chain. At 2024 usages levels, these sorts of transactions are very rare. In the future, it may be the case that these transactions become more common, it will be up to the chain operators to ensure quality of service for their users. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ blocklogs | |
| BLOCKPROFILERATE | ||
| blockprofilerate | ||
| Blockscout | ||
| blockspace | ||
| blocktime | ||
| BLOOMFILTER | ||
| bloomfilter | ||
|
|
||
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.