DEV Community

Cover image for Layer 1 vs. Layer 2
Francis
Francis

Posted on • Updated on

Layer 1 vs. Layer 2

Why is blockchain scalability important?

The application of blockchain technology in finance is invaluable, but it does have inherent drawbacks known as the Blockchain Trilemma. It establishes a balance between security, decentralization, and scalability of the network. Blockchain security prioritizes the protection of the network from bad actors and attacks, while decentralization deals with how the network capabilities are divided across multiple computers globally. Decentralization ensures that the service cannot be destroyed because there is no head. A blockchain network is more like a hydra.

Security and decentralization are essential pillars in any blockchain network. The necessity of adding scalability to this network is challenging. Scalability focuses on the network's ability to handle high-frequency transactions and change. Without it, the blockchain network has no chance of replacing the traditional financial system. Compared to Visa, Bitcoin processes 4–7 transactions per second, while Visa does 1,700.

Currently, most DeFi projects are suffering from extremely high transaction fees. Due to the increase in traffic on the network, more users on the network congest it, and transactions are processed by paying fees (gas) to the miners. The current solution to congestion has been to place transactions that pay more in fees at the front of the line for processing. This procedure has single-handedly created the high transaction fee race currently. These high fees have been a barrier to entry for most individuals interested in crypto. Without a solution, the ones with the most coins will be the ones shaping the industry.

Layer 1 vs. Layer 2

Layer 1 would be the blockchain Ethereum is built on, while Polygon ($MATIC) refers to a layer 2 solution that relies on the overlaying network established by Ethereum. As a result of blockchain's current inherent congestion issues, layer 2 solutions have emerged to solve these problems. It cannot be completely perfect as layer 2 solutions give up something to achieve higher network speeds. To handle these issues, we examine the layer 1 and layer 2 solutions. By no means is this an extensive breakdown of possible solutions.

Layer 1 and Layer 2 simplified

Imagine the fastest snail that could exist. You want the snail to go faster, but the snail cannot. So you place a treadmill on top of the snail and then a turtle on top of the treadmill; now you have a fast turtle on top of a slow snail. That's layer 1 and layer 2 in a “snail shell.”

Image description

Scaling of Layer 1

Layer 1 scale focuses on increasing the number of transactions on the blockchain network. The Ethereum Foundation is proposing sharding, which is the splitting of a database to distribute its capacity. Ethereum (2.0) plans to implement this concept by breaking their distributed ledger, which is technically a database, into smaller pieces, or smaller chains, to improve transaction speed. This ensures their network stays decentralized and improves performance and security.

Another scaling solution is consensus protocol changes. Both Bitcoin and Ethereum use proof-of-work (PoW) to process transactions, which is very costly and slow. Proof-of-Stake (PoS), on the other hand, is faster and has a lower carbon footprint than PoW. Ethereum can process 15-20 transactions per second. This has resulted in high fees and slow process times, but once PoS can be implemented, it can increase speed and reduce fees tremendously.

Layer 2

Layer 2 has two popular solutions for scaling: rollups and state channels. Rollups utilize outside computational capabilities to process transactions, instead of having the network perform the calculations. Utilizing outside computational abilities eases the load off of Layer 1, which increases the transaction speed. With this method, only necessary information is added to the blockchain, making it inherit Layer 1 security while being scalable, and still maintaining decentralization.

State on the chain, a deposit is locked, known as the state, then a channel opens up off-chain for users to transact quickly. Once it is complete, the final last interaction is recorded on-chain, and the initial deposit, or state, is unlocked. Just like the rollups, part of the process is abstracted to increase speed, while utilizing the final security of layer 1.

Closing

Every DeFi project is racing to achieve improved transaction speeds without sacrificing security and the decentralized nature of this ecosystem. Layer 2 solutions might be adopted and expanded on by most emerging projects today. Although Ethereum is also attempting to solve this problem, high fees make it impossible for DeFi to be accessible to everyone. Soon enough, this will be a problem of yesterday, but today we can explore projects attempting to implement these solutions.

Stay Connected!!

Follow Francis on | Twitter| Portfolio| OpenSea|

Top comments (0)