Love skiing and skydiving!
Share Dialog
Share Dialog
Love skiing and skydiving!

Subscribe to hudson

Subscribe to hudson
Layer2 refers to an off-chain network, system or technology based on the underlying blockchain (note: also commonly referred to as a "Layer1 network") and designed to extend the underlying blockchain network. layer2 networks can improve the throughput and other performance of any underlying blockchain.
The core value of a Layer2 network, system or technology is the ability to leverage the security of the underlying blockchain. Its transaction data must be verified and validated in some form by the underlying blockchain network. By this standard, a sidechain would not be Layer2 because sidechains typically deploy their own consensus mechanisms and validation nodes, and therefore have security mechanisms independent of the underlying blockchain.
Some blockchains sacrifice scalability to guarantee the level of decentralization and security, and such blockchains can use Layer2 to increase transaction throughput and reduce transaction costs. layer2 is one of the solutions to the scalability problem, allowing fast execution of transactions and scalability without sacrificing the level of decentralization or security.
The Need for Layer2
Blockchain technology was born in 2008. Since then, thousands of researchers and developers have been working to address bottlenecks in blockchain scalability to meet the growing demand for applications. These bottlenecks have resulted in high transaction costs, slow execution, and have been a stumbling block to the mainstreaming of blockchain technology.
Vitalik Buterin, co-founder of Ethernet, first introduced the concept of the "blockchain impossibility triangle", arguing that blockchain cannot simultaneously combine the three dimensions of scalability, security and decentralization. Developers have to make trade-offs between these three dimensions. Today's blockchain networks can only satisfy at most two of these dimensions at the same time.

Layer2 is an emerging technology that asserts that the reason why blockchains have limitations in scalability is because they have too many tasks to perform. The current blockchain has three core functions, namely: executing transactions, data availability, and consensus building.
Execute transactions - Process and complete transactions. The metric is the number of computations per second that the blockchain can complete (which includes the number of transactions). Data Availability - Nodes and validators in the network need to store transactions, state, and other data. The metrics are standard storage units, such as MB and GB, etc. Consensus reaching - Nodes and validators need to reach consensus for network state and transaction ordering. The metrics are the level of decentralization and the speed of finalization, or the time it takes for all nodes to agree on a certain state change. Note: This paper will focus on the transaction execution layer. For a comprehensive understanding of blockchain scaling solutions, read this blog post on blockchain scalability.
Operational Mechanisms of L2 Solutions
Note: Most Layer2 solutions are still in the early stages and many of their elements are yet to be validated.
Layer2 solutions can be roughly divided into two parts: a network responsible for processing transactions; and a smart contract deployed on the underlying blockchain that is responsible for resolving any disagreements and transmitting the consensus reached by the Layer2 network to the underlying blockchain for validation.
Transactions can be quickly executed and computations carried out on the Layer2 network. Different networks will boost transaction throughput in completely different ways. But one thing these Layer 2 networks have in common is that they all submit some sort of verifiable cryptographic proof to the underlying blockchain at settlement to prove the authenticity of the state change. Some Layer2s create proofs in advance and submit them to the underlying blockchain, while others create retroactive proofs later.
Also, different Layer2 networks implement smart contracts on the underlying blockchain in different ways, but the core functions of smart contracts are the same, namely
Saving and releasing funds to be transferred to Layer2. receive proofs submitted by Layer2, validate them, resolve differences, and ultimately confirm the transaction. To better understand these two mechanisms, we can explore the two current Layer2 implementations, namely: payment channels and rollups.
Payment Channels
Two or more users can pre-fund the channel and then transfer passes off-chain.
Alice and Bob each lock a sum of money in a smart contract, create a payment channel, and agree on how much money they can use through cryptographic signature technology. For example, each party locks in $50, so the total amount of funds in the payment channel is $100. Then they will likely agree that each party can use $50.
Once the payment channel is established, both Alice and Bob can transact off-chain via a signed message without submitting the transaction to the underlying blockchain. In this two-way payment channel, Alice's and Bob's transactions are not sent to the underlying blockchain. Only when both parties decide to close the channel, the final transaction result is sent to the chain for settlement.
Thus, ultimately Bob and Alice only need to pay two on-chain transaction fees when the payment channel is created and closed. When the payment channel is opened, a multi-million dollar transfer can be completed in less than a second and at no cost. This is a classic example of solving the blockchain scaling problem.

Rollups
Optimistic rollups and zk-rollups can improve blockchain throughput and reduce costs by executing smart contract state changes off-chain and verifying them on-chain. rollups can scale in three ways.
Rollups execute transactions off-chain, and the underlying blockchain simply computes lightweight proofs of transactions, validates network activity and stores raw transaction data. Rollups package the transaction data and submit it to the blockchain, where on-chain gas fees can be apportioned across transactions. Rollups requires at least one honest validation node to prove the validity of a transaction to the underlying blockchain, thus requiring a low number of validation nodes and a high level of node hardware, without having a significant impact on security. Off-chain execution A key quality of rollups is off-chain execution of transactions. This means that the Layer2 network can handle transactions with other users or smart contracts instead of the underlying blockchain. With fewer authentication nodes and more powerful hardware, this will significantly increase the transaction throughput of the Layer2 network compared to the underlying blockchain.
The underlying blockchain only needs to compute proofs submitted to the smart contract to validate activity in the Layer2 network (note: in the case of optimistic rollups, validation is only required when disagreements arise) and store the raw, unexecuted transaction data as calldata. In short, the blockchain no longer needs to perform as many computational tasks and store as much transaction data on Layer2, thus reducing the cost per transaction.
Packaged Transactions Another way to reduce costs is to package transactions. You can think of this as giving a gift. On the blockchain, each transaction is a separate gift that is placed in a different box. This would make shipping costs very high, as you would need to pay a shipping fee for each gift sent. Rollups, on the other hand, put many gifts into one large box and only pay one shipping charge, which can be shared for each gift.
If you want to explain it in more technical terms, rollups package the raw transaction data into calldata. rollup transactions are validated differently than on-chain transactions, and the transaction data is only packaged to store the data on the underlying blockchain so that the validating node or rollup participant can rebuild the state of the Layer2 network at any time if needed. However, the core logic remains unchanged, i.e., multiple rollup transactions are stored in a single packaged transaction on the main chain.

This can effectively reduce transaction costs and clear the way for blockchain scaling. Compressing the data can further reduce transaction execution costs.
Zk-rollups and optimistic rollups use the same way to package transactions.
Reducing the number of validation nodes As mentioned above, Layer2 can take advantage of the underlying blockchain's level of security and decentralization, which we will elaborate on below. But the core concept here is that Layer2 must submit some sort of proof to the underlying blockchain that the state change it initiated is valid.
Thus, rollups can then reduce the number of validation nodes in the Layer2 network that are responsible for executing transactions. Validation nodes can be licensed entities that typically have more powerful hardware to compute transactions faster and at a lower cost. This is possible because the validation nodes are not responsible for reaching consensus, which is reached by the underlying blockchain, and smart contracts on the underlying blockchain need to validate the proofs submitted by Layer2.
Proofs are critical to Layer2's security "Proofs" are critical to Layer2 because Layer2 needs to submit proofs to take advantage of the security of the underlying blockchain. In the real world, proofs can take many forms, such as fingerprints on a weapon or security footage.
Encrypted proofs are similar, except that the content is more objective than evidence in a court of law. Using encryption to prove something guarantees its objectivity, verifiability, and tamper-proofness. If the proof is valid, then there is a 100% guarantee of authenticity. For example, in the case of the payment channel mentioned above, attaching a cryptographic signature to a transaction would provide a definitive authoritative fact for a smart contract to resolve any disagreement.
Every Layer2 network needs to provide some sort of cryptographic proof to resolve disagreements on the underlying blockchain. The two most dominant types of proofs today are fault proof and validity proof (also known as "zero-knowledge proof"). These two proofs are the underlying technologies for optimistic rollups and zk-rollups.
Payment channel signature message Suppose that when the payment channel is closed, Bob or Alice launches a malicious attack and tries to take funds that do not belong to them. Either of them can send a previous version of the payment channel "ledger" to the smart contract.
The key to the payment channel is that each transaction must be accompanied by a cryptographic signature. This provides proof to the smart contract on the underlying blockchain to resolve disagreements. For example, if Alice submits an outdated copy of the ledger and takes a portion of the money that does not belong to her, then Bob can challenge the settlement transaction and submit an updated copy of the ledger. The smart contract can then determine the correct amount. And Alice would also be fined for dishonest behavior.
The payment channel is also a Layer2 solution since the underlying blockchain smart contract will adjudicate. A simple way to judge this is to see if there is a "proof". Once a payment channel is created, both Bob and Alice must attach a signature to each transaction they initiate and store a copy of the other's signature.
This is the proof of the transaction in the payment channel. But proof is not enough; the facts need to be executed, much like the process by which a judge makes a decision after being presented with evidence and the results of a jury's deliberations. Likewise, the smart contract executes the verdict by crediting the correct amount to each party's wallet on the underlying blockchain for settlement.
This is the "level of decentralization and security using the underlying blockchain" mentioned above. The payment channel takes most of the computation and execution off-chain, but uses the powerful consensus layer of the underlying blockchain to make the final decision when it comes to final settlement.
Proof of Error for Optimistic Rollups Error proofs are actually quite simple. A Layer2 network using this proof will default to all transactions being valid. However, the network sets a challenge period where any participant can initiate a challenge and submit a proof to the smart contract that the transaction data or state change is incorrect. When the proof of incorrectness is issued, the rollup transactions are partially or fully recalculated on the chain and the final state change is compared to the original result. If the recalculated result is different, the original result will be considered invalid and withdrawn.
This is the mechanism currently used in optimistic rollups. The Chinese word "optimistic" means "optimistic" and represents an optimistic philosophical perspective, i.e., the smart contract "optimistically" defaults to all transactions being valid, unless someone objects. unless someone disputes it (innocent by association). Returning to the example of the dishonestly verified node just mentioned. Any network participant need only submit a valid proof of wrongness to the smart contract during the challenge period, and once proven correct, the validating node's actions are nullified.

Proof of validity of zk-rollup Proof of validity is a very different philosophical perspective, where by default all computational results are in doubt and must be proven before they can be accepted.
In short, a proof of validity serves to prove that something is correct. For zk-rollup, the proof is of the transactions and computations in the Layer2 network. Thus, a smart contract on the underlying blockchain can validate the proof of validity submitted by the Layer2 network to approve state changes. For the validating node, a fully functional zk-rollup will not allow any erroneous transactions to settle on the underlying blockchain, as each batch of transactions must be accompanied by the corresponding proof of validity.

Blockchain Scaling Solutions
Payment channels, rollups and Layer2 are all blockchain scaling solutions that have long-term potential to fuel the development of Web3 applications and enhance the user experience.
Most Web3 technology stacks such as Layer1 and Layer2 are just starting out and need to evolve. These technologies have not yet reached their breaking point and still need to go through a series of real-world tests to prove themselves. However, countless developers and researchers are working tirelessly to expand the blockchain ecosystem and develop DAG and Layer2 solutions to drive Web3 towards mainstream adoption.
Layer2 refers to an off-chain network, system or technology based on the underlying blockchain (note: also commonly referred to as a "Layer1 network") and designed to extend the underlying blockchain network. layer2 networks can improve the throughput and other performance of any underlying blockchain.
The core value of a Layer2 network, system or technology is the ability to leverage the security of the underlying blockchain. Its transaction data must be verified and validated in some form by the underlying blockchain network. By this standard, a sidechain would not be Layer2 because sidechains typically deploy their own consensus mechanisms and validation nodes, and therefore have security mechanisms independent of the underlying blockchain.
Some blockchains sacrifice scalability to guarantee the level of decentralization and security, and such blockchains can use Layer2 to increase transaction throughput and reduce transaction costs. layer2 is one of the solutions to the scalability problem, allowing fast execution of transactions and scalability without sacrificing the level of decentralization or security.
The Need for Layer2
Blockchain technology was born in 2008. Since then, thousands of researchers and developers have been working to address bottlenecks in blockchain scalability to meet the growing demand for applications. These bottlenecks have resulted in high transaction costs, slow execution, and have been a stumbling block to the mainstreaming of blockchain technology.
Vitalik Buterin, co-founder of Ethernet, first introduced the concept of the "blockchain impossibility triangle", arguing that blockchain cannot simultaneously combine the three dimensions of scalability, security and decentralization. Developers have to make trade-offs between these three dimensions. Today's blockchain networks can only satisfy at most two of these dimensions at the same time.

