Part 1: Understanding Layer 2 solutions in Blockchain

Priyansh Rastogi
2 min readJun 23, 2021

(The is a Beta release of the article xP)
Still figuring out what actually a layer 2 solution for ethereum does?
How it works?

Okay let’s simplify!

Why are Scalability and Sustainability necessary?

Scalability: The ability to function and meet the demands of multiple users without compromising efficiency.

Sustainability: The process of improving scalability once it is achieved, for the sake of competition.

Problems with Scalability as of now

  • Transactions per second(TPS)
  • Cost-effectiveness
  • Security(Avoiding Centralization and Attacks)

Solutions

Ethereum scaling solutions are split into Layer 1 solutions(on-chain) and Layer 2 solutions(off-chain). Layer 1 scaling includes Sharding and Proof of Stake which gives around 100x improvement in transaction speed.

Layer 2 is a collective term for solutions designed to help scale your application by handling transactions off the Ethereum mainnet (layer 1), while taking advantage of the robust decentralized security model of mainnet. Transaction speed suffers when the network is busy which can make the user experience poor for certain types of dapps. And as the network gets busier, gas prices increase as transaction senders aim to outbid each other. This can make using Ethereum very expensive.

This is where layer 2 helps. Let’s understand it better through a simple payment channel.

Let’s say you take an internet subscription plan from me where you need to pay 1 cent for every megabyte of data used. So if you pay by making on-chain transactions on blockchain for every megabyte consumed this would create a lot of transactions and also the gas fee would be even more than the payable amount(1 cent).

So what you could do is, you could deposit $10 to a smart contract address, which can only be controlled by a computer program and not a human. Now for every megabyte of internet consumed you need to sign an off-chain message that will have a value of 1 cent and your signature and you send it to me. So let’s assume you worked for some hours and consumed ‘x’ amount of data throughout and you sign out for today. Then, you send me a signed message containing the final value. Remember all this is happening off-chain so no interaction with blockchain yet.

So now what I will do is I will add my signature also to your signed message and publish it as a transaction on blockchain going to the smart contract address where you deposited $10.

So the smart contract will have the logic that if I send a signed transaction(ticket) to it then whatever amount of money is written on it, it will be transferred to my address in just one transaction, thus avoiding multiple small transactions and gas fees.

So this way multiple transactions can be reduced to just one or two simple transactions. Thus improving the efficiency of transactions by 10,000x.

Hope you got a bit more idea of how Ethereum Scaling works.
See you in the next part!

--

--