A mega-π§΅ about Layer 2 scaling solutions for @ethereum.
β’ Why are Layer 2s necessary?
β’ Understanding sidechains, plasma chains, channels, and rollups (differences, pros & cons)
β’ What does this mean for L1s?
[1/42] π
β’ Why are Layer 2s necessary?
β’ Understanding sidechains, plasma chains, channels, and rollups (differences, pros & cons)
β’ What does this mean for L1s?
[1/42] π
Note: much of the information in this thread comes straight from the @ethereum docs.
I've tried to organize and compress it as best as I can, but I recommend referring to the official docs for best info.
I'll also link to other helpful resources.
ethereum.org
I've tried to organize and compress it as best as I can, but I recommend referring to the official docs for best info.
I'll also link to other helpful resources.
ethereum.org
A lot of this content is highly technical, and was challenging to understand.
If I made any mistakes or didn't explain something perfectly, feel free to leave comments so others can understand it better.
If I made any mistakes or didn't explain something perfectly, feel free to leave comments so others can understand it better.
It's no secret that $ETH has a scalability problem.
Currently, Ethereum can only handle about 15-30 transactions per second (tps)
In comparison, other L1s like $FTM, $AVAX, $SOL, etc have much better throughput, and can support thousands of transactions per second.
Currently, Ethereum can only handle about 15-30 transactions per second (tps)
In comparison, other L1s like $FTM, $AVAX, $SOL, etc have much better throughput, and can support thousands of transactions per second.
But they are a lot less decentralized, and therefore more vulnerable.
$ETH is still the king when it comes to security and decentralization. π
$ETH is still the king when it comes to security and decentralization. π
Now, $ETH's scalability problem means the network is always congested.
This means people usually have to be exorbitant gas fees (hundreds of $) to get simple transactions through.
@txstreetCom has an awesome tool that shows this congestion visually: txstreet.com
This means people usually have to be exorbitant gas fees (hundreds of $) to get simple transactions through.
@txstreetCom has an awesome tool that shows this congestion visually: txstreet.com
So what are Layer-2 solutions?
Layer 1s (or L1s) are blockchains like Ethereum, Avalanche, Fantom, Solana, etc.
Layer 2s are scaling solutions built on top of Layer 1s designed to help the L1 chains scale.
Layer 1s (or L1s) are blockchains like Ethereum, Avalanche, Fantom, Solana, etc.
Layer 2s are scaling solutions built on top of Layer 1s designed to help the L1 chains scale.
Now, while the sharding upgrades to Ethereum will improve scalability, they are meant to work alongside (not instead of) L2s to improve the usability of the Ethereum network.
L2s + sharding will allow for 100,000 transactions per second.
L2s + sharding will allow for 100,000 transactions per second.
Using Layer 2 solutions means:
β’ Increased tps
β’ Reduced congestion on $ETH Mainnet
β’ They still benefit from Ethereum's security & decentralization since they are built on top of $ETH.
β’ Increased tps
β’ Reduced congestion on $ETH Mainnet
β’ They still benefit from Ethereum's security & decentralization since they are built on top of $ETH.
An analogy that might help explain the value of L2s:
@ethereum is like land in NYC. It's very valuable - setting up shop there costs a lot of money.
So you might not want to build a single house on that land, just as you might not want to transact directly on Ethereum L1.
@ethereum is like land in NYC. It's very valuable - setting up shop there costs a lot of money.
So you might not want to build a single house on that land, just as you might not want to transact directly on Ethereum L1.
There are a number of categories of off-chain scaling solutions based on the technology they use:
1. Sidechains (not technically an L2)
2. Plasma
3. State channels
4. Rollups
1. Sidechains (not technically an L2)
2. Plasma
3. State channels
4. Rollups
1. Sidechain
It is a separate blockchain which runs in parallel to Ethereum Mainnet and operates independently using its own consensus mechanism.
Sidechains are responsible for their own security and therefore they are not considered layer 2 solutions.
It is a separate blockchain which runs in parallel to Ethereum Mainnet and operates independently using its own consensus mechanism.
Sidechains are responsible for their own security and therefore they are not considered layer 2 solutions.
Examples: @0xPolygon, @gnosischain
The downsides of using Sidechains:
β’ Less decentralized
β’ Less security (since the validation of tx happens through a separate consensus mechanism, not through L1)
The downsides of using Sidechains:
β’ Less decentralized
β’ Less security (since the validation of tx happens through a separate consensus mechanism, not through L1)
Plasma chains may be called child chains, since they are smaller copies of the ETH mainnet.
Plasma chains can create more child chains infinitely to offload work from parent chains.
They use fraud proofs (explained later) to resolve disputes.
Plasma chains can create more child chains infinitely to offload work from parent chains.
They use fraud proofs (explained later) to resolve disputes.
Downsides of Plasma:
β’ Cannot be used to scale general purpose smart contracts
β’ Very long withdrawal time
Examples: @0xPolygon and @omgnetworkhq are implementations of Plasma.
β’ Cannot be used to scale general purpose smart contracts
β’ Very long withdrawal time
Examples: @0xPolygon and @omgnetworkhq are implementations of Plasma.
Imagine a game of tic-tac-toe where every move is described by a tx.
You don't need every move to be validated on-chain (slow + costly).
Instead you could create txs off-chain and send an ordered list of moves to the mainnet after the game ends to validate the final state.
You don't need every move to be validated on-chain (slow + costly).
Instead you could create txs off-chain and send an ordered list of moves to the mainnet after the game ends to validate the final state.
At any point, the transactions being sent back and forth for the tic tac toe game *could* be sent to validate on-chain.
@0xstark wrote a great Medium article explaining this in 2018: medium.com
@0xstark wrote a great Medium article explaining this in 2018: medium.com
Features of channels:
β’ Great for privacy since only opening & closing txs must be public - all else is off-chain in a channel b/w participants
β’ Great when exchanging many state updates over a period since cost per state update is very low
β’ They have instant finality
β’ Great for privacy since only opening & closing txs must be public - all else is off-chain in a channel b/w participants
β’ Great when exchanging many state updates over a period since cost per state update is very low
β’ They have instant finality
The downsides of using Channels:
β’ They require high availability
β’ Not good for one-off transactions
β’ Solutions are application specific (can't work for a generic smart contract)
β’ No open participation
β’ They require high availability
β’ Not good for one-off transactions
β’ Solutions are application specific (can't work for a generic smart contract)
β’ No open participation
4. Rollups
Rollups execute transactions off-chain, bundle the transaction data and then posts it to the @ethereum mainnet in a compressed format.
Since data is posted to $ETH mainnet, rollups are still secured by the $ETH consensus.
Rollups execute transactions off-chain, bundle the transaction data and then posts it to the @ethereum mainnet in a compressed format.
Since data is posted to $ETH mainnet, rollups are still secured by the $ETH consensus.
So how does $ETH know that the posted data is valid?
Rollups need to offer some kind of "proof" that the transaction data they are posting is valid.
There are two types of rollups:
1. Optimistic Rollups
2. Zero-knowledge (Zk) Rollups
Rollups need to offer some kind of "proof" that the transaction data they are posting is valid.
There are two types of rollups:
1. Optimistic Rollups
2. Zero-knowledge (Zk) Rollups
Optimistic Rollups (like Plasma chains) assume the data is correct and use fraud proofs.
If the data is incorrect, someone can submit a "fraud proof" which will penalize the bad actors.
If the incentives are set up correctly, the dispute resolution should be a rare occurrence.
If the data is incorrect, someone can submit a "fraud proof" which will penalize the bad actors.
If the incentives are set up correctly, the dispute resolution should be a rare occurrence.
A quote from Ben Jones from @optimismPBC:
You basically take some ETH and lock it up and you say "Hey, I promise to tell the truth"... If I don't tell the truth and fraud is proven, this money will be slashed.
You basically take some ETH and lock it up and you say "Hey, I promise to tell the truth"... If I don't tell the truth and fraud is proven, this money will be slashed.
Some implementations of Optimistic Rollups include @optimismPBC, @arbitrum, @MetisDAO, @bobanetwork.
One downside of Optimistic Rollups is that withdrawal times can be very long to give sufficient time to submit fraud proofs.
One downside of Optimistic Rollups is that withdrawal times can be very long to give sufficient time to submit fraud proofs.
Zero-knowledge rollups use validity proofs to prove the data is correct.
Proofs can be SNARKs or STARKs (won't go into details - but feel free to look them up).
Since Zk-rollups use validity proofs, the time to finality is much quicker, and no long wait time for withdrawals.
Proofs can be SNARKs or STARKs (won't go into details - but feel free to look them up).
Since Zk-rollups use validity proofs, the time to finality is much quicker, and no long wait time for withdrawals.
Projects using Zk-rollups: @0xPolygon, @loopringorg, @StarkWareLtd, @zksync
Downsides of Zk-rollups:
β’ Much harder to create EVM-compatibility
β’ Requires lots of computation to create validity proofs for every tx
Downsides of Zk-rollups:
β’ Much harder to create EVM-compatibility
β’ Requires lots of computation to create validity proofs for every tx
This is probably the best explanation of rollups you'll find on the internet - @finematics comes through yet again with an excellent video.
I highly, highly, HIGHLY recommend watching this if you want to understand rollups:
youtube.com
I highly, highly, HIGHLY recommend watching this if you want to understand rollups:
youtube.com
Validium is another type of scaling solution which is very similar to zkRollups except that the data availability is off-chain instead of on-chain.
Is your mind as fried from all the technicalities of the L2 solutions above as mine was? Just curious which is best?
They all have tradeoffs, but it seems that rollups are the preferred scaling solution for general purpose L2s.
Why so?
They all have tradeoffs, but it seems that rollups are the preferred scaling solution for general purpose L2s.
Why so?
Plasmas and state channels are application specific (not good for general purpose smart contracts), and sidechains don't have the security benefits of an L2.
Rollups can be general purpose, EVM compatible, offer high throughput and leverage the security of $ETH.
Rollups can be general purpose, EVM compatible, offer high throughput and leverage the security of $ETH.
Which is why @ethereum's roadmap is now also focused on scaling alongside rollup based L2s
polynya.medium.com
polynya.medium.com
Note: You might have noticed @0xPolygon mentioned a few times for various types of solutions.
That's because Polygon is building a suite of $ETH scaling solutions using a few of the different technologies mentioned, including sidechains and zk-rollups.
That's because Polygon is building a suite of $ETH scaling solutions using a few of the different technologies mentioned, including sidechains and zk-rollups.
Just here to make $? Many of the rollup-based L2s like @arbitrum and @optimismPBC don't have tokens yet, but they may in the future.
A common practice is to retroactively airdrop tokens to people who used the chains.
@Uniswap airdropped users 400 $UNI tokens (~$17k at its peak)
A common practice is to retroactively airdrop tokens to people who used the chains.
@Uniswap airdropped users 400 $UNI tokens (~$17k at its peak)
Also, keep a close eye on the on-chain activity on different L2s (TVL, transactions, wallets, dapps, etc).
You can find this kind of information on l2beat.com, defillama.com, dune.xyz, etc.
These will tell you where the $ is flowing.
You can find this kind of information on l2beat.com, defillama.com, dune.xyz, etc.
These will tell you where the $ is flowing.
l2beat.com
L2BEAT β The state of the layer two ecosystem
L2BEAT is an analytics and research website about Ethereum layer 2 scaling. Here you will find in de...
dune.xyz
Dashboards
Blockchain ecosystem analytics by and for the community. Explore and share data from Ethereum, Bitco...
defillama.com
DefiLlama
DefiLlama is a DeFi TVL aggregator. It is committed to providing accurate data without ads or sponso...
Will this be a winner takes all market?
Hard to say, but ultimately, the L2s that attract the dapps will attract the TVL and users.
Hard to say, but ultimately, the L2s that attract the dapps will attract the TVL and users.
What does this mean for L1s?
I think the rapid growth of L2s is going to create some serious competition for the L1 chains.
It's very easy for devs to port over dapps to EVM compatible L2s, and ultimately, everyone wants the security benefits of $ETH.
I think the rapid growth of L2s is going to create some serious competition for the L1 chains.
It's very easy for devs to port over dapps to EVM compatible L2s, and ultimately, everyone wants the security benefits of $ETH.
I think some L1s still have competitive advantages.
For example, $AVAX has a strong narrative around subnets, which can be used to scale high volume dapps (like gaming applications) without impacting the main blockchain.
For example, $AVAX has a strong narrative around subnets, which can be used to scale high volume dapps (like gaming applications) without impacting the main blockchain.
Different chains have different strengths. I do think the future is multichain.
That being said, I think that the days of random L1s that solved for scalability while compromising on security and decentralization are numbered unless they have something else going on.
That being said, I think that the days of random L1s that solved for scalability while compromising on security and decentralization are numbered unless they have something else going on.
You can read the unrolled version of this thread here: typefully.com
This turned out to be a lot longer than I expected and took me a lot longer to understand too π
.
But I hope you found it valuable. If you did, please do consider retweeting the original post β»οΈ:
But I hope you found it valuable. If you did, please do consider retweeting the original post β»οΈ:
Loading suggestions...