Optimism SuperChain Rollups Using the Op-Stack
In this article you will learn what a rollup is in the crypto development space. Specifically the Optimism SuperChain ecosystem deploying rollups using the op stack.
This is a high level overview. So anyone should be able to read this and understand what is going on. Before that, you need to know why rollups exist.
Ethereum congestion is a problem
Ethereum has congestion issues which lead to slow transaction times and high gas fees. This is why rollups exist. Rollups batch transactions on L2 chains which are sent as a group to the L1. This saves gas and increases speed. More on this later.
Gimmi the basics bro, this all sounds like gobble-de-goop.
Ethereum is a Layer 1 blockchain which means that it is the base layer which L2’s and DApps can be built upon. Layer 2’s are chains that share the same security, consensus and execution attributes as the L1, but they have novel ways to offer improvements to clear congestion on the L1. This is why there are so many L2’s. Each one has a different way of doing things. You can also build DApps that communicate with the L1 directly to grab transaction data, event logs or current EVM state. This is what block explorers like etherscan.io use to retrieve blockchain data for their users.
The Ethereum Virtual Machine (EVM) is a virtual machine environment that runs the smart contract code. Each time there is a transaction on the network, that transaction goes through consensus and execution before it is finalized and the EVM state is updated.
But before your transaction reaches confirmation through a miner, it lands in a mempool which is a holding area for unconfirmed transactions. Transactions that pay higher gas get chosen first. Once the unconfirmed transaction is taken from the mempool, a miner will add it to the current block of transactions on the blockchain.
Every node on the network shares the same state at all times. All nodes share the same distributed ledger and all nodes must comply to the L1 consensus algorithm. Proof of Stake for Ethereum or Proof of Work for bitcoin for example. The more nodes on the network, the more secure.
Since Ethereum is a peer to peer network, we have thousands of nodes around the world and each node needs to run the EVM which operates this system. These nodes validate transactions and secure the network, this is where your gas goes to pay these people to validate your transactions.
There are 2 things going on in the EVM when you transact.
Consensus node and Execution nodes
The L1 consensus node is the all seeing eye for the current state of the EVM by validating transactions. They make sure all nodes aggree according to the L1 contracts for consensus.
The execution node runs the code for the block of transactions and updates the state. They also expose the EVM state through RPC-URL’s which developers can grab chain events from. This is how etherscan.io gets data for their website.
领英推荐
Isn’t this an article about Optimism?
Yes, now it is. Since high traffic on the Ethereum network creates big mempool, high gas fees and slow transaction speeds. Optimism and other L2’s try to alleviate some of the congestion. Optimism is a Ethereum L2 scaling solution that uses rollups to batch multiple transactions together and submits them to Ethereum Layer 1 as a single transaction.
Optimism uses the op stack which provides a standardized and open source framework that runs op main net and also allows you to spin up your very own L2 base on the op stack. Op stack has 3 things going on to rollup transactions to increase speed and lower costs
op-node, op-geth and the batcher/sequencer
Op-node: This is pretty much the L2 version of Ethereum consensus algorithm. this validates transactions and oversee the L2 state.
Op-geth: this is the optimism L2 version of the Ethereum execution node which executes transactions. op-geth is the execution layer for optimism and shares the same security protocols as the L1 but with specific rollup logic for the op stack.
Batcher/sequencer: These two are kind of the same. The sequencer gathers L2 transactions and orders them for submission to the L1. The batcher takes that batch of transactions and submits a compressed, gas optimized hash to the L1.
Optimistic rollups or Zero-Knowledge proof validation rollups
L2’s use rollup technology to speed up Ethereum. But they also need to validate their rollup before it gets accepted into the L1. They can use an optimistic validation which assumes everything is gucci and gives a 48 hour window where fraud can be detected by nodes.
Or they can use zero-knowledge which is slower and more expensive. A cryptographic proof is submitted to the L1 at the batcher submission to prove the rollup is legit. Both have their trade offs.
---
That is pretty much it. L2 chains like Optimism with rollups make transactions on L1 faster and cheaper. If you want to build your own chain on Optimism check out this link. https://docs.optimism.io/builders/chain-operators/self-hosted
Thanks for reading,
Justin
#bitcoin #halifax #softwareengineer #crypto #blockchain #software