3. Deposits
Deposited transactions = transactions initiated on L1, executed on L2.
Two types:
1) L1 attributes deposited transaction (1st transaction of L2 block)
2) User-deposited transaction (Must be in 1st block of L2 epoch)
Â
Deposited Transaction Type (0x7E)
Deposited transactions have the following differences from existing transaction types:
- Derived from L1 blocks.
- Do not include signature validation.
- Buy L2 gas on L1 (L2 gas not refundable).
- EIP-2718 transaction type =
0x7E
.
Â
A deposit has the following fields (RLP-encoded in the order they are shown below):
bytes32 sourceHash
: source-hash that uniquely identifies the origin of the deposit.
address from
: address of sender account.
address to
: address of recipient account (or null (zero length) address if deposited transaction is a contract creation).
uint256 mint
: ETH value to mint on L2.
uint256 value
: ETH value to send to recipient account.
bytes data
: Input data.
bool isSystemTx
: If true → transaction does not interact with L2 block gas pool.- In Regolith upgrade: boolean is enforced to be
false
.
uint64 gasLimit
: Gas limit for L2 transaction.
Â
Differences from EIP-155 transactions (replay-protection):
- Does not include a nonce (since identified by the source hash, though API responses will have a nonce attribute).
Â
Difference between deposited transaction types and EIP-155 transactions:
- Does not include a nonce (since they are identified by the source hash).
- API responses, however, will have a nonce attribute.
- Before Regolith →
nonce
is always0
. - With Regolith →
nonce
set todepositNonce
attribute of transaction receipt.
- Does not include signature information (
v
,r
,s
API response values are zeroed).
from
address is explicit.
- Includes
sourceHash
,from
,mint
,isSystemTx
attributes.
Â
1. Source hash computation
2. Kinds of Deposited transactions
3. Validation and authorisation of deposited transactions
4. Execution of deposited transactions
5. Deposit Receipt
6. Special Accounts on L2
7. Deposit Contract (OptimismPortal.sol on L1)
1. L1 Attributes Deposited Transaction
2. User-Deposited Transactions
Â
Â