为广大币圈朋友提供币圈基础入门专业知识!
当前位置首页 > 区块链知识> 正文

区块链10技术架构

发布时间:2023-12-06-00:35:00 来源:网络 区块链知识 区块   架构   技术

区块链10技术架构

近年来,区块链技术在金融、医疗、政府等领域得到了广泛应用,它的核心技术架构也不断发展壮大。下面,小编就介绍一下区块链10大技术架构:

1. 共识算法:共识算法是区块链技术的核心,它是指在区块链网络中节点之间共同确认区块的方法。常见的共识算法有工作量证明(POW)、权益证明(POS)和共识机制(PBFT)等。

2. 元数据:元数据是指区块链网络中的数据,它可以描述区块链网络的状态,如交易数据、账户余额等。

3. 加密算法:加密算法是指在区块链网络中使用的加密算法,它可以保护数据的安全性和隐私性,常见的加密算法有AES、RSA和ECDSA等。

4. 脚本语言:脚本语言是指在区块链网络中使用的脚本语言,它可以实现复杂的智能合约,常见的脚本语言有Solidity、JavaScript和Python等。

5. 虚拟机:虚拟机是指在区块链网络中使用的虚拟机,它可以实现智能合约的执行,常见的虚拟机有EVM、JVM和XVM等。

6. 数据存储:数据存储是指在区块链网络中使用的数据存储,它可以保存区块链网络中的数据,常见的数据存储有LevelDB、BigChainDB和IPFS等。

7. 网络协议:网络协议是指在区块链网络中使用的网络协议,它可以实现区块链网络的通信,常见的网络协议有TCP/IP、HTTP和UDP等。

8. 交易处理:交易处理是指在区块链网络中使用的交易处理,它可以实现区块链网络中的交易,常见的交易处理有比特币(Bitcoin)、以太坊(Ethereum)和比特股(BitShares)等。

9. 钱包:钱包是指在区块链网络中使用的钱包,它可以实现账户余额的管理和转账,常见的钱包有MetaMask、Trust Wallet和Coinbase Wallet等。

10. 安全:安全是指在区块链网络中使用的安全技术,它可以保护数据的安全性和隐私性,常见的安全技术有数据加密、多方认证和可信计算等。

以上就是区块链10大技术架构,它们共同构成了区块链技术的核心技术架构,可以实现区块链网络的安全性和可靠性。


请查看相关英文文档

『一』What is the core technology of blockchain

