Detailed explanation of blockchain layered architecture

Blockchain is a decentralized network system formed by combining a large number of disciplines and technologies such as mathematics, cryptography, and computer science . How to achieve the integration of these technologies comes from the six main layered structures formed during the construction of the blockchain, which are network layer, data layer, consensus layer, incentive layer, contract layer, and application layer. , and a network transport layer that supports data transfer.
insert image description here

In each layered structure of the blockchain, it is also divided into three main layers according to their different functions and characteristics.

Layer 0

This layer is mainly the data transmission layer. It is from this layer that the traditional network and the blockchain decentralized network need to realize the transmission of data. It is also responsible for resolving non-consensus issues between the two.

Layer 1 layer

Layer 1 mainly includes all underlying protocols including the network layer, data layer, consensus layer, and incentive layer.
Network layer: including P2P network, propagation mechanism, data verification mechanism, etc. The network layer can realize the information exchange between the various nodes of the blockchain. It mainly uses P2P technology to realize the distributed processing of the network, and to verify and disseminate the data. In essence, the blockchain can still be called a P2P network.

Data layer : Contains the underlying data blocks, basic data, and algorithms. Through the physical manifestation of blockchain technology, a chain structure is realized. Each block contains block random numbers, timestamps, and public and private key data generated by asymmetric encryption algorithms.
insert image description here

Consensus layer : mainly includes the consensus mechanism and corresponding algorithms of the blockchain network. The distributed nature of the blockchain makes its governance require the consensus of the entire network nodes. The consensus layer is mainly responsible for the effective identification and authentication of the peer-to-peer mode. There are many consensus algorithms currently in use, such as POW, POS, DPOS, etc.

Incentive layer : mainly includes the issuance and distribution mechanism of economic incentives. For blockchain alliance chains or private chains, the incentive layer is unnecessary, because all their nodes can be certified by an enterprise or institution, and all nodes will spontaneously maintain the area under the operation of the enterprise or institution. The stability and security of the blockchain network. But for the public chain, the incentive layer is necessary, because the nodes of the public chain come from all over the world, and the nodes can join and exit freely. For any enterprise, it is unrealistic for these nodes to act spontaneously like alliance chain nodes. The existence of the incentive mechanism will continue to reward nodes that make contributions in the blockchain network, which will also stimulate nodes to provide more resources in terms of computing power and storage space.
insert image description here

Layer 2

Layer 2 includes the contract layer and the application layer, and the content involved is the messaging on and off the chain, smart contract programming and other related aspects.

Contract layer : mainly refers to the smart contract formed by code in the blockchain. The blockchain has a programmable feature, allowing users to write different codes according to their own needs, and its basis comes from the contract layer. At the same time, the existence of smart contracts is also a key point in the blockchain to establish trust without "guarantees". The non-tamperable and transparent features of the blockchain make the terms in the smart contract authentic and credible, and when the terms of the contract are met, the smart contract will be automatically executed.

Application layer : mainly various application scenarios of the blockchain. Responsible for closely integrating blockchain with real life. For example, use the blockchain to trace the source of the product supply chain, decentralized social networking, distributed data storage, blockchain games, etc. With its powerful functional advantages, the blockchain has a very wide range of application scenarios.

It is worth noting that Layer 2 is only responsible for processing data "state generation" and does not perform verification. The final verification still has to go back to Layer 1. Since the security of Layer 2 is not particularly high, many attacks or deceptions faced in the blockchain come from Layer 2. Therefore, how to more effectively prevent data errors in Layer 2 is also a problem that many blockchain developers continue to explore and research.

Guess you like

Origin blog.csdn.net/xfilesystem/article/details/123357143