Understanding Layer 2s

th3cappy
2 min readJul 25, 2021

Hello CAPPIES! The market has been a bit crappy or crabby recently so let’s take the time to accumulate coins and knowledge. In my opinion, the next hot defi summer is going to be the battle of Layer 2s, networks, and bridges so let's take some time to understand and compare some of the tech in play here.

Polygon

For starters, they are not really considered a Layer 2, they are considered a sidechain as they have their own POS mechanism in place, with their own set of validators.

Layer 2
are defined by being fully secured by the Ethereum Main Chain

Sidechains
uses their own consensus mechanism

Optimism vs Arbitrum

Both of them are very similar and leverages on the same optimistic rollups. In short, the technology “roll-up” data and moves it off the main ethereum chain to handle the computations. After that, it pushes a bundle of data which is just the minimum info needed with no proofs back to the main chain AND it does this optimistically hoping that all the data is valid, no guarantees!

Disputing transactions via “Challenge Period”

There needs to be a mechanism in place to ensure transactions are legitimate and not fraudulent. This is where fraud proofs come in. During the challenge period (7 days) if someone notices a fraudulent transaction, they can submit a fraud proof and the transactions will be rolled back; which the rollup will execute and run the transaction’s computation, using the available state data.

Note: Whoever gets (validators) caught frauding gets “slashed” — staked tokens will be taken from them.

The difference between Optimism and Arbitrum

lies in their fraud proofs. Arbitrum’s fraud proofs seek to find the very specific point of disagreement over transaction history whereas Optimism looks at fraud more holistically.

ZK Roll-ups

Knows as Zero-knowledge rollups aka ZK rollups bundle or “roll up” hundreds of transfers off-chain and generates a cryptographic proof, known as a SNARK (succinct non-interactive argument of knowledge). This is known as a validity proof and is posted on layer 1.

The ZK-rollup smart contract maintains the state of all transfers on layer 2, and this state can only be updated with a validity proof. This means that ZK-rollups only need the validity proof, instead of all transaction data. With a ZK-rollup, validating a block is quicker and cheaper because less data is included.

With a ZK-rollup, there are no delays when moving funds from layer 2 to layer 1 because a validity proof accepted by the ZK-rollup contract has already verified the funds.

Who has the best tech?

I think we need to move away from this “winner takes all” mentality. The market is big enough to accommodate many players; the complexity and plethora of smart contracts would mean certain Layer 2s are simply better suitable for certain protocols. The winner will still be defi!

Complicated concepts to grasp so do take your time and re-read them to improve your understanding. As usual, Google is your best friend and th3cappy is always here to help!

--

--