Skip to content

Commit 3eb7a66

Browse files
authored
Merge pull request #1297 from qbzzt/250125-weth-interop
Rewrite of `SuperchainWETH`
2 parents 5f16660 + 2d6501c commit 3eb7a66

File tree

3 files changed

+109
-53
lines changed

3 files changed

+109
-53
lines changed

pages/stack/interop/_meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"predeploy": "Interop predeploys",
44
"message-passing": "Interop message passing",
55
"op-supervisor": "OP Supervisor",
6-
"superchain-weth": "SuperchainWETH (Interoperable ETH)",
6+
"superchain-weth": "Interoperable ETH",
77
"superchain-erc20": "SuperchainERC20",
88
"security": "Cross-chain security",
99
"tools": "Tools",
Lines changed: 108 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
---
2-
title: SuperchainWETH (Interoperable ETH)
2+
title: Interoperable ETH
33
lang: en-US
4-
description: Learn basic details about SuperchainWETH or Interoperable ETH.
4+
description: Learn basic details about Interoperable ETH.
55
---
66

77
import { Callout } from 'nextra/components'
88

9-
# SuperchainWETH (Interoperable ETH)
9+
import { InteropCallout } from '@/components/WipCallout'
1010

11-
<Callout>
12-
Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information.
13-
</Callout>
11+
<InteropCallout />
1412

15-
Superchain WETH or Interoperable ETH is a specialized version of the standard WETH (Wrapped Ether) contract designed to enable seamless movement of ETH across the Superchain. It addresses the liquidity constraints and usability issues that arise when transferring ETH between different chains.
13+
# Interoperable ETH
14+
15+
InteroperableETH enables seamless ETH transfers across Superchain blockchains. It is implemented using three key contracts:
16+
17+
* [`SuperchainWETH`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainWETH.sol): A bridge contract that facilitates ETH transfers between Superchain blockchains.
18+
* [`ETHLiquidity`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/ETHLiquidity.sol): A liquidity provider for ETH transfers.
19+
`SuperchainWETH` uses this contract as a liquidity repository to ensure ETH availability on the destination chain.
20+
* [`L2ToL2CrossDomainMessenger`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol): A messaging contract that [facilitates cross-chain communication](/message-passing).
21+
22+
InteroperableETH deposits ETH into the `ETHLiquidity` contract on the source chain and withdraws an equivalent amount on the destination chain.
23+
This mechanism improves capital efficiency and eliminates liquidity fragmentation and poor user experiences caused by asset wrapping or reliance on liquidity pools.
1624

1725
## Features and benefits
1826

@@ -21,66 +29,117 @@ Superchain WETH or Interoperable ETH is a specialized version of the standard WE
2129
* Provides liquidity for cross-chain transactions
2230
* Improves user experience by abstracting complex bridging processes
2331

24-
<Callout>
25-
The `SuperchainTokenBridge` can only rebalance assets across chains. It cannot mint or increase/decrease the total circulating supply.
26-
</Callout>
27-
2832
## How it works
2933