Layer2 is an emerging technology that asserts that the reason why blockchains have limitations in scalability is because they have too many tasks to perform. The current blockchain has three core functions, namely: executing transactions, data availability, and consensus building.
Execute transactions - Process and complete transactions. The metric is the number of computations per second that the blockchain can complete (which includes the number of transactions). Data Availability - Nodes and validators in the network need to store transactions, state, and other data. The metrics are standard storage units, such as MB and GB, etc. Consensus reaching - Nodes and validators need to reach consensus for network state and transaction ordering. The metrics are the level of decentralization and the speed of finalization, or the time it takes for all nodes to agree on a certain state change. Note: This paper will focus on the transaction execution layer. For a comprehensive understanding of blockchain scaling solutions, read this blog post on blockchain scalability.
Operational Mechanisms of L2 Solutions
Note: Most Layer2 solutions are still in the early stages and many of their elements are yet to be validated.
Layer2 solutions can be roughly divided into two parts: a network responsible for processing transactions; and a smart contract deployed on the underlying blockchain that is responsible for resolving any disagreements and transmitting the consensus reached by the Layer2 network to the underlying blockchain for validation.
Transactions can be quickly executed and computations carried out on the Layer2 network. Different networks will boost transaction throughput in completely different ways. But one thing these Layer 2 networks have in common is that they all submit some sort of verifiable cryptographic proof to the underlying blockchain at settlement to prove the authenticity of the state change. Some Layer2s create proofs in advance and submit them to the underlying blockchain, while others create retroactive proofs later.
Also, different Layer2 networks implement smart contracts on the underlying blockchain in different ways, but the core functions of smart contracts are the same, namely
Saving and releasing funds to be transferred to Layer2. receive proofs submitted by Layer2, validate them, resolve differences, and ultimately confirm the transaction. To better understand these two mechanisms, we can explore the two current Layer2 implementations, namely: payment channels and rollups.
Payment Channels
Two or more users can pre-fund the channel and then transfer passes off-chain.
Alice and Bob each lock a sum of money in a smart contract, create a payment channel, and agree on how much money they can use through cryptographic signature technology. For example, each party locks in $50, so the total amount of funds in the payment channel is $100. Then they will likely agree that each party can use $50.
Once the payment channel is established, both Alice and Bob can transact off-chain via a signed message without submitting the transaction to the underlying blockchain. In this two-way payment channel, Alice's and Bob's transactions are not sent to the underlying blockchain. Only when both parties decide to close the channel, the final transaction result is sent to the chain for settlement.
Thus, ultimately Bob and Alice only need to pay two on-chain transaction fees when the payment channel is created and closed. When the payment channel is opened, a multi-million dollar transfer can be completed in less than a second and at no cost. This is a classic example of solving the blockchain scaling problem.

Rollups
Optimistic rollups and zk-rollups can improve blockchain throughput and reduce costs by executing smart contract state changes off-chain and verifying them on-chain. rollups can scale in three ways.
Rollups execute transactions off-chain, and the underlying blockchain simply computes lightweight proofs of transactions, validates network activity and stores raw transaction data. Rollups package the transaction data and submit it to the blockchain, where on-chain gas fees can be apportioned across transactions. Rollups requires at least one honest validation node to prove the validity of a transaction to the underlying blockchain, thus requiring a low number of validation nodes and a high level of node hardware, without having a significant impact on security. Off-chain execution A key quality of rollups is off-chain execution of transactions. This means that the Layer2 network can handle transactions with other users or smart contracts instead of the underlying blockchain. With fewer authentication nodes and more powerful hardware, this will significantly increase the transaction throughput of the Layer2 network compared to the underlying blockchain.
The underlying blockchain only needs to compute proofs submitted to the smart contract to validate activity in the Layer2 network (note: in the case of optimistic rollups, validation is only required when disagreements arise) and store the raw, unexecuted transaction data as calldata. In short, the blockchain no longer needs to perform as many computational tasks and store as much transaction data on Layer2, thus reducing the cost per transaction.
Packaged Transactions Another way to reduce costs is to package transactions. You can think of this as giving a gift. On the blockchain, each transaction is a separate gift that is placed in a different box. This would make shipping costs very high, as you would need to pay a shipping fee for each gift sent. Rollups, on the other hand, put many gifts into one large box and only pay one shipping charge, which can be shared for each gift.
If you want to explain it in more technical terms, rollups package the raw transaction data into calldata. rollup transactions are validated differently than on-chain transactions, and the transaction data is only packaged to store the data on the underlying blockchain so that the validating node or rollup participant can rebuild the state of the Layer2 network at any time if needed. However, the core logic remains unchanged, i.e., multiple rollup transactions are stored in a single packaged transaction on the main chain.

