BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

An article to understand the expansion scheme of the blockchain execution layer, storage layer and consensus layer

Chainlink
特邀专栏作者
2022-07-20 13:30
This article is about 9994 words, reading the full article takes about 15 minutes
This article outlines the scalability issues of blockchain, focuses on the differences between blockchain and traditional computing systems, and lists the advantages and disadvantages of different expansion solutions for blockchain at the execution layer
AI Summary
Expand
This article outlines the scalability issues of blockchain, focuses on the differences between blockchain and traditional computing systems, and lists the advantages and disadvantages of different expansion solutions for blockchain at the execution layer

Trust minimization is a valuable security property, whileblockchain technologyencrypted factsencrypted factsimage description

Encrypted facts enable trust-minimized backend computation for applications and records

At present, the blockchain has realized trust minimization for various innovative application scenarios, including monetary policy (such as: Bitcoin) and digital asset transactions (such as:DEX). However, blockchain has always been difficult to meet the speed and cost requirements of many application scenarios, and cannot match traditional computing systems in these two dimensions. The scalability limitations of the blockchain also make users have to pay high transaction fees, which makes developers wonder whether the blockchain can really support high-value application scenarios and realize real-time data processing.

smart contractsmart contractBecome a key element of the back-end infrastructure of traditional industries such as finance, supply chain and gaming. The following outlines the scalability issues of the blockchain, focusing on the differences between the blockchain and traditional computing systems, and lists the advantages and disadvantages of different expansion solutions for the execution layer, storage layer, and consensus layer of the blockchain.

first level title

Comparative Analysis of Blockchain and Traditional Computing

Before discussing how to scale blockchain, it is necessary to understand the fundamental difference between blockchain computing and traditional computing. In general, blockchain has the following core values:

  • Computation is highly deterministic - it is strictly executed according to the predefined code logic and has a very high degree of determinism.

  • Trusted and neutral - the blockchain has no centralized administrators or special network permissions, meaning anyone can submit transactions without fear of manipulation or discrimination.

  • Verification by end users - anyone in the world can audit the history and current state of the blockchain ledger and the underlying code of the client software.

More specifically, the task of the blockchain is to manage an internal ledger that can record asset ownership, contract status, or raw data. Most blockchain networks are managed by "block producers" and "full nodes". These two types of actors each perform distinct but sometimes overlapping functions.

Block producers collect unconfirmed transactions submitted by users, check the validity of transactions, and place transactions in data structures we call "blocks". Block producers are usually called “miners” in proof-of-work (PoW) blockchains and “validators” in proof-of-stake (PoS) blockchains. Both PoW and PoS are anti-Sybil attack mechanisms, which can always maintain the robustness of the blockchain ledger and prevent the ledger from being manipulated.

full nodefull nodeAccept or decline. The full node will independently store a complete copy of the blockchain ledger and continuously verify new blocks, but the full node does not need to participate in the block production process. Most full nodes are run by block producers, but key economic actors and end users such as exchanges, RPC protocol providers, and stablecoin issuers can also run full nodes. Full nodes have the right to reject invalid blocks, so they can supervise the behavior of block producers, even ifMost block producers are maliciousimage description

Users submit transactions to the blockchain through full nodes, while miners and verification nodes provide blocks to full nodes and get verified

In addition, separating full nodes from block producers can also prevent miners or verification nodes from arbitrarily changing protocol rules and manipulating blocks. This is a power checks and balances mechanism where block producers only have the power to order transactions but cannot dictate the rules of the blockchain. The rules are governed by the full-node community. In theory, anyone can easily join the full-node community. To learn more about the underlying architecture of the blockchain, check out theRead the facts of encryption in one article: the calculation and recording of trust minimization》。

Reduced hardware requirements forLower the threshold for full node operationThis is crucial for blockchains, which has always been the key to maintaining the level of decentralization and the key to achieving trust minimization. However, decentralization also often results in very slow blockchains, as the network is only as fast as the slowest node in it. This problem is also known as "The Impossible Trinity of Blockchain", or"The Scalability Conundrum"image description

The impossible triangle of the blockchain means that the blockchain has to make trade-offs in the three dimensions of scalability, security, and decentralization

There is a bottleneck in the traditional blockchain model, that is, to achieve scalability, the level of decentralization or security must be sacrificed, or a certain sacrifice must be made in both dimensions. For example, a network that achieves scalability and decentralization will have to provide economic incentives for a large number of active participants to ensure security. A network that achieves scalability and security usually has to increase node operating costs, thereby sacrificing the level of decentralization. In addition, networks that achieve decentralization and security usually need to maintain low node requirements and high attack costs, but eventually encounter bottlenecks in scalability.

Unlike blockchains, traditional computing environments don't need to worry about decentralization because their primary purpose is not to maximize trust minimization. As such, traditional computing networks are often centralized and run by for-profit businesses. Low cost and high speed of operation can be achieved because the network is managed by a single entity and its calculation results do not need to be independently verified by end users.

Because of this, the trust model of traditional computing environments is based on brand endorsements and legal contracts. In contrast, the trust model of the blockchain is based on cryptography and game theory, and participants can be independently verified and can directly participate in the network. Because the traditional computing environment is subject to external influence, there are risks of single point of failure and single point of control, and users cannot audit the process, so it is not compatible with the blockchain network.

first level title

Three Key Features of Blockchain Scaling

secondary title

Blockchain Execution Layer

The blockchain execution layer refers to the computing layer that executes transactions and state changes. Transaction execution includes checking the validity of transactions (e.g. verifying signatures and token balances), executing on-chain logic and computing state changes. A state change means that the full node updates a copy of the ledger to reflect new token transfers, smart contract code updates, and data storage.

Blockchain execution layer scaling usually refers to the amount of transactions processed per second (TPS), but at a more macro level, it refers to the amount of calculations processed per second, because the complexity and cost of each transaction are different. The greater the number of transactions processed in the network, the greater the amount of computation that needs to be performed at any point in time.

secondary title

Blockchain storage layer

The blockchain storage layer refers to the storage layer where the full node maintains and stores a copy of the ledger. The storage functions of the blockchain are generally divided into two categories:

  • historical data--Includes all raw transaction and block data. Transaction data includes origin and destination addresses, amounts sent, and signatures for each transaction. Block data includes a list of transactions and metadata from a block, such as the root hash, nonce, and hash of the previous block. Historical data usually does not need to be accessed quickly, it only needs to have at least one honest node to download.

  • Global state -It is a snapshot of all data, which can be read and written by smart contracts, such as account balances and variables of all smart contracts. The global state can be regarded as the database of the blockchain, and the input transactions need to be verified. The state is usually stored in a tree data structure (eg: Merkle tree), which can be easily and quickly accessed and changed by full nodes.

Full nodes need access to historical data to first sync with the blockchain, and global state to validate new blocks and execute new state changes. As the amount of ledger and associated stored data grows, state calculations become slower and more expensive, as nodes spend more time and perform more calculations to read and write to the state. If the node's memory is full, it needs to use disk storage space, which further slows down the calculation, because the node needs to switch back and forth between different storage environments during execution.

As the storage requirements of the blockchain become higher and higher, it usually leads to state bloat. If there is state inflation, the full node often has to upgrade the hardware, otherwise it will be difficult to keep in sync with the current version of the ledger, and it will be difficult for users to synchronize the new full node. A number of factors can cause state bloat in a blockchain, such as the amount of historical data on the ledger, how often new blocks are added, the maximum size of each block, and the amount of data that must be stored on-chain in order to verify transactions and enforce state changes.

secondary title

Blockchain Consensus Layer

The blockchain consensus layer is where nodes in a decentralized network come to an agreement on the current state of the blockchain. The key to consensus is to ensure that the majority of nodes are honest, and finally achieve finality, that is, to process transactions accurately and ensure that transactions will not be withdrawn to the greatest extent. The design principle of the blockchain consensus layer is usually to minimize communication costs to increase the upper limit of the level of decentralization, achieve a stronger Byzantine fault tolerance mechanism, and shorten the final time.

first level title

Execution Layer Expansion

secondary title

Improve the hardware requirements of verification nodes to achieve vertical expansion

Advantage:

Advantage:Disadvantages:

Disadvantages:Vertical scaling of validators limits the degree of decentralization of the network, as the cost of running a validator or full node becomes higher. The cost of nodes usually increases over time, which is also prohibitive for most users. Maintaining the level of decentralization will depend onMoore's Lawsecondary title

Create a multi-chain ecosystem to achieve horizontal expansion

Advantage:

Advantage:Disadvantages:

Disadvantages:secondary title

Shard the execution layer to achieve horizontal expansion

Another similar expansion solution is to divide a blockchain into many pieces and execute them in parallel. Each shard is actually a blockchain, which means that many blockchains can be executed in parallel. Additionally, there will be a main chain whose sole task is to keep all shards in sync.

Advantage:

Advantage:Disadvantages:

Disadvantages:Sharding is limited in flexibility since all nodes must be able to support computation on each shard. In addition, since the computing requirements on the main chain will increase, and the number of nodes assigned to each shard may not be enough, there is also an upper limit on the number of shards that a blockchain can support. In addition, due to the shared security model, all shards may have the same security vulnerabilities, so there will be certain problems in terms of load balancing and implementation risks.

secondary title

Horizontal expansion through modularization

Modular BlockchainModular Blockchain. This scheme divides the blockchain infrastructure into an execution layer, a data availability layer (DA) and a consensus layer. The most mainstream blockchain modularization mechanism isrollupAdvantage:

Advantage:Modular blockchains move transaction execution and state to lower-cost, leaner, higher-throughput computing environments while preserving the security properties of the underlying blockchain. This is because the consensus layer is still based on the original decentralized underlying blockchain (ie L1) when verifying the off-chain calculation of the execution layer. In other words, since full nodes no longer need to execute every transaction, the computing bandwidth of the underlying blockchain can be used more efficiently. Full nodes only need to verify concise proofs and store a small amount of transaction data.

Disadvantages:

Disadvantages:image description

secondary titlesource

Payment and State Channels

