Skip to main content

What is Optimism and how does it work?

tokenviewAbout 2 min

What is Optimism and how does it work?

Optimism is a fast, stable, scalable and low-cost Ethereum Layer 2 blockchain. This means it runs on top of the Ethereum blockchain (Layer 1) to help alleviate congestion, which in turn reduces transaction costs and processing times. As a minimal extension of existing Ethereum software, Optimism's EVM-equivalent architecture can extend Ethereum applications. If it works on Ethereum, it also works on Optimism at a fraction of the cost of Ethereum. Optimism adopts optimism rollups technology, which can 'aggregate' a large amount of transaction data into a batch of data on Ethereum, so that only one transaction fee is charged. In this way, transactions are processed faster and cheaper, while relying on the security of Ethereum.

Optimistic Rollups

Optimism adopts optimism rollups technology, which can 'aggregate' a large amount of transaction data into a batch of data on Ethereum, so that only one transaction fee is charged. In this way, transactions are processed faster and cheaper, while relying on the security of Ethereum.Optimism is an 'Optimistic Rollup', which is basically just a fancy way of describing a blockchain that relies on the security of another 'parent' blockchain. Specifically, Optimistic Rollups leverage their parent chain’s consensus mechanism (such as PoW or PoS) rather than providing their own. In Optimism's usage, this parent blockchain is Ethereum.

Bridge assets between L1 and L2

Optimism is designed to allow users to send arbitrary messages between Optimism and smart contracts on Ethereum. This makes it possible to transfer assets (including ERC20 tokens) between the two networks. The exact mechanism by which this communication occurs depends on the direction in which the message is sent. Optimism uses a standard bridge (StandardBridge) to allow users to deposit assets (ERC20 and ETH) from Ethereum into Optimism, and to withdraw the same assets from Optimism back to Ethereum.The Standard Bridge consists of two main contracts L1StandardBridge (for Layer 1) and L2StandardBridge (for Layer 2).

Deposits

Deposit ERC20

ERC20 deposits to L2 can be triggered via the depositERC20 and depositERC20To functions on L1StandardBridge, Standard Token Bridge must be approved to use the amount of tokens you want to deposit, otherwise the deposit will fail.

Deposit ETH

The deposit of ETH into L2 can be triggered by the depositETH and depositETHTo functions on L1StandardBridge. It is also possible by sending ETH directly to L1StandardBridge. Once a user's deposit is detected and finalized on Optimism, the user's account will receive a corresponding amount of ETH on L2.

Withdrawals

Deposit ETH

ERC20 withdrawal can be triggered by the withdraw or withdrawTo function on L2StandardBridge.

Withdraw ETH

Unlike L1, we do not have a separate function on L2 to withdraw ETH. Instead, users can use the withdraw or withdraw to function on L2StandardBridge, and use the address 0xdeaddeaddeaddeaddeaddeaddead0000 as the L2 token address.

Failure Proof

In an Optimistic Rollup, state commitments are posted to Ethereum without any direct proof of the validity of those commitments. Instead, these commitments are considered pending for a period of time (called the 'challenge window'). A proposed state commitment is considered final if it has not been challenged during the challenge window (currently set to 7 days). Once a commitment is considered final, smart contracts on Ethereum can safely accept proofs based on the Optimism state of that commitment.When state commitments are challenged, they can be invalidated through the 'proof-of-failure' (formerly 'proof-of-fraud') process. If the commitment is successfully challenged, it is removed from the StateCommitmentChain and eventually replaced by another proposed commitment. It is important to note that a successful challenge does not roll back Optimism itself, only the published commitments about the state of the chain. The order of transactions and the state of Optimism will not change due to a proof-of-failure challenge.

Last update: