WO2019222993A1 - Blockchain consensus method based on trust relationship - Google Patents

Blockchain consensus method based on trust relationship Download PDF

Info

Publication number
WO2019222993A1
WO2019222993A1 PCT/CN2018/088355 CN2018088355W WO2019222993A1 WO 2019222993 A1 WO2019222993 A1 WO 2019222993A1 CN 2018088355 W CN2018088355 W CN 2018088355W WO 2019222993 A1 WO2019222993 A1 WO 2019222993A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
nodes
trust
consensus
blockchain
Prior art date
Application number
PCT/CN2018/088355
Other languages
French (fr)
Chinese (zh)
Inventor
李挥
王贤桂
王菡
马军锋
伊鹏
李恪聃
黄建森
李科浇
Original Assignee
北京大学深圳研究生院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京大学深圳研究生院 filed Critical 北京大学深圳研究生院
Priority to PCT/CN2018/088355 priority Critical patent/WO2019222993A1/en
Priority to CN201880004217.6A priority patent/CN109964242B/en
Publication of WO2019222993A1 publication Critical patent/WO2019222993A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the invention belongs to the field of Internet technology improvement, and particularly relates to a blockchain consensus method based on a trust relationship.
  • Blockchain technology is an integrated application model of distributed data storage systems, point-to-point transmission, consensus mechanisms, encryption algorithms and other technologies. It can achieve trust and value transfer on the Internet that cannot be achieved by traditional Internet. It is based on the principle of cryptography rather than credit, which enables any agreed parties to trade directly without the participation of third-party intermediaries. On the other hand, there is almost no single point of failure in the blockchain, and the data on the chain is stored on countless machine nodes around the world, making the data “stable”, “trustworthy” and “immutable”, which re-gives the network The value of the data can be trusted.
  • the blockchain has the characteristics of decentralization. Each node in the network needs to follow a certain protocol to ensure the consistency of the node data. This protocol is called a consensus protocol or consensus algorithm. Consensus algorithm is a key part of blockchain technology, which directly affects the security and efficiency of blockchain products. A secure and efficient consensus protocol is an important research issue in the field of blockchain.
  • the PoW consensus algorithm in the Bitcoin system creatively implements data consistency between nodes in an untrusted decentralized network. It proves that the system is completely decentralized and has the advantages of simplicity and ease of implementation, but it also has resources. Waste and poor performance.
  • the PoS consensus algorithm in the peer-to-peer currency system solves the problem of waste of resources in the PoW consensus through the proof-of-stake mechanism.
  • the DPoS consensus algorithm in the BitShares system proposes an authorized share certification mechanism based on the PoS consensus.
  • the node authorizes its own rights to other nodes.
  • the top 101 nodes with the highest rights become the representative nodes.
  • the representative nodes have exactly the same rights as each other. Bookkeeping rights.
  • the representative mechanism reduces the operating cost of the network and can increase the rate of block generation.
  • the Hyperledger project verified the possibility of PBFT consensus in the alliance chain network with very few malicious nodes, and achieved good results.
  • O (n 2 ) of the PBFT consensus itself limits the network size of the blockchain.
  • the domestic small ant blockchain development team proposed the dBFT protocol, and the bookkeeper was selected through equity, and the bookkeeper reached a consensus through the Byzantine fault tolerance algorithm, thereby reducing the network operation cost and improving the efficiency of the consensus algorithm.
  • Existing consensus algorithms that introduce a representative mechanism are limited by the token mechanism of the blockchain application, and cannot be used in some blockchain systems where tokens do not exist.
  • the dBFT consensus is formed on the basis of the PBFT consensus.
  • the original C / S architecture response mode is modified to a P2P mode suitable for peer-to-peer networks and nodes can dynamically enter and exit.
  • Nodes select bookkeepers based on equity, and then the bookkeepers reach consensus through a Byzantine fault tolerance algorithm.
  • the dBFT consensus sets system nodes into two roles: ordinary nodes and accounting nodes.
  • the accounting node is an important node in the consensus process. It is responsible for collecting and serializing transaction messages in the network and recording them into the distributed ledger maintained by the entire network. Ordinary nodes do not participate in the consensus process, and only use the system to perform operations such as transfers and transactions. Accept the data in the ledger, but be able to see the full consensus process.
  • the initial state consistency of the nodes is achieved through block synchronization and view replacement.
  • the dBFT system works in a time-synchronized state. Each round of consensus generates a block within a certain time interval. The generation of each block may go through different views. In one view, there is a node that acts as the speaker (leader), and the other nodes are members (followers). When the speaker receives block authentication support from more than a certain number of members, a consensus on a new block can be reached.
  • the dBFT consensus is applicable to the alliance chain and the private chain. The digital certificate is used to solve the authentication problem of the identity of the consensus node.
  • the main advantages of the dBFT consensus are: first, the use of professional bookkeepers improves the efficiency of block generation and has good scalability; second, the bookkeeping is completed by multiple people in cooperation, and each block is It is final and will not fork.
  • the Larimer team presented the DPoS white paper and its first application, Bitshares, in March 2014. Due to the emergence of mining pools and ASIC mining machines, the Bitcoin system using the PoW consensus has become more and more centralized, and to some extent it has deviated from the original decentralization of "one CPU, one vote". The Larimer team believes that the decentralization of the PoS consensus can rely on a certain number of representatives instead of all shareholders, and all shareholders vote together to elect a representative. The DPoS consensus expects to return the accounting rights to those who hold digital currencies, and let everyone who holds bitcoin currency BTS vote on candidate representatives in the entire system resources. The 101 people who received the most votes become the representatives. In a random and unpredictable order, they have obtained the right to package and calculate blocks.
  • the DPoS consensus is similar to the US parliamentary system, except that the election process can occur at any time. Therefore, the accounting and verification nodes in the DPoS consensus are reduced from a worldwide scale to a certain number of nodes, which can achieve a second-level delay. However, the entire consensus mechanism still relies on tokens, and in order to achieve a certain level of security, a large number of block confirmations are required. 51% of the 100 blocks after the transaction is written into the block are produced. Can be considered safe on the main chain.
  • the main advantages of this consensus algorithm are: first, the number of participating verification and accounting nodes is greatly reduced, and the waste of computing power is further reduced based on the POS consensus, and the cost of network operation is reduced; second, the consensus traffic Small and has good scalability.
  • the above consensus also has certain flaws. First, the entire consensus mechanism still relies on tokens, and many commercial applications do not require tokens to exist. Secondly, because the above consensus is an improvement on the PoW consensus, it inherits the low block speed characteristics of the PoW consensus, and the system throughput is small.
  • the purpose of the present invention is to provide a blockchain consensus method based on a trust relationship, which aims to solve the above technical problems.
  • the present invention is implemented as such, a blockchain consensus method based on a trust relationship, the blockchain consensus method includes the following steps:
  • Each round of consensus randomly selects a representative node as the master node with accounting rights.
  • the master node selects several transactions from the transaction pool to create blocks;
  • C represents confidence matrix
  • T i represents the trusted node value vector after iteration i
  • T i-1 represents the confidence value vector after the i-1 th iteration.
  • a further technical solution of the present invention is that most of the attacks in the blockchain are related to transactions and blocks.
  • the attacks include creating false transactions, broadcasting invalid transactions, creating false blocks, and broadcasting invalid blocks.
  • a further technical solution of the present invention is that, in step S1, the receipt of valid transactions and valid blocks sent by node i by node i will increase node i's trust in node j, otherwise it will reduce the trust.
  • the trust calculation formula is Among them, g ij represents the number of valid transactions and blocks that node i received from node j, u ij represents the number of invalid transactions and blocks that node i received from node j, and ⁇ represents a penalty coefficient for invalid data.
  • a further technical solution of the present invention is: in step S2, in order to prevent a malicious node from giving a higher trust value to other malicious nodes and a lower trust value to a normal node, thereby affecting the selection of a trust representative node, use Regularize the trust value between nodes to get the final trust matrix C n ⁇ n ; where c ij represents the normalized trust value of node i to node j, t ij represents the trust degree of node i to node j, and n represents The total number of nodes in the network.
  • a further technical solution of the present invention is: the trust value between the nodes in step S3 is affected by interactive transactions and block data, and changes dynamically with time from 0 to 1; the k nodes with high trust value Being selected as a representative node, each representative node has the opportunity to obtain accounting rights.
  • a further technical solution of the present invention is: in step S3, a representative node is selected according to a trust relationship, the representative node participates in a fault-tolerant Byzantine agreement, and a professional accounting node improves the scalability of the consensus protocol.
  • a further technical solution of the present invention is: considering the network transmission delay in the step S4, the interval from the creation of the block to the final joining of the blockchain is Block generation cycle Therefore, at the beginning of the new round of consensus, other nodes have received the previous block data.
  • step S4 the blockchain network is considered to be relatively stable over a period of time, so the period t 0 of the update representative is much larger than the period t of the block creation, which improves the efficiency of consensus.
  • a further technical solution of the present invention is: in the step S4, the representative nodes create a block through a fault-tolerant Byzantine agreement, and then spread it to other nodes in the blockchain network.
  • the nodes are based on the rule that the longest chain is the main chain. Ensure eventual consistency of node data.
  • the beneficial effect of the present invention is that a representative mechanism is adopted to select some nodes as representative nodes participating in consensus according to the trust relationship between the nodes.
  • Representative selection is a cyclical behavior, which means that as long as any node works strictly and honestly, it will have the opportunity to become a representative node, obtain accounting rights and create blocks, so it has better decentralization characteristics than equity-based representative mechanisms.
  • Adopting a representative mechanism to professionalize bookkeeping nodes reduces the cost of consensus and saves energy consumption, while improving the efficiency of node consensus and the scalability of the algorithm.
  • a node with a high trust value is selected as the representative node, which does not rely on the token system and avoids the shortcomings of concentrating accounting rights on a few "rich people".
  • the trust value is formed by the iterative convergence of the trust matrix, which is essentially a probability, which is the basis for the nodes on the entire network to judge a certain node, and has relative stability. The trust relationship between nodes changes slowly, so the update cycle of a representative node is much longer than the block generation cycle.
  • the number of representative nodes is relatively fixed, meaning that the number of nodes in the network does not affect the efficiency of running fault-tolerant Byzantine protocols between the representative nodes.
  • FIG. 1 is a diagram of a consensus algorithm network model according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a blockchain-based consensus method based on a trust relationship according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a consensus algorithm according to an embodiment of the present invention.
  • Blockchain is a distributed architecture. Multiple computers connected to each other form a peer-to-peer network, which operates in accordance with a consensus protocol to jointly process requests submitted by users.
  • each node in a peer-to-peer network, each node is in a peer-to-peer position, serving as both a server and a client, with the same functions.
  • the number of nodes is usually not fixed, and nodes may join or leave the network at any time.
  • the consensus algorithm selects some nodes with high trust values to participate in consensus through the trust relationship between nodes, and these nodes become representative nodes. Therefore, the network model of the algorithm contains four types of nodes: ordinary nodes, Byzantine nodes, ordinary representative nodes, and Byzantine representative nodes. Nodes use encryption technology to ensure communication security. Each message contains a key signature, digest, and verification information. Byzantine nodes cannot brute force encrypted messages, cannot forge signatures, and cannot find messages with the same digest.
  • the process of the consensus protocol is shown in Figure 2. It consists of (1) quantifying the trust relationship between nodes, (2) generating a trust relationship graph and trust matrix, (3) calculating the node trust value and selecting a representative node, and (4) a block generation protocol.
  • Nodes monitor the transactions and block information of neighboring nodes to establish a trust relationship and quantify the trust relationship as a real number between 0 and 1. A larger value indicates a higher degree of trust.
  • a node sends valid transaction and block information to other nodes, it will increase the trust between nodes, otherwise it will reduce the trust. Then, based on the trust relationship between nodes in the entire network, a trust relationship graph is constructed, and a trust relationship matrix is generated.
  • the nodes are compared to web pages, and the trust relationship between nodes is compared to the hyperlink relationship between web pages, and the trust value is iteratively calculated for each node.
  • the k nodes with a high trust value are elected as the representative nodes, and they have the opportunity to obtain accounting rights and create blocks.
  • Byzantine protocols with 1/3 fault tolerance are run between the nodes to ensure the security and availability of the consensus algorithm.
  • Step S1 Quantify the trust relationship between nodes according to the transaction and block data; the trust relationship itself is difficult to define.
  • a node with a high degree of trust in a computer system usually means that it can independently, safely and reliably complete the specified function in a specific environment.
  • Step S2 constructing a trust relationship graph and generating a trust matrix according to the trust relationship between nodes; in the World Wide Web, web pages are linked to each other by hyperlinks, and more valuable web pages are usually linked by many web pages, otherwise they are rarely linked .
  • the search engine sorts related web pages according to the link relationship between web pages and presents them to users in an appropriate order.
  • the invention draws on the webpage link relationship diagram, compares nodes to a webpage, and trust relationships to a hyperlink relationship, and establishes a trust relationship map according to the mutual trust relationship between nodes.
  • a trust relationship graph is a directed graph in which the weight of an edge represents the degree of trust between the two vertices corresponding to the edge.
  • a trust relationship matrix D n ⁇ n between nodes can be obtained, where n represents the total number of nodes in the network, and each element d ij of the matrix represents the degree of trust between node i and node j.
  • formula (2) is used to regularize the trust values between nodes to obtain the final trust matrix.
  • C n ⁇ n Each element represents the direct trust relationship between nodes. The value of the relationship with high trust is close to 1, the value of the relationship with low trust is close to 0, and the value of the relationship with little interaction between nodes is close to 0.5.
  • Step S3 Iteratively calculate the trust value of each node by using the trust relationship of the nodes of the entire network; the nodes can obtain the direct trust relationship between them by directly monitoring the behavior of other nodes, and then iteratively calculate the trust relationship of each node by using the trust relationship of the entire network.
  • the trust value of each node is shown in formula (3). Where C represents the above-mentioned trust matrix, T i represents the node trust value matrix after the i-th iteration, and T i-1 represents the node trust value matrix after the i-1 iteration.
  • Step S4 each round of consensus randomly selects a representative node as the master node with accounting rights.
  • the master node selects several transactions from the transaction pool to create a block; only the representative node participates in the consensus process, ordinary nodes cannot create blocks, but can see To the full consensus process.
  • a round of consensus includes two parts: selecting a master node and creating a block. First, a node is randomly selected as the master node from the representative nodes. Only the representative node elected as the master node has the right to keep accounts and can create blocks. Then the block passes the verification of other representative nodes and is finally added to the blockchain. Assume that the number of nodes participating in the consensus protocol is k, and f is the number of malicious Byzantine nodes that can be tolerated
  • a node When a node starts, it will first synchronize block data through other nodes in the network. Nodes listen to incoming transactions, independently verify the validity of the transactions, store valid transactions in the transaction pool and broadcast to other nodes, and discard invalid transactions. After the node obtains the right to book, it selects several transactions from the transaction pool to form a block, and the hash value of the parent block is recorded in the block header to ensure the orderliness of the block. . When the transaction pool is empty and there are no valid transactions, empty blocks will be generated according to the normal cycle. Considering the delay of network transmission, the interval from the creation of the block to the final addition to the blockchain is Block generation cycle As a result, at the beginning of a round of consensus, other nodes have received the previous block data.
  • the master node that obtained the accounting right sends a Pre-Prepare request to all consensus nodes.
  • the request message includes the height h of the current block, the view v, the master node number p, the block block, and the block signature block p .
  • the node verifies the accuracy of the message. If the Pre-Prepare request is invalid, it is proposed to change the view and reselect the master node.
  • a node receives a valid Pre-Prepare request, it sends a Prepare request to other nodes and enters the Prepare state itself.
  • the prepare request contains the height h of the current block, the view v, the node number i, and the signature block i of the block.
  • the Commit message contains the height h of the current block, the view v, the node number i, and the signature block i of the block.
  • the Pre-Prepare message contains the complete block.
  • the node After receiving the Pre-Prepare message from the master node, the node will save the block content of the consensus locally, and use the hash value to replace the block in the following Prepare and Commit phases. Blocks, reducing communication costs. Through these three stages of negotiation and voting, the consistency of block data between consensus nodes is finally achieved. Only blocks that have reached consensus among the representative nodes can be broadcast to other nodes in the blockchain network.
  • a representative mechanism is adopted, and some nodes are selected as representative nodes participating in the consensus according to the trust relationship between the nodes.
  • Representative selection is a cyclical behavior, which means that as long as any node works strictly and honestly, it will have the opportunity to become a representative node, obtain accounting rights and create blocks, so it has better decentralization characteristics than equity-based representative mechanisms. .
  • Adopting a representative mechanism to professionalize bookkeeping nodes reduces the cost of consensus and saves energy consumption, while improving the efficiency of node consensus and the scalability of the algorithm.
  • the node with a high trust value is selected as the representative node. It does not rely on the token system and avoids the shortcomings of concentrating accounting rights on a few "rich people.” Application prospects.
  • the trust value is formed by the iterative convergence of the trust matrix, which is essentially a probability, which is the basis for the nodes on the entire network to judge a certain node, and has relative stability.
  • the trust relationship between nodes changes slowly, so the update cycle of a representative node is much longer than the block generation cycle.
  • the number of representative nodes is relatively fixed, meaning that the number of nodes in the network does not affect the efficiency of running fault-tolerant Byzantine protocols between the representative nodes.
  • the fault-tolerant Byzantine algorithm is required to have 1/3 fault tolerance.
  • the representative nodes are not completely randomly selected, but are strictly selected based on the trust relationship between the nodes.
  • the trust value is greater than other nodes in the network, so it has a fault tolerance of more than 1/3.
  • the trust mechanism is introduced into the blockchain in the blockchain. Since transactions and blocks are the most important data, the consensus method proposes a type of node suitable for the blockchain network based on the transactions and block data that are exchanged between nodes.
  • a Quantitative Approach to Trust Relationships Each node independently judges the trust value of other nodes, and different nodes may have different trust values for the same node.
  • the trust value between nodes is affected by interactive transactions and block data, and changes dynamically over time in the range of 0 to 1. However, the trust value of any node is not absolutely reliable. It is essentially a probability and the basis for other nodes to judge it.
  • the mutual trust relationship between nodes is used to iteratively converge to obtain the trust value of nodes in the entire network.
  • a node with a high trust value is selected as the representative node and has the opportunity to obtain the right to account.
  • the representative node usually has a higher trust value, which improves the decentralization characteristics and also enhances the security and reliability of the system. This method of selecting representative nodes does not depend on the token system and avoids the shortcomings of bookkeeping rights concentrated on a few "rich people".
  • the communication cost of the fault-tolerant Byzantine protocol cannot be used in large-scale blockchain networks and has poor scalability.
  • the trust-based consensus mechanism algorithm proposed in this article specializes in bookkeeping nodes through the trust mechanism, improves the trustworthiness of bookkeeping nodes, avoids fault-tolerant Byzantine consensus throughout the network, and improves the scalability and efficiency of consensus .

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention is applicable to the field of improvements in Internet technology, and provides a blockchain consensus method based on a trust relationship, the method comprising: S1. quantifying a trust relationship between nodes according to trading and block data; S2. constructing a trust relationship graph and generating a trust matrix according to the trust relationship between the nodes; S3. iteratively calculating a trust value of each node using the trust relationship between the nodes of a whole network; and S4. for each round of consensus, randomly selecting a representative node as a primary node having the bookkeeping rights, and the primary node selecting several trading creation blocks from a trading pit. A representative mechanism is used to professionalize a bookkeeping node, thereby reducing the consensus cost, reducing energy consumption, and improving the efficiency of node consensus and an expansion capability of an algorithm at the same time. A representative node is selected based on a trust relationship, without depending on a token of a blockchain, thereby preventing the bookkeeping rights from being concentrated to a few "rich people".

