CN113489743B - Consensus realization method and device applied to block chain system - Google Patents

Consensus realization method and device applied to block chain system Download PDF

Info

Publication number
CN113489743B
CN113489743B CN202110840784.9A CN202110840784A CN113489743B CN 113489743 B CN113489743 B CN 113489743B CN 202110840784 A CN202110840784 A CN 202110840784A CN 113489743 B CN113489743 B CN 113489743B
Authority
CN
China
Prior art keywords
node
data
account book
ledger
check
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110840784.9A
Other languages
Chinese (zh)
Other versions
CN113489743A (en
Inventor
易朝刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Chenyi Info Technology Co ltd
Original Assignee
Guangdong Chenyi Info Technology Co ltd
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 Guangdong Chenyi Info Technology Co ltd filed Critical Guangdong Chenyi Info Technology Co ltd
Priority to CN202110840784.9A priority Critical patent/CN113489743B/en
Publication of CN113489743A publication Critical patent/CN113489743A/en
Application granted granted Critical
Publication of CN113489743B publication Critical patent/CN113489743B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

The invention discloses a consensus realization method and a consensus realization device applied to a block chain system, wherein the consensus realization method comprises the following steps: the method comprises the steps that a first node receives an encrypted account book issued by a second node and verifies the node identity of the second node, and when the verification is passed, account book data, first verification data used for verifying the continuity of the account book and second verification data used for verifying the accuracy of the account book data are extracted from the encrypted account book; the first node executes a check operation on the account book data according to the first check data and the second check data; when the account book data passes the verification, the first node performs uplink operation on the account book data and the verification information of the account book data, and broadcasts the account book data and the verification information to all other nodes of the block chain system, so that the other nodes perform uplink operation on the received account book data and the verification information. Therefore, the method and the device can realize 100% consensus on the account book, improve the consensus degree, greatly reduce cross-node comparison and verification work and reduce computing power redundancy.

Description

Consensus realization method and device applied to block chain system
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a consensus realization method and device applied to a blockchain system.
Background
The new generation of blockchain operating system is a powerful infrastructure for quickly constructing universal trust and constructing universal consensus, is one of core contents of digital new infrastructure, and is also a powerful foundation for honest social construction, improvement of operator environment quality and global flow of data and services. The method not only can powerfully promote the scale and quality of social and economic activities and the increase of regional GDP, but also can greatly reduce the cost and risk of government-enterprise cooperation, industry promotion and enterprise operation so as to further improve the credible, accurate and efficient quality and level of social administration, government affair service and public opinion management and control.
The consensus algorithm is the most core content of a new generation of block chain operating system, and the new generation of block chain operating system has subversive requirements on the consensus algorithm, so that the risk of computational power attack is eliminated, and computational power redundancy is greatly reduced. Currently, the consensus algorithm applied to the blockchain system is mostly implemented by the traditional byzantine algorithm and the algorithm modified by the continued mechanism thereof: when one node (namely the ledger server) generates a new ledger and issues the new ledger, the other nodes check the new ledger with other nodes except the one node after obtaining the ledger, and when the check reaches a certain consistency degree, the ledger is determined to be valid, and then all the nodes are linked together. However, practice has found that the consensus mechanism based on the byzantine algorithm and the improved algorithm thereof requires multiple nodes to check the ledger, and when the number of nodes increases, the calculation power redundancy index increases greatly, and on the other hand, the consensus degree is not high. Therefore, it is important to provide a new consensus method to reduce computational redundancy and improve the degree of consensus.
Disclosure of Invention
The invention provides a consensus realization method and device applied to a block chain system, which can realize 100% consensus on an account book, improve the degree of consensus, greatly reduce cross-node comparison and verification work and reduce computing power redundancy.
In order to solve the above technical problem, a first aspect of the present invention discloses a consensus realization method applied to a blockchain system, where the blockchain system includes a plurality of nodes, and each node stores identity authentication information uniquely corresponding to the node, and the method includes:
a first node receives an encrypted account book issued by a second node, wherein the encrypted account book is obtained by encrypting a newly generated account book by the second node according to unique corresponding identity authentication information of the second node, the first node and the second node are nodes in the block chain system, and the first node is a node with the accounting authority at this time;
the first node verifies the node identity of the second node, and when the node identity verification of the second node passes, the first node extracts ledger data, first verification data used for verifying the continuity of the ledger and second verification data used for verifying the accuracy of the ledger data from the encrypted ledger;
the first node checks the book data according to the first check data and the second check data;
when the checking of the ledger data is passed, the first node performs uplink operation on the ledger data and checking information thereof on the ledger data, and broadcasts the ledger data and the checking information to all other nodes of the blockchain system, so that each other node performs uplink operation on the ledger data and the checking information.
As an alternative implementation, in the first aspect of the present invention, the method further includes:
when the account book data is not verified, the first node acquires source node information of the account book data and executes uplink operation on the source node information so as to add the source node information of the account book data to a node blacklist;
and the source node information of the account book data is the node information of the second node.
As an optional implementation manner, in the first aspect of the present invention, the checking, by the first node, the ledger data according to the first check data and the second check data includes:
the first node checks whether the first check data is consistent with the latest hash value recorded by the first node; when the first check data is checked to be consistent with the latest hash value, checking whether the ledger data is correct or not according to the second check data; when the account book data is verified to be correct, determining that the account book data passes verification; alternatively, the first and second electrodes may be,
the first node checks whether the ledger data is correct or not according to the second check data; when the account book data is verified to be correct, verifying whether the first verification data is consistent with the latest hash value recorded by the first node; when the first verification data is verified to be consistent with the latest hash value, determining that the account book data is verified to pass;
when the ledger data is verified to be incorrect or the first verification data is inconsistent with the latest hash value, the first node determines that the ledger data is not verified.
As an optional implementation manner, in the first aspect of the present invention, the first check data includes a pre-hash value of the encrypted ledger, and the second check data includes a ledger random number corresponding to the encrypted ledger and a current hash value of the encrypted ledger.
As an optional implementation manner, in the first aspect of the present invention, the checking, by the first node, whether the ledger data is correct according to the second check data includes:
the first node performs hash operation on the latest hash value, the account book random number and the account book data to obtain a check hash value;
the first node judges whether the check hash value is consistent with the current hash value or not, and when the check hash value is consistent with the current hash value, the first node determines that the account book data is checked correctly; and when the check hash value is inconsistent with the current hash value, determining that the account book data is checked incorrectly.
As an optional implementation manner, in the first aspect of the present invention, the verifying, by the first node, the node identity of the second node includes:
the first node performs decryption operation on the encrypted account book through the determined public key to obtain a decryption result, and when the decryption result comprises the unique identity authentication information corresponding to the second node, the node identity verification of the second node is determined to be passed;
wherein before the first node verifies the node identity of the second node, the method further comprises:
the first node judges whether the second node is a node in a node blacklist stored on a chain or not according to the node information of the second node;
and when the judgment result is negative, the first node executes the step of verifying the node identity of the second node.
As an optional implementation manner, in the first aspect of the present invention, the first node is determined by:
and collecting the voting result fed back by each node in all the nodes with the voting authority except the target node by the target node with the accounting authority at the last time, and selecting the node with the highest vote quantity from the rest nodes except the target node and the second node according to all the collected voting results as the first node with the accounting authority aiming at the ledger newly generated by the second node.
The second aspect of the present invention discloses a consensus realization apparatus applied to a blockchain system, where the blockchain system includes a plurality of nodes, each node stores identity authentication information uniquely corresponding to the node, the apparatus is applied to a first node included in the blockchain system, and the first node is a node having a current accounting authority, and the apparatus includes:
the receiving module is used for receiving an encrypted account book issued by a second node, wherein the encrypted account book is obtained by encrypting a newly generated account book by the second node according to unique corresponding identity authentication information of the second node, and the second node is a node in the block chain system;
the identity authentication module is used for authenticating the node identity of the second node;
the information extraction module is used for extracting the ledger data, first check data used for checking the continuity of the ledger and second check data used for checking the accuracy of the ledger data from the encrypted ledger when the node identity verification of the second node is passed by the identity verification module;
the checking module is used for checking the ledger data according to the first checking data and the second checking data;
the uplink module is used for executing uplink operation on the account data and the checking information of the account data when the checking module passes the checking on the account data;
a broadcasting module, configured to broadcast the ledger data and the check information to all other nodes of the block chain system when the check module passes checking the ledger data, or after the uplink module performs an uplink operation on the ledger data and the check information thereof on the ledger data, so that each other node performs an uplink operation on the ledger data and the check information.
As an alternative embodiment, in the second aspect of the present invention, the apparatus further comprises:
the information acquisition module is used for acquiring source node information of the account book data when the verification module fails to verify the account book data, wherein the source node information of the account book data is node information of the second node;
the uplink module is further configured to perform uplink operation on the source node information, so as to add the source node information of the ledger data to a node blacklist.
As an optional implementation manner, in the second aspect of the present invention, a specific manner of the checking module checking the ledger data according to the first checking data and the second checking data includes:
checking whether the first check data is consistent with the latest hash value recorded by the first node; when the first check data is checked to be consistent with the latest hash value, checking whether the ledger data is correct or not according to the second check data; when the account book data is verified to be correct, determining that the account book data passes verification; alternatively, the first and second electrodes may be,
checking whether the ledger data are correct or not according to the second check data; when the account book data is verified to be correct, verifying whether the first verification data is consistent with the latest hash value recorded by the first node; when the first verification data is verified to be consistent with the latest hash value, determining that the account book data is verified to pass;
and when the ledger data is verified to be incorrect or the first verification data is inconsistent with the latest hash value, determining that the ledger data is not verified.
As an optional implementation manner, in the second aspect of the present invention, the first check data includes a hash value of the encrypted ledger, and the second check data includes a random number of the ledger corresponding to the encrypted ledger and a current hash value of the encrypted ledger.
As an optional implementation manner, in the second aspect of the present invention, a specific manner of the checking module checking whether the ledger data is correct according to the second checking data includes:
performing hash operation on the latest hash value, the random number of the account book and the data of the account book to obtain a check hash value;
judging whether the check hash value is consistent with the current hash value or not, and determining that the account book data is checked correctly when the check hash value is consistent with the current hash value; and when the check hash value is inconsistent with the current hash value, determining that the account book data is checked incorrectly.
As an optional implementation manner, in the second aspect of the present invention, a specific manner of the authentication module verifying the node identity of the second node includes:
performing decryption operation on the encrypted account book through the determined public key to obtain a decryption result, and determining that node identity verification of the second node is passed when the decryption result comprises identity authentication information uniquely corresponding to the second node;
and, the apparatus further comprises:
a judging module, configured to judge, before the identity authentication module authenticates the node identity of the second node, whether the second node is a node in a node blacklist stored in a chain according to node information of the second node; and when the judgment result is negative, triggering the identity authentication module to execute the operation of authenticating the node identity of the second node.
As an optional implementation manner, in the second aspect of the present invention, the first node is determined by:
and collecting the voting result fed back by each node in all the nodes with the voting authority except the target node by the target node with the accounting authority at the last time, and selecting the node with the highest vote quantity from the rest nodes except the target node and the second node according to all the collected voting results as the first node with the accounting authority aiming at the ledger newly generated by the second node.
The third aspect of the present invention discloses another consensus realization apparatus applied to a blockchain system, where the blockchain system includes a plurality of nodes, each node stores identity authentication information uniquely corresponding to the node, the apparatus is applied to a first node included in the blockchain system, and the first node is a node having an accounting right this time, and the apparatus includes:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute part or all of the steps of the consensus implementation method applied to the blockchain system disclosed by the first aspect of the invention.
In a fourth aspect of the present invention, a computer storage medium is disclosed, which stores computer instructions for executing part or all of the steps of the consensus method applied to a blockchain system disclosed in the first aspect of the present invention when the computer instructions are called.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, a first node receives an encrypted ledger book issued by a second node and verifies the node identity of the second node, and when the verification is passed, ledger book data, first verification data for verifying the continuity of the ledger book and second verification data for verifying the accuracy of the ledger book data are extracted from the encrypted ledger book; the first node executes a check operation on the account book data according to the first check data and the second check data; when the checking of the account book data passes, the first node performs uplink operation on the account book data and the checking information of the account book data, and broadcasts the account book data and the checking information to all other nodes of the block chain system, so that the other nodes perform uplink operation on the received account book data and the checking information. Therefore, the method and the device can realize 100% consensus on the account book, improve the degree of consensus, and can link the check information of the nodes, thereby greatly reducing the cross-node comparison and check work and reducing the calculation redundancy.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for implementing consensus in a blockchain system according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating another embodiment of a consensus method applied to a blockchain system;
FIG. 3 is a schematic structural diagram of a consensus realization apparatus applied to a blockchain system according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another consensus achieving apparatus applied to a blockchain system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of another consensus realization apparatus applied to a blockchain system according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, article, or article that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or article.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
The invention discloses a consensus realization method and device applied to a block chain system, which can realize 100% consensus on an account book, improve the degree of consensus, and can link check information of nodes, thereby greatly reducing cross-node comparison and check work and reducing computing power redundancy. In addition, when the node receiving the account book finds that the account book is wrong, the node directly publishes the source node information of the account book to a corresponding chain (such as a main chain) so as to reduce the risk of power attack and improve the safety and accuracy of the account book data in the block chain system. The following are detailed below.
In order to better understand the consensus method and apparatus applied to the blockchain system described in the present invention, the key contents in the blockchain system are first described. The blockchain system may include a plurality of ledger nodes (which may also be understood as ledger servers), and in addition, a main chain server, an intelligent contract server, a cascading ledger server, and the like, where each ledger node may obtain, from a CA module of the blockchain system, identity authentication information (such as a digital identity) uniquely corresponding to the node. The consensus realization method applied to the block chain system described in the invention is specifically triggered when the previous ledger node synchronizes new ledger data to the next ledger node, that is: the consensus identification process executed by the next-level ledger node when receiving a new ledger is described below in detail with specific embodiments. Note that, in the following embodiments, all nodes are ledger nodes.
Example one
Referring to fig. 1, fig. 1 is a flowchart illustrating a consensus method applied to a blockchain system according to an embodiment of the present invention. The method described in fig. 1 may be applied to a blockchain system, where the blockchain system includes a plurality of nodes, and each node stores identity authentication information uniquely corresponding to the node. As shown in fig. 1, the consensus implementation method applied to the blockchain system may include the following steps:
101. and the first node receives the encrypted ledger issued by the second node.
The encrypted account book is obtained by encrypting a newly generated account book by the second node according to the unique corresponding identity authentication information, and the first node and the second node are nodes in the block chain system and the first node is a node having the accounting authority at this time. Specifically, when a new account book is generated at the second node, the block chain system selects a node having the accounting authority at this time from the remaining nodes as the first node, or the block chain system can also select a node having the accounting authority at the next time when the last generated account book is linked up, and the node is used as the first node, preferably the latter node.
The encrypting of the newly generated account book by the second node specifically comprises: and encrypting the newly generated account book by using a private key corresponding to the identity authentication information uniquely corresponding to the second node.
In the embodiment of the present invention, the first node is one of the ledger nodes (also called ledger servers) in the blockchain system, and the first and second nodes of the first node and the second node are only used for distinguishing two different nodes, and are not used for representing the sequence between the nodes.
102. And the first node verifies the node identity of the second node, and when the node identity verification of the second node passes, the ledger data, the first verification data for verifying the continuity of the ledger and the second verification data for verifying the accuracy of the ledger data are extracted from the encrypted ledger.
103. And the first node checks the account book data according to the first check data and the second check data.
104. When the account book data passes the verification, the first node performs uplink operation on the account book data and the verification information of the account book data, and broadcasts the account book data and the verification information to all other nodes of the block chain system, so that each other node performs uplink operation on the account book data and the verification information.
Therefore, the implementation of the method described in the embodiment of the invention can not only realize 100% consensus on the account book and improve the degree of consensus, but also link the check information of the node itself, thereby greatly reducing the cross-node comparison and check work and reducing the computational redundancy.
In an optional embodiment, the checking, by the first node, the account data according to the first check data and the second check data may include:
the first node checks whether the first check data is consistent with the latest hash value recorded by the first node; when the first check data is checked to be consistent with the latest hash value, checking whether the ledger data is correct or not according to the second check data; when the check-out book data is correct, determining that the check-out book data passes the check; alternatively, the first and second electrodes may be,
the first node checks whether the ledger data is correct or not according to the second check data; when the check-out book data is correct, checking whether the first check data is consistent with the latest hash value recorded by the first node; when the first check data is checked to be consistent with the latest hash value, the checking of the account book data is determined to be passed;
and when the check-out book data is incorrect or the first check data is inconsistent with the latest hash value, the first node determines that the check-out book data cannot be checked.
Optionally, the first check data includes a pre-hash value of the encrypted ledger, and the second check data includes a random number of the ledger corresponding to the encrypted ledger and a current hash value of the encrypted ledger.
Further optionally, the checking, by the first node, whether the ledger data is correct according to the second check data may include:
the first node performs hash operation on the latest hash value, the random number of the account book and the data of the account book to obtain a check hash value;
the first node judges whether the check hash value is consistent with the current hash value or not, and when the check hash value is consistent with the current hash value, the account book data is determined to be correctly checked; when the check hash value is inconsistent with the current hash value, determining that the account book data is checked incorrectly
As can be seen, this optional embodiment provides 2 implementation manners for checking the account data by using the first check data and the second check data, and a preferred implementation manner of the 2 implementation manners is a first implementation manner, that is: whether the latest hash value recorded by the first check data and the first node is consistent or not is checked firstly, subsequent operation is executed when the first check data and the latest hash value recorded by the first node are consistent or not, the accuracy of the ledger data does not need to be checked through the second check data when the first check data and the latest hash value recorded by the first node are inconsistent, the process is complex because the second check data is used for checking the accuracy of the ledger data and hash operation and data consistency check need to be involved, unnecessary ledger data accuracy check operation of the first node is reduced under the condition that whether the latest hash value recorded by the first check data and the latest hash value recorded by the first node are consistent or not and the inconsistency is checked out, and therefore the waste of node processing resources of the first node is reduced. In addition, when checking account book data, not only need check account book data accuracy still need check account book continuity, provide the realization mode that account book cochain 100% was recognized altogether, improve the degree of recognizing altogether, and the process of recognizing altogether is simple, can also improve the efficiency of recognizing altogether, is favorable to improving account book cochain efficiency when realizing account book cochain 100% is recognized altogether.
Example two
Referring to fig. 2, fig. 2 is a flowchart illustrating another consensus method applied to a blockchain system according to an embodiment of the present invention. The method described in fig. 2 may be applied to a blockchain system, where the blockchain system includes a plurality of nodes, and each node stores identity authentication information uniquely corresponding to the node. As shown in fig. 2, the method for implementing consensus applied to the blockchain system may include the following steps:
201. and the first node receives the encrypted ledger issued by the second node.
The encrypted account book is obtained by encrypting a newly generated account book by the second node according to the unique corresponding identity authentication information, and the first node and the second node are nodes in the block chain system and the first node is a node having the accounting authority at this time.
In the embodiment of the present invention, after the step 201 is executed, the step 202 may be directly triggered to be executed. In other alternative embodiments, after step 201 is completed, step 203 may also be triggered to be executed directly.
202. The first node judges whether the second node is a node in a node blacklist stored in the chain according to the node information of the second node, and when the judgment result in the step 202 is yes, the process can be ended; when the determination result of step 202 is no, step 203 may be triggered to be executed.
203. And the first node verifies the node identity of the second node, and when the node identity verification of the second node passes, the ledger data, the first verification data for verifying the continuity of the ledger and the second verification data for verifying the accuracy of the ledger data are extracted from the encrypted ledger.
As an optional implementation, the verifying, by the first node, the node identity of the second node may include:
and the first node performs decryption operation on the encrypted account book through the determined public key to obtain a decryption result, and when the decryption result comprises the unique corresponding identity authentication information of the second node, the node identity verification of the second node is determined to be passed.
204. The first node checks the account data according to the first check data and the second check data, and when the check of the account data is passed, the step 205 is triggered to be executed; when the account book data is not verified, execution is triggered to step 206.
205. The first node performs uplink operation on the account book data and the check information of the account book data, and broadcasts the account book data and the check information to all other nodes of the block chain system, so that each other node performs uplink operation on the account book data and the check information.
206. The first node acquires source node information of the ledger data, and performs uplink operation on the source node information to add the source node information of the ledger data to the node blacklist.
The source node information of the ledger data is the node information of the second node, and the source node information of the ledger data can be specifically added to a node blacklist on the main chain.
Therefore, the method described by the embodiment of the invention can realize 100% common identification of the account book uplink, improve the common identification degree, and can also uplink the verification information of the node, thereby greatly reducing the cross-node comparison and verification work and reducing the calculation redundancy. In addition, when the node receiving the account book finds that the account book is wrong, the node directly publishes the source node information of the account book to a corresponding chain (such as a main chain) so as to reduce the risk of power attack and improve the safety and accuracy of the account book data in the block chain system.
In an optional embodiment, the first node is determined by:
and collecting the voting result fed back by each node in all the nodes with the voting authority except the target node by the target node with the accounting authority at the last time, and selecting the node with the highest vote quantity from the rest nodes except the target node and the second node according to all the collected voting results to serve as the first node with the accounting authority aiming at the ledger newly generated by the second node.
It should be noted that the above-mentioned determining process of the first node may also be implemented by the proxy node designated by the target node having the accounting right last time, in this case, all nodes having the voting right are all nodes having the voting right except the proxy node or the proxy node and the target node, and the node having the highest number of votes is specifically selected from the remaining nodes except the second node, the proxy node and the target node.
Further, all nodes having voting authority may be understood as nodes not included in the node blacklist.
It can be seen that this optional embodiment can also not need all nodes to contend for the accounting authority in a manner of calculating appointed characters, only need by the node with the accounting authority last time or the voting result of the remaining nodes counted by the appointed proxy node, so that the fairness of determining the node (also called the first node) with the accounting authority this time is improved, a large amount of computing resources are not consumed, the efficiency of determining the node with the accounting authority is favorably improved, and further, the efficiency of packing the accounting book data into blocks and adding the blocks to the block chain is favorably improved.
EXAMPLE III
Referring to fig. 3, fig. 3 is a schematic structural diagram of a consensus realization apparatus applied to a blockchain system according to an embodiment of the present invention. The apparatus described in fig. 3 may be applied to a first node included in the blockchain system, where the first node is a node having the current accounting authority, and the blockchain system further includes a plurality of other nodes. As shown in fig. 3, the apparatus may include:
a receiving module 301, configured to receive an encrypted account book issued by a second node, where the encrypted account book is obtained by encrypting a newly generated account book by the second node according to unique corresponding identity authentication information of the second node, and the second node is a node in a block chain system;
an identity verification module 302, configured to verify a node identity of the second node;
the information extraction module 303 is configured to extract, from the encrypted ledger book, ledger book data, first check data used for checking continuity of the ledger book, and second check data used for checking accuracy of the ledger book data when the node identity verification of the second node by the identity verification module 302 passes;
the checking module 304 is configured to check the account book data according to the first checking data and the second checking data;
an uplink module 305, configured to perform an uplink operation on the account data and the check information of the account data when the check module 304 passes the check on the account data;
the broadcasting module 306 is configured to broadcast the account book data and the check information to all other nodes of the blockchain system when the check module 304 passes the check of the account book data, or after the uplink module 305 performs an uplink operation on the account book data and the check information of the account book data, so that each other node performs an uplink operation on the account book data and the check information.
Therefore, the implementation of the device described in fig. 3 can not only realize 100% consensus on the account book, improve the degree of consensus, but also link the check information of the node itself, greatly reduce the cross-node comparison and check work, and reduce the computing power redundancy.
In an alternative embodiment, as shown in fig. 4, the apparatus may further include:
an information obtaining module 307, configured to obtain source node information of the ledger data when the checking module 304 fails to check the ledger data, where the source node information of the ledger data is node information of a second node;
the uplink module 305 is further configured to perform an uplink operation on the source node information to add the source node information of the ledger data to the node blacklist.
It can be seen that, when the node receiving the ledger discovers that the ledger is incorrect, the apparatus described in fig. 4 can also directly publish the source node information of the ledger to the corresponding link (for example, the main link) to reduce the risk of power attack and improve the security and accuracy of the ledger data in the block link system.
In another optional embodiment, the specific manner of the checking module 304 checking the account data according to the first check data and the second check data includes:
checking whether the first check data is consistent with the latest hash value recorded by the first node; when the first check data are checked to be consistent with the latest hash value, checking whether the ledger data are correct or not according to the second check data; when the check-out book data is correct, determining that the check-out book data passes the check; alternatively, the first and second liquid crystal display panels may be,
checking whether the ledger data are correct or not according to the second checking data; when the check-out book data is correct, checking whether the first check data is consistent with the latest hash value recorded by the first node; when the first verification data is verified to be consistent with the latest hash value, determining that the account book data passes verification;
and when the check-out book data are incorrect or the first check data are inconsistent with the latest hash value, determining that the check-out book data do not pass the check.
In this optional embodiment, optionally, the first check data includes a hash value of the encrypted ledger, and the second check data includes a random number of the ledger corresponding to the encrypted ledger and a current hash value of the encrypted ledger.
Further optionally, the checking module 304 may check whether the ledger data is correct according to the second check data, including:
performing hash operation on the latest hash value, the random number of the account book and the data of the account book to obtain a check hash value;
judging whether the check hash value is consistent with the current hash value or not, and when the check hash value is consistent with the current hash value, determining that the account book data is checked correctly; and when the check hash value is inconsistent with the current hash value, determining that the account book data is checked incorrectly.
It can be seen that 2 implementation manners of checking the account data by using the first check data and the second check data are provided for implementing the apparatus described in fig. 3 or fig. 4, and a first implementation manner is preferred in the 2 implementation manners, that is to say: whether the latest hash value recorded by the first check data and the first node is consistent or not is checked firstly, subsequent operation is executed when the check is consistent, the accuracy of the account book data does not need to be checked through the second check data when the check is inconsistent, the process is complex because the second check data is used for checking the accuracy of the account book data and hash operation and data consistency check are involved, unnecessary account book data accuracy check operation of the first node is reduced under the condition that the inconsistency is checked through checking whether the latest hash value recorded by the first check data and the first node is consistent or not, and further the waste of node processing resources of the first node is reduced. In addition, when checking account book data, not only need check account book data accuracy still need check account book continuity, provide the realization mode of account book cochain 100% common identification, improve the common identification degree, and the common identification process is simple, can also improve common identification efficiency, be favorable to improving account book cochain efficiency when realizing account book cochain 100% common identification.
In yet another alternative embodiment, the specific way for the identity verification module 302 to verify the node identity of the second node includes:
and performing decryption operation on the encrypted account book through the determined public key to obtain a decryption result, and determining that the node identity verification of the second node passes when the decryption result comprises the unique identity authentication information corresponding to the second node.
It can be seen that implementing the apparatus described in fig. 3 or fig. 4 can also improve the billing security of the blockchain system.
In yet another alternative embodiment, as shown in fig. 4, the apparatus may further include:
a determining module 308, configured to determine, before the identity verifying module 302 verifies the node identity of the second node, whether the second node is a node in a node blacklist stored in the chain according to node information of the second node; if the determination result is negative, the identity verification module 302 is triggered to perform the above operation of verifying the node identity of the second node.
It can be seen that, by implementing the apparatus described in fig. 4, it can also be determined whether the node sending the ledger is a node in the node blacklist or not at first when a new ledger is received, if so, the process is ended, and if not, the subsequent operation is continued, so that the reliability of node identity verification for the node sending the ledger can be improved.
In yet another alternative embodiment, the first node is determined by:
and collecting the voting result fed back by each node in all the nodes except the target node with the accounting authority for the last time by the target node with the accounting authority, and selecting the node with the highest vote number from the rest nodes except the target node and the second node according to all the collected voting results to serve as the first node with the accounting authority for the newly generated ledger of the second node.
It should be noted that the above-mentioned determining process of the first node may also be implemented by the proxy node designated by the target node having the accounting right last time, in this case, all nodes having the voting right are all nodes having the voting right except the proxy node or the proxy node and the target node, and the node having the highest number of votes is specifically selected from the remaining nodes except the second node, the proxy node and the target node.
Further, all nodes having voting authority may be understood as nodes not included in the node blacklist.
It can be seen that this optional embodiment can also not need all nodes to contend for the accounting authority in a manner of calculating appointed characters, only need by the node with the accounting authority last time or the voting result of the remaining nodes counted by the appointed proxy node, so that the fairness of determining the node (also called the first node) with the accounting authority this time is improved, a large amount of computing resources are not consumed, the efficiency of determining the node with the accounting authority is favorably improved, and further, the efficiency of packing the accounting book data into blocks and adding the blocks to the block chain is favorably improved.
Example four
Referring to fig. 5, fig. 5 is a schematic structural diagram of another consensus achieving apparatus applied to a block chain system according to an embodiment of the present invention. The apparatus described in fig. 5 may be applied to a first node included in the blockchain system, where the first node is a node having the current accounting authority, and the blockchain system further includes a plurality of other nodes. As shown in fig. 5, the apparatus may include:
a memory 401 storing executable program code;
a processor 402 coupled with the memory 401;
the processor 402 calls the executable program code stored in the memory 401 to execute the steps of the consensus method applied to the blockchain system disclosed in the first embodiment or the second embodiment of the present invention.
EXAMPLE five
The embodiment of the invention discloses a computer storage medium, which stores computer instructions, and the computer instructions are used for executing the steps of the consensus realization method applied to the block chain system disclosed in the first embodiment or the second embodiment of the invention when being called.
The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above detailed description of the embodiments, those skilled in the art will clearly understand that the embodiments may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. Based on such understanding, the above technical solutions may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, wherein the storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc-Read-Only Memory (CD-ROM) or other Memory capable of storing data, a magnetic tape, or any other computer-readable medium capable of storing data.
Finally, it should be noted that: the embodiment of the present invention discloses a method and an apparatus for implementing consensus in a blockchain system, which are disclosed only as preferred embodiments of the present invention, but are only used for illustrating the technical solutions of the present invention and are not limited thereto; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art; the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. A consensus realization method applied to a blockchain system, wherein the blockchain system comprises a plurality of nodes, and each node stores identity authentication information uniquely corresponding to the node, the method comprising:
a first node receives an encrypted account book issued by a second node, wherein the encrypted account book is obtained by encrypting a newly generated account book by the second node according to unique corresponding identity authentication information of the second node, and the first node and the second node are nodes in the block chain system and the first node is a node with the accounting authority at this time;
the first node verifies the node identity of the second node, and when the node identity verification of the second node passes, the ledger data, first verification data for verifying the continuity of the ledger and second verification data for verifying the accuracy of the ledger data are extracted from the encrypted ledger;
the first node checks the book data according to the first check data and the second check data;
when the ledger data passes the verification, the first node performs uplink operation on the ledger data and verification information thereof on the ledger data, and broadcasts the ledger data and the verification information to all other nodes of the block chain system, so that each other node performs uplink operation on the ledger data and the verification information;
wherein, the first node checks the ledger data according to the first check data and the second check data, and the method includes:
the first node checks whether the first check data is consistent with the latest hash value recorded by the first node; when the first check data is checked to be consistent with the latest hash value, checking whether the ledger data is correct or not according to the second check data; when the account book data is verified to be correct, determining that the account book data passes verification; alternatively, the first and second electrodes may be,
the first node checks whether the ledger data is correct or not according to the second check data; when the account book data is verified to be correct, verifying whether the first verification data is consistent with the latest hash value recorded by the first node; when the first verification data is verified to be consistent with the latest hash value, determining that the account book data is verified to pass;
when the ledger data is checked to be incorrect or the first check data is inconsistent with the latest hash value, the first node determines that the ledger data is not checked to be passed.
2. The method of claim 1, further comprising:
when the account book data is not verified, the first node acquires source node information of the account book data and executes uplink operation on the source node information so as to add the source node information of the account book data to a node blacklist;
and the source node information of the account book data is the node information of the second node.
3. The method of claim 1, wherein the first check-up data comprises a pre-hash value of the encrypted ledger, and the second check-up data comprises a ledger random number corresponding to the encrypted ledger and a current hash value of the encrypted ledger.
4. The method as claimed in claim 3, wherein the checking whether the ledger data is correct by the first node according to the second check-up data comprises:
the first node performs hash operation on the latest hash value, the account book random number and the account book data to obtain a check hash value;
the first node judges whether the check hash value is consistent with the current hash value or not, and when the check hash value is consistent with the current hash value, the first node determines that the account book data is checked correctly; and when the check hash value is inconsistent with the current hash value, determining that the account book data is checked incorrectly.
5. The consensus method of claim 4 applied to a blockchain system, wherein the verifying the node identity of the second node by the first node comprises:
the first node performs decryption operation on the encrypted account book through the determined public key to obtain a decryption result, and when the decryption result comprises the unique identity authentication information corresponding to the second node, the node identity verification of the second node is determined to be passed;
wherein before the first node verifies the node identity of the second node, the method further comprises:
the first node judges whether the second node is a node in a node blacklist stored on a chain or not according to the node information of the second node;
and when the judgment result is negative, the first node executes the step of verifying the node identity of the second node.
6. The method of any one of claims 1, 2, and 3-5, wherein the first node is determined by:
and collecting the voting result fed back by each node in all the nodes with the voting authority except the target node by the target node with the accounting authority at the last time, and selecting the node with the highest vote quantity from the rest nodes except the target node and the second node according to all the collected voting results as the first node with the accounting authority aiming at the ledger newly generated by the second node.
7. An apparatus for implementing consensus in a blockchain system, wherein the blockchain system includes a plurality of nodes, each node stores unique corresponding identity authentication information, the apparatus is applied to a first node included in the blockchain system, and the first node is a node having an accounting right this time, the apparatus comprising:
the receiving module is used for receiving an encrypted account book issued by a second node, wherein the encrypted account book is obtained by encrypting a newly generated account book by the second node according to unique corresponding identity authentication information of the second node, and the second node is a node in the block chain system;
the identity authentication module is used for authenticating the node identity of the second node;
the information extraction module is used for extracting the ledger data, first check data used for checking the continuity of the ledger and second check data used for checking the accuracy of the ledger data from the encrypted ledger when the node identity verification of the second node is passed by the identity verification module;
the checking module is used for checking the ledger data according to the first checking data and the second checking data;
the uplink module is used for executing uplink operation on the account data and the checking information of the account data when the checking module passes the checking on the account data;
a broadcasting module, configured to broadcast the ledger data and the check information to all other nodes of the block chain system when the checking module passes checking the ledger data, or after the uplink module performs an uplink operation on the ledger data and the check information thereof on the ledger data, so that each other node performs an uplink operation on the ledger data and the check information;
the specific mode that the checking module checks the account book data according to the first checking data and the second checking data comprises the following steps:
checking whether the first check data is consistent with the latest hash value recorded by the first node; when the first check data is checked to be consistent with the latest hash value, checking whether the ledger data is correct or not according to the second check data; when the account book data is verified to be correct, determining that the account book data passes verification; alternatively, the first and second electrodes may be,
checking whether the ledger data are correct or not according to the second check data; when the account book data is verified to be correct, verifying whether the first verification data is consistent with the latest hash value recorded by the first node; when the first verification data is verified to be consistent with the latest hash value, determining that the account book data is verified to pass;
and when the account book data is verified to be incorrect or the first verification data is inconsistent with the latest hash value, determining that the account book data is not verified.
8. An apparatus for implementing consensus in a blockchain system, the blockchain system including a plurality of nodes, each node storing identity authentication information uniquely corresponding to the node, the apparatus being applied to a first node included in the blockchain system, the first node being a node having current accounting authority, the apparatus comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the consensus implementation method applied to the blockchain system according to any one of claims 1 to 6.
9. A computer storage medium storing computer instructions which, when invoked, perform the consensus implementation method as claimed in any one of claims 1-6 for use in a blockchain system.
CN202110840784.9A 2021-07-26 2021-07-26 Consensus realization method and device applied to block chain system Active CN113489743B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110840784.9A CN113489743B (en) 2021-07-26 2021-07-26 Consensus realization method and device applied to block chain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110840784.9A CN113489743B (en) 2021-07-26 2021-07-26 Consensus realization method and device applied to block chain system

Publications (2)

Publication Number Publication Date
CN113489743A CN113489743A (en) 2021-10-08
CN113489743B true CN113489743B (en) 2022-12-23

Family

ID=77943544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110840784.9A Active CN113489743B (en) 2021-07-26 2021-07-26 Consensus realization method and device applied to block chain system

Country Status (1)

Country Link
CN (1) CN113489743B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115168872B (en) * 2022-09-07 2023-01-10 南方科技大学 Decentralized trust-based method for protecting TEE state continuity under public cloud

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107864198A (en) * 2017-11-07 2018-03-30 济南浪潮高新科技投资发展有限公司 A kind of block chain common recognition method based on deep learning training mission
CN109481936A (en) * 2018-10-26 2019-03-19 咪咕文化科技有限公司 A kind of block chain accounting nodes selection method, device and computer readable storage medium
CN109672518A (en) * 2019-03-02 2019-04-23 西安邮电大学 The node data processing of the block chain of anti-quantum attack
CN111858751A (en) * 2020-06-29 2020-10-30 深圳壹账通智能科技有限公司 Data storage method and device based on block chain
CN112541758A (en) * 2020-12-01 2021-03-23 鲁静 Multi-round voting type fault-tolerant sequencing consensus mechanism and method based on block chain

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108960837A (en) * 2018-06-05 2018-12-07 上海和数软件有限公司 Block chain common recognition verification method, device and computer readable storage medium
CN110875893B (en) * 2018-08-29 2022-03-08 深圳启元信息服务有限公司 Consensus verification method, check node and block chain system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107864198A (en) * 2017-11-07 2018-03-30 济南浪潮高新科技投资发展有限公司 A kind of block chain common recognition method based on deep learning training mission
CN109481936A (en) * 2018-10-26 2019-03-19 咪咕文化科技有限公司 A kind of block chain accounting nodes selection method, device and computer readable storage medium
CN109672518A (en) * 2019-03-02 2019-04-23 西安邮电大学 The node data processing of the block chain of anti-quantum attack
CN111858751A (en) * 2020-06-29 2020-10-30 深圳壹账通智能科技有限公司 Data storage method and device based on block chain
CN112541758A (en) * 2020-12-01 2021-03-23 鲁静 Multi-round voting type fault-tolerant sequencing consensus mechanism and method based on block chain

Also Published As

Publication number Publication date
CN113489743A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
CN109493221B (en) Method, device, network and storage medium for keeping transaction records secret in block chain
US11233656B2 (en) Method for mining a block in a decentralized blockchain consensus network
CN106529952B (en) Verification implementation method and system in data transfer
CN111277553A (en) Credible node determination method and device based on block chain network
CN111163182A (en) Block chain-based device registration method and apparatus, electronic device, and storage medium
CN109861996B (en) Block chain-based relationship proving method, device, equipment and storage medium
CN110611647A (en) Node joining method and device on block chain system
CN111523899A (en) Consensus method of alliance chain, data verification method, device and system
CN111931220A (en) Consensus processing method, device, medium and electronic equipment for block chain network
CN113489743B (en) Consensus realization method and device applied to block chain system
CN111343179A (en) Real-time consensus method and device for authenticity of data on link
CN113872932A (en) Method, system, terminal and storage medium for authenticating interface between micro services
CN114881757A (en) Letter method, system and electronic equipment
CN110941840A (en) Data processing method, system and terminal
CN111260475A (en) Data processing method, block chain node point equipment and storage medium
CN114640464A (en) Block chain-based subscription data transmission method, device, equipment and storage medium
CN111353138A (en) Abnormal user identification method and device, electronic equipment and storage medium
CN110414197B (en) Bank user identity verification method and device based on behavior characteristics
CN116993523A (en) Configurable account checking method, device, equipment and storage medium
CN111597537A (en) Block chain network-based certificate issuing method, related equipment and medium
CN116452135A (en) Distributed anonymous voting method, device, equipment and medium based on Ethernet
CN112465516B (en) Block chain network-based device management method, related device and storage medium
CN112926981B (en) Transaction information processing method, device and medium for block chain and electronic equipment
CN112671738A (en) Login method, device, terminal and storage medium of enterprise internal system
CN112037062A (en) Transaction consensus method, device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20211008

Assignee: GUANGDONG KAMFU TECHNOLOGY Co.,Ltd.

Assignor: GUANGDONG CHENYI INFO TECHNOLOGY CO.,LTD.

Contract record no.: X2024980000284

Denomination of invention: Consensus Implementation Method and Device Applied to Blockchain Systems

Granted publication date: 20221223

License type: Common License

Record date: 20240108

EE01 Entry into force of recordation of patent licensing contract