In the previous article, “Arbitrum’s Component Structure Interpreted by the Former Arbitrum Technical Ambassador (Part 1),” we introduced the roles of the key components in Arbitrum, including the sequencer, validator, sequencer inbox contract, rollup block, and the role of non-interactive fraud proofs. In today’s article, we will focus on explaining the components related to cross-chain message passing and the entry for anti-censorship transactions in the core components of Arbitrum.
Main Text: In previous articles, we mentioned that the Sequencer Inbox contract is specifically designed to receive transaction data batches published by the sequencer on Layer 1. At the same time, we pointed out that the Sequencer Inbox is also referred to as the “fast box,” and in contrast, there is the “slow box” or Delayed Inbox (referred to as Inbox). Below, we will provide a detailed interpretation of components related to cross-chain message passing, including the Delayed Inbox.
Cross-chain transactions can be divided into transactions from L1 to L2 (deposit) and transactions from L2 to L1 (withdrawal). It’s important to note that the terms “deposit” and “withdrawal” here may not necessarily involve the cross-chain transfer of assets; they can refer to message passing without directly transferring assets. Therefore, these terms merely represent the two directions of cross-chain-related actions.
In comparison to pure L2 transactions, cross-chain transactions involve the exchange of information between two different systems, L1 and L2, making the process more complex.
Additionally, when we talk about cross-chain actions, it usually refers to crossing between two entirely unrelated networks using a cross-chain bridge in a federated model. The security of such cross-chain operations depends on the operator of the cross-chain bridge, and historically, incidents of theft have been frequent in witness-based cross-chain bridges.
On the other hand, cross-chain actions between Rollup and the ETH mainnet are fundamentally different from the aforementioned cross-chain processes. This is because the state of Layer2 is determined by data recorded on Layer1. As long as you use the official Rollup cross-chain bridge, it is structurally secure in its operations.
This highlights the essence of Rollup, which, from the user’s perspective, appears as an independent chain, but in reality, the so-called “Layer2” is just a fast display window opened by Rollup to users, and its true chain-like structure is still recorded on Layer1. Therefore, we can consider L2 as half a chain or “a chain created on Layer1.”
Please note that cross-chain transactions are asynchronous and non-atomic. Unlike transactions on a single chain, completing a transaction and confirming the result after one transaction on one chain is not possible in cross-chain transactions. There is also no guarantee that something specific will happen on the other side at a certain point in time. Therefore, cross-chain transactions may fail due to some soft issues, but with the use of proper techniques, such as retryable tickets, hard issues like funds being stuck won’t occur.
Retryable tickets are fundamental tools used in the Arbitrum official bridge during deposits, applicable to both ETH and ERC20 deposits. The lifecycle consists of three steps:
Furthermore, regarding the withdrawal process on the Arbitrum official bridge, although there is a certain symmetrical similarity in the process compared to deposits, there is no concept of retryable tickets. This can be understood from the perspective of the Rollup protocol itself, and some differences can be highlighted:
Cross-chaining of ERC-20 assets is complex. We can think about several questions:
We are not going to answer all of these questions because they are too complex to unfold. These questions are only used to illustrate the complexity of ERC20 cross-chain.
Currently, many scaling solutions use whitelist and manual list solutions to avoid various complex problems and boundary conditions.
Arbitrum uses the Gateway system to solve most of the sticking problems of ERC20 cross-chain. It has the following features:
Let’s take the relatively simple WETH cross-chain as an example to illustrate the necessity of customizing the gateway.
WETH is an ERC20 equivalent of ETH. As the main currency, Ether cannot implement complex functions in many dApps, so an ERC20 equivalent is needed. Transfer some ETH into the WETH contract, they will be locked in the contract, and the same amount of WETH will be generated.
In the same way, WETH can also be burned and ETH can be withdrawn. Obviously, the ratio of circulating WETH and locked ETH is always 1:1.
If we now directly cross-chain WETH to L2, we will find some strange problems:
Obviously this violates the design principles of WETH. Hence, when WETH is cross-chained, whether it is deposit or withdrawal, it needs to be unwrapped into ETH first, then crossed to the other side, and then wrapped into WETH. This is the role of WETH Gateway.
The same goes for other tokens with more complex logic, which require a more complex and carefully designed Gateway to work properly in a cross-chain environment. Arbitrum’s custom Gateway inherits the cross-chain communication logic of ordinary Gateway and allows developers to customize cross-chain behavior related to token logic, which can meet most needs.
The counterpart to the fast inbox, known as Sequencer Inbox, is the slow inbox (fully named Delayed Inbox). Why differentiate between fast and slow? This is because the fast inbox is dedicated to receiving batches of L2 transactions published by the sequencer, and any transactions not preprocessed by the sequencer within the L2 network should not appear in the fast inbox contract.
The first function of the slow inbox is to handle the process of depositing from L1 to L2. Users initiate deposits through the slow inbox, and once the sequencer observes this, it reflects on L2. Eventually, this deposit record is included in the L2 transaction sequence by the sequencer and submitted to the fast inbox contract (Sequencer Inbox).
In this scenario, it’s inappropriate for users to directly submit deposit transactions to the fast inbox (Sequencer Inbox) because transactions submitted to the fast inbox may disrupt the normal transaction ordering in Layer2, thereby affecting the sequencer’s operation.
The second function of the slow inbox is censorship-resistant. Transactions directly submitted to the slow inbox contract are generally aggregated into the fast inbox within 10 minutes by the sequencer. However, if the sequencer maliciously ignores your request, the slow inbox has a forced inclusion feature:
If a transaction is submitted to the Delayed Inbox and, after 24 hours, it remains unincorporated into the transaction sequence by the sequencer, users can manually trigger the force inclusion function on Layer1. This action compels transactions ignored by the sequencer to be forcibly aggregated into the fast inbox (Sequencer Inbox). Subsequently, they will be detected by all Arbitrum One nodes and forcefully included in the Layer2 transaction sequence.
We just mentioned that the data in the fast inbox represents the historical data entity of L2. Therefore, in cases of malicious censorship, using the slow inbox allows transaction instructions to eventually be included in the L2 ledger, covering scenarios such as forced withdrawals to escape Layer2.
From this, it can be seen that for any direction and level of transactions, the sequencer ultimately cannot permanently censor you.
Several core functions of the slow inbox (Inbox):
However, it’s important to note that the force inclusion function is actually located in the fast inbox contract. For ease of understanding, we explained it together with the slow inbox.
Outbox is only related to withdrawals and can be understood as a recording and management system for withdrawal behaviors:
Below we will take ETH as an example to fully explain the deposit and withdrawal process. The only difference between ERC20 and ETH is that former uses Gateway. We will not explain it in detail.
The user calls the depositETH() function of the slow box.
This function will continue to call ‘bridge.enqueueDelayedMessage()’, record the message in the bridge contract, and send ETH to the bridge contract. All ETH deposit funds are kept in the bridge contract, which is equivalent to a deposit address.
The sequencer monitors the deposit messages in the slow box and reflects the deposit operation to the L2 database. Users can see the assets they have deposited on the L2 network.
The sequencer includes the deposit record into the transaction batch and submits it to the fast box contract on L1.
The user calls the withdrawEth() function of the ArbSys contract on L2, and the corresponding number of ET is burned on L2.
The sequencer sends the withdrawal request to the express box.
The Validator node creates a new Rollup Block based on the transaction sequence in the fast box, which will contain the above withdrawal transactions.
After the Rollup Block goes through the challenge period which is also confirmed, the user can call the Outbox.execute Transaction() function on L1 to prove that the parameters are given by the ArbSys contract mentioned above.
After the Outbox contract is confirmed to be correct, the corresponding amount of ETH in the bridge will be unlocked and sent to the user.
When using the Optimistic Rollup official bridge to withdraw cash, there will be a problem of waiting for the challenge period. We can use a private third-party cross-chain bridge to remove this problem:
The force Inclusion() function is used to resist the censorship of the sequencer. Any L2 local transaction, L1 to L2 transaction and L2 to L1 transaction can be implemented using this function. The malicious censorship of the sequencer seriously affects the transaction experience. In most cases, we will choose to withdraw money and leave L2. Therefore, the following uses forced withdrawal as an example to introduce the usage of forceInclusion.
Looking back at the ETH withdrawal steps, only steps 1 and 2 involve sequencer censorship, so only these two steps need to be changed:
End users can withdraw money in Outbox, and the rest of the steps are the same as normal withdrawals.
In addition, there are also detailed tutorials on using the Arb SDK in arbitrum-tutorials to guide users on how to perform L2 local transactions and L2 to L1 transactions through forceInclusion() function.
In the previous article, “Arbitrum’s Component Structure Interpreted by the Former Arbitrum Technical Ambassador (Part 1),” we introduced the roles of the key components in Arbitrum, including the sequencer, validator, sequencer inbox contract, rollup block, and the role of non-interactive fraud proofs. In today’s article, we will focus on explaining the components related to cross-chain message passing and the entry for anti-censorship transactions in the core components of Arbitrum.
Main Text: In previous articles, we mentioned that the Sequencer Inbox contract is specifically designed to receive transaction data batches published by the sequencer on Layer 1. At the same time, we pointed out that the Sequencer Inbox is also referred to as the “fast box,” and in contrast, there is the “slow box” or Delayed Inbox (referred to as Inbox). Below, we will provide a detailed interpretation of components related to cross-chain message passing, including the Delayed Inbox.
Cross-chain transactions can be divided into transactions from L1 to L2 (deposit) and transactions from L2 to L1 (withdrawal). It’s important to note that the terms “deposit” and “withdrawal” here may not necessarily involve the cross-chain transfer of assets; they can refer to message passing without directly transferring assets. Therefore, these terms merely represent the two directions of cross-chain-related actions.
In comparison to pure L2 transactions, cross-chain transactions involve the exchange of information between two different systems, L1 and L2, making the process more complex.
Additionally, when we talk about cross-chain actions, it usually refers to crossing between two entirely unrelated networks using a cross-chain bridge in a federated model. The security of such cross-chain operations depends on the operator of the cross-chain bridge, and historically, incidents of theft have been frequent in witness-based cross-chain bridges.
On the other hand, cross-chain actions between Rollup and the ETH mainnet are fundamentally different from the aforementioned cross-chain processes. This is because the state of Layer2 is determined by data recorded on Layer1. As long as you use the official Rollup cross-chain bridge, it is structurally secure in its operations.
This highlights the essence of Rollup, which, from the user’s perspective, appears as an independent chain, but in reality, the so-called “Layer2” is just a fast display window opened by Rollup to users, and its true chain-like structure is still recorded on Layer1. Therefore, we can consider L2 as half a chain or “a chain created on Layer1.”
Please note that cross-chain transactions are asynchronous and non-atomic. Unlike transactions on a single chain, completing a transaction and confirming the result after one transaction on one chain is not possible in cross-chain transactions. There is also no guarantee that something specific will happen on the other side at a certain point in time. Therefore, cross-chain transactions may fail due to some soft issues, but with the use of proper techniques, such as retryable tickets, hard issues like funds being stuck won’t occur.
Retryable tickets are fundamental tools used in the Arbitrum official bridge during deposits, applicable to both ETH and ERC20 deposits. The lifecycle consists of three steps:
Furthermore, regarding the withdrawal process on the Arbitrum official bridge, although there is a certain symmetrical similarity in the process compared to deposits, there is no concept of retryable tickets. This can be understood from the perspective of the Rollup protocol itself, and some differences can be highlighted:
Cross-chaining of ERC-20 assets is complex. We can think about several questions:
We are not going to answer all of these questions because they are too complex to unfold. These questions are only used to illustrate the complexity of ERC20 cross-chain.
Currently, many scaling solutions use whitelist and manual list solutions to avoid various complex problems and boundary conditions.
Arbitrum uses the Gateway system to solve most of the sticking problems of ERC20 cross-chain. It has the following features:
Let’s take the relatively simple WETH cross-chain as an example to illustrate the necessity of customizing the gateway.
WETH is an ERC20 equivalent of ETH. As the main currency, Ether cannot implement complex functions in many dApps, so an ERC20 equivalent is needed. Transfer some ETH into the WETH contract, they will be locked in the contract, and the same amount of WETH will be generated.
In the same way, WETH can also be burned and ETH can be withdrawn. Obviously, the ratio of circulating WETH and locked ETH is always 1:1.
If we now directly cross-chain WETH to L2, we will find some strange problems:
Obviously this violates the design principles of WETH. Hence, when WETH is cross-chained, whether it is deposit or withdrawal, it needs to be unwrapped into ETH first, then crossed to the other side, and then wrapped into WETH. This is the role of WETH Gateway.
The same goes for other tokens with more complex logic, which require a more complex and carefully designed Gateway to work properly in a cross-chain environment. Arbitrum’s custom Gateway inherits the cross-chain communication logic of ordinary Gateway and allows developers to customize cross-chain behavior related to token logic, which can meet most needs.
The counterpart to the fast inbox, known as Sequencer Inbox, is the slow inbox (fully named Delayed Inbox). Why differentiate between fast and slow? This is because the fast inbox is dedicated to receiving batches of L2 transactions published by the sequencer, and any transactions not preprocessed by the sequencer within the L2 network should not appear in the fast inbox contract.
The first function of the slow inbox is to handle the process of depositing from L1 to L2. Users initiate deposits through the slow inbox, and once the sequencer observes this, it reflects on L2. Eventually, this deposit record is included in the L2 transaction sequence by the sequencer and submitted to the fast inbox contract (Sequencer Inbox).
In this scenario, it’s inappropriate for users to directly submit deposit transactions to the fast inbox (Sequencer Inbox) because transactions submitted to the fast inbox may disrupt the normal transaction ordering in Layer2, thereby affecting the sequencer’s operation.
The second function of the slow inbox is censorship-resistant. Transactions directly submitted to the slow inbox contract are generally aggregated into the fast inbox within 10 minutes by the sequencer. However, if the sequencer maliciously ignores your request, the slow inbox has a forced inclusion feature:
If a transaction is submitted to the Delayed Inbox and, after 24 hours, it remains unincorporated into the transaction sequence by the sequencer, users can manually trigger the force inclusion function on Layer1. This action compels transactions ignored by the sequencer to be forcibly aggregated into the fast inbox (Sequencer Inbox). Subsequently, they will be detected by all Arbitrum One nodes and forcefully included in the Layer2 transaction sequence.
We just mentioned that the data in the fast inbox represents the historical data entity of L2. Therefore, in cases of malicious censorship, using the slow inbox allows transaction instructions to eventually be included in the L2 ledger, covering scenarios such as forced withdrawals to escape Layer2.
From this, it can be seen that for any direction and level of transactions, the sequencer ultimately cannot permanently censor you.
Several core functions of the slow inbox (Inbox):
However, it’s important to note that the force inclusion function is actually located in the fast inbox contract. For ease of understanding, we explained it together with the slow inbox.
Outbox is only related to withdrawals and can be understood as a recording and management system for withdrawal behaviors:
Below we will take ETH as an example to fully explain the deposit and withdrawal process. The only difference between ERC20 and ETH is that former uses Gateway. We will not explain it in detail.
The user calls the depositETH() function of the slow box.
This function will continue to call ‘bridge.enqueueDelayedMessage()’, record the message in the bridge contract, and send ETH to the bridge contract. All ETH deposit funds are kept in the bridge contract, which is equivalent to a deposit address.
The sequencer monitors the deposit messages in the slow box and reflects the deposit operation to the L2 database. Users can see the assets they have deposited on the L2 network.
The sequencer includes the deposit record into the transaction batch and submits it to the fast box contract on L1.
The user calls the withdrawEth() function of the ArbSys contract on L2, and the corresponding number of ET is burned on L2.
The sequencer sends the withdrawal request to the express box.
The Validator node creates a new Rollup Block based on the transaction sequence in the fast box, which will contain the above withdrawal transactions.
After the Rollup Block goes through the challenge period which is also confirmed, the user can call the Outbox.execute Transaction() function on L1 to prove that the parameters are given by the ArbSys contract mentioned above.
After the Outbox contract is confirmed to be correct, the corresponding amount of ETH in the bridge will be unlocked and sent to the user.
When using the Optimistic Rollup official bridge to withdraw cash, there will be a problem of waiting for the challenge period. We can use a private third-party cross-chain bridge to remove this problem:
The force Inclusion() function is used to resist the censorship of the sequencer. Any L2 local transaction, L1 to L2 transaction and L2 to L1 transaction can be implemented using this function. The malicious censorship of the sequencer seriously affects the transaction experience. In most cases, we will choose to withdraw money and leave L2. Therefore, the following uses forced withdrawal as an example to introduce the usage of forceInclusion.
Looking back at the ETH withdrawal steps, only steps 1 and 2 involve sequencer censorship, so only these two steps need to be changed:
End users can withdraw money in Outbox, and the rest of the steps are the same as normal withdrawals.
In addition, there are also detailed tutorials on using the Arb SDK in arbitrum-tutorials to guide users on how to perform L2 local transactions and L2 to L1 transactions through forceInclusion() function.