30-
Currently, L2-to-L2 ETH transfers between two interoperable chains require four separate transactions:
31-
32-
1. Wrap `ETH` to `SuperchainWETH`.
33-
2. Call `SuperchainTokenBridge#SendERC20` to burn `SuperchainWETH` on source chain and relay a message to the destination chain that mints `SuperchainWETH` to the recipient (`crosschainBurn` is used).
34-
3. Execute the message on the destination chain, triggering `SuperchainTokenBridge#RelayERC20` to mint `SuperchainWETH` to the recipient (`crosschainMint` is used). If the destination is a non-custom gas token chain, ETH is sourced from the `ETHLiquidity` contract.
35-
4. Unwrap the received `SuperchainWETH` to `ETH`.
34+
```mermaid
3635
37-
<Callout type="info">
38-
Abstraction is a possible future consideration to reduce this process to two transactions, which can be followed in the [design docs](https://github.com/ethereum-optimism/design-docs/pull/146/files).
39-
</Callout>
36+
%%{
37+
init: {
38+
"sequence": {
39+
"wrap": true
40+
}
41+
}
42+
}%%
4043
41-
```mermaid
4244
sequenceDiagram
43-
participant User
44-
participant Source Chain
45-
participant Cross-Chain Messenger
46-
participant Destination Chain
47-
48-
User->>Source Chain: 1. Wrap ETH to SuperchainWETH
49-
Source Chain->>Cross-Chain Messenger: 2. Burn SuperchainWETH and relay message
50-
Cross-Chain Messenger->>Destination Chain: 3. Mint SuperchainWETH to recipient
51-
User->>Destination Chain: 4. Unwrap SuperchainWETH to ETH
45+
box rgba(0,0,0,0.1) Source Chain
46+
participant src-liquidity as ETHLiquidity
47+
participant src-weth as SuperchainWETH
48+
end
49+
actor user as User
50+
participant any-offchain as User, Relayer, etc.
51+
box rgba(0,0,0,0.1) Destination Chain
52+
participant dst-l2Xl2 as L2ToL2CrossDomainMessenger
53+
participant dst-weth as SuperchainWETH
54+
participant dst-liquidity as ETHLiquidity
55+
participant dst-final as ETH Destination
56+
end
57+
rect rgba(0,0,0,0.1)
58+
note over src-weth, dst-l2Xl2: Initiating Message
59+
user->>src-weth: 1. sendETH(to, chainId) with n ETH
60+
src-weth->>src-liquidity: 2. Deposit n ETH
61+
src-weth->>dst-l2Xl2: 3. Send relayETH to Superchain WETH on chainId
62+
end
63+
rect rgba(0,0,0,0.1)
64+
note over any-offchain,dst-weth: Executing message
65+
any-offchain->>dst-l2Xl2: 4. Relay the message
66+
dst-l2Xl2->>dst-weth: 5. relayETH(from, to, amount)
67+
dst-weth->>dst-liquidity: 6. Withdraw amount ETH
68+
dst-weth->>dst-final: 7. Here are amount ETH
69+
end
5270
```
53-
_Figure 1: Superchain WETH transfer process between two interoperable L2 chains._
5471

55-
<Callout type="warning">
56-
`crosschainBurn` and `crosschainMint`can only be called by the `SuperchainTokenBridge`.
57-
</Callout>
72+
#### Initiating message
73+
74+
1. The user (or a contract operating on a user's behalf) calls `SuperchainWETH.sendETH` with a destination address and a chainId.
75+
ETH, in the amount to transfer must be attached to this call.
76+
77+
2. `SuperchainWETH` transfers the specified ETH amount to `ETHLiquidity`, removing it from circulation on the source chain.
78+
79+
3. `SuperchainWETH` on the source chain sends a [`relayETH`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainWETH.sol#L125-L145) message to `SuperchainWETH` on the destination chain using the [`L2ToL2CrossDomainMessenger`](/message-passing).
80+
81+
#### Executing message
82+
83+
4. An off-chain entity submits a transaction to execute the message.
84+
Any address can submit this transaction, but it must have ETH on the destination chain.
85+
Typically, a relayer submits the transaction, since the user does not yet have ETH on the destination chain.
86+
87+
5. `L2ToL2CrossDomainMessenger` on the destination chain calls `SuperchainWETH` with the following details:
88+
89+
* Source of the ETH
90+
* Destination address
91+
* Amount of ETH
92+
93+
`SuperchainWETH` performs several sanity checks:
94+
95+
* The `relayETH` call must originate from `L2ToL2CrossDomainMessenger`.
96+
* The interop message must have been sent by `SuperchainWETH`
97+
98+
6. `SuperchainWETH` withdraws the specified amount of ETH from `ETHLiquidity`.
99+
Only `SuperchainWETH` can withdraw from `ETHLiquidity`, ensuring that the ETH is correctly reintroduced into circulation on the destination chain.
100+
101+
7. `SuperchainWETH` uses [`SafeSend`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/universal/SafeSend.sol) to send ETH.
102+
This ensures that even if the destination is a smart contract, its custom logic is not executed.
103+
This behavior differs from [standard ETH transfers](https://docs.base.org/base-learn/docs/address-and-payable/#receiving-ether-with-payable-addresses), where smart contracts can trigger custom logic upon receiving ETH.
58104

59-
## Major components
105+
## L1 Treasury
60106

61-
### `SuperchainWETH` contract
107+
Every ETH in circulation on the Superchain—excluding ETH held by `ETHLiquidity`—must be backed by ETH on L1.
62108

63-
This contract implements the core functionality for wrapping, unwrapping, and cross-chain transfer of ETH. It integrates with the `SuperchainTokenBridge` for interoperable actions.
109+
This is enforced by a lockbox contract on L1, which holds all ETH bridged to [Superchain interop cluster chains](/explainer#superchain-interop-cluster) that has not yet been withdrawn.
110+
New ETH can only be minted on L2 when it is locked on L1, and it is burned on L2 before it can be released from the lockbox.
64111

65-
* Contract address: `0x4200000000000000000000000000000000000024`
112+
Here is an example of how this works.
66113

67-
### `ETHLiquidity` contract
114+
| Step | User on L1 | Lockbox | User on chain A | ETHLiquidity on chain A | User on chain B | ETHLiquidity on chain B |
115+
| ---: | ---------: | ------: | --------------: | ----------------------: | --------------: | ----------------------: |
116+
| 1 | 7 | 200 | 0 | 100000 | 0 | 100000 |
117+
| 2 | 4 | 203 | 3 | 100000 | 0 | 100000 |
118+
| 3 | 4 | 203 | 2 | 100001 | 0 | 100000 |
119+
| 4 | 4 | 203 | 2 | 100001 | 1 | 99999 |
120+
| 5 | 4 | 203 | 2 | 100001 | 0 | 99999 |
121+
| 6 | 5 | 202 | 2 | 100001 | 0 | 99999 |
68122

69-
A predeploy contract with a large pool of ETH that provides liquidity for cross-chain transfers. It allows "burning" and "minting" of ETH for cross-chain transfers. ETH is associated with bridge ETH from the L1 lockbox, making ETH available to interop chains through a shared lockbox rather than fragmented amongst the existing portal contracts.
123+
1. The initial state. The user has 7 ETH on L1, and nothing on chains A and B.
70124

71-
* Contract address: `0x4200000000000000000000000000000000000025`
125+
2. The user bridges 3 ETH to chain A.
126+
The user sends 3 ETH on L1 to the bridge, which is locked in the lockbox.
127+
The bridge on chain A then mints 3 ETH for the user.
72128

73-
### `L2ToL2CrossDomainMessenger` contract
129+
3. The user sent the initiating message to `SuperchainWETH` on chain A, along with 1 ETH to bridge to chain B.
130+
This 1 ETH is sent to `ETHLiquidity` on chain A.
74131

75-
This predeploy contract facilitates general message passing between different chains in the Superchain. It also securely transfers ERC20 tokens between L2 chains.
132+
4. Somebody (the user, a relayer action on behalf of the user, etc.) sent the corresponding executing message to chain B.
133+
`SuperchainWETH` transfers 1 ETH from `ETHLiquidity` on chain B to the user.
76134

77-
* Contract address: `0x4200000000000000000000000000000000000023`
135+
5. The user decides to withdraw 1 ETH from chain B back into L1.
136+
Normally, a user would do this through a third-party bridge, which is faster and usually cheaper, but for illustration purposes this user uses the standard OP bridge.
137+
The user starts with an initiating message on chain B, which burns 1 ETH and sends a message to L1.
78138

79-
<Callout type="info">
80-
`SuperchainWETH` implements strict access controls to ensure security (e.g., only `SuperchainWETH` can call `ETHLiquidity` functions).
81-
</Callout>
139+
6. After the week long [challenge period](/connect/resources/glossary#challenge-period), the user finalizes the withdrawal on L1.
140+
The lock box releases 1 ETH, which is then sent to the user.
82141

83142
## Next steps
84143

85-
* Explore the [`SuperchainWETH`](https://specs.optimism.io/interop/superchain-weth.html) specs for in-depth implementation details.
86-
* Review the [Superchain Interop Explainer](../explainer) for answers to common questions about interoperability.
144+
* Explore [the `SuperchainWETH` specs](https://specs.optimism.io/interop/superchain-weth.html) for in-depth implementation details.
145+
* Read the [interop message passing](/message-passing) page for more information about how `L2ToL2CrossDomainMessenger` passes messages.

words.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ pprof
282282
Precommitments
283283
precommitments
284284
preconfigured
285-
Preconfigured
286285
predeploy
287286
Predeployed
288287
predeployed
@@ -315,7 +314,6 @@ QRNG
315314
Quicknode
316315
quicknode
317316
quickstarts
318-
rebalance
319317
Regenesis
320318
regenesis
321319
REJOURNAL
@@ -378,7 +376,6 @@ Superchain
378376
superchain
379377
Superchain's
380378
Superchainerc
381-
superchainerc
382379
Superchains
383380
Superscan
384381
Supersim

0 commit comments

Comments
 (0)