ETH bridging
Ether (ETH) is the native currency of Ethereum and all Arbitrum chains. It is used to pay the necessary fees to execute a transaction in those chains. Bridging ETH from Ethereum (Layer 1, or L1) to an Arbitrum chain (Layer 2, or L2) follows, thus, a different process than the one followed when bridging other types of asset.
Depositing ether
To move ETH from L1 to L2, you execute a deposit transaction via Inbox.depositEth
. This transfers funds to the Bridge contract on the L1 and credits the same funds to you inside the Arbitrum chain at the specified address.
function depositEth(address destAddr) external payable override returns (uint256)
The following diagram depicts the process that funds follow during a deposit operation.
flowchart TB
subgraph L1 ["L1 - Ethereum"]
%% Nodes
USERL1["#128100;"]
INBOX("Inbox\ncontract")
BRIDGE("Bridge\ncontract")
WAIT{{"
Wait for the transaction to be
justified on Ethereum, meaning that
2 epochs have passed
"}}
ESCROWNOTE["
Deposited funds are escrowed in
the Bridge contract
"]:::noteBox
%% Links
USERL1 --->|" depositEth() "| INBOX
INBOX --->|" enqueueDelayedMessage() "| BRIDGE
BRIDGE -.- ESCROWNOTE
BRIDGE --> WAIT
end
L1 --> L2
subgraph L2 ["L2 - Arbitrum"]
%% Nodes
NODE[(Node)]
NODENOTE["
Nodes pick up the transaction
from the Bridge's emitted events and
add it to a block
"]:::noteBox
CREDITUSER{{"
Funds equal to the deposited
amount are credited to the user
"}}
USERL2["#128100;"]
%% Links
NODE -.- NODENOTE
CREDITUSER --> USERL2
end
%% Styling
classDef noteBox fill:#ffffcc,stroke:#000000,color:#000000
As far as the L1 knows, all deposited funds are held by Arbitrum's Bridge contract.
Withdrawing ether
Withdrawing ether can be done using the ArbSys precompile's withdrawEth
method:
ArbSys(100).withdrawEth{ value: 2300000 }(destAddress)
Upon withdrawing, the Ether balance is burnt on the Arbitrum side, and will later be made available on the Ethereum side.
ArbSys.withdrawEth
is actually a convenience function which is equivalent to calling ArbSys.sendTxToL1
with empty calldataForL1. Like any other sendTxToL1
call, it will require an additional call to Outbox.executeTransaction
on L1 after the dispute period elapses for the user to finalize claiming their funds on L1 (see "L2 to L1 Messages"). Once the withdrawal is executed from the Outbox, the user's Ether balance will be credited on L1.
The following diagram depicts the process that funds follow during a withdraw operation.
flowchart TB
subgraph L2 ["L2 - Arbitrum"]
%% Nodes
USERL2["#128100;"]
ARBSYS("ArbSys\nprecompile")
BURNNOTE["
Ether is burnt and
a withdrawEth event is emitted
"]:::noteBox
WAIT{{"
Wait for a challenge period to elapse
"}}
%% Links
USERL2 --->|" withdrawEth() "| ARBSYS
ARBSYS -.- BURNNOTE
ARBSYS --> WAIT
end
L2 --> L1
subgraph L1 ["L1 - Ethereum"]
%% Nodes
USERL1["#128100;"]
OUTBOX("Outbox\ncontract")
BRIDGE("Bridge\ncontract")
%% Links
USERL1 --->|" executeTransaction() "| OUTBOX
OUTBOX -->|" triggers ETH transfer "| BRIDGE
BRIDGE ---> USERL1
end
%% Styling
classDef noteBox fill:#ffffcc,stroke:#000000,color:#000000