CN113114495B - Method for fairly electing main node based on block chain - Google Patents

Method for fairly electing main node based on block chain Download PDF

Info

Publication number
CN113114495B
CN113114495B CN202110364101.7A CN202110364101A CN113114495B CN 113114495 B CN113114495 B CN 113114495B CN 202110364101 A CN202110364101 A CN 202110364101A CN 113114495 B CN113114495 B CN 113114495B
Authority
CN
China
Prior art keywords
node
information
main
nodes
message
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
CN202110364101.7A
Other languages
Chinese (zh)
Other versions
CN113114495A (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.)
Hunan University
Original Assignee
Hunan University
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 Hunan University filed Critical Hunan University
Priority to CN202110364101.7A priority Critical patent/CN113114495B/en
Publication of CN113114495A publication Critical patent/CN113114495A/en
Application granted granted Critical
Publication of CN113114495B publication Critical patent/CN113114495B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/30Decision processes by autonomous network management units using voting and bidding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1051Group master selection mechanisms
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • 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 belongs to the field of computer science and discloses a block chain-based fair master node election method. The invention improves the PBFT consensus method, enables the nodes in the network to freely join and exit, and increases the flexibility of the block chain network. Meanwhile, a nearest production queue is set in the block chain network, the number of the selected main node in the round cannot be repeated with the number of the nodes in the production queue, and the unfairness problem that part of the nodes cannot be selected as production nodes is solved in the mode. The main node in the blockchain network is not acted by a fixed node, so that the safety of the system is increased to a certain extent.

Description

Method for fairly electing main node based on block chain
Technical Field
The invention belongs to the field of computer science, relates to the technical application of a block chain, and particularly relates to a block chain-based fair election method for a main node.
Background
In the blockchain system, a consensus method is needed to ensure the fairness of the system operation. Common methods for recognition include POW (proof Of work), POS (proof Of stamp), PBFT (practical Byzantine FaultTolerance), DBFT (DelegatedByzantine FaultTolerant), etc. The common recognition methods such as POW and POS are basically a result of the arithmetic or equity size, which results in the chance that some nodes in the network are not used as production nodes and causes a certain waste of resources. The PBFT algorithm has many advantages, but it also has fatal disadvantages. First, it works in a completely closed environment where a node that wants to join or leave must stop the entire system. Second, many system members in PBFT prefer to rely on other people to do cumbersome work to reduce costs, which is disruptive to system security. The DBFT solves the problem of capacity expansion of a BFT algorithm, but the consensus method is mainly determined by 7 fixed super nodes, so that the consensus method is suspected to be over-centralized by the outside, and the fixedly exposed nodes are easily attacked and are not safe enough. The common identification method has the problems of resource waste, unfair election, difficult network node joining and exiting and fixed elected nodes and exposure. The invention provides a block chain-based fair election method for a main node, which can be applied to a dynamic network, facilitates the addition and the exit of the node, and simultaneously increases the fairness of the network.
Disclosure of Invention
Aiming at the problems of resource waste, unfair election, difficult network node joining and quitting and fixed and exposed elected nodes in the common identification method, the invention provides a block chain-based main node fair election method.
In order to achieve the above object, the solution of the present invention is:
a fair election method of a main node based on a block chain divides node types in a system into a supervisory node (Supervision), a main node (Primary) and a Slave node (Slave), and comprises three parts of node joining and quitting, main node election and system consensus, wherein the node joining and quitting comprises the following steps:
the first step is as follows: registering a new node to be added at a NodeCA, and maintaining a list for recording node identity information through the NodeCA, wherein the list information comprises a node ID, an IP address, a public key and a node state; if the identity information of the newly added node passes the check, the NodeCA adds the identity information at the tail of the node information list and allocates a number j to the node information list;
the second step is that: the node j multicasts a JOIN request message < JOIN, j, IP, PK > sigma j to all the copies, wherein the first variable of the message is the information type, the JOIN refers to the JOIN request of a new node, the IP refers to the IP address of the node j, the PK is the public key of the node j, and the sigma j refers to the signature of the node j on the message by using the private key of the node j; after receiving the joining request, the node i in the network verifies the signature, and then the public key information of the node j is checked with the signature recorded in the NodeCA; if these checks are passed, node i will run the JOIN protocol, sending a JOIN-REPLY message to node j;
the third step: if node j wants to leave the network, it revokes its certificate and related information at NodeCA, then node j multicasts the EXIT request message < EXIT, j, IP, PK > σ j to other copies; upon receiving the EXIT request, node i in the network will verify the signature, and if these checks pass, node i runs the EXIT protocol and sends an EXIT-REPLY message to node j.
The election of the master node comprises the following steps:
the first step is as follows: determining the total number of nodes in the system to be n, using 1,2, 3. cndot. n as each node number, and setting a nearest production queue for the system, wherein the capacity of the queue is determined by the number of nodes in the system, the node numbers of the latest rounds selected as the main nodes are stored in the queue, and the node numbers of the latest m rounds selected as the main nodes are stored in the queue if the capacity of the queue is m;
the second step is that: randomly selecting a node as a main node by using a random function;
the third step: if the number of the selected main node in the round is repeated with the number of the node in the production queue, repeating the second step for re-election until the number of the selected main node in the round is not repeated with the number of the node in the production queue;
the system consensus process comprises the following steps:
the first step is as follows: in the request stage, a client sends request information to a master node;
the second step is that: in the prefix stage, after receiving a client request, the main node provides main information in the request data and sends the main information to other nodes;
the third step: in the commit stage, the nodes receive the prefix from the main node, firstly, the public key of the main node is used for signature authentication, secondly, the message is hashed and signed, and then the signed message is sent to the supervision node;
the fourth step: in the distribution stage, a supervision node receives 2f commit information, if all signatures pass verification, the supervision node goes to the distribution step and broadcasts the commit information to other nodes in the whole network;
the fifth step: in a replay stage, after the nodes receive the distribution of the supervision nodes and pass signature verification, the messages are stored into the local, and the replay messages are returned to the client.
The invention has the beneficial effects that:
the PBFT consensus method is improved, so that nodes in the network can freely join and exit, and the flexibility of the block chain network is improved. Meanwhile, a nearest production queue is set for the block chain network, and the unfairness problem that part of nodes cannot be selected as production nodes is solved in the mode. The main node in the block chain network is not served by a fixed node, so that the safety of the system is increased to a certain extent.
Drawings
FIG. 1 is a process of a node joining a network in accordance with the present invention;
FIG. 2 is a process of a node exiting a network in accordance with the present invention;
FIG. 3 illustrates a process of electing a master node in the present invention;
FIG. 4 is a system consensus process of the present invention.
Detailed Description
The invention provides a block chain-based fair election method for a main node, and in order to describe the invention more specifically, the technical scheme of the invention is described in detail below with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a process of a node joining a network:
the first step is as follows: registering a new node to be added at a NodeCA, and maintaining a list for recording node identity information through the NodeCA, wherein the list information comprises a node ID, an IP address, a public key and a node state; if the identity information of the newly added node passes the check, the NodeCA adds the identity information at the tail of the node information list and allocates a number j to the node information list;
the second step is that: the node j multicasts a JOIN request message < JOIN, j, IP, PK > sigma j to all the copies, wherein the first variable of the message is the information type, the JOIN refers to the JOIN request of a new node, the IP refers to the IP address of the node j, the PK is the public key of the node j, and the sigma j refers to the signature of the node j on the message by using the private key of the node j; after receiving the joining request, the node i in the network verifies the signature, and then the public key information of the node J is checked with the signature recorded in the NodeCA; if these checks are passed, node i will run the JOIN protocol, sending a JOIN-REPLY message to node j;
fig. 2 is a process in which a node exits the network:
the first step is as follows: if node j wants to leave the network, it revokes its certificate and related information at NodeCA, then node j multicasts the EXIT request message < EXIT, j, IP, PK > σ j to other copies; upon receiving the EXIT request, node i in the network will verify the signature, and if these checks pass, node i runs the EXIT protocol and sends an EXIT-REPLY message to node j.
FIG. 3 is the election process of the master node:
the first step is as follows: determining the total number of nodes in the system to be n, using 1,2, 3. cndot. n as each node number, and setting a nearest production queue for the system, wherein the capacity of the queue is determined by the number of nodes in the system, the node numbers of the latest rounds selected as the main nodes are stored in the queue, and the node numbers of the latest m rounds selected as the main nodes are stored in the queue if the capacity of the queue is m;
the second step is that: randomly selecting a node as a main node by using a random function;
the third step: if the number of the selected main node in the round is repeated with the number of the node in the production queue, repeating the second step for re-election until the number of the selected main node in the round is not repeated with the number of the node in the production queue;
FIG. 4 is a system consensus process:
the first step is as follows: in the request stage, a client sends request information to a master node;
the second step is that: in the prefix stage, after receiving a client request, the main node provides main information in the request data and sends the main information to other nodes;
the third step: in the commit stage, the nodes receive the prefix from the main node, firstly, the public key of the main node is used for signature authentication, secondly, the message is hashed and signed, and then the signed message is sent to the supervision node;
the fourth step: in the distribution stage, a supervision node receives 2f commit information, if all signatures pass verification, the supervision node goes to the distribution step and broadcasts the commit information to other nodes in the whole network;
the fifth step: in a replay stage, after the nodes receive the distribution of the supervision nodes and pass signature verification, the messages are stored into the local, and the replay messages are returned to the client.
The embodiments described above are presented to enable a person having ordinary skill in the art to make and use the invention. It will be readily apparent to those skilled in the art that various modifications to the above-described embodiments may be made, and the generic principles defined herein may be applied to other embodiments without the use of inventive faculty. Therefore, the present invention is not limited to the above embodiments, and those skilled in the art should make improvements and modifications to the present invention based on the disclosure of the present invention within the protection scope of the present invention.

