|
2 | 2 | sidebar_position: 3
|
3 | 3 | ---
|
4 | 4 |
|
5 |
| -# Layer 2 Solutions |
| 5 | +# Layer 2 solutions |
6 | 6 |
|
7 |
| -> What does layer 2 mean? What types of layer 2 solutions exist? |
| 7 | +This section provides an overview of various types of layer 2 solutions, along with several examples. |
8 | 8 |
|
9 |
| -In the blockchain industry, we talk about **layer 2** solution whenever we refer to a solution that overlays an existing protocol (the layer 1) to provide either additional functionality or performance benefits over the underlying protocol. In essence, they are generic purpose solutions built on top of a protocol to enable other applications. They provide a framework for developing decentralized applications with generally different trade-offs than the underlying layer 1 protocol. |
| 9 | +In the blockchain industry, a layer 2 solution refers to any protocol that overlays an existing protocol (layer 1) to provide additional functionality or performance benefits. Essentially, these solutions are built on top of the base protocol to enable other applications. They offer a framework for developing decentralized applications with different trade-offs compared to the underlying layer 1 protocol. |
10 | 10 |
|
11 |
| -## State Channels |
| 11 | +## State channels |
12 | 12 |
|
13 |
| -The Hydra head protocol is a layer 2 solution which belongs to the family of **state channels**, which is itself a descendant of **payment channels**. A payment channel allows for two or more parties to exchange funds according to a given off-chain protocol without having to commit all transactions to the underlying blockchain. They are historically one of the first kind of layer 2 solution to arise as an answer to scalability issues of permission-less ledgers (and consequently, they're also the most studied and known kind of solutions). |
| 13 | +The Hydra Head protocol is a layer 2 solution within the family of **state channels**, which evolved from **payment channels**. A payment channel allows two or more parties to exchange funds using an off-chain protocol without committing all transactions to the underlying blockchain. Historically, they were among the first types of layer 2 solutions developed to address the scalability issues of permissionless ledgers, making them the most studied and well-known. |
14 | 14 |
|
15 |
| -State-channels extend the traditional concept of payment channels to support smart-contracts over off-chain channels. In such a setup, one or more parties are no longer limited to pure transactional payments, but they can execute full-blown scripts validations to handle complex logic, off-chain, only to later commit the result back to the layer 1. |
| 15 | +State channels extend the concept of payment channels to support smart contracts over off-chain channels. In this setup, parties can execute complex logic and validate full-blown scripts off-chain, not just transactional payments. The final result is then committed back to the layer 1 blockchain. |
16 | 16 |
|
17 | 17 | #### Examples
|
18 | 18 |
|
19 | 19 | - Lightning (Bitcoin)
|
20 | 20 | - Perun (Ethereum, Polkadot, Cosmos)
|
21 | 21 | - Sprites (Ethereum)
|
22 |
| -- And of course, our favorite: **Hydra: Head** (Cardano) |
| 22 | +- And of course, our favorite: **Hydra: Head** (Cardano). |
23 | 23 |
|
24 |
| -## Side Chains |
| 24 | +## Sidechains |
25 | 25 |
|
26 |
| -**Side chains** allow for transferring assets from a layer 1 protocol to a new chain with its own set of consensus rules. Usually, a side-chain provides either a simpler or more efficient consensus mechanism which allows for more scalability or which ease the implementation of new functionality harder to get adopted on the layer 1. Often, this comes at the price of decentralization or security, since side-chains are typically involving only few actors or committees at their root. |
| 26 | +Sidechains allow for transferring assets from a layer 1 protocol to a new chain with its own set of consensus rules. Typically, a sidechain provides a simpler or more efficient consensus mechanism that allows for greater scalability or facilitates the implementation of new functionality that is harder to adopt on layer 1. Often, this comes at the price of decentralization or security, as sidechains typically involve only a few actors or committees at their core. |
27 | 27 |
|
28 |
| -Side chains are however "proper chains", with blocks produced by validator and usually, smart-contract capabilities. Therefore, unlike state-channels, they provide data-availability and offer ways to participate into the validation and observation of the chain (in a state-channel, only participants of the channel really have a reliable view of what is going on in the channel). Entering a side-chain is usually done by burning or locking assets on the layer 1, to receive an equivalent counterpart on the side-chain network. |
| 28 | +Sidechains are, however, 'proper chains', with blocks produced by validators and usually smart contract capabilities. Therefore, unlike state channels, they provide data availability and offer ways to participate in the validation and observation of the chain. In a state channel, only participants of the channel have a reliable view of what is happening within the channel. Entering a sidechain is usually done by burning or locking assets on layer 1 to receive an equivalent counterpart on the sidechain network. |
29 | 29 |
|
30 | 30 | #### Examples
|
31 | 31 |
|
32 | 32 | - Liquid Network (Bitcoin)
|
33 | 33 | - RSK (Bitcoin)
|
34 | 34 | - Polygon (Ethereum)
|
35 |
| -- Milkomeda (Cardano) |
| 35 | +- Milkomeda (Cardano). |
36 | 36 |
|
37 | 37 | ## Rollups
|
38 | 38 |
|
39 |
| -Another major type of layer 2 solution is **Rollups**. They provide a way for moving transaction execution off-chain only to keep a much more compact representation of the execution on the layer 1. Rollups are typically driven by a central actor, often called _sequencer_, with high availability and computational resource demands off-chain, while regularly leaving verifiable breadcrumbs on-chain (the rollups). |
| 39 | +Another major type of layer 2 solution is rollups. Rollups move transaction execution off-chain, keeping a much more compact representation of the execution on layer 1. They are typically driven by a central actor, often called a *sequencer*, which has high availability and computational resource demands off-chain, while regularly leaving verifiable ‘breadcrumbs’ on-chain (the rollups). |
40 | 40 |
|
41 |
| -In general, rollups come in two popular flavours |
42 |
| -+ **optimistic** rollups involving interactive games for fraud disputes, and |
43 |
| -+ **validity** rollups involving Zero-Knowledge-based proofs for validity checks. |
| 41 | +In general, rollups come in two popular flavors: *optimistic* rollups and *validity* rollups. |
44 | 42 |
|
45 |
| -In the former, rollups are posted on-chain optimistically and verification are done _a posteriori_ by independent validators. In case of disagreement, the dispute is resolved on-chain and the rollup batch publisher endure financial consequences. In zero-knowledge approaches, a succinct proof of execution is calculated off-chain, published alongside the rollup batch commitment and controlled by on-chain validators (which thus enforce the rightful execution of the rollup). |
| 43 | +- **Optimistic rollups** involve interactive games for fraud disputes. Transactions are posted on-chain optimistically, and verification is performed afterward by independent validators. In case of disagreement, the dispute is resolved on-chain, and the rollup batch publisher incurs financial consequences. |
| 44 | +- **Validity rollups** involve zero-knowledge proofs for validity checks. A succinct proof of execution is calculated off-chain, published alongside the rollup batch commitment, and controlled by on-chain validators, enforcing the rightful execution of the rollup. |
46 | 45 |
|
47 | 46 | #### Examples
|
48 | 47 |
|
49 | 48 | - Arbitrum (Ethereum)
|
50 | 49 | - Optimism (Ethereum)
|
51 | 50 | - Hermez (Ethereum)
|
52 |
| -- ZKSync (Ethereum) |
| 51 | +- ZKSync (Ethereum). |
0 commit comments