Payment and state channels enable blockchain scaling. Users lock the cryptocurrency in a multi-signature smart contract, and then exchange signed messages off-chain, which represent asset ownership transfer or state change information. There is no need to initiate any on-chain transactions during the whole process. Users only need to initiate on-chain transactions when creating and closing channels.

Advantage:

Advantage:Disadvantages:

Disadvantages:in addition,

in addition,hardfirst level title

Expand data storage layer

secondary title

Vertical expansion of blockchain nodes

Advantage:

Advantage:Disadvantages:

Disadvantages:secondary title

Data sharding on the underlying blockchain

Another blockchain data storage expansion solution isdata shardingAdvantage:

Advantage:Disadvantages:

Disadvantages:Data Availability SamplingData Availability Samplingsecondary title

Use a modular blockchain to compress on-chain data storage

Modular blockchains perform computational tasks off-chain, then store transaction data and state changes either on-chain or off-chain. Other nodes or users can use this data to reconstruct the current or historical state of the ledger. rollup will store data off-chain before storing it on-chaincompression

Advantages: Storing compressed data on the chain is the most secure data storage solution for modular blockchains, because all nodes in the network will store data. In addition, doing so reduces data storage costs on the underlying blockchain. After rollup implements data sharding, it can store transaction data on the chain more efficiently and at a lower cost, and better achieve expansion as usage increases.

secondary title

Off-chain data storage for modular blockchains

Modular blockchains can store transaction data off-chain to further reduce on-chain storage requirements. Examples include “validiums”, which issue zero-knowledge proofs on-chain and store data off-chain. At present, the modular blockchain mainly adopts four kinds of off-chain data storage schemes:

  • Centralized storage——Store data on an off-chain centralized platform. This solution has the lowest data storage cost, but it may also lead to a lack of transparency or security of the data. For example, the centralized storage platform may modify the data or go offline directly.

  • Licensed DAC -Store data off-chain, prove the accuracy of the data on-chain, and sign off on a committee composed of a small group of trusted nodes called the "Data Availability Committee" (DAC). The advantages and disadvantages of this solution are similar to the centralized storage solution, but the trust assumption in terms of data availability is better.

  • License-Free DAC -Store data off-chain, use permissionless DACs to provide on-chain proofs, and use cryptoeconomic incentives to incentivize honest behavior. Permissionless DACs cost less than on-chain storage solutions and are more secure than other off-chain storage solutions. Its disadvantage is that the security is still not as good as the on-chain storage solution, and it has not yet achieved large-scale application and sustainable economic model.

  • Volition——secondary title

data pruning

data pruningTechnology can allow blockchain full nodes to delete historical data before a certain block height. Data pruning is usually used simultaneously with PoS checkpoints (checkpoints), and transactions in blocks exceeding a certain checkpoint will be considered final. This means that these transactions cannot be reversed unless there is a major social consensus or a hard fork.

Advantages: Data pruning reduces the amount of data that nodes need to store or refer to when participating in consensus. Since historical data has been validated, it can be pruned to reduce the ledger size. If running a full node is only to verify future blocks instead of tracing historical blocks, then there is no need to store historical data.

Disadvantage: Data pruning needs to rely on third parties such as trading platforms or block explorers to permanently store historical data, so that it can be traced back to the genesis block. However, since this is a 1/n trust model, only one third party is required to honestly store data and help full nodes reconstruct all historical states. Since PoS provides checkpoints andweak subjectivitysecondary title

Statelessness, State Expiration, and State Rent

In addition, there are some solutions that focus on limiting the number of states stored by the full node, especially by setting state expiration,no statusOr state rent to achieve.

  • Status Expired - sectionPeers can prune state that has not been accessed for more than a period of time, and can use some kind of Merkle proof (also known as a "witness") to restore expired state when needed.

  • no status--Full nodes do not need to store state. The full node only needs to verify the new block through the witness. Weak statelessness means that only the block producing node needs to store the global state, while all other nodes can verify the block without storing the state.

  • State Rent -Advantage:

Advantage:Disadvantages:

Disadvantages:first level title

Expansion Consensus Layer

secondary title

Increased Execution and Storage Capabilities

secondary title

Reduce network bandwidth usage

secondary title

Reduce network latency

secondary title

Raise your security budget

first level title

The Future of Scalability and Secure Cross-Chain Development

Blockchain expansion is currently at a critical stage of development, and a series of rich solutions are being developed, tested and released. The current development focus of the blockchain is to achieve expansion on the premise of minimizing trust, and it is bound to become the preferred back-end infrastructure for various industries and application scenarios.

In order to support the ever-growing multi-chain ecosystem, Chainlink is actively developing the Cross-Chain Interoperability Protocol (CCIP) to help users securely transfer data and tokens across various blockchains with custom logic. CCIP focuses on security and creates an anti-fraud network that enables cross-chain smart contracts and secure token bridges while maintaining the original trust assumptions of the blockchain. For more information about CCIP, please read "image description》。

CCIP infrastructure

, get the latest news and announcements from Chainlink.Chainlink official website, and followChainlink Official Twitter, get the latest news and announcements from Chainlink.

Chainlink
basic knowledge
Welcome to Join Odaily Official Community