Description

一种基于信任关系的区块链共识方法Blockchain consensus method based on trust relationship 技术领域Technical field
本发明属于互联网技术改进领域,尤其涉及一种基于信任关系的区块链共识方法。The invention belongs to the field of Internet technology improvement, and particularly relates to a blockchain consensus method based on a trust relationship.
背景技术Background technique
随着全球信息技术领域的科技革命和产业变革,互联网逐渐由“信息互联网”向“价值互联网”发展。在“信息互联网”时代,网络上的信息公开透明,但也因可以随意篡改而变得不可信,需要第三方机构提供信任担保。一旦提供信任的第三方平台倒闭,其所提供的信任便化为泡沫。为了解决互联网发展过程中产生的信任问题,区块链技术应运而生。With the technological revolution and industrial changes in the global information technology field, the Internet has gradually evolved from "information Internet" to "value Internet". In the "Information Internet" era, information on the Internet is open and transparent, but it also becomes unreliable because it can be tampered with at will, and requires a third party to provide a guarantee of trust. Once the third-party platform that provides trust fails, the trust it provides becomes a bubble. In order to solve the trust problem generated during the development of the Internet, blockchain technology came into being.
区块链技术是分布式数据存储系统、点对点传输、共识机制、加密算法等技术的集成应用模式,能够在互联网上实现传统互联网无法实现的信任和价值传递。其基于密码学原理而非信用的特征,使得任何达成一致的双方能够直接交易,不需要第三方中介的参与。另一方面,区块链中几乎不存在单点故障,链上的数据存储在全球无数台机器节点上,使得数据“稳定”、“可信”且“不可篡改”,这重新赋予了网络上的数据一种可以被信任的价值。Blockchain technology is an integrated application model of distributed data storage systems, point-to-point transmission, consensus mechanisms, encryption algorithms and other technologies. It can achieve trust and value transfer on the Internet that cannot be achieved by traditional Internet. It is based on the principle of cryptography rather than credit, which enables any agreed parties to trade directly without the participation of third-party intermediaries. On the other hand, there is almost no single point of failure in the blockchain, and the data on the chain is stored on countless machine nodes around the world, making the data "stable", "trustworthy" and "immutable", which re-gives the network The value of the data can be trusted.
区块链具有去中心化的特点,网络中的每个节点需要遵循某种协议来保证节点数据的一致性,这种协议称为共识协议或者共识算法。共识算法是区块链技术的关键部分,直接影响区块链产品的安全性和效能。安全高效的共识协议是区块链领域的一个重要的研究问题。比特币系统中的PoW 共识算法创造性地在不可信任的去中心网络中实现节点之间数据一致性,通过算力证明实现了系统完全去中心化并且具有简单易于实现的优点,但是它也存在资源浪费和性能差的缺陷。此外,在区块链网络规模小的应用中,少数节点可掌握大于50%算力,会使得PoW共识由去中心化退化为中心化,甚至影响共识的安全性,因此PoW共识通常在节点数量大的应用场景下采用。点点币系统中的PoS共识算法通过权益证明机制解决了PoW共识的资源浪费的缺陷,但是和PoW共识的算力集中在少数节点类似,PoS共识会因为权益集中而退化为中心化共识。比特股系统中的DPoS共识算法在PoS共识的基础上提出授权股份证明机制,节点将自己的权益授权给其它节点,权益最高的前101个节点成为代表节点,代表节点彼此权利完全相同,轮流获得记账权。代表机制使得网络的运行成本降低,能够提高区块产生的速率。The blockchain has the characteristics of decentralization. Each node in the network needs to follow a certain protocol to ensure the consistency of the node data. This protocol is called a consensus protocol or consensus algorithm. Consensus algorithm is a key part of blockchain technology, which directly affects the security and efficiency of blockchain products. A secure and efficient consensus protocol is an important research issue in the field of blockchain. The PoW consensus algorithm in the Bitcoin system creatively implements data consistency between nodes in an untrusted decentralized network. It proves that the system is completely decentralized and has the advantages of simplicity and ease of implementation, but it also has resources. Waste and poor performance. In addition, in small-scale applications of the blockchain network, a small number of nodes can master more than 50% of the computing power, which will degrade the PoW consensus from decentralization to centralization, and even affect the security of the consensus. Adopted in large application scenarios. The PoS consensus algorithm in the peer-to-peer currency system solves the problem of waste of resources in the PoW consensus through the proof-of-stake mechanism. However, similar to the concentration of PoW consensus in a few nodes, the PoS consensus will degenerate into a centralized consensus due to the concentration of equity. The DPoS consensus algorithm in the BitShares system proposes an authorized share certification mechanism based on the PoS consensus. The node authorizes its own rights to other nodes. The top 101 nodes with the highest rights become the representative nodes. The representative nodes have exactly the same rights as each other. Bookkeeping rights. The representative mechanism reduces the operating cost of the network and can increase the rate of block generation.
尽管区块链共识一直在发展,但是性能还是十分有限,很难实现秒级共识。研究和开发人员开始将目光转向传统分布式共识算法。Leslie Lamport在1990年提出的Paxos算法是目前最有效的基于消息传递的一致性算法,也是工程实践中使用最多的共识算法。Paxso能够高效地实现节点之间数据的一致性,但是它不能允许恶意节点破坏共识过程,因此只能在可信的内网中采用。1999年,Castro和Liskov提出容忍恶意节点数量小于网络内所有节点数量的1/3的PBFT共识算法,该机制下系统吞吐量可以达到10万以上。超级账本项目验证了PBFT共识在恶意节点非常少的联盟链网络中的可能性,并取得了很好的效果。然而PBFT共识自身O(n 2)的通信代价 限制了区块链的网络规模,随着节点数量增加,其性能快速下降,所以PBFT共识的可扩展性比较差。国内的小蚁区块链开发团队提出dBFT协议,通过权益选出记账人,再由记账人通过拜占庭容错算法达成共识,从而减少网络运行的成本,提高共识算法的效率。现有的引入代表机制的共识算法都受限于区块链应用的代币机制,无法在某些不存在代币的区块链系统中使用。 Although blockchain consensus has been developing, its performance is still very limited and it is difficult to achieve second-level consensus. Researchers and developers are turning their attention to traditional distributed consensus algorithms. The Paxos algorithm proposed by Leslie Lamport in 1990 is currently the most efficient consensus algorithm based on message passing, and it is also the most commonly used consensus algorithm in engineering practice. Paxso can efficiently achieve data consistency between nodes, but it cannot allow malicious nodes to undermine the consensus process, so it can only be used in trusted intranets. In 1999, Castro and Liskov proposed a PBFT consensus algorithm that tolerates fewer malicious nodes than 1/3 of the total number of nodes in the network. Under this mechanism, the system throughput can reach more than 100,000. The Hyperledger project verified the possibility of PBFT consensus in the alliance chain network with very few malicious nodes, and achieved good results. However, the communication cost of O (n 2 ) of the PBFT consensus itself limits the network size of the blockchain. As the number of nodes increases, its performance decreases rapidly, so the scalability of the PBFT consensus is poor. The domestic small ant blockchain development team proposed the dBFT protocol, and the bookkeeper was selected through equity, and the bookkeeper reached a consensus through the Byzantine fault tolerance algorithm, thereby reducing the network operation cost and improving the efficiency of the consensus algorithm. Existing consensus algorithms that introduce a representative mechanism are limited by the token mechanism of the blockchain application, and cannot be used in some blockchain systems where tokens do not exist.
2015年9月份,在小蚁项目正式成立一年后,Onchain发布小蚁共识算法白皮书,提出了一种改进的拜占庭容错算法——授权拜占庭容错(delegated BFT,dBFT)作为能够适用于区块链系统的共识机制模块。In September 2015, one year after the official establishment of the ant project, Onchain released a white paper on the ant consensus algorithm, which proposed an improved Byzantine fault tolerance algorithm-authorized Byzantine fault tolerance (dBFT) as being applicable to the blockchain System consensus module.
dBFT共识是在PBFT共识的基础上改进后形成的,将原本的C/S架构的响应模式修改为适合对等网络的P2P模式并实现节点可动态进入退出。节点根据权益来选出记账人,然后记账人之间通过拜占庭容错算法来达成共识。dBFT共识设置系统节点为两种角色:普通节点和记账节点。记账节点是共识过程中的重要节点,负责在网络中收集和序列化事务消息并记入全网维持的分布式账本;普通节点不参与共识过程,只使用系统来进行转账、交易等操作并接受账本中的数据,但能够看到完整的共识过程。通过区块同步和视图更换,来达到节点的初始状态一致性。dBFT系统工作于时间同步状态,每一轮共识在一定时间间隔内产生一个区块,每个区块的产生可能经历不同的视图。在一个视图中,都有一个节点充当议长(领导者),其他节点为议员(跟随者),当议长得到超过一定数量的议员的区块认证支持,就可以达成一个新区块的共识。dBFT共识适用于联盟链和 私有链,通过引入数字证书来解决对共识节点身份的认证问题。The dBFT consensus is formed on the basis of the PBFT consensus. The original C / S architecture response mode is modified to a P2P mode suitable for peer-to-peer networks and nodes can dynamically enter and exit. Nodes select bookkeepers based on equity, and then the bookkeepers reach consensus through a Byzantine fault tolerance algorithm. The dBFT consensus sets system nodes into two roles: ordinary nodes and accounting nodes. The accounting node is an important node in the consensus process. It is responsible for collecting and serializing transaction messages in the network and recording them into the distributed ledger maintained by the entire network. Ordinary nodes do not participate in the consensus process, and only use the system to perform operations such as transfers and transactions. Accept the data in the ledger, but be able to see the full consensus process. The initial state consistency of the nodes is achieved through block synchronization and view replacement. The dBFT system works in a time-synchronized state. Each round of consensus generates a block within a certain time interval. The generation of each block may go through different views. In one view, there is a node that acts as the speaker (leader), and the other nodes are members (followers). When the speaker receives block authentication support from more than a certain number of members, a consensus on a new block can be reached. The dBFT consensus is applicable to the alliance chain and the private chain. The digital certificate is used to solve the authentication problem of the identity of the consensus node.
dBFT共识的主要优点在于,第一,采用专业化的记账人,提高区块生成的效率,并且具有良好的的可扩展性;第二,记账由多人协同完成,每一个区块都有最终性,不会分叉。The main advantages of the dBFT consensus are: first, the use of professional bookkeepers improves the efficiency of block generation and has good scalability; second, the bookkeeping is completed by multiple people in cooperation, and each block is It is final and will not fork.
上述共识也存在着一定的缺陷。首先,代表节点的选取依赖权益和代币。其次,当有1/3或以上记账人停止工作后,系统将无法提供服务,当有1/3或以上记账人联合作恶,且其它所有的记账人被恰好分割为两个网络孤岛时,恶意记账人可以使系统出现分叉,但是会留下密码学证据。The above consensus also has certain flaws. First, the selection of representative nodes depends on equity and tokens. Second, when one-third or more of the bookkeepers stop working, the system will not be able to provide services. When one-third or more of the bookkeepers cooperate with each other, and all other bookkeepers are split into two network islands. At times, malicious bookkeepers can fork the system, but leave behind cryptographic evidence.
Larimer团队在2014年3月提出了DPoS白皮书以及其第一个应用——比特股(Bitshares)。由于应用了PoW共识的比特币系统因为矿池和ASIC矿机的出现,算力变得越来越集中化,在某种程度上已经偏离了“一个CPU一票”的去中心化初心,因此Larimer团队认为PoS共识的去中心化可以依赖于一定数量的代表而不是全部股东,所有股东共同投票选举出代表。DPoS共识期望重新把记账权利归还到那些持有数字货币的人手中,让每一个持有比特股货币BTS的人对整个系统资源中的候选代表进行投票,获得最多票数的101个人则成为代表,以随机不可预测的顺序轮流获得了对区块进行打包计算的权利。所有代表将收到等同于一个平均水平的区块所含交易费的10%作为报酬,如果一个平均水平的区块含有100股作为交易费,则一名代表将获得1股作为报酬。可以理解为权利平均分配到101个CPU中,且每个CPU彼此权利完全相等。DPoS共识类似于美国议会制度,只是选举过程随时都能发生,因此DPoS共识中的记账和验证节点就从全 世界范围被缩小到一定数量的节点,可以达到秒级延迟。但整个共识机制还是依赖于代币,且为达到一定安全性,需要的区块确认数较多,事务被写入区块后的100个区块中的51%被生产出来了,该事务就可以被认为安全的在主链上。The Larimer team presented the DPoS white paper and its first application, Bitshares, in March 2014. Due to the emergence of mining pools and ASIC mining machines, the Bitcoin system using the PoW consensus has become more and more centralized, and to some extent it has deviated from the original decentralization of "one CPU, one vote". The Larimer team believes that the decentralization of the PoS consensus can rely on a certain number of representatives instead of all shareholders, and all shareholders vote together to elect a representative. The DPoS consensus expects to return the accounting rights to those who hold digital currencies, and let everyone who holds bitcoin currency BTS vote on candidate representatives in the entire system resources. The 101 people who received the most votes become the representatives. In a random and unpredictable order, they have obtained the right to package and calculate blocks. All representatives will receive 10% of the transaction fee equivalent to an average block as compensation. If an average block contains 100 shares as transaction fee, one representative will receive 1 share as compensation. It can be understood that the rights are evenly distributed among the 101 CPUs, and each CPU has completely equal rights with each other. The DPoS consensus is similar to the US parliamentary system, except that the election process can occur at any time. Therefore, the accounting and verification nodes in the DPoS consensus are reduced from a worldwide scale to a certain number of nodes, which can achieve a second-level delay. However, the entire consensus mechanism still relies on tokens, and in order to achieve a certain level of security, a large number of block confirmations are required. 51% of the 100 blocks after the transaction is written into the block are produced. Can be considered safe on the main chain.
在抵抗攻击上,因为前100名代表所获得的权力是相同的,因此无法通过获得超过1%的选票而将权力集中到一个单一代表上。因为只有100名代表,可以想象成一个攻击者对每名获得记账权的代表依次进行拒绝服务攻击。幸运的是,由于事实上每名代表的标识是其公钥而非IP地址,这种特定攻击的威胁很容易被减轻。这将使确定DDoS攻击目标更为困难。而代表之间的潜在直接连接,将使妨碍他们创建区块变得更为困难。In terms of resistance to attacks, because the top 100 delegates received the same power, it was not possible to focus power on a single representative by obtaining more than 1% of the votes. Because there are only 100 representatives, it can be imagined that an attacker conducts a denial-of-service attack on each representative who has obtained the right of accounting in turn. Fortunately, the threat of this particular attack is easily mitigated due to the fact that the identity of each representative is its public key rather than its IP address. This will make it harder to target DDoS attacks. The potential direct connection between delegates will make it more difficult for them to create blocks.
所以这种共识算法的主要优点在于,第一,大幅缩小了参与验证和记账节点的数量,在POS共识的基础上进一步削减了算力的浪费,降低网络运转的成本;第二,共识流量小,具有良好的可扩展性。Therefore, the main advantages of this consensus algorithm are: first, the number of participating verification and accounting nodes is greatly reduced, and the waste of computing power is further reduced based on the POS consensus, and the cost of network operation is reduced; second, the consensus traffic Small and has good scalability.
上述共识也存在着一定的缺陷。首先,整个共识机制还是依赖于代币,很多商业应用是不需要代币存在的。其次,由于上述共识是对PoW共识的改进,继承了PoW共识的低出块速度特性,系统吞吐量小。The above consensus also has certain flaws. First, the entire consensus mechanism still relies on tokens, and many commercial applications do not require tokens to exist. Secondly, because the above consensus is an improvement on the PoW consensus, it inherits the low block speed characteristics of the PoW consensus, and the system throughput is small.
发明内容Summary of the Invention
本发明的目的在于提供一种基于信任关系的区块链共识方法,旨在解决上述的技术问题。The purpose of the present invention is to provide a blockchain consensus method based on a trust relationship, which aims to solve the above technical problems.
本发明是这样实现的,一种基于信任关系的区块链共识方法,所述区块链共识方法包括以下步骤:The present invention is implemented as such, a blockchain consensus method based on a trust relationship, the blockchain consensus method includes the following steps:
S1、根据交易和区块数据量化节点之间的信任关系;S1. Quantify the trust relationship between nodes based on transaction and block data;
S2、根据节点之间的信任关系构建信任关系图和生成信任矩阵;S2. Construct a trust relationship graph and generate a trust matrix according to the trust relationship between nodes;
S3、利用全网节点的信任关系迭代计算每个节点的信任值,其函数式:T i=C TT i-1S3. Iteratively calculate the trust value of each node by using the trust relationship of the nodes of the entire network, and its function formula is: T i = C T T i-1 ;
S4、每轮共识随机选择一个代表节点作为具有记账权的主节点,主节点从交易池中选择若干交易创建区块;S4. Each round of consensus randomly selects a representative node as the master node with accounting rights. The master node selects several transactions from the transaction pool to create blocks;
其中,C表示信任矩阵,T i表示第i次迭代后的节点信任值向量,T i-1表示第i-1次迭代后的信任值向量。 Wherein, C represents confidence matrix, T i represents the trusted node value vector after iteration i, T i-1 represents the confidence value vector after the i-1 th iteration.
本发明的进一步技术方案是:区块链中攻击行为多数与交易和区块有关,所述攻击行为包括创建虚假交易、广播无效交易、创建虚假区块和广播无效区块。A further technical solution of the present invention is that most of the attacks in the blockchain are related to transactions and blocks. The attacks include creating false transactions, broadcasting invalid transactions, creating false blocks, and broadcasting invalid blocks.
本发明的进一步技术方案是:所述步骤S1中节点i收到节点j发送的有效交易和有效区块会增加节点i对节点j的信任度,反之则会降低信任度。信任度计算公式为
Figure PCTCN2018088355-appb-000001
其中,g ij表示节点i收到节点j发送的有效的交易和区块数,u ij表示节点i收到节点j发送的无效的交易和区块数,β表示无效数据的惩罚系数。
A further technical solution of the present invention is that, in step S1, the receipt of valid transactions and valid blocks sent by node i by node i will increase node i's trust in node j, otherwise it will reduce the trust. The trust calculation formula is
Figure PCTCN2018088355-appb-000001
Among them, g ij represents the number of valid transactions and blocks that node i received from node j, u ij represents the number of invalid transactions and blocks that node i received from node j, and β represents a penalty coefficient for invalid data.
本发明的进一步技术方案是:所述步骤S2中为了防止恶意节点给其它恶意节点较高的信任值,给正常节点较低的信任值,从而影响信任代表节点的选取,因此使用
Figure PCTCN2018088355-appb-000002
正则化处理节点之间的信任值得到最终的 信任矩阵C n×n;其中,c ij表示节点i对节点j的归一化信任值,t ij表示节点i对节点j的信任度,n表示网络的节点总数。
A further technical solution of the present invention is: in step S2, in order to prevent a malicious node from giving a higher trust value to other malicious nodes and a lower trust value to a normal node, thereby affecting the selection of a trust representative node, use
Figure PCTCN2018088355-appb-000002
Regularize the trust value between nodes to get the final trust matrix C n × n ; where c ij represents the normalized trust value of node i to node j, t ij represents the trust degree of node i to node j, and n represents The total number of nodes in the network.
本发明的进一步技术方案是:所述步骤S2中构造的信任关系矩阵具有随机、不可约和非周期性质,因此节点信任值矩阵T的迭代过程T i=C TT i-1能够收敛。 A further technical solution of the present invention is that the trust relationship matrix constructed in the step S2 has random, irreducible and non-periodic properties, so the iterative process T i = C T T i-1 of the node trust value matrix T can converge.
本发明的进一步技术方案是:所述步骤S3中节点之间的信任值受交互的交易和区块数据的影响,在0到1范围内随时间动态变化;所述信任值高的k个节点被选为代表节点,每个代表节点都有获得记账权的机会。A further technical solution of the present invention is: the trust value between the nodes in step S3 is affected by interactive transactions and block data, and changes dynamically with time from 0 to 1; the k nodes with high trust value Being selected as a representative node, each representative node has the opportunity to obtain accounting rights.
本发明的进一步技术方案是:所述步骤S3中根据信任关系选择代表节点,代表节点参与容错拜占庭协议,专业化记账节点,提高共识协议的扩展性。A further technical solution of the present invention is: in step S3, a representative node is selected according to a trust relationship, the representative node participates in a fault-tolerant Byzantine agreement, and a professional accounting node improves the scalability of the consensus protocol.
本发明的进一步技术方案是:所述步骤S4中考虑网络传输延迟性,创建区块到最终加入区块链的间隔为
Figure PCTCN2018088355-appb-000003
区块生成周期
Figure PCTCN2018088355-appb-000004
因此新一轮共识开始时其它节点已经收到前一区块数据。
A further technical solution of the present invention is: considering the network transmission delay in the step S4, the interval from the creation of the block to the final joining of the blockchain is
Figure PCTCN2018088355-appb-000003
Block generation cycle
Figure PCTCN2018088355-appb-000004
Therefore, at the beginning of the new round of consensus, other nodes have received the previous block data.
本发明的进一步技术方案是:所述步骤S4中考虑区块链网络在一段时间内具有相对稳定性,因此更新代表的周期t 0远大于区块创建的周期t,提高共识的效率。 A further technical solution of the present invention is that in step S4, the blockchain network is considered to be relatively stable over a period of time, so the period t 0 of the update representative is much larger than the period t of the block creation, which improves the efficiency of consensus.
本发明的进一步技术方案是:所述步骤S4中代表节点之间通过容错拜占庭协议创建区块,再将其扩散到区块链网络中的其它节点,节点根据最长链为主链的规则,确保节点数据的最终一致性。A further technical solution of the present invention is: in the step S4, the representative nodes create a block through a fault-tolerant Byzantine agreement, and then spread it to other nodes in the blockchain network. The nodes are based on the rule that the longest chain is the main chain. Ensure eventual consistency of node data.
本发明的有益效果是:采用代表机制,根据节点之间的信任关系选择 部分节点作为参与共识的代表节点。代表选取是一个周期行为,这意味着任何一个节点只要严格诚实工作,都将有机会成为代表节点,获得记账权并创建区块,因此比基于权益的代表机制具有更好的去中心化特性。采取代表机制,专业化记账节点,减小了共识代价,节约能耗,同时提高了节点共识的效率和算法的扩展能力。通过监测节点之间交互的交易和区块数据的有效性,选择信任值高的节点为代表节点,不依赖于代币体系,避免记账权集中在少数“有钱人”的缺点。信任值由信任矩阵迭代收敛而成,本质上是一种概率,是全网节点对某个节点判断的依据,具有相对稳定性。节点之间的信任关系变化较慢,因此代表节点的更新周期远大于区块的生成周期。另一方面,代表节点的数量相对固定,意味着网络中节点的数量并不会影响到代表节点之间运行容错拜占庭协议的效率。The beneficial effect of the present invention is that a representative mechanism is adopted to select some nodes as representative nodes participating in consensus according to the trust relationship between the nodes. Representative selection is a cyclical behavior, which means that as long as any node works strictly and honestly, it will have the opportunity to become a representative node, obtain accounting rights and create blocks, so it has better decentralization characteristics than equity-based representative mechanisms. . Adopting a representative mechanism to professionalize bookkeeping nodes reduces the cost of consensus and saves energy consumption, while improving the efficiency of node consensus and the scalability of the algorithm. By monitoring the interactions between the nodes and the validity of the block data, a node with a high trust value is selected as the representative node, which does not rely on the token system and avoids the shortcomings of concentrating accounting rights on a few "rich people". The trust value is formed by the iterative convergence of the trust matrix, which is essentially a probability, which is the basis for the nodes on the entire network to judge a certain node, and has relative stability. The trust relationship between nodes changes slowly, so the update cycle of a representative node is much longer than the block generation cycle. On the other hand, the number of representative nodes is relatively fixed, meaning that the number of nodes in the network does not affect the efficiency of running fault-tolerant Byzantine protocols between the representative nodes.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明实施例提供的共识算法网络模型图。FIG. 1 is a diagram of a consensus algorithm network model according to an embodiment of the present invention.
图2是本发明实施例提供的基于信任关系的区块链共识方法的流程图。FIG. 2 is a flowchart of a blockchain-based consensus method based on a trust relationship according to an embodiment of the present invention.
图3是本发明实施例提供的共识算法示意图。FIG. 3 is a schematic diagram of a consensus algorithm according to an embodiment of the present invention.
具体实施方式Detailed ways
区块链是一种分布式架构,彼此连接的多台计算机构成对等网络,依照共识协议协调运作,共同处理用户提交的请求。如图1所示,对等网络中,每个节点都处于对等的地位,既是服务器也是客户端,具有相同的功能。对于一个对等网络而言,通常节点数量是不固定的,节点可能在任意时刻加入或者退出网络。除此之外,网络中还可能存在一些不可信任的恶 意节点,恶意拜占庭节点可以拒绝响应其它节点的交互信息,甚至虚假回应其它节点的请求。为了减小共识的代价,提高共识的效率,共识算法会通过节点之间的信任关系选择一部分信任值高的节点参与共识,这部分节点成为代表节点。因此在算法的网络模型包含四种节点,分别是普通节点、拜占庭节点、普通代表节点和拜占庭代表节点。节点之间使用加密技术来保证通信安全,每条消息中都包含密钥签名,摘要和验证信息,拜占庭节点无法通过暴力破解加密消息,不能伪造签名和找到具有相同摘要的消息。Blockchain is a distributed architecture. Multiple computers connected to each other form a peer-to-peer network, which operates in accordance with a consensus protocol to jointly process requests submitted by users. As shown in Figure 1, in a peer-to-peer network, each node is in a peer-to-peer position, serving as both a server and a client, with the same functions. For a peer-to-peer network, the number of nodes is usually not fixed, and nodes may join or leave the network at any time. In addition, there may be some untrustworthy malicious nodes in the network. Malicious Byzantine nodes can refuse to respond to the interactive information of other nodes and even falsely respond to other node's requests. In order to reduce the cost of consensus and improve the efficiency of consensus, the consensus algorithm selects some nodes with high trust values to participate in consensus through the trust relationship between nodes, and these nodes become representative nodes. Therefore, the network model of the algorithm contains four types of nodes: ordinary nodes, Byzantine nodes, ordinary representative nodes, and Byzantine representative nodes. Nodes use encryption technology to ensure communication security. Each message contains a key signature, digest, and verification information. Byzantine nodes cannot brute force encrypted messages, cannot forge signatures, and cannot find messages with the same digest.
共识协议的流程,如图2所示。包含(1)量化节点之间的信任关系、(2)生成信任关系图和信任矩阵、(3)计算节点信任值和选择代表节点和(4)区块生成协议四部分。节点通过监测相邻节点的交易和区块信息,建立信任关系,并将信任关系量化为0到1之间的实数,值越大表示信任度越高。当节点发送有效的交易和区块信息给其它节点时,会提高节点之间的信任度,反之则会降低信任度。然后通过全网节点之间的信任关系,构造信任关系图,生成信任关系矩阵。然后借鉴搜索引擎网页排序的思想,将节点类比于网页,节点之间的信任关系类比于网页之间的超链接关系,为每个节点迭代计算信任值。信任值高的k个节点当选为代表节点,有机会获取记账权并创建区块。代表节点之间运行具有1/3容错能力的拜占庭协议,保证共识算法的安全性和可用性。The process of the consensus protocol is shown in Figure 2. It consists of (1) quantifying the trust relationship between nodes, (2) generating a trust relationship graph and trust matrix, (3) calculating the node trust value and selecting a representative node, and (4) a block generation protocol. Nodes monitor the transactions and block information of neighboring nodes to establish a trust relationship and quantify the trust relationship as a real number between 0 and 1. A larger value indicates a higher degree of trust. When a node sends valid transaction and block information to other nodes, it will increase the trust between nodes, otherwise it will reduce the trust. Then, based on the trust relationship between nodes in the entire network, a trust relationship graph is constructed, and a trust relationship matrix is generated. Then, based on the idea of search engine web page ranking, the nodes are compared to web pages, and the trust relationship between nodes is compared to the hyperlink relationship between web pages, and the trust value is iteratively calculated for each node. The k nodes with a high trust value are elected as the representative nodes, and they have the opportunity to obtain accounting rights and create blocks. Byzantine protocols with 1/3 fault tolerance are run between the nodes to ensure the security and availability of the consensus algorithm.
如图2、3所示,本发明提供的基于信任关系的区块链共识方法的流程图,其详述如下:As shown in Figures 2 and 3, the flowchart of the consensus method based on the trust relationship provided by the present invention is detailed as follows:
步骤S1,根据交易和区块数据量化节点之间的信任关系;信任关系本 身很难定义,计算机系统中信任度高的节点通常是指在特定的环境下能够独立、安全且可靠地完成指定功能的节点。由于交易和区块是区块链中最重要的数据,因此共识方法根据节点之间交互的交易和区块数据量化节点之间的信任关系。在区块链网络中,节点每时每刻都在进行交易和区块数据的交互,不断地处理用户提交的交易请求,验证交易的有效性,并向其它节点广播有效的交易。区块链大多数的攻击行为都和交易和区块有关,主要存在创建虚假交易、广播无效交易、创建虚假区块和广播无效区块等恶意行为,因此共识算法根据交易和区块数据实现节点之间信任关系的量化是有效的。节点在运行过程会统计其相邻节点交互的数据信息,假设节点i某段时间从节点j处收到g ij个有效的交易和区块,收到u ij个无效的交易和区块,则节点i对节点j的信任度如公式(1)所示。β表示无效数据的惩罚系数,可调节,通常大于1,表示收到无效数据比收到有效数据对信任值影响更大。由于区块链网络通常很大,存在许多节点之间不进行交互的情况,此时信任关系被量化为0.5。 Step S1: Quantify the trust relationship between nodes according to the transaction and block data; the trust relationship itself is difficult to define. A node with a high degree of trust in a computer system usually means that it can independently, safely and reliably complete the specified function in a specific environment. Node. Since transactions and blocks are the most important data in the blockchain, the consensus method quantifies the trust relationship between nodes based on the transactions and block data that are exchanged between nodes. In a blockchain network, nodes are interacting with transactions and block data at all times, constantly processing transaction requests submitted by users, verifying the validity of transactions, and broadcasting valid transactions to other nodes. Most of the blockchain's attack behaviors are related to transactions and blocks. There are mainly malicious acts such as creating false transactions, broadcasting invalid transactions, creating false blocks, and broadcasting invalid blocks. Therefore, consensus algorithms implement nodes based on transactions and block data. Quantification of trust relationships is effective. During the operation of a node, it will count the data information of the interaction between its neighboring nodes. Assuming that node i receives g ij valid transactions and blocks from node j for a certain period of time, and u ij invalid transactions and blocks, then The trust degree of node i to node j is shown in formula (1). β indicates the penalty coefficient of invalid data, which can be adjusted, usually greater than 1, indicating that receiving invalid data has a greater impact on the trust value than receiving valid data. Because the blockchain network is usually large, there are many cases where no nodes interact with each other. At this time, the trust relationship is quantified to 0.5.
Figure PCTCN2018088355-appb-000005
Figure PCTCN2018088355-appb-000005
按照公式(1)对节点之间信任关系的描述,节点i收到节点j发送的有效交易和有效区块会增加节点i对节点j的信任度,反之则会降低信任度。According to the description of the trust relationship between nodes according to formula (1), the receipt of valid transactions and valid blocks sent by node i by node i will increase node i's trust in node j, otherwise it will reduce the trust.
步骤S2,根据节点之间的信任关系构建信任关系图和生成信任矩阵;在万维网中,网页通过超链接的方式相互链接,比较有价值的网页通常会被许多网页链接,反之则很少被链接。搜索引擎根据网页之间的链接关系,对相关网页排序,以合适的顺序呈现给用户。本发明借鉴了网页链接关系 图,将节点类比于网页,信任关系类比于超链接关系,根据节点的相互信任关系建立信任关系图。Step S2, constructing a trust relationship graph and generating a trust matrix according to the trust relationship between nodes; in the World Wide Web, web pages are linked to each other by hyperlinks, and more valuable web pages are usually linked by many web pages, otherwise they are rarely linked . The search engine sorts related web pages according to the link relationship between web pages and presents them to users in an appropriate order. The invention draws on the webpage link relationship diagram, compares nodes to a webpage, and trust relationships to a hyperlink relationship, and establishes a trust relationship map according to the mutual trust relationship between nodes.
信任关系图是一个有向图,其中边的权重表示该边对应的两个顶点之间的信任度。根据信息关系图可以得出节点之间的信任关系矩阵D n×n,其中n表示网络的节点总数,矩阵的每个元素d ij表示节点i对节点j的信任度。为了防止恶意节点给其它恶意节点较高的信任值,给正常节点较低的信任值,影响信任代表节点的选取,使用公式(2)正则化处理节点之间的信任值,得到最终的信任矩阵C n×n。其中每个元素表示节点之间的直接信任关系,信任度高的关系数值接近1,信任度低的关系数值接近为0,节点之间交互很少的关系数值近为0.5。 A trust relationship graph is a directed graph in which the weight of an edge represents the degree of trust between the two vertices corresponding to the edge. According to the information relationship graph, a trust relationship matrix D n × n between nodes can be obtained, where n represents the total number of nodes in the network, and each element d ij of the matrix represents the degree of trust between node i and node j. In order to prevent malicious nodes from giving higher trust values to other malicious nodes and lower trust values to normal nodes, which affects the selection of trust representative nodes, formula (2) is used to regularize the trust values between nodes to obtain the final trust matrix. C n × n . Each element represents the direct trust relationship between nodes. The value of the relationship with high trust is close to 1, the value of the relationship with low trust is close to 0, and the value of the relationship with little interaction between nodes is close to 0.5.
Figure PCTCN2018088355-appb-000006
Figure PCTCN2018088355-appb-000006
步骤S3,利用全网节点的信任关系迭代计算每个节点的信任值;节点通过直接监测其它节点的行为可以得出它们之间的直接信任关系,进而可以利用全网节点的信任关系迭代计算每个节点的信任值,如公式(3)所示。其中C表示上述的信任矩阵,T i表示第i次迭代后的节点信任值矩阵,T i-1表示第i-1次迭代后的节点信任值矩阵。 Step S3: Iteratively calculate the trust value of each node by using the trust relationship of the nodes of the entire network; the nodes can obtain the direct trust relationship between them by directly monitoring the behavior of other nodes, and then iteratively calculate the trust relationship of each node by using the trust relationship of the entire network. The trust value of each node is shown in formula (3). Where C represents the above-mentioned trust matrix, T i represents the node trust value matrix after the i-th iteration, and T i-1 represents the node trust value matrix after the i-1 iteration.
T i=C TT i-1              式(3) T i = C T T i-1 Formula (3)
可以证明,公式(3)的迭代关系能够最终收敛,收敛结果就是根据全网节点信任关系计算得出的全部节点的信任值。信任值高的k个节点被选为代表节点,有机会获得记账权。It can be proved that the iterative relationship of formula (3) can finally converge, and the convergence result is the trust value of all nodes calculated according to the trust relationship of the entire network. The k nodes with high trust value are selected as the representative nodes and have the opportunity to obtain accounting rights.
步骤S4,每轮共识随机选择一个代表节点作为具有记账权的主节点, 主节点从交易池中选择若干交易创建区块;只有代表节点参与共识过程,普通节点不能创建区块,但是能看到完整的共识过程。一轮共识包含选取主节点和创建区块两部分。首先,随机从代表节点中选择一个节点为主节点。只有当选为主节点的代表节点拥有记账权,能创建区块。然后区块经过其它代表节点的校验通过,最终被添加到区块链中。假设参与共识协议节点数量为k,f为所能容忍恶意拜占庭节点的数量Step S4, each round of consensus randomly selects a representative node as the master node with accounting rights. The master node selects several transactions from the transaction pool to create a block; only the representative node participates in the consensus process, ordinary nodes cannot create blocks, but can see To the full consensus process. A round of consensus includes two parts: selecting a master node and creating a block. First, a node is randomly selected as the master node from the representative nodes. Only the representative node elected as the master node has the right to keep accounts and can create blocks. Then the block passes the verification of other representative nodes and is finally added to the blockchain. Assume that the number of nodes participating in the consensus protocol is k, and f is the number of malicious Byzantine nodes that can be tolerated
节点启动时,首先会通过网络中其它节点做区块数据的同步。节点监听到来的交易,独立验证交易的有效性,将有效的交易存储在交易池中并广播到其它节点,抛弃无效的交易。当节点获得记账权后,从交易池中选择若干交易构成区块,区块头中记录父区块的哈希值以保证区块的有序性。。当交易池为空,不存在有效交易时,会按照正常周期产生空区块。考虑到网络传输的延迟性,从创建区块到最终加入到区块链的间隔为
Figure PCTCN2018088355-appb-000007
区块生成周期
Figure PCTCN2018088355-appb-000008
从而使得一轮共识开始时其它节点已经收到前一区块数据。
When a node starts, it will first synchronize block data through other nodes in the network. Nodes listen to incoming transactions, independently verify the validity of the transactions, store valid transactions in the transaction pool and broadcast to other nodes, and discard invalid transactions. After the node obtains the right to book, it selects several transactions from the transaction pool to form a block, and the hash value of the parent block is recorded in the block header to ensure the orderliness of the block. . When the transaction pool is empty and there are no valid transactions, empty blocks will be generated according to the normal cycle. Considering the delay of network transmission, the interval from the creation of the block to the final addition to the blockchain is
Figure PCTCN2018088355-appb-000007
Block generation cycle
Figure PCTCN2018088355-appb-000008
As a result, at the beginning of a round of consensus, other nodes have received the previous block data.
区块数据在共识节点之间达成一致需要经历三个阶段,分别为Pre-Prepare,Prepare和Commit。It takes three stages to reach consensus on the block data between consensus nodes, namely Pre-Prepare, Prepare and Commit.
(1)Pre-Prepare阶段(1) Pre-Prepare phase
获得记账权的主节点向所有的共识节点发送Pre-Prepare请求,请求消息中包含当前区块的高度h、视图v、主节点的编号p、区块block以及区块的签名block p。节点在收到主节点的Pre-Prepare请求后,验证消息的准确性。如果Pre-Prepare请求不合法,则提议改变视图,重新选择主节点。当节点收到合法的Pre-Prepare请求,会向其它节点发送Prepare请求,自身 进入Prepare状态。Prepare请求中包含当前区块的高度h、视图v、节点的编号i和对区块的签名block iThe master node that obtained the accounting right sends a Pre-Prepare request to all consensus nodes. The request message includes the height h of the current block, the view v, the master node number p, the block block, and the block signature block p . After receiving the Pre-Prepare request from the master node, the node verifies the accuracy of the message. If the Pre-Prepare request is invalid, it is proposed to change the view and reselect the master node. When a node receives a valid Pre-Prepare request, it sends a Prepare request to other nodes and enters the Prepare state itself. The prepare request contains the height h of the current block, the view v, the node number i, and the signature block i of the block.
(2)Prepare阶段(2) Prepare stage
当节点收到2f个Prepare消息时,节点进入Commit状态,并向其它节点发送Commit消息,Commit消息中包含当前区块的高度h、视图v、节点的编号i和对区块的签名block iWhen a node receives 2f Prepare messages, the node enters the Commit state and sends a Commit message to other nodes. The Commit message contains the height h of the current block, the view v, the node number i, and the signature block i of the block.
(3)Commit阶段(3) Commit stage
当节点收到2f个Commit消息时,则认为这一轮共识完成,将区块写入区块链中。When the node receives 2f Commit messages, it considers that this round of consensus is complete and writes the block into the blockchain.
Pre-Prepare消息中包含完整的区块,节点在接收到主节点的Pre-Prepare消息后会在本地保存本次共识的区块内容,而在之后的Prepare阶段和Commit阶段使用哈希值替换区块,减少通信代价。通过这三个阶段的协商投票,最终实现共识节点间区块数据的一致性。只有在代表节点间达成共识的区块,才能被广播到区块链网络的其它节点。The Pre-Prepare message contains the complete block. After receiving the Pre-Prepare message from the master node, the node will save the block content of the consensus locally, and use the hash value to replace the block in the following Prepare and Commit phases. Blocks, reducing communication costs. Through these three stages of negotiation and voting, the consistency of block data between consensus nodes is finally achieved. Only blocks that have reached consensus among the representative nodes can be broadcast to other nodes in the blockchain network.
采用代表机制,根据节点之间的信任关系选择部分节点作为参与共识的代表节点。代表选取是一个周期行为,这意味着任何一个节点只要严格诚实工作,都将有机会成为代表节点,获得记账权并创建区块,因此比基于权益的代表机制具有更好的去中心化特性。A representative mechanism is adopted, and some nodes are selected as representative nodes participating in the consensus according to the trust relationship between the nodes. Representative selection is a cyclical behavior, which means that as long as any node works strictly and honestly, it will have the opportunity to become a representative node, obtain accounting rights and create blocks, so it has better decentralization characteristics than equity-based representative mechanisms. .
采取代表机制,专业化记账节点,减小了共识代价,节约能耗,同时提高了节点共识的效率和算法的扩展能力。通过监测节点之间交互的交易和区块数据的有效性,选择信任值高的节点为代表节点,不依赖于代币体 系,避免记账权集中在少数“有钱人”的缺点,具有广阔的应用前景。Adopting a representative mechanism to professionalize bookkeeping nodes reduces the cost of consensus and saves energy consumption, while improving the efficiency of node consensus and the scalability of the algorithm. By monitoring the interaction between nodes and the validity of the block data, the node with a high trust value is selected as the representative node. It does not rely on the token system and avoids the shortcomings of concentrating accounting rights on a few "rich people." Application prospects.
信任值由信任矩阵迭代收敛而成,本质上是一种概率,是全网节点对某个节点判断的依据,具有相对稳定性。节点之间的信任关系变化较慢,因此代表节点的更新周期远大于区块的生成周期。另一方面,代表节点的数量相对固定,意味着网络中节点的数量并不会影响到代表节点之间运行容错拜占庭协议的效率。The trust value is formed by the iterative convergence of the trust matrix, which is essentially a probability, which is the basis for the nodes on the entire network to judge a certain node, and has relative stability. The trust relationship between nodes changes slowly, so the update cycle of a representative node is much longer than the block generation cycle. On the other hand, the number of representative nodes is relatively fixed, meaning that the number of nodes in the network does not affect the efficiency of running fault-tolerant Byzantine protocols between the representative nodes.
为了严格保证共识的安全性,要求容错拜占庭算法具有1/3的容错能力。然而代表节点不是完全随机选择的,而是基于节点之间的信任关系严格筛选出来的,其信任值大于网络中的其他节点,因此具有高于1/3的容错能力。In order to strictly guarantee the security of the consensus, the fault-tolerant Byzantine algorithm is required to have 1/3 fault tolerance. However, the representative nodes are not completely randomly selected, but are strictly selected based on the trust relationship between the nodes. The trust value is greater than other nodes in the network, so it has a fault tolerance of more than 1/3.
在区块链中区块链中引入信任机制,由于交易和区块是最重要的数据,因此共识方法根据节点之间交互的交易和区块数据提出一种适用于区块链网络的节点之间信任关系的量化方法。每个节点独立判断其它节点的信任值,不同的节点对同一节点可能有不同的信任值。节点之间的信任值受交互的交易和区块数据的影响,在0到1范围内随时间动态变化。但是,任意节点的信任值都不是绝对可靠的,它本质上是一种概率,是其它节点对其判断的依据。The trust mechanism is introduced into the blockchain in the blockchain. Since transactions and blocks are the most important data, the consensus method proposes a type of node suitable for the blockchain network based on the transactions and block data that are exchanged between nodes. A Quantitative Approach to Trust Relationships. Each node independently judges the trust value of other nodes, and different nodes may have different trust values for the same node. The trust value between nodes is affected by interactive transactions and block data, and changes dynamically over time in the range of 0 to 1. However, the trust value of any node is not absolutely reliable. It is essentially a probability and the basis for other nodes to judge it.
利用节点之间相互的信任关系,迭代收敛得到全网节点的信任值。信任值高的节点被选为代表节点,有机会获得记账权。代表节点通常具有较高的信任值,提高了去中心化特性的同时也增强了系统的安全可靠性。这种代表节点选取的方式不依赖于代币体系,避免记账权集中在少数“有钱 人”的缺点。The mutual trust relationship between nodes is used to iteratively converge to obtain the trust value of nodes in the entire network. A node with a high trust value is selected as the representative node and has the opportunity to obtain the right to account. The representative node usually has a higher trust value, which improves the decentralization characteristics and also enhances the security and reliability of the system. This method of selecting representative nodes does not depend on the token system and avoids the shortcomings of bookkeeping rights concentrated on a few "rich people".
容错拜占庭协议的通信代价无法在大规模区块链网络中使用,具有较差的扩展性。本文提出的基于信任的共识机制算法,从另一个角度说,通过信任机制专业化记账节点,提高记账节点的信任度,避免了全网进行容错拜占庭共识,提高了共识的扩展性和效率。The communication cost of the fault-tolerant Byzantine protocol cannot be used in large-scale blockchain networks and has poor scalability. The trust-based consensus mechanism algorithm proposed in this article, from another perspective, specializes in bookkeeping nodes through the trust mechanism, improves the trustworthiness of bookkeeping nodes, avoids fault-tolerant Byzantine consensus throughout the network, and improves the scalability and efficiency of consensus .
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiments of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention shall be included in the protection of the present invention. Within range.