Introduction to the 7 core technologies of blockchain operation
2018-01-15
1. Blockchain links
As the name suggests, blockchain is a chain composed of blocks. Each block is divided into two parts: block header and block body (including transaction data). The block header includes the hash (PrevHash) value (also called hash value) of the previous block used to implement block linking and the random number (nonce) used to calculate the mining difficulty. The hash value of the previous block is actually the hash value of the header of the previous block, and the rules for calculating random numbers determine which miner can obtain the power to record the block.
2. Consensus Mechanism
Blockchain was born with Bitcoin and is the basic technical architecture of Bitcoin. Blockchain can be understood as a decentralized accounting system based on the Internet. A decentralized digital currency system like Bitcoin requires blockchain to ensure the consistency of accounting by each honest node without a central node. Therefore, the core of blockchain technology is a consensus mechanism that reaches a consensus on the legality of transactions among individuals who have no basis for trust in each other without central control.
There are currently four main categories of blockchain consensus mechanisms: PoW, PoS, DPoS, and distributed consensus algorithms.
3. Unlocking script
Script is an important technology for automatic verification and automatic execution of contracts on the blockchain. Each output of each transaction does not strictly point to an address, but to a script. A script is like a set of rules that govern how the recipient can spend the assets locked on this output.
The legality verification of transactions also relies on scripts. Currently it relies on two types of scripts: locking scripts and unlocking scripts. The locking script is a condition added to the output transaction, implemented through a script language, and is located at the output of the transaction. The unlocking script corresponds to the locking script. Only if the conditions required by the locking script are met, the corresponding assets on this script can be spent, which is located at the input of the transaction. Many flexible conditions can be expressed through scripting languages. The interpretation script is similar to a "virtual machine" in our programming field, which is distributed and runs on every node in the blockchain network.
4. Transaction Rules
Blockchain transactions are the basic units that constitute blocks, and are also the actual effective content that the blockchain is responsible for recording. A blockchain transaction can be a transfer or other transactions such as the deployment of smart contracts.
In the case of Bitcoin, a transaction refers to a payment transfer. The transaction rules are as follows:
1) The input and output of the transaction cannot be empty.
2) For each input of the transaction, if its corresponding UTXO output can be found in the current transaction pool, the transaction will be rejected. Because the current transaction pool is a transaction that has not been recorded in the blockchain, and each input of the transaction should come from a confirmed UTXO. If found in the current trading pool, that is a double-spending transaction.
3) For each input in the transaction, its corresponding output must be UTXO.
4) Each input unlocking script (unlocking
) must work with the corresponding output locking script (locking
) to verify the compliance of the transaction.
5. Transaction priority
The priority of blockchain transactions is determined by the blockchain protocol rules. For Bitcoin, the priority of a transaction being included in a block is determined by the time it takes for the transaction to be broadcast to the network and the size of the transaction. As the time it takes for a transaction to be broadcast to the network increases and the chain age of the transaction increases, the priority of the transaction is increased and will eventually be included in the block. For Ethereum, the priority of a transaction is also related to the transaction fee that the publisher of the transaction is willing to pay. The higher the transaction fee that the publisher is willing to pay, the higher the priority of the transaction being included in the block.
6.Merkle proof
The original application of Merkle proof is the Bitcoin system (Bitcoin), which was described and created by Satoshi
Nakamoto in 2009. The Bitcoin blockchain uses Merkle proofs in order to store transactions in every block. This makes the transaction unable to be tampered with and makes it easy to verify whether the transaction is included in a specific block.
7.RLP
RLP (Recursive
Length
Prefix, recursive length prefix encoding) is a main encoding method for object serialization in Ethereum. Its purpose is to encode any nested A sequence of binary data is encoded.

『二』What is the blockchain technology architecture

The architecture of blockchain technology includes the following aspects:

Decentralized network: area The core of blockchain technology is decentralization. Its network structure is different from the traditional centralized network structure. It realizes data transmission and verification in a point-to-point manner, thereby achieving the purpose of decentralization.

Consensus mechanism: The consensus mechanism is an important means to ensure data security and reliability in the blockchain network. The consensus mechanism can ensure data consistency among all nodes in the blockchain network. Common consensus mechanisms include proof of work, proof of equity, and share authorization.

Smart contract: Smart contract is another important component of blockchain technology. It is a computer program that can automatically execute and verify contracts and can be programmable on the blockchain network. Automated trading. Distributed storage: Distributed storage is another important component of blockchain technology. It realizes distributed storage and backup of data by storing data on various nodes of the network, thereby improving the security and reliability of data. .

Common numerical features include expectation, variance, standard deviation, etc. TheseIndicators can be used to describe the central trend, degree of dispersion and other characteristics of random variables, and can also be used to perform probability calculations and risk analysis.

『三』 The organizational structure that makes up the basic computing function of the blockchain

With the rapid development of the Internet, consumers’ awareness of blockchain technology and digital virtual currency The level is also constantly improving. Today, let’s take a look at the structures of the basic computing methods of blockchain technology. Let’s take a look at the specific situation in the following Java course.

The basic elements that make up computing technology are storage, processing and communication. Mainframes, PCs, mobile devices, and cloud services all exhibit these elements in their own way. There are also dedicated building blocks within each element to allocate resources.

This article focuses on the large framework of the blockchain: it introduces the modules of each computing element in the blockchain and some implementation cases of each module, preferring an overview rather than a detailed explanation.

The building blocks of blockchain

The following are the building blocks of each computing element in decentralized technology:

p>

Storage: token storage, database, file system/blob

