Layer 2 solutions are protocols built on top of base blockchains (layer 1) that enable faster transactions, improved scalability, and lower fees while benefitting from the underlying blockchain’s security. They process transactions off-chain and periodically settle data to layer 1.
Types of layer 2 solutions:
State Channels
- Operate by opening a payment channel between users that enables fast, cheap transfers off-chain.
- Allow instant payments and micropayments.
- Increased privacy compared to public blockchains.
- Some security tradeoffs by moving transactions off the main chain.
Sidechains
- Separate blockchains that run in parallel to the main chain and enable transfer of tokens/data between them.
- Improves scalability by moving transactions off the congested main chain.
- Requires some trust in the sidechain validators to ensure proper transfers.
Plasma Chains
- Operate like sidechains but have greater security assurances through reliance on layer 1.
- Economic incentives to ensure accurate off-chain recordkeeping.
- Complex exit procedures back to layer 1 can cause issues.
Rollups (Optimistic and ZK)
- Bundle/roll up transactions off-chain and generate cryptographic proofs, submitting only proof data to layer 1.
- Very cost-effective scaling solution due to minimal data on-chain.
- Some variants have limitations on types of computations supported.
In summary, layer 2 solutions enable major improvements in transaction throughput, fees, and latency by handling most computation and storage off the main blockchain, while benefiting from the underlying security. The tradeoffs include increased complexity and varying security models.