Claims (10)

  1. 一种基于信任关系的区块链共识方法,其特征在于,所述区块链共识方法包括以下步骤:A blockchain consensus method based on a trust relationship is characterized in that the blockchain consensus method includes the following steps:
    S1、根据交易和区块数据量化节点之间的信任关系;S1. Quantify the trust relationship between nodes based on transaction and block data;
    S2、根据节点之间的信任关系构建信任关系图和生成信任矩阵;S2. Construct a trust relationship graph and generate a trust matrix according to the trust relationship between nodes;
    S3、利用全网节点的信任关系迭代计算每个节点的信任值,其函数式:T i=C TT i-1S3. Iteratively calculate the trust value of each node by using the trust relationship of the nodes of the entire network, and its function formula is: T i = C T T i-1 ;
    S4、每轮共识随机选择一个代表节点作为具有记账权的主节点,主节点从交易池中选择若干交易创建区块;S4. Each round of consensus randomly selects a representative node as the master node with accounting rights. The master node selects several transactions from the transaction pool to create blocks;
    其中,C表示信任矩阵,T i表示第i次迭代后的节点信任值向量,T i-1表示第i-1次迭代后的节点信任值向量。 Among them, C represents the trust matrix, T i represents the node trust value vector after the i-th iteration, and T i-1 represents the node trust value vector after the i-1 iteration.
  2. 根据权利要求1所述的区块链共识方法,其特征在于,区块链中攻击行为多数与交易和区块有关,所述攻击行为包括创建虚假交易、广播无效交易、创建虚假区块和广播无效区块。The blockchain consensus method according to claim 1, wherein the majority of attacks in the blockchain are related to transactions and blocks, and the attacks include creating false transactions, broadcasting invalid transactions, creating false blocks, and broadcasting Invalid block.
  3. 根据权利要求2所述的区块链共识方法,其特征在于,所述步骤S1中节点i收到节点j发送的有效交易和有效区块会增加节点i对节点j的信任度,反之则会降低信任度;信任度计算公式为
    Figure PCTCN2018088355-appb-100001
    其中,g ij表示节点i收到节点j发送的有效的交易和区块数,u ij表示节点i收到节点j发送的无效的交易和区块数,β表示无效数据的惩罚系数。
    The blockchain consensus method according to claim 2, wherein in step S1, the receipt of a valid transaction and a valid block sent by node i by node i will increase node i's trust in node j, and vice versa Reduce trust; trust calculation formula is
    Figure PCTCN2018088355-appb-100001
    Among them, g ij represents the number of valid transactions and blocks that node i received from node j, u ij represents the number of invalid transactions and blocks that node i received from node j, and β represents a penalty coefficient for invalid data.
  4. 根据权利要求3所述的区块链共识方法,其特征在于,所述步骤S2中为了防止恶意节点给其它恶意节点较高的信任值,给正常节点较低的 信任值,从而影响信任代表节点的选取,因此使用
    Figure PCTCN2018088355-appb-100002
    正则化处理节点之间的信任值得到最终的信任矩阵C n×n;其中,c ij表示节点i对节点j的归一化信任值,t ij表示节点i对节点j的信任度,n表示网络的节点总数。
    The blockchain consensus method according to claim 3, characterized in that, in step S2, in order to prevent malicious nodes from giving higher trust values to other malicious nodes, lower normal trust values are given to normal nodes, thereby affecting trust representative nodes. Selection, so use
    Figure PCTCN2018088355-appb-100002
    Regularize the trust value between nodes to get the final trust matrix C n × n ; where c ij represents the normalized trust value of node i to node j, t ij represents the trust degree of node i to node j, and n represents The total number of nodes in the network.
  5. 根据权利要求4所述的区块链共识方法,其特征在于,所述步骤S2中构造的信任关系矩阵具有随机、不可约和非周期性质,因此节点信任值矩阵T的迭代过程T i=C TT i-1能够收敛。 The blockchain consensus method according to claim 4, characterized in that the trust relationship matrix constructed in the step S2 has random, irreducible and non-periodic properties, so the iterative process of the node trust value matrix T i = C T T i-1 is able to converge.
  6. 根据权利要求5所述的区块链共识方法,其特征在于,所述步骤S3中节点之间的信任值受交互的交易和区块数据的影响,在0到1范围内随时间动态变化。所述信任值高的k个节点被选为代表节点,每个代表节点都有获得记账权的机会。The blockchain consensus method according to claim 5, characterized in that the trust value between the nodes in step S3 is affected by the interaction of transactions and block data, and changes dynamically with time in the range of 0 to 1. The k nodes with a high trust value are selected as the representative nodes, and each representative node has the opportunity to obtain the right to book.
  7. 根据权利要求6所述的区块链共识方法,其特征在于,所述步骤S3中根据信任关系选择代表节点,代表节点参与容错拜占庭协议,专业化记账节点,提高共识协议的扩展性。The blockchain consensus method according to claim 6, characterized in that in step S3, a representative node is selected according to a trust relationship, the representative node participates in a fault-tolerant Byzantine agreement, specializes a bookkeeping node, and improves the scalability of the consensus protocol.
  8. 根据权利要求7所述的区块链共识方法,其特征在于,所述步骤S4中考虑网络传输延迟性,创建区块到最终加入区块链的间隔为
    Figure PCTCN2018088355-appb-100003
    区块生成周期
    Figure PCTCN2018088355-appb-100004
    因此新一轮共识开始时其它节点已经收到前一区块数据。
    The blockchain consensus method according to claim 7, characterized in that the network transmission delay is considered in the step S4, and the interval from the creation of a block to the final joining of the blockchain is
    Figure PCTCN2018088355-appb-100003
    Block generation cycle
    Figure PCTCN2018088355-appb-100004
    Therefore, at the beginning of the new round of consensus, other nodes have received the previous block data.
  9. 根据权利要求8所述的区块链的共识方法,其特征在于,所述步骤S4中考虑区块链网络在一段时间内具有相对稳定性,因此更新代表的周期t 0远大于区块生成周期t,提高共识的效率。 The consensus method for a blockchain according to claim 8, characterized in that the step S4 considers that the blockchain network has relative stability over a period of time, and therefore the period t 0 of the update representative is much larger than the block generation period t, improve the efficiency of consensus.
  10. 根据权利要求9所述的区块链共识方法,其特征在于,所述步骤S4中代表节点之间通过容错拜占庭协议创建区块,再将其扩散到区块链网 络中的其它节点,节点根据最长链为主链的规则,保证节点数据的最终一致性。The blockchain consensus method according to claim 9, characterized in that, in step S4, the representative nodes create a block through a fault-tolerant Byzantine agreement, and then spread it to other nodes in the blockchain network. The rule of the longest chain as the main chain guarantees the final consistency of the node data.