This can effectively reduce transaction costs and clear the way for blockchain scaling. Compressing the data can further reduce transaction execution costs.
Zk-rollups and optimistic rollups use the same way to package transactions.
Reducing the number of validation nodes As mentioned above, Layer2 can take advantage of the underlying blockchain's level of security and decentralization, which we will elaborate on below. But the core concept here is that Layer2 must submit some sort of proof to the underlying blockchain that the state change it initiated is valid.
Thus, rollups can then reduce the number of validation nodes in the Layer2 network that are responsible for executing transactions. Validation nodes can be licensed entities that typically have more powerful hardware to compute transactions faster and at a lower cost. This is possible because the validation nodes are not responsible for reaching consensus, which is reached by the underlying blockchain, and smart contracts on the underlying blockchain need to validate the proofs submitted by Layer2.
Proofs are critical to Layer2's security "Proofs" are critical to Layer2 because Layer2 needs to submit proofs to take advantage of the security of the underlying blockchain. In the real world, proofs can take many forms, such as fingerprints on a weapon or security footage.
Encrypted proofs are similar, except that the content is more objective than evidence in a court of law. Using encryption to prove something guarantees its objectivity, verifiability, and tamper-proofness. If the proof is valid, then there is a 100% guarantee of authenticity. For example, in the case of the payment channel mentioned above, attaching a cryptographic signature to a transaction would provide a definitive authoritative fact for a smart contract to resolve any disagreement.
Every Layer2 network needs to provide some sort of cryptographic proof to resolve disagreements on the underlying blockchain. The two most dominant types of proofs today are fault proof and validity proof (also known as "zero-knowledge proof"). These two proofs are the underlying technologies for optimistic rollups and zk-rollups.
Payment channel signature message Suppose that when the payment channel is closed, Bob or Alice launches a malicious attack and tries to take funds that do not belong to them. Either of them can send a previous version of the payment channel "ledger" to the smart contract.
The key to the payment channel is that each transaction must be accompanied by a cryptographic signature. This provides proof to the smart contract on the underlying blockchain to resolve disagreements. For example, if Alice submits an outdated copy of the ledger and takes a portion of the money that does not belong to her, then Bob can challenge the settlement transaction and submit an updated copy of the ledger. The smart contract can then determine the correct amount. And Alice would also be fined for dishonest behavior.
The payment channel is also a Layer2 solution since the underlying blockchain smart contract will adjudicate. A simple way to judge this is to see if there is a "proof". Once a payment channel is created, both Bob and Alice must attach a signature to each transaction they initiate and store a copy of the other's signature.
This is the proof of the transaction in the payment channel. But proof is not enough; the facts need to be executed, much like the process by which a judge makes a decision after being presented with evidence and the results of a jury's deliberations. Likewise, the smart contract executes the verdict by crediting the correct amount to each party's wallet on the underlying blockchain for settlement.
This is the "level of decentralization and security using the underlying blockchain" mentioned above. The payment channel takes most of the computation and execution off-chain, but uses the powerful consensus layer of the underlying blockchain to make the final decision when it comes to final settlement.
Proof of Error for Optimistic Rollups Error proofs are actually quite simple. A Layer2 network using this proof will default to all transactions being valid. However, the network sets a challenge period where any participant can initiate a challenge and submit a proof to the smart contract that the transaction data or state change is incorrect. When the proof of incorrectness is issued, the rollup transactions are partially or fully recalculated on the chain and the final state change is compared to the original result. If the recalculated result is different, the original result will be considered invalid and withdrawn.
This is the mechanism currently used in optimistic rollups. The Chinese word "optimistic" means "optimistic" and represents an optimistic philosophical perspective, i.e., the smart contract "optimistically" defaults to all transactions being valid, unless someone objects. unless someone disputes it (innocent by association). Returning to the example of the dishonestly verified node just mentioned. Any network participant need only submit a valid proof of wrongness to the smart contract during the challenge period, and once proven correct, the validating node's actions are nullified.

Proof of validity of zk-rollup Proof of validity is a very different philosophical perspective, where by default all computational results are in doubt and must be proven before they can be accepted.
In short, a proof of validity serves to prove that something is correct. For zk-rollup, the proof is of the transactions and computations in the Layer2 network. Thus, a smart contract on the underlying blockchain can validate the proof of validity submitted by the Layer2 network to approve state changes. For the validating node, a fully functional zk-rollup will not allow any erroneous transactions to settle on the underlying blockchain, as each batch of transactions must be accompanied by the corresponding proof of validity.

Blockchain Scaling Solutions
Payment channels, rollups and Layer2 are all blockchain scaling solutions that have long-term potential to fuel the development of Web3 applications and enhance the user experience.
Most Web3 technology stacks such as Layer1 and Layer2 are just starting out and need to evolve. These technologies have not yet reached their breaking point and still need to go through a series of real-world tests to prove themselves. However, countless developers and researchers are working tirelessly to expand the blockchain ecosystem and develop DAG and Layer2 solutions to drive Web3 towards mainstream adoption.
<100 subscribers
<100 subscribers
No activity yet