Notes on Basic Knowledge of Cryptography: Knowledge Graph of Blockchain Layer
# 1. What is a Layer in Blockchain?
Data Layer: Data that is distributed and immutable, which needs to be maintained collectively by all nodes.
Network Layer: A vast decentralized peer-to-peer network formed by all nodes on the blockchain.
Consensus Layer: The blockchain requires a consensus mechanism to maintain data consistency; well-known consensus mechanisms include PoW, PoS, and DPoS.
Actuator Layer: The reward mechanism of the blockchain, where nodes compete for bookkeeping rights by maintaining the blockchain network.
Contract Layer: The code of the blockchain that grants the foundation for smart contract applications on the chain without third-party interference.
Application Layer: A diverse range of application solutions developed based on technology on the blockchain system.
The six major architectures of a blockchain system are indispensable, with the data layer and network layer being the foundational layers. Above them are the consensus layer, actuator layer, contract layer, and application layer, which together constitute the blockchain protocol. We can further categorize the architecture of the blockchain system from the bottom up, labeled as Layer 0 to Layer 4.
# 2. Cases of Blockchain Layers
Once we understand that solutions can be developed to meet the needs of blockchain as it evolves, where can they be applied? Below, we will provide a simple explanation of common blockchain applications and the associated cryptocurrencies or applications through a mind map (more intuitive). Figure 1 (Data as of August 2024)
Bitcoin Lightning Network
A major Layer 2 scaling solution on Bitcoin is the Lightning Network, optimized for small payment scenarios. The main implementation of the Lightning Network allows both parties to establish a "channel" off-chain, where they can conduct multiple payment transactions. When settlement is needed, they simply close the channel. If the two parties do not have a direct "channel," they can use a third-party node for relay. Figure 2 (Data as of August 2024)
# 3. The Blockchain Trilemma
The blockchain trilemma is a theory proposed by Ethereum founder Vitalik Buterin, which states that a blockchain network cannot simultaneously achieve security, decentralization, and scalability.
(1) Security
Refers to the network's ability to resist malicious attacks, such as preventing double-spending attacks or 51% attacks, ensuring the immutability of transactions.
(2) Decentralization
Refers to the non-centralized structure of the network, where all nodes have equal status and participate in decision-making together. This is key for the blockchain to resist censorship and single points of failure.
(3) Scalability
Refers to the blockchain's ability to process transactions, including high transaction throughput and low latency, which is a prerequisite for large-scale applications.
The trilemma arises because improving the transaction processing speed and capacity of the blockchain typically requires more computational power and network bandwidth, making it more expensive and difficult to operate nodes. This may lead to a reduction in the number of nodes on the network, increasing centralization, which could also compromise its security and decentralization features.
Thus, the trilemma highlights the trade-offs faced by blockchain in pursuing scalability and the challenges encountered in achieving truly decentralized and scalable blockchains.
# 4. Implementation Methods of Layer 2
Blockchain Layer 2 is a scalability solution that refers to networks or technologies running on top of the underlying blockchain protocol to enhance network scalability, increase transaction speed, reduce costs, and ensure security. By moving some transactions to the second layer, Layer 2 technology can effectively alleviate congestion and high transaction fees on the underlying blockchain.
By allowing the underlying blockchain to focus on key aspects such as decentralization, security, and usability, Layer 2 solutions enhance user experience and play a significant role in the growth of the entire cryptocurrency industry.
Currently, mainstream Layer 2 solutions include Optimistic Rollups, Zero-Knowledge Rollups, and sidechains.
(1) What is Optimistic Rollup?
Optimistic Rollups are a Layer 2 protocol that allows users to perform computations and state storage off-chain, improving the processing speed of the Ethereum blockchain and reducing transaction fees.
Optimistic Rollup operators reduce costs for end-users by batching multiple off-chain transactions and submitting them to the Ethereum network.
The architecture of Optimistic Rollups includes on-chain contracts and off-chain virtual machines.
The operations of Optimistic Rollups are controlled by smart contracts running on Ethereum, which include contracts for storing blocks, monitoring state updates, and tracking user deposits.
The two most prominent implementations of Optimistic Rollup are Arbitrum and Optimism.
(2) What is ZK Rollup?
Zero-Knowledge Rollups are another Layer 2 solution that uses ZK Proofs to verify the validity of a batch of up to thousands of transactions, then publishes minimal summary data to the main chain.
Zero-Knowledge Proofs (ZKPs) are a method of proof that allows one party (the prover) to prove to another party (the verifier) that they know a secret or that a statement is true without revealing any actual information.
This can be used to enhance privacy on the blockchain, as it allows for the verification of transactions without disclosing sensitive information about them.
The state of Zero-Knowledge Rollups is maintained by smart contracts deployed on the Ethereum network. To update this state, Zero-Knowledge Rollups nodes must submit validity proofs for verification.
This validity proof is a cryptographic guarantee that the proposed state change is indeed the result of executing the given batch of transactions.
This means that Zero-Knowledge Rollups only need to provide validity proofs to complete transactions on Ethereum, rather than publishing all transaction data on-chain like Optimistic Rollups.
Currently, there are various implementations of Zero-Knowledge Rollups, including Loopring, zkSync, Starknet, etc. Projects using zkEVM include Polygon zkEVM, Scroll, Taiko, etc.
(3) Comparison of Technical Features between Optimistic Rollup and ZK Rollup
We will conclude this section here. This is the first part of the "Cryptocurrency Knowledge Notes" series. We will continue to share more content from the knowledge architecture diagram in subsequent installments. The complete "Cryptocurrency Knowledge Notes" will be organized into a PDF for download and reading after the series is fully updated.
Note: The above content is sourced from the internet. If there are any citation errors or other suggestions, please feel free to leave a message to inform us. All information in this article is for learning records and educational exchange purposes only and should not be considered as investment advice.