PCT/CN2018/088355 2018-05-25 2018-05-25 Blockchain consensus method based on trust relationship WO2019222993A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/088355 WO2019222993A1 (en) 2018-05-25 2018-05-25 Blockchain consensus method based on trust relationship
CN201880004217.6A CN109964242B (en) 2018-05-25 2018-05-25 Block chain consensus method based on trust relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/088355 WO2019222993A1 (en) 2018-05-25 2018-05-25 Blockchain consensus method based on trust relationship

Publications (1)

Publication Number Publication Date
WO2019222993A1 true WO2019222993A1 (en) 2019-11-28

Family

ID=67023432

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/088355 WO2019222993A1 (en) 2018-05-25 2018-05-25 Blockchain consensus method based on trust relationship

Country Status (2)

Country Link
CN (1) CN109964242B (en)
WO (1) WO2019222993A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111915294A (en) * 2020-06-03 2020-11-10 东南大学 Safety, privacy protection and tradable distributed machine learning framework based on block chain technology
CN112819433A (en) * 2021-02-01 2021-05-18 北京工业大学 Consensus method for collaborative government affair block chain
CN113051348A (en) * 2021-03-29 2021-06-29 河南向量智能科技研究院有限公司 Group product collaborative design block chain technical data synchronous collaborative method
CN113438327A (en) * 2021-08-30 2021-09-24 湖南三湘银行股份有限公司 Consensus algorithm implementation method based on block chain
CN113923217A (en) * 2021-09-30 2022-01-11 中国人民解放军国防科技大学 Asynchronous Byzantine consensus method and system based on DAG
CN113965566A (en) * 2021-10-11 2022-01-21 浪潮云信息技术股份公司 BFT consensus algorithm implementation method and system based on Header-Sig flow
CN114189325A (en) * 2021-11-19 2022-03-15 新疆大学 Scalable Byzantine fault-tolerant method with high fault tolerance, device and storage medium
CN114374520A (en) * 2022-01-06 2022-04-19 上海交通大学宁波人工智能研究院 Trusted and safe lightweight block chain implementation system and method
CN115021929A (en) * 2022-05-24 2022-09-06 中国电信股份有限公司 Trust management method and device for computing power network, storage medium and electronic equipment
CN115314513A (en) * 2022-06-16 2022-11-08 北京邮电大学 Trust twinning method based on block chain and related equipment
CN115914225A (en) * 2022-10-28 2023-04-04 三峡大学 Optimization method for election stage of Raft consensus algorithm
CN117478300A (en) * 2023-12-27 2024-01-30 湖南天河国云科技有限公司 Cross-chain consensus method and device based on node determination and computer equipment
CN117670329A (en) * 2024-02-01 2024-03-08 中国信息通信研究院 Trust-based transaction method and device in blockchain network

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110189128B (en) * 2019-06-06 2021-05-14 西安安盟智能科技股份有限公司 Distributed consensus method and device for block rapid generation
CN110535836B (en) * 2019-08-12 2021-10-29 安徽师范大学 Trust block chain consensus method based on role classification
CN110519246B (en) * 2019-08-15 2021-09-28 安徽师范大学 Trust degree calculation method based on trust block chain node
CN110505091B (en) * 2019-08-23 2021-09-10 昆明理工大学 Improved consensus method based on PBFT
CN110661867B (en) * 2019-09-25 2021-07-23 东北大学 Block chain consensus method based on improved workload certification and equity certification
CN112671815A (en) * 2019-10-16 2021-04-16 陈小虎 Byzantine fault-tolerant consensus scheme for unlicensed network
CN110853214B (en) * 2019-11-06 2021-05-11 杭州复杂美科技有限公司 Block generation method, device and storage medium
CN110990490B (en) * 2019-12-19 2023-09-01 京东科技信息技术有限公司 Method, device, equipment and medium for checking in blockchain network
CN111414420B (en) * 2020-03-17 2023-05-26 重庆邮电大学 Improved PBFT block chain consensus method
CN111711711A (en) 2020-05-28 2020-09-25 北京邮电大学 Block chain-based top-level domain name management and analysis method and system
CN112416905A (en) * 2020-07-03 2021-02-26 支付宝(杭州)信息技术有限公司 Block chain consensus method, node and system of badger Byzantine fault-tolerant consensus mechanism
CN112104482B (en) * 2020-08-11 2021-06-29 佛山赛思禅科技有限公司 Consensus method based on parallel voting
CN112583798B (en) * 2020-11-30 2022-11-08 北京八分量信息科技有限公司 Method, device and related product for screening common identification nodes from block chain system
CN114650289B (en) * 2020-12-02 2023-04-14 王志诚 Method and device for block chain consensus
CN112651830B (en) * 2020-12-03 2023-01-24 齐鲁工业大学 Block chain consensus method applied to power resource sharing network
CN112804305B (en) * 2020-12-30 2023-03-31 北京八分量信息科技有限公司 Credible networking method and system of internet node and related product
CN112783976B (en) * 2021-01-05 2024-01-26 上海特高信息技术有限公司 Consensus system for flexible packaging of alliance blockchain
CN112860482B (en) * 2021-01-27 2021-11-12 西南林业大学 Block chain consensus performance optimization method
CN112905692B (en) * 2021-02-01 2023-09-29 中国科学院数学与系统科学研究院 Leaf block selection method of block chain system based on directed acyclic graph
CN113672987B (en) * 2021-09-06 2023-09-05 上海万向区块链股份公司 Method and system for selecting packet type billing node under PoW mechanism
CN113922965B (en) * 2021-10-09 2024-04-16 筹远(上海)信息科技有限公司 Block chain data consensus method and device in Bayesian scene
CN113961545B (en) * 2021-10-26 2022-04-26 北京市科学技术情报研究所 Block chain-based information value database construction method
CN114500046B (en) * 2022-01-26 2024-03-15 南京晓庄学院 Consensus method based on field network and IOTA
CN114332872B (en) * 2022-03-14 2022-05-24 四川国路安数据技术有限公司 Contract document fault-tolerant information extraction method based on graph attention network
CN114745140B (en) * 2022-06-13 2022-08-23 天津市城市规划设计研究总院有限公司 Urban planning field block chain consensus verification method and system based on aggregation encryption

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169765A (en) * 2017-05-11 2017-09-15 电子科技大学 A kind of method adjusted into Mobile state of being known together based on business degree of belief to block chain
CN107977340A (en) * 2017-12-27 2018-05-01 邵美 A kind of importance ranking method of block chain trade network node
US20180129953A1 (en) * 2016-11-09 2018-05-10 Cognitive Scale, Inc. System for Performing Compliance Operations Using Cognitive Blockchains

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391320B (en) * 2017-03-10 2020-07-10 创新先进技术有限公司 Consensus method and device
CN107124403A (en) * 2017-04-14 2017-09-01 朱清明 The generation method and computing device of common recognition block in block chain
CN107341660B (en) * 2017-05-27 2021-06-29 唐盛(北京)物联技术有限公司 Block chain bottom layer consensus mechanism and block chain system based on same
CN107819848A (en) * 2017-11-08 2018-03-20 济南浪潮高新科技投资发展有限公司 A kind of internet of things equipment autonomy interconnected method based on block chain
CN108053308A (en) * 2017-12-08 2018-05-18 横琴密达科技有限责任公司 A kind of method and system of monetary device selection and intelligent Trade based on block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180129953A1 (en) * 2016-11-09 2018-05-10 Cognitive Scale, Inc. System for Performing Compliance Operations Using Cognitive Blockchains
CN107169765A (en) * 2017-05-11 2017-09-15 电子科技大学 A kind of method adjusted into Mobile state of being known together based on business degree of belief to block chain
CN107977340A (en) * 2017-12-27 2018-05-01 邵美 A kind of importance ranking method of block chain trade network node

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111915294B (en) * 2020-06-03 2023-11-28 东南大学 Safe, privacy-preserving and tradable distributed machine learning framework operation method based on blockchain technology
CN111915294A (en) * 2020-06-03 2020-11-10 东南大学 Safety, privacy protection and tradable distributed machine learning framework based on block chain technology
CN112819433B (en) * 2021-02-01 2024-03-26 北京工业大学 Consensus method for collaborative government block chain
CN112819433A (en) * 2021-02-01 2021-05-18 北京工业大学 Consensus method for collaborative government affair block chain
CN113051348A (en) * 2021-03-29 2021-06-29 河南向量智能科技研究院有限公司 Group product collaborative design block chain technical data synchronous collaborative method
CN113051348B (en) * 2021-03-29 2023-11-10 河南向量智能科技研究院有限公司 Group product collaborative design block chain technology data synchronization collaborative method
CN113438327B (en) * 2021-08-30 2021-11-30 湖南三湘银行股份有限公司 Consensus algorithm implementation method based on block chain
CN113438327A (en) * 2021-08-30 2021-09-24 湖南三湘银行股份有限公司 Consensus algorithm implementation method based on block chain
CN113923217B (en) * 2021-09-30 2024-04-16 中国人民解放军国防科技大学 Asynchronous Bayesian-busy family consensus method and system based on DAG
CN113923217A (en) * 2021-09-30 2022-01-11 中国人民解放军国防科技大学 Asynchronous Byzantine consensus method and system based on DAG
CN113965566B (en) * 2021-10-11 2024-05-14 浪潮云信息技术股份公司 BFT consensus algorithm implementation method and system based on Header-Sig stream
CN113965566A (en) * 2021-10-11 2022-01-21 浪潮云信息技术股份公司 BFT consensus algorithm implementation method and system based on Header-Sig flow
CN114189325A (en) * 2021-11-19 2022-03-15 新疆大学 Scalable Byzantine fault-tolerant method with high fault tolerance, device and storage medium
CN114189325B (en) * 2021-11-19 2023-09-29 新疆大学 Bayesian-tolerant and scalable method and device with high fault tolerance and storage medium
CN114374520A (en) * 2022-01-06 2022-04-19 上海交通大学宁波人工智能研究院 Trusted and safe lightweight block chain implementation system and method
CN114374520B (en) * 2022-01-06 2023-11-03 上海交通大学宁波人工智能研究院 Trusted and safe lightweight block chain implementation system and method
CN115021929B (en) * 2022-05-24 2024-02-02 中国电信股份有限公司 Trust management method and device for computing power network, storage medium and electronic equipment
CN115021929A (en) * 2022-05-24 2022-09-06 中国电信股份有限公司 Trust management method and device for computing power network, storage medium and electronic equipment
CN115314513B (en) * 2022-06-16 2023-09-19 北京邮电大学 Trust twinning method based on block chain and related equipment
CN115314513A (en) * 2022-06-16 2022-11-08 北京邮电大学 Trust twinning method based on block chain and related equipment
CN115914225A (en) * 2022-10-28 2023-04-04 三峡大学 Optimization method for election stage of Raft consensus algorithm
CN115914225B (en) * 2022-10-28 2024-04-30 三峡大学 Optimization method for Raft consensus algorithm election stage
CN117478300A (en) * 2023-12-27 2024-01-30 湖南天河国云科技有限公司 Cross-chain consensus method and device based on node determination and computer equipment
CN117478300B (en) * 2023-12-27 2024-03-01 湖南天河国云科技有限公司 Cross-chain consensus method and device based on node determination and computer equipment
CN117670329A (en) * 2024-02-01 2024-03-08 中国信息通信研究院 Trust-based transaction method and device in blockchain network
CN117670329B (en) * 2024-02-01 2024-05-14 中国信息通信研究院 Trust-based transaction method and device in blockchain network