Processing: stateful business logic, stateless business Logic, high-performance computing

Communication: a connected network of data, value and state

Storage

As a basic computing element, the storage part contains the following building blocks.

Token storage. Tokens are storage media of value (such as assets, securities, etc.), and the value can be bitcoins, airline miles, or the copyright of digital works. The main function of the token storage system is to issue and transfer tokens (there are many variations) while preventing events such as multiple payments from occurring.

Bitcoin and Zcash are two "pure" systems that only focus on the token itself. Ethereum began to use tokens for various services to realize its ideal of serving as a global computing center. These are examples where tokens are used as internal incentives to operate the entire network architecture.

There are also some tokens that are not internal tools used by the network to promote its own operation, but are used as incentives for higher-level networks, but their tokens are actually stored in in the underlying architecture. One example is an ERC20 token like Golem, which runs on the Ethereum network layer. Another example is Envoke’s IP authorization token, which runs on the IPDB network layer.

Database. Databases specialize in storing structured metadata, such as data tables (relational databases), document stores (such as JSON), key-value stores, time series or graph databases. Databases can quickly retrieve data using queries like SQL.

Traditional distributed (but centralized) databases such as MongoDB and Cassandra typically store hundreds of terabytes or even petabytes of data, with performance reaching millions of writes per second.

Query languages ​​like SQL are very powerful because they separate implementation from specifications, so that Fu Tanqing is not bound to a specific application. . SQL has been used as a standard for decades, so the same database system can be used in many different industries.

In other words, to discuss generality outside of Bitcoin, one does not necessarily have to talk about Turing completeness. You only need one database, which is both concise and easy to expand. There are times when Turing completeness is also useful, which we will discuss in detail in the "Decentralized Processing" section.

BigchainDB is decentralized database software and a specialized document storage system. It is based on MongoDB (or RethinkDB) and inherits the latter's query and expansion logic. But it also has the characteristics of blockchain, such as decentralized control, tamper resistance and token support. IPDB is a regulated public instance of BigchainDB.

In the field of blockchain, it can also be said that IOTA is a time series database.

File system/blob data storage. These systems store large files (movies, music, large data sets) in a hierarchical structure of directories and files.

IPFS and Tahoe-LAFS are decentralized file systems that contain decentralized or centralized blob storage. FileCoin, Storj, Sia and Tieron are decentralized blob storage systems, as is the old and wonderful BitTorrent, although the latter uses a p2p system rather than a token. Ethereum Swarm, Dat, and Swarm-JS basically support the above two methods.

Data market. Such systems connect data owners (such as businesses) with data users (such as AI startups). They sit on top of databases and file systems, but they are still the core architecture because countless data-hungry applications (such as AI) rely on such services. Ocean is an example of a protocol and network upon which a data marketplace can be created. There are also application-specific data marketplaces: EnigmaCatalyst for crypto markets, Datum for private data, and DataBrokerDAO for IoT data streams.

Processing

The basic computational element of processing is discussed next.

"Smart contract" system usually refers to a system that processes data in a decentralized form [3]. It actually has two completely different propertiesSubsets of: stateless (combinable) business logic and stateful (sequential) business logic. There is a huge difference between stateless and stateful in terms of complexity, verifiability, etc. The three decentralized processing modules are high-performance computing (HPC).

Stateless (combined) business logic. This is arbitrary logic and does not retain state internally. In electrical engineering terms, it can be understood as a combinational digital logic circuit. This logic can be expressed as a truth table, a logic diagram, or code with conditional statements (a combination of if/then, and, or, not, etc.). Because they are stateless, it is easy to verify large stateless smart contracts, creating large provably secure systems. N inputs and one output require O(2^N) calculations to verify.

The Inter-Ledger Protocol (ILP) includes crypto-conditions (CC) protocols to clearly label combinational circuits. CC is easy to understand because it became an Internet standard through the IETF, while ILP is widely used in various centralized and decentralized payment networks (such as Ripple used by more than 75 banks). CC has many independently implemented versions, including JavaScript, Python, Java, etc. BigchainDB, Ripple and other systems also use CC to support combined business logic/smart contracts.

『四』What are the blockchain technology frameworks

The current mainstream blockchain architecture contains six levels: network layer, data layer, and consensus. layer, incentive layer, contract layer and application layer. The positions of the data layer and the network layer are reversed in the figure, and their main uses will be detailed in the next section.
Network layer: The essence of the blockchain network is a P2P (Peer-to-peer) network. The resources and services in the network are scattered on all nodes. The transmission of information and the implementation of services are directly between the nodes. It can be carried out in a short period of time without the intervention of intermediate links and servers. Each node both receives and generates information. The nodes synchronize information by maintaining a common blockchain. When a node creates a new block, it notifies other nodes in the form of broadcast, and other nodes receive the information. The block is then verified and a new block is created based on the block, thereby achieving the role of the entire network jointly maintaining an underlying ledger. Therefore, the network layer will involve the design of P2P network, propagation mechanism, verification mechanism, etc. Obviously, these designs can affect the confirmation speed of block information. The network layer can be used as a research direction in the scalable solution of blockchain technology;
Data layer: The underlying data of the blockchain is a block + linked list data structure, which includes data blocks, chain structures, timestamps, hash functions, Merkle trees, asymmetric encryption and other designs. Among them, data blocks and chain structures can be used as improvement directions for data layer research in the scalable solution of blockchain technology.
Consensus layer:It is the basis for highly dispersed nodes to achieve rapid consensus on the validity of block data. The main consensus mechanisms include POW (Proof Of Work workload proof mechanism), POS (Proof of Stake equity proof mechanism), DPOS (Delegated Proof) of Stake (Delegated Proof of Stake Mechanism) and PBFT (Practical Byzantine Fault Tolerance), etc., which have always been the highlight of the scalable solutions for blockchain technology.
Incentive layer: It is what everyone often calls a mining mechanism. It is used to design a certain economic incentive model and encourage nodes to participate in the security verification of the blockchain, including the design of issuance mechanisms and distribution mechanisms, etc. This level of improvement does not seem to be directly related to blockchain scalability.
Contract layer: mainly refers to various script codes, algorithm mechanisms, smart contracts, etc. Strictly speaking, this layer is missing in the first generation of blockchains, so they can only conduct transactions and cannot be used in other fields or perform other logical processing. The emergence of the contract layer makes it possible to use blockchains in other fields. has become a reality. This part of Ethereum includes two parts: EVM (Ethereum Virtual Machine) and smart contracts. Improvements at this level seem to provide potential new directions for blockchain scalability, but there seems to be no direct connection in structure
Application layer: It is the display layer of the blockchain, including various application scenarios and cases. . For example, Ethereum uses truffle and web3-js. The application layer of the blockchain can be the mobile terminal, the web terminal, or it can be integrated into the existing server, and the current business server is regarded as the application layer. Improvements at this level seem to provide potential new directions for blockchain scalability, but there does not seem to be a direct connection in structure.
The Xueshuo Innovation Blockchain Technology Workstation under Lianqiao Education Online is the only approved "Blockchain Technology Professional" pilot of the "Smart Learning Workshop 2020- Xueshuo Innovation Workstation" launched by the School Planning, Construction and Development Center of the Ministry of Education of China. workstation. The professional base is based on providing students with diversified growth paths, promoting the reform of the training model integrating professional degree research, production, and research, and building an applied and compound talent training system.

『五』What is blockchain technology and what are the core components of blockchain technology

From a technical perspective and an architectural perspective, I will tell you about it in popular language. , my understanding of blockchain.

What exactly is blockchain? Block chain, in a word, blockchain is a storage system, and the storage system is more detailed. Block chain is a distributed storage system without an administrator, and each node owns all data.

What do common storage systems look like?

First, let’s take a look at how to ensure high availability?

Ordinary storage systems usually use "redundancy" to solve high availability problems.question. As shown in the figure above, if the data can be copied into several copies and redundantly spread to multiple places, high availability can be ensured. If the data in one place is down, there will still be data in another place. For example, the master-slave cluster of MySQL has this principle, and the RAID of the disk also has this principle.

Two points that need to be emphasized here are: data redundancy often causes consistency problems

1. For example, in the master-slave cluster of MySQL, there will actually be a delay in reading and writing. Sometimes, it actually means that there is inconsistency between reading and writing for a short period of time. This is a side effect of data redundancy.

2. The second point is that data redundancy often reduces writing efficiency, because data synchronization also consumes resources. If you look at single-point writing, if two slave libraries are added, the writing efficiency will actually be affected. Ordinary storage systems use redundancy to ensure high data availability.

Then the second question is, can an ordinary storage system perform multiple writes?

The answer is yes, for example, take this picture as an example:

In fact, MySQL can do a master-slave synchronization of dual masters, a master-slave synchronization of dual masters, and two nodes. , and can be written at the same time. If you want to build a multi-machine room and multi-active data center, in fact, multi-machine room and multi-active data center also requires data synchronization. What should be emphasized here is that multi-point writing often leads to consistency issues of write-write conflicts. Taking MySQl as an example, assuming that the attribute of a table is an auto-increment ID, then the data in the database is now 1234, then one of the nodes When writing, a piece of data is inserted, it may become 5. Then these 5 pieces of data are synchronized to another master node. Before the synchronization is completed, if another writing node also inserts a piece of data, it will also generate A piece of data with an auto-incrementing ID of 5 is obtained. Then, after it is generated, it is synchronized to another node, and then when the synchronized data arrives, it will conflict with the two local 5s, and the synchronization will fail, which will cause write consistency conflicts. This problem will occur if there are multiple writes.

How to ensure consistency when writing multiple points?

Weixin's "Swan Master Class" will give you more technical work

『Lu』 Blockchain Architecture Design

Blockchain as a The implementation of architectural design is quite different from the basic language or platform. Blockchain is the technology behind cryptocurrency. It is one of the popular technologies currently on par with VR and virtual reality. It is not a new technology in itself. It is similar to Ajax. It can be said that it is a technical architecture, so we would like to let Bian follow the architecture design. Let’s talk about the technical implementation of blockchain from the perspective of Sui Que. No matter what programming language you are good at, you can refer to this design to implement a blockchain product. At the same time, we will sort out the related knowledge maps and systems to help everyone study and research systematically.

In terms of architectural design, blockchain can be simply divided into three levels, the protocol layer, the sliding dust extension layer and the application layer. Among them, the protocol layer can be divided into storage layer and network layer, which are independent of each other.Established but inseparable.

『撒』What is the model architecture of blockchain

Blockchain technology is not a single innovative technology, but the result of the integration and innovation of multiple technologies. Its essence is a weak Centralized, self-trusting underlying architecture technology. Compared with traditional Internet technology, its technical principles and model architecture are a major innovation. Here, we will analyze the basic technical model of blockchain.

Model diagram

The blockchain technology model includes data layer, network layer, consensus layer, incentive layer, contract layer and application layer from bottom to top. . Each layer has a core function, and different layers cooperate with each other to jointly build a decentralized value transmission system

The data layer is the lowest level interpretation architecture of the blockchain, which uses public and private keys. The combined asymmetric encryption technology uses hash functions to ensure that information is not tampered with, and also uses chain structure, timestamp technology, Merkle tree and other technologies to process data blocks, so that the old and new blocks can be Mutual links and mutual verification are the basis for the safe and stable operation of the blockchain.

The Xueshuo Innovation Blockchain Technology Workstation under Lianqiao Education Online is the only "blockchain technology" approved by the "Smart Learning Workshop 2020- Xueshuo Innovation Workstation" carried out by the School Planning and Construction Development Center of the Ministry of Education of China. Professional” pilot workstation. The professional base is based on providing students with diversified growth paths, promoting the reform of the training model integrating professional degree research, production, and research, and building an applied and compound talent training system.