Claims (1)

1. A block chain-based fair election method for a main node is characterized in that the node types in a system are divided into a supervisory node, a main node and slave nodes, and the method comprises three parts of node adding and quitting, main node election and system consensus, wherein the node adding and quitting comprises the following steps:
the first step is as follows: registering a new node to be added at a NodeCA, and maintaining a list for recording node identity information through the NodeCA, wherein the list information comprises a node ID, an IP address, a public key and a node state; if the identity information of the newly added node passes the check, the NodeCA adds the identity information at the tail of the node information list and allocates a number j to the node information list;
the second step is that: the node j multicasts an adding request message < JOIN, j, IP, PK > sigma j to all the copies, wherein the first variable JOIN of the message is information type, the JOIN refers to the adding request of a new node, the IP refers to the IP address of the node j, the PK is the public key of the node j, and the sigma j refers to the signature of the node j on the message by using the private key of the node j; after receiving the joining request, the node i in the network verifies the signature, and then the public key information of the node j is checked with the signature recorded in the NodeCA; if these checks are passed, node i will run the JOIN protocol, sending a JOIN-REPLY message to node j;
the third step: if node j wants to leave the network, it revokes its certificate and related information at NodeCA, then node j multicasts the EXIT request message < EXIT, j, IP, PK > σ j to other copies; after receiving the quit request, the node i in the network verifies the signature, if the check is passed, the node i runs the EXIT protocol and sends the EXIT-REPLY message to the node j;
the election of the master node comprises the following steps:
the first step is as follows: determining the total number of nodes in the system to be n, using 1,2, 3. cndot. n as each node number, and setting a nearest production queue for the system, wherein the capacity of the queue is determined by the number of nodes in the system, the node numbers of the latest rounds selected as the main nodes are stored in the queue, and the node numbers of the latest m rounds selected as the main nodes are stored in the queue if the capacity of the queue is m;
the second step is that: randomly selecting a node as a main node by using a random function;
the third step: if the number of the selected main node in the round is repeated with the number of the node in the production queue, repeating the second step for re-election until the number of the selected main node in the round is not repeated with the number of the node in the production queue;
the system consensus process comprises the following steps:
the first step is as follows: in the request stage, a client sends request information to a master node;
the second step is that: in the prefix stage, after receiving a client request, the main node provides main information in the request data and sends the main information to the slave nodes;
the third step: in the commit stage, the slave nodes receive the prefix from the master node, the master node and the slave nodes firstly use the public key of the master node to carry out signature authentication, secondly carry out signature after hashing on the message and send the message to the supervision node;
the fourth step: in the distribution stage, a supervision node receives commit information sent by a master node and slave nodes, if all signatures are verified to pass, the supervision node goes to the distribution step and broadcasts the commit information to the master node and the slave nodes in the whole network;
the fifth step: in a replay stage, after the master node and the slave nodes receive distribution of the supervision node and pass signature verification, the message is stored into the local, and a replay message is returned to the client.
CN202110364101.7A 2021-04-03 2021-04-03 Method for fairly electing main node based on block chain Active CN113114495B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110364101.7A CN113114495B (en) 2021-04-03 2021-04-03 Method for fairly electing main node based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110364101.7A CN113114495B (en) 2021-04-03 2021-04-03 Method for fairly electing main node based on block chain

Publications (2)

Publication Number Publication Date
CN113114495A CN113114495A (en) 2021-07-13
CN113114495B true CN113114495B (en) 2021-12-28

Family

ID=76713663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110364101.7A Active CN113114495B (en) 2021-04-03 2021-04-03 Method for fairly electing main node based on block chain

Country Status (1)

Country Link
CN (1) CN113114495B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110351133A (en) * 2019-06-28 2019-10-18 阿里巴巴集团控股有限公司 Method and device for the host node hand-off process in block catenary system
CN111865608A (en) * 2020-07-02 2020-10-30 南京邮电大学 Consensus mechanism operation method applied to alliance chain
US10939405B1 (en) * 2019-04-08 2021-03-02 Helium Systems, Inc. Systems and methods for implementing permissionless network consensus using blockchain
US10958450B1 (en) * 2020-10-15 2021-03-23 ISARA Corporation Constructing a multiple-entity root certificate data block chain

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111106942B (en) * 2019-12-13 2023-07-11 南京邮电大学 Block chain credit process method based on AP-PBFT algorithm
CN111865918B (en) * 2020-06-16 2022-09-27 广东工业大学 Optimized and improved block chain PBFT consensus method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10939405B1 (en) * 2019-04-08 2021-03-02 Helium Systems, Inc. Systems and methods for implementing permissionless network consensus using blockchain
CN110351133A (en) * 2019-06-28 2019-10-18 阿里巴巴集团控股有限公司 Method and device for the host node hand-off process in block catenary system
CN111865608A (en) * 2020-07-02 2020-10-30 南京邮电大学 Consensus mechanism operation method applied to alliance chain
US10958450B1 (en) * 2020-10-15 2021-03-23 ISARA Corporation Constructing a multiple-entity root certificate data block chain

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种基于环签名的PBFT区块链共识算法改进方案;方轶等;《计算机工程》;20191130;第45卷(第11期);全文 *
区块链技术:架构及进展;邵奇峰等;《计算机学报》;20180531;第41卷(第5期);全文 *
区块链的网络安全:威胁与对策;房文东等;《信息安全学报》;20180331;第3卷(第2期);全文 *

Also Published As

Publication number Publication date
CN113114495A (en) 2021-07-13

Similar Documents

Publication Publication Date Title
CN110784346B (en) Reputation value-based PBFT consensus system and method
US11128522B2 (en) Changing a master node in a blockchain system
CN108881169B (en) Time distribution and synchronization method and system based on block chain and data processing system
CN111131209B (en) Improved efficient consensus method, system, computer device and storage medium
CN111371877B (en) Consensus method of heterogeneous alliance chain
CN113570357B (en) Dynamic layered efficient PBFT algorithm
CN112968883B (en) Block chain heterogeneous consensus method with high safety and terminal
CN112540926A (en) Resource allocation fairness federal learning method based on block chain
CN111865608B (en) Consensus mechanism operation method applied to alliance chain
WO2022217807A1 (en) Blockchain consensus node selection method and apparatus, and computer device and storage medium
CN110445795B (en) Block chain authentication uniqueness confirmation method
CN115065468B (en) PBFT consensus optimization method based on group reputation value
CN110445603A (en) A kind of decentralization random digit generation method
CN114615281B (en) Block chaining and block outputting method based on small-scale committee and PoS protocol confirmation method
CN114143021B (en) News information credit score system based on block chain
CN115796261A (en) Block chain-based lightweight group consensus federated learning method
CN110545261A (en) Consensus algorithm applied to block chain network
CN113114495B (en) Method for fairly electing main node based on block chain
CN111046439A (en) Intelligent contract task verifiable method and system based on block chain
CN114449476A (en) Block link point consensus method for safety communication in Internet of vehicles
CN108173658B (en) Block chain consistency maintenance method and device
CN112600672B (en) Inter-domain credibility consensus method and device based on real identity
CN116527684A (en) Multi-chain information interaction method based on 1+1+N relay consensus committee
CN115189871A (en) Byzantine fault-tolerant consensus algorithm based on verifiable random function and threshold signature
Wu et al. Blockchain consensus mechanism for distributed energy transactions

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