Also Published As

Publication number Publication date
CN109964242B (en) 2023-07-14
CN109964242A (en) 2019-07-02

Similar Documents

Publication Publication Date Title
WO2019222993A1 (en) Blockchain consensus method based on trust relationship
Wan et al. Recent advances in consensus protocols for blockchain: a survey
Zhang et al. Analysis of the main consensus protocols of blockchain
US11128522B2 (en) Changing a master node in a blockchain system
US20190251199A1 (en) Transactions Across Blockchain Networks
Alizadeh et al. A survey of secure internet of things in relation to blockchain
Yadav et al. A comparative study on consensus mechanism with security threats and future scopes: Blockchain
Samy et al. Enhancing the performance of the blockchain consensus algorithm using multithreading technology
Hei et al. Practical AgentChain: A compatible cross-chain exchange system
US20200204338A1 (en) Securing public key cryptographic algorithms
CN111951108A (en) Chain structure design method with intelligent contract block chain with complete picture
Wang et al. Improvement research of PBFT consensus algorithm based on credit
Fu et al. Teegraph: A Blockchain consensus algorithm based on TEE and DAG for data sharing in IoT
Lin et al. A Blockchain-enabled decentralized settlement model for IoT data exchange services
Zhang et al. An efficient and robust committee structure for sharding blockchain
Yadav et al. The efficient consensus algorithm for land record management system
He et al. Blockchain-based p2p content delivery with monetary incentivization and fairness guarantee
Zhai et al. BPKI: A secure and scalable blockchain-based public key infrastructure system for web services
Cai et al. Introduction to blockchain basics
Bansal et al. Analysis of consensus algorithms in context of the blockchain based applications
Rahmadika et al. A blockchain approach for the future renewable energy transaction
Sun et al. A reputation based hybrid consensus for e-commerce blockchain
Chen et al. Thinkey: A scalable blockchain architecture
Lv et al. CoT: a secure consensus of trust with delegation mechanism in blockchains
Chiu et al. ChainPKI-Towards Ethash-based Decentralized PKI with Privacy Enhancement

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18920169

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18920169

Country of ref document: EP

Kind code of ref document: A1