First things first, a transaction is not just the balance (in this case, 2 ETH on Arbitrum and 1 ETH on mainnet). Transactions include to and from addresses, amounts, fees, and so on. More on transactions here.
The utility of a rollup is to collect a bunch of transactions into one and post this new transaction onto the L1 chain (mainnet). This is what it means when you say "Arbitrum sends the transactions to Ethereum mainnet". It depends on the type of rollup what it actually sends to the mainnet. For ex. A zk-Rollup sends the transaction data as well as validity proof.
Image source
Why is this necessary? Well, basically to increase the throughput of Ethereum Mainnet while keeping its security. In order to achieve this you have to find a way such that:
- You should be able to process more transactions per second (TPS) (Ethereum by itself only processes around 30 TPS; faster than Bitcoin, but way slower than any centralized mechanism today like VISA which processes around 24,000 TPS)
- You should be able to use the same consensus mechanism that of Ethereum (because it is already tried and tested)
Rollups increase the throughput by bunching multiple transactions into one so that when this transaction is added to the mainnet, there's only one transaction to process now (instead of many).
Since the verification of the transaction happens on the mainnet, the security remains intact (though not with 100% certainty).
You can learn in detail about how this happens by searching Optimistic Rollup and zkRollup. Optimistic and zkRollups are two different kinds of rollups with different levels of security and throughput. This might be a good start.
Edit: Following is a brief technical overview of how transactions are posted to L1 in a zk-Rollup as discussed here.
Users in the ZK-rollup sign transactions and submit to L2 operators for processing and inclusion in the next batch. In some cases, the operator is a centralized entity, called a sequencer, who executes transactions, aggregates them into batches, and submits to L1. The sequencer in this system is the only entity allowed to produce L2 blocks and add rollup transactions to the ZK-rollup contract.
Transaction data is published on Ethereum as calldata
. calldata
is a data area in a smart contract used to pass arguments to a function and behaves similarly to memory. While calldata
isn’t stored as part of Ethereum’s state, it persists on-chain as part of the Ethereum chain's history logs. calldata
does not affect Ethereum's state, making it a cheap way to store data on-chain.
I hope this helped you!