CN112804101B - Master-slave multi-chain cross-link method and system based on voting and credit mechanism - Google Patents

Master-slave multi-chain cross-link method and system based on voting and credit mechanism Download PDF

Info

Publication number
CN112804101B
CN112804101B CN202110031705.XA CN202110031705A CN112804101B CN 112804101 B CN112804101 B CN 112804101B CN 202110031705 A CN202110031705 A CN 202110031705A CN 112804101 B CN112804101 B CN 112804101B
Authority
CN
China
Prior art keywords
node
chain
block
nodes
voting
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
CN202110031705.XA
Other languages
Chinese (zh)
Other versions
CN112804101A (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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202110031705.XA priority Critical patent/CN112804101B/en
Publication of CN112804101A publication Critical patent/CN112804101A/en
Application granted granted Critical
Publication of CN112804101B publication Critical patent/CN112804101B/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/1059Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem
    • H04L2209/463Electronic voting
    • 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 master-slave multi-chain cross-link method and a system based on a voting and credit mechanism, wherein the attribution of an accounting right is determined by introducing the voting mechanism, thereby avoiding the calculation competition among nodes and ensuring that the nodes in the system can fairly obtain the accounting right; the credit value is given to the node, so that the influence of the rights and interests on the system is reduced, and meanwhile, the behavior of the node can be better restrained by quantitatively evaluating the behavior of the node, so that the node has a concern about malicious behavior; and on the basis, a master-slave multi-chain layered cross-chain model with a slave chain based on POVT consensus and a main chain based on PBFT consensus is constructed, and the performance of the model is experimentally analyzed, so that the result shows that the efficiency of the system is improved, and meanwhile, the model has certain defense capability on attack means such as double-flower attack, selfish mining, equity crushing and the like.

Description

Master-slave multi-chain cross-link method and system based on voting and credit mechanism
Technical Field
The invention relates to the technical field of block chains, in particular to a master-slave multi-chain cross-chain method and a master-slave multi-chain cross-chain system based on a voting and credit mechanism.
Background
The block chain is used as a distributed database, and the most basic and most core requirement is that all nodes can agree on the stored data, so the consensus mechanism is always the focus of research.
Common consensus algorithms currently used in the blockchain technology include workload certification pow (proof of work), rights and interests certification pos (proof of stamp), and practical byzantine fault-tolerant algorithm pbft (practical byzantine fault tolerance). In which PoS consensus is compared with PoW consensus, where nodes reduce the difficulty of mining by investing equity, the more equity invested, the less difficult it is, and this method considers that the more people who hold tokens want to keep the system stable, so that their benefits are not compromised. However, this also brings new problems, and the more people who possess tokens, the more the possibility that they can obtain the block right, and thus obtain the block reward, which forms a vicious circle, and is not good for the long-term fairness and stability of the system, and the PoS consensus finally needs to compete for the accounting right through the hash operation.
Therefore, how to select the block nodes more fairly, thoroughly avoiding the competitive competition among the nodes, improving the reliability of the nodes participating in the consensus, reducing the influence of the rights and interests on the allocation of the accounting rights, improving the efficiency of the system, and increasing the difficulty of initiating rights and interests smashing attack, double blossom attack and selfish mining attack on the system is a technical problem which needs to be solved urgently.
Disclosure of Invention
In order to solve the above problem, an aspect of the present invention provides a master-slave multi-chain cross-chain method based on a voting and credit mechanism, where the master-slave multi-chain cross-chain method based on the voting and credit mechanism includes the following steps:
selecting some nodes from the nodes which wish to participate in consensus according to the rights and interests of the nodes and the value of STRust to form a consensus node set N { (A1, S1, STRust1), (A2, S2, STRust2) } (An, Sn, STRust);
numbering the nodes in the set;
dividing time into time segments;
the complete process from block output to uplink is completed through POVT consensus from the chain;
generating a pseudo random number by operating a Meisen rotation algorithm to generate a representative node number constituting a main chain;
and the main chain nodes are in consensus on the data through a PBFT algorithm, and the uplink process is completed.
Preferably, the POVT consensus comprises the following steps:
from the range of (1,2, …, Num) in the consensus node setp) Selecting nodes with the same number as the random number R from the production nodes to become block-out nodes;
after receiving a block verification request sent by a production node, the voting node verifies the data in the block;
according to the message received by the production node, selecting a timestamp for recording the time at the moment, or immediately canceling the consensus qualification of the node;
determining each selected productionWhether the time of the node block output exceeds the set time T or notb
After each round of the period is over, the nodes which successfully participate in the consensus get the benefit of the STRust value.
Preferably, the block extracting node extracts some transactions from the transaction pool, packs the transactions into a block, then broadcasts the block to the voting node and prepares to receive a feedback message of the voting node, and if the generated block is a created block, the random number R is 1; if the generated block is a non-generative block, the random number R is generated by the last generation node in the process of generating a new block.
Preferably, the random number R is generated as follows:
the production node submits the block to the voting node and collects the feedback information of the voting node, namely Signature [ i](1≤i≤Numv) While according to the Timestamp to Rsource by equation (1):
Figure BDA0002892577220000021
carrying out Hash operation on the obtained Rsource, and then taking the later 32 bits of the character string to convert the character string into an integer to obtain R', which is shown as a formula (2):
R'=StrToInt(SubStringEnd32(Hash(Rsource))) (2)
obtaining R' from (3) a random number R:
R=R'mod Nump(1≤R≤Nump) (3)
preferably, the credibility of a node is quantitatively described by comprehensively considering factors such as the effective block number, the effective vote number, the participation degree and the like of the node, and then the rights and interests of the node are combined to determine whether the node can participate in the consensus process.
Preferably, the main chain node is selected from the set N, and a random number R is obtained by using intermediate data R' obtained in the process of calculating the random number R from the chain production node as a seed of the Meisen rotation algorithmmThen select the number and R from the set NmThe same node as the representative node constitutes the masterAnd (3) a chain.
Preferably, the random number R is generated at a production node of the slave chainmThen writing it into newly generated blocks, after the last slave chain block is generated in each period, collecting all numbers in N and writing R in each blockmThe same node becomes a representative node, and the representative node uploads the confirmed block data in the slave chain to the main chain network, participates in consensus and stores the main chain block to the local.
Another aspect of the present invention provides a master-slave multi-chain inter-chain system based on a voting and credit mechanism, wherein the master-slave multi-chain inter-chain system based on the voting and credit mechanism comprises:
a node generation module: selecting some nodes from the nodes which wish to participate in consensus to form a consensus node set;
a time division module: dividing time into time slices, wherein each time slice is a period, and each period is divided into a plurality of time slots;
a node numbering module: generating a production node number of a block for each time slot;
a main chain generation module: the main chain nodes are responsible for uploading the confirmed block data of the main body in each period to a main chain network, and the main chain nodes form a main chain by realizing consensus on the data;
a data cross-link module: and completing data cross-chain between different slave chains.
Preferably, after the set N is formed, the POVT consensus is used to determine the production number of the generation block of each timeslot, and during this process, a pseudo-random number is generated by running the metson rotation algorithm to generate the number of the representative node constituting the main chain.
Preferably, the master-slave multi-chain cross-chain system based on the voting and credit mechanism is built on a Docker 18.10.
Preferably, the operating system adopted by the master-slave multi-chain cross-chain system based on the voting and credit mechanism is Ubuntu 18.04.
The invention has the beneficial effects that: according to the master-slave multi-chain cross-link method and system based on the voting and credit mechanisms, the voting mechanism is introduced to select the block nodes more fairly, and the computational competition among the nodes is thoroughly avoided; the introduced credit mechanism can ensure the reliability of the nodes participating in consensus and reduce the influence of rights and interests on the allocation of the accounting rights; the behavior of the node can be better restrained by quantitatively evaluating the behavior of the node, so that the node has a concern about malicious behavior; the efficiency of the system is effectively improved, and the difficulty of launching rights and interests smashing attack, double-flower attack, selfish excavation attack and the like to the system is increased.
Drawings
FIG. 1 is a flowchart of a master-slave multi-chain cross-linking method based on voting and credit mechanisms according to the present invention;
FIG. 2 is a flow chart of the POVT consensus algorithm provided by the present invention;
FIG. 3 is a schematic structural diagram of a master-slave multi-chain inter-chain system based on voting and credit mechanisms according to the present invention;
FIG. 4 is a graph of node credit growth;
FIG. 5 is a comparison graph of node trust penalty;
fig. 6 is a graph of the transaction throughput per second TPS of a node.
Detailed Description
For the purpose of describing the embodiments of the present invention in detail, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The invention mainly aims to provide a master-slave multi-chain cross-link method and a system based on a voting and credit mechanism, aiming at solving the problem of how to select block nodes more fairly, thoroughly avoiding computational competition among the nodes, improving the reliability of the nodes participating in consensus and simultaneously reducing the influence of rights and interests on the allocation of accounting rights; the system efficiency is improved, and the technical problems of right and interests smashing attack, double-flower attack and selfish mining attack difficulty of the system are increased.
To achieve the above object, the present invention provides an embodiment, as shown in fig. 1, fig. 1 is a flowchart of a master-slave multi-chain cross-linking method based on a voting and credit mechanism provided by the present invention. The master-slave multi-chain cross-link method based on the voting and credit mechanism comprises the following steps:
selecting some nodes from the nodes which wish to participate in consensus according to the rights and interests of the nodes and the value of STRust to form a consensus node set N { (A1, S1, STRust1), (A2, S2, STRust2) } (An, Sn, STRust);
numbering the nodes in the set;
dividing time into time segments;
the complete process from block output to uplink is completed through POVT consensus from the chain;
generating a pseudo random number by operating a Meisen rotation algorithm to generate a representative node number constituting a main chain;
and the main chain nodes are in consensus on the data through a PBFT algorithm, and the uplink process is completed.
Furthermore, the time is divided into time segments, each time segment is a period (epoch), each period is divided into a plurality of slots (slots), each slot completes a complete process from block output to uplink transmission from the link, and after the last slot of each period is finished, the representative node uploads all the confirmed block data of the period to the main-chain network.
Further, the nodes in the model are divided into 5 roles: common node NoVoting node NvProduction node NpCandidate node NcRepresenting node Nm. Before each period, selecting some nodes from the nodes which want to participate in consensus according to the rights and interests of the nodes and credit values (STrust values) to form a consensus node set N { (a1, S1, STrust1), (a2, S2, STrust2) }, (An, Sn, STrust) wherein the nodes in the set consist of 3 roles:a production node, a voting node, and a candidate node. The production node takes out the transaction from the transaction pool, packages and assembles the transaction into a block, the voting node verifies and votes for the data, and the candidate node is responsible for complementing the service to continue the mission of the role when the production node or the voting node cannot continue to provide the service for some reasons, so that the safety and the stability of the system are ensured.
Further, after the set N is formed, the production node number of each time slot generation block is determined by PoVT consensus, and the Messen rotation algorithm is operated in the process[10]A pseudo-random number is generated to generate a number representing the node that makes up the backbone. The nodes in the set N are allowed to have dual identities of a main chain and a secondary chain at the same time, the main chain node is responsible for uploading the confirmed block data of the main body in each period to a main chain network, and the main chain nodes are identified with each other through a PBFT algorithm to form a main chain.
Further, before each period begins, the system selects some nodes from the nodes that want to participate in consensus according to the rights and interests of the nodes and the value of STrust to form a consensus node set N { (a1, S1, STrust1), (a2, S2, STrust2) … (An, Sn, STrust N) }, wherein the number of nodes in the set N | ═ Nump+Numv+NumcA is the public key address of the node, S is the rights and interests of the node, and the STRust value is the credit value of the node, NumpTo produce the number of nodes, NumvNumber of voting nodes, NumcThe number of the candidate nodes. Numbering the nodes in the set from 1 to NumpBecomes a production node, and has the number Nump+1 to Nump+NumvThe node of (1) is a voting node, and the rest number is NumcBecomes a candidate node, the normal node NoNot participating in consensus but synchronizing the latest data block to local.
As shown in fig. 2, fig. 2 is a flow chart of the POVT consensus algorithm provided in the present invention.
Specifically, the POVT consensus algorithm includes the following steps:
s1: before the period starts, forming a consensus node set according to the rights and interests of the nodes and the STRust value;
s2: from the range (1,2, …, Num) in the setp) Selecting nodes with the same number as the random number R from the production nodes to become block-out nodes; the block-out node takes out some transactions from the transaction pool, packs the transactions into blocks, broadcasts the blocks to the voting nodes and prepares to receive feedback messages of the voting nodes;
s3: after receiving a block verification request sent by a production node, the voting node verifies data in the block, signs and adds a timestamp after the data are verified to be correct, and broadcasts confirmation information; if the data is found to be wrong, broadcasting rejection information;
s4: if the production node receives NumvConfirming messages of the/2 +1 voting nodes indicate that the block is identified, a timestamp for recording the time at the moment is generated, and subsequent operations such as signature and broadcast are carried out on the block; if there is more than Num in the networkvIf the/2 +1 voting nodes send out rejection messages, the production node is judged to have malicious behaviors, the consensus qualification of the node is immediately cancelled, and the production node with the number of R +1 continues the consensus process (if R +1>NumpIf yes, starting from the first production node), and complementing the candidate nodes into new production nodes according to the numbering sequence;
s5: each selected production node is required to be at a time TbIf the block is not finished beyond the time, the number is R +1 (if R + 1)>NumpThen, starting from the first production node) continues to complete the generation of the next block;
s6: after each round of the period is over, the nodes which successfully participate in the consensus get the benefit of the STRust value. Accordingly, a node with malicious behavior is also penalized by reducing the STrust value, and the difficulty of the node subsequently wanting to participate in consensus increases.
Specifically, in step S2, if the generated tile is a created tile, the random number R is 1; if the generated block is a non-generative block, the random number R is generated by the last generation node in the process of generating a new block.
Specifically, the generation process of the random number R is as follows:
the production node submits the block to the voting node and collects the feedback information of the voting node, namely Signature [ i](1≤i≤Numv) While according to the Timestamp to Rsource by equation (1):
Figure BDA0002892577220000071
carrying out Hash operation on the obtained Rsource, and then taking the later 32 bits of the character string to convert the character string into an integer to obtain R', which is shown as a formula (2):
R'=StrToInt(SubStringEnd32(Hash(Rsource))) (2)
obtaining R' from (3) a random number R:
R=R'modNump(1≤R≤Nump) (3)
specifically, in addition to the default value of R for generating the created block being 1, each production node generates a block and also generates a random number R recorded in the block to determine which is the next production node.
Further, the credit mechanism comprehensively considers the effective block number, the effective vote number, the participation degree and other factors of a node, then uses the STRust value to quantitatively describe the credibility of the node, and then combines the rights and interests of the node to decide whether the node can participate in the consensus process.
Specifically, the number of valid output blocks of a node refers to the number of valid blocks generated by the production node in the whole period. If a production node successfully generates a validated block within the time slot belonging to it, the node is deemed to generate a valid block. Otherwise, it is an invalid block. The node effective vote number γ is expressed as:
Figure BDA0002892577220000072
wherein
Figure BDA0002892577220000073
And indicating whether the node i successfully generates the block in the s-th time slot, wherein if the block is successfully generated, the value is 1, and otherwise, the value is 0. t is the time at which the node generates the block, and γ decreases as t increases. c (c is equal to 0, 1)]) Is an adjusting factor, and the influence of the block time can be adjusted according to the practical consideration of the system. and a is a weight, and can be adjusted according to the actual needs of the system.
Specifically, the valid vote number of the node refers to the valid vote number of the node during the whole period, and the valid vote number refers to the valid vote which is determined if the node is signed and confirmed according to requirements after the block is correctly verified and the data are correct. Meanwhile, if the node sends a confirmation ticket to a block, but the network has more than Num in the time slotvAnd 2+1 refusal messages, the voting of the node is considered invalid. The effective number of votes for a node is expressed as:
Figure BDA0002892577220000081
wherein Vi sAnd the node i is represented whether to throw a valid ticket in the s-th time slot, if so, the value is 1, and if not, the value is-1. m is the total number of time slots in the period, and n is the number of time slots actually participated in by the node i in the period. b (b is equal to [0, 1 ]]) Is a regulatory factor.
Specifically, the node participation degree refers to a situation that the node participates in the transaction. The node engagement λ may be expressed as:
Figure BDA0002892577220000082
wherein transThe number of transactions that node i participates in the block generated in the s-th time slot is shown, if node i is one of the sender and the receiver of the transaction, the number is 1, otherwise, the number is 0. f (f is equal to [0, 1 ]]) Is a regulatory factor.
Specifically, the historical credit influence of the node means that the credit value of the node is influenced by the historical credit value and the rights and interests of the node. The historical credit impact epsilon of a node can be expressed as:
Figure BDA0002892577220000083
where Stake represents the rights possessed by the node,
Figure BDA0002892577220000084
represents the credit value of node i before the h-th cycle, g (g ∈ [0, 1 ]]) Is a regulatory factor. The value of epsilon follows
Figure BDA0002892577220000085
The value of (2) is increased, and the influence ratio of the node rights is reduced.
Specifically, the penalty factor is: in order to ensure that the system can operate safely and stably, measures need to be taken to punish some malicious behaviors of the nodes. The penalty factor θ is expressed as:
Figure BDA0002892577220000086
wherein
Figure BDA0002892577220000087
And indicating whether the node i generates an invalid block in the s-th time slot, if so, the invalid block is 1, and otherwise, the invalid block is 0.
Figure BDA0002892577220000088
And whether the node i sends out invalid votes in the s-th time slot or not is represented, and if the invalid votes are sent out, the votes are 1, and if not, the votes are 0. c and d are corresponding regulating factors respectively, and the punishment of the invalid blocks and the invalid tickets can be flexibly adjusted according to the actual needs of the system.
Specifically, the node trust level updating formula is as follows: after the period is finished, the system evaluates the behavior of the consensus node according to the formula and updates the credit value of the consensus node. Credit value update formula
Figure BDA0002892577220000089
Can be expressed as:
Figure BDA0002892577220000091
Wherein
Figure BDA0002892577220000092
To increase the aggressiveness of the node participating in the consensus, the system also gives a credit reward to the node if the node is selected in the set N but does not actually participate in the consensus (e.g., candidate node).
Specifically, if the sturst value drops below the system-set threshold value due to the rogue node, the node is restricted to participate in consensus only at intervals of several cycles, and if the sturst value drops to 0, the node will permanently lose the qualification for participating in consensus.
Further, the main chain node is selected from the set N, and a random number R is obtained by using intermediate data R' obtained in the process of calculating the random number R from the chain production node as a seed of the Messen rotation algorithm (MT19937-32)mThen select the number and R from the set NmThe same node constitutes the main chain as a representative node. RmThe calculation process of (2) is as follows: first assign R' as a seed to MT [0 ]]And (5) recurrently obtaining the remaining 623 states according to the equation (10), and completing the filling of all 624 states.
Figure BDA0002892577220000093
The resulting rotating chain is then traversed and each state bit is processed according to equation (11):
Figure BDA0002892577220000094
wherein the content of the first and second substances,
Figure BDA0002892577220000095
indicating exclusive or operation, m takes on value 397, | | indicating MT [ i |)]High 1 bit of (1) and MT [ i +1]If the combined number is x, the operation rule of xA is as follows:
Figure BDA0002892577220000096
wherein a is 0x9908B0DF, x0The lowest order bit of the number is indicated. Then, the pseudo random number R is obtained by the processing of the formula (13)m':
Figure BDA0002892577220000097
Figure BDA0002892577220000098
Figure BDA0002892577220000099
Figure BDA00028925772200000910
Wherein let x be MT [0 ═ m](u, D) is (11, FFFFFFFF16), (s, b) is (7, 9D2C568016), (t, C) is (15, EFC6000016), and l is 18. Finally, R ism' obtaining R after modulus-taking treatmentm
Rm=Rm'mod|N|(1≤Rm≤|N|) (14)
Wherein | N | is the sum of the numbers of the production nodes, the voting nodes and the candidate nodes in the set N. Selecting node number and RmThe same nodes become main chain nodes, and a main chain is constructed by the main chain nodes to finish the transaction processing on the main chain.
Further, a random number R is generated at a production node of the slave chainmThen written into the newly generated block, the last slave chain in each cycleAfter the block is generated, all numbers in the set N and R written in each blockmThe same node becomes a representative node, and the representative node uploads the confirmed block data in the slave chain to the main chain network, participates in consensus and stores the main chain block to the local. In order to ensure that the slave chain block data stored on the main chain are all real, complete and not tampered, the representative node checks the uploading times of the uploaded slave chain block data before packaging, and only the slave chain block data uploaded by the representative node which is not less than half or more than half of the slave chain block data in the slave chain can be packaged and uplinked by the main chain node. When the main chain node ensures that the packaged information meets the requirements, the main chain node achieves consensus through a PBFT consensus algorithm to complete the complete chain winding process of the information on the main chain.
Furthermore, each slave chain representative node selected as the master chain node in each period uploads the block generated in the slave chain period to the master chain network, participates in master chain consensus, and stores the master chain block to the local network after the consensus is completed, and the master chain block stored by each representative node contains block data from different slave chains for other nodes of the slave chain to query, so that data cross-linking between different slave chains is completed.
For equity shattering attacks: in PoS networks, the probability of a node with lower interest digging out a block is also low. On the other hand, nodes with lower rights are more likely to attempt forking because generating blocks by nodes in a PoS network does not require a large amount of resources, such as power, to be invested, and even if forking fails, only a small amount of rights are lost, and a large amount of benefits are obtained once the attack succeeds. In PoVT, the producer is only responsible for assembling the blocks, and the blocks need to be issued after being confirmed by the voting node, and at most one producer is allowed to generate one block in one slot, so the attacker cannot launch the rights and interests breaking attack.
For selfish mining attacks: after digging out the block, an attacker of the private mine digging chooses not to release the dug-out block, but continues to dig out a new block on the dug-out block, and when the length of the private branch exceeds the length of the main chain, the private branch is released to replace the original main chain to become a new longest chain, so that the attacker obtains more benefits. Such an attack not only seriously impairs the rights of honest miners on the original main chain, but also causes data loss and the like which jeopardize the stability of the blockchain. However, under the PoVT mechanism, the chucker is randomly selected from the production nodes through the voting mechanism, the selection of the production nodes is affected by the stust value, and if the production nodes cannot generate blocks within a predetermined time, not only the reward of not obtaining the stust value but also the stust value is reduced, which results in a reduction in the probability of the nodes becoming common nodes thereafter, thereby making the attack difficult to succeed.
For the double blossom attack: a double-flower attack is a threat that must be addressed by all blockchain networks. The traditional double-flower attack comprises the following steps: (1) an attacker initiates a transaction; (2) after the transaction is linked, the attacker creates a fork containing the new transaction on a block before the transaction; (3) when the length of the fork exceeds the original main chain, the attacker releases the fork to replace the original main chain into a new longest chain, and the original transaction is replaced by a new exchange. In the master-slave multi-chain hierarchical chain-crossing system, the block data of the slave chain is not only stored on the slave chain link point, but also uploaded to the main chain through the proxy node, and after the main chain is identified, the main chain block is formed and stored in the main chain node. If a double-flower attack is to be initiated, not only the block information of the slave chain but also the block information on the corresponding main chain node needs to be changed, so that the cost is huge, and the attack is difficult to realize.
Fig. 3 is a schematic structural diagram of a master-slave multi-chain inter-chain system based on voting and credit mechanisms according to the present invention. In the examples: a master-slave multi-chain hierarchical cross-chain prototype (model) system with a slave chain based on PoVT and a main chain based on Fabric is built on Docker18.10, and an experimental operating system is Ubuntu 18.04. The main test purpose of the experiment is to test the transaction processing speed per second, node credit value increase and penalty of node credit value after malignancy of the master-slave multi-chain cross-chain hierarchical consensus mechanism. We set the experimental nodes to 11, respectively 5 voting nodes, 4 production nodes, 2 candidate nodes, and we divide one cycle into 10 slots, and each slot goes through the whole process of block-out to uplink. We set the threshold for the STrust value to 30, and when the STrust value of a node is below 30 we set that the node must go through the consensus every 5 cycles.
Furthermore, in order to adjust the credit value increase of the system node more flexibly, weights are set for parameters participating in credit value evaluation. The roles of the nodes participating in the consensus in each cycle and the roles of the nodes participating in the consensus are different, so that a certain node is selected to participate in the increase of the credit value of the consensus under different weights. FIG. 4 is a graph of node credit growth, as shown in FIG. 4; the weights are given values of 1, 0.5 and 0.1 respectively. It can be seen that the weight can better adjust the increase of the STrust value of the node, and when the weight is higher, the STrust value of the node can quickly rise to finally reach the maximum STrust value 300 set by us. Meanwhile, as the weight is reduced, the sturst value of the node becomes slowly increased, but eventually reaches a maximum value. The method ensures the stability of systems with different node scales, and can increase the weight when the node scale is smaller, and reduce the weight in a network with larger node scale, so that the growth speed of the STRust of the nodes in the network can be kept approximately the same, and the situation that the STRust value of a few nodes grows too fast to endanger the safety and the stability of the system can be avoided.
Further, if the node normally participates in consensus, the STrust value will keep a growing state, but if the node has bad behaviors while participating in consensus, such as the voting node fails to vote honestly and the block packed by the node contains tampered transactions, the node immediately loses the consensus qualification of the period, and is punished by the decrease of the STrust value at the end of the period. As shown in fig. 5, fig. 5 is a graph comparing trust penalties of nodes; line 2 represents the change of the STRust value when the node normally participates in consensus, and the STRust value of the node reaches the maximum value in the 40 th period; line 3 normally participates in consensus during the first 15 cycles, and the node starts to perform rogue during the 15 th cycle, when the Strust value of the node rapidly drops to 30, and thereafter the node is limited to participate in consensus only every 5 cycles, and when the node continues to perform rogue, the node is permanently deprived of the qualification for participating in consensus when the stust value drops to 0; from line 1, it can be seen that the node starts to participate in consensus normally at the 35 th cycle, but the value of STrust is not increased to be more than 30 until the 45 th cycle, and the STrust of the node participating in consensus normally reaches the maximum value, so that it can be seen that the node goes bad at the expense of huge STrust value, which affects the difficulty of the node participating in consensus, and is a very obvious irrevocable behavior.
Further, as shown in fig. 6, fig. 6 is a graph of transaction throughput per second TPS of a node; transaction throughput per second, i.e., the number of transactions packed with tiles divided by the time the tiles were generated, can measure the transaction processing performance of the system. We have performed a total of 50 cycles to generate a total of 500 blocks. The Etherhouse network in the experiment adopts standard setting, generates a block every 15 seconds on average, and sets T of a slave chainbThe value is 10, i.e. one block is generated every 10 seconds, and the experimental results are shown in fig. 5. The TPS in the standard etherhouse network was found to average 49, while the TPS in the singleton chain with PoVT fluctuated around 60 with an average 63. Whereas TPS in a backbone network with PBFT consensus fluctuated around 45 with an average value of 47. It can be seen that the transaction processing speed of the slave chain using PoVT is better than that of the ethernet network and that of the entire cross-chain model is ideal.
In the above embodiments, the basic principle and the main features of the present invention and the advantages of the present invention are described. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are merely illustrative of the principles of the invention, and that modifications and variations can be made by one skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (6)

1. A master-slave multi-chain cross-chain method based on a voting and credit mechanism is characterized by comprising the following steps:
selecting some nodes from the nodes which wish to participate in consensus according to the rights and the STrust values of the nodes to form a consensus node set N { (a1, S1, STrust1), (a2, S2, STrust2) · (An, Sn, STrust) }, wherein a is the public key address of the node, S is the rights and the STrust value is the credit value of the node, and the nodes in the consensus node set N consist of 3 roles: the system comprises a production node, a voting node and a candidate node, wherein the production node takes out transactions from a transaction pool, packages and assembles the transactions into a block, the voting node verifies and votes data, and the candidate node is responsible for complementing the data to be a role for continuous operation when the production node or the voting node cannot continuously provide services, so that the safety and the stability of the system are ensured;
numbering the nodes in the set from 1 to NumpBecomes a production node, and has the number Nump+1 to Nump+NumvThe node of (1) is a voting node, and the rest number is NumcBecomes a candidate node, the normal node NoNot participating in consensus but synchronizing the latest data block to the local; wherein, NumpTo produce the number of nodes, NumvNumber of voting nodes, NumcThe number of the candidate nodes is;
dividing time into time segments, wherein each time segment is a period, each period is divided into a plurality of time slots, and each time slot completes a complete process from block output to uplink from a chain;
the complete process from block output to uplink is completed through POVT consensus from the chain;
generating a pseudo random number by operating a Meisen rotation algorithm to generate a representative node number constituting a main chain;
the main chain nodes are identified by the PBFT algorithm to finish the chain winding process;
wherein, the POVT consensus comprises the following steps:
from the range of (1,2, …, Num) in the consensus node setp) Selecting nodes with the same number as the random number R from the production nodes to become block-out nodes;
after receiving a block verification request sent by a production node, the voting node verifies the data in the block; according to the message received by the production node, selecting a timestamp for recording the time at the moment, or immediately canceling the consensus qualification of the node;
judging whether the block-out time of each selected production node exceeds the set time Tb
After each round of the period is over, the nodes which successfully participate in the consensus get the benefit of the STRust value.
2. The master-slave multi-chain crossing method based on the voting and credit mechanism as claimed in claim 1, wherein after the block extraction node extracts the trade from the trade pool and packs the trade into a block, the block is broadcasted to the voting node and ready to receive the feedback message of the voting node, and if the generated block is a created block, the random number R is 1; if the generated block is a non-generative block, the random number R is generated by the last generation node in the process of generating a new block.
3. The master-slave multi-chain cross-chain method based on the voting and credit mechanism of claim 1, wherein the generation process of the random number R is as follows:
the production node submits the block to the voting node and collects the feedback information of the voting node, namely Signature [ i](1≤i≤Numv) And simultaneously obtaining Rsource according to the Timestamp by the formula (1):
Figure FDA0003540926130000021
performing hash operation on the obtained Rsource according to the formula (2), and then taking the last 32 bits of the character string to convert the character string into an integer to obtain R':
R'=StrToInt(SubStringEnd32(Hash(Rsource))) (2)
obtaining R' from formula (3) as a random number R:
R=R'mod Nump(1≤R≤Nump) (3)。
4. the master-slave multi-chain crossing method based on the voting and credit mechanism as claimed in claim 1, wherein the number of valid blocks, the number of valid votes and the participation degree of a node are considered comprehensively, the stust value is used to quantitatively describe the credibility of a node, and the rights and interests of the node are combined to determine whether the node can participate in the consensus process.
5. The master-slave multi-chain crossing method based on the voting and credit mechanism as claimed in claim 1, wherein the main chain node is selected from the set N, and the intermediate data R' obtained in the process of calculating the random number R from the chain production node is used as a seed of the Meisen rotation algorithm to obtain a random number RmThen select the number and R from the set NmThe same node constitutes the main chain as a representative node.
6. A master-slave multi-chain cross-chain method based on voting and credit mechanisms, as claimed in claim 5, wherein the random number R is generated at the production node of the slave chainmThen writing it into newly generated blocks, after the last slave chain block is generated in each period, collecting all numbers in N and writing R in each blockmThe same node becomes a representative node, and the representative node uploads the confirmed block data in the slave chain to the main chain network, participates in consensus and stores the main chain block to the local.
CN202110031705.XA 2021-01-11 2021-01-11 Master-slave multi-chain cross-link method and system based on voting and credit mechanism Active CN112804101B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110031705.XA CN112804101B (en) 2021-01-11 2021-01-11 Master-slave multi-chain cross-link method and system based on voting and credit mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110031705.XA CN112804101B (en) 2021-01-11 2021-01-11 Master-slave multi-chain cross-link method and system based on voting and credit mechanism

Publications (2)

Publication Number Publication Date
CN112804101A CN112804101A (en) 2021-05-14
CN112804101B true CN112804101B (en) 2022-04-29

Family

ID=75809816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110031705.XA Active CN112804101B (en) 2021-01-11 2021-01-11 Master-slave multi-chain cross-link method and system based on voting and credit mechanism

Country Status (1)

Country Link
CN (1) CN112804101B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113572825B (en) * 2021-07-09 2023-03-21 中国科学院计算技术研究所 Access control and resource access control method and system for relay chain cross-link architecture
CN113672987B (en) * 2021-09-06 2023-09-05 上海万向区块链股份公司 Method and system for selecting packet type billing node under PoW mechanism
CN114025012B (en) * 2022-01-10 2022-03-22 国网电子商务有限公司 Node selection method, device, storage medium and equipment based on credit grouping
CN114048515B (en) * 2022-01-11 2022-03-22 四川大学 Medical big data sharing method based on federal learning and block chain

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104662838A (en) * 2012-09-27 2015-05-27 惠普发展公司,有限责任合伙企业 Transmit specific traffic along blocked link
CN106445711A (en) * 2016-08-28 2017-02-22 杭州云象网络技术有限公司 Byzantine-fault-tolerant consensus method applied to block chain
CN110351067A (en) * 2019-06-12 2019-10-18 南京理工大学 For the block chain common recognition mechanism of principal and subordinate's multichain

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200059369A1 (en) * 2017-05-16 2020-02-20 Peking University Shenzhen Graduate School Determining consensus by parallel proof of voting in consortium blockchain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104662838A (en) * 2012-09-27 2015-05-27 惠普发展公司,有限责任合伙企业 Transmit specific traffic along blocked link
CN106445711A (en) * 2016-08-28 2017-02-22 杭州云象网络技术有限公司 Byzantine-fault-tolerant consensus method applied to block chain
CN110351067A (en) * 2019-06-12 2019-10-18 南京理工大学 For the block chain common recognition mechanism of principal and subordinate's multichain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Blockchain Dividing Based on Node Community Clustering in Intelligent Manufacturing CPS;Suisheng Li;《2019 IEEE International Conference on Blockchain (Blockchain)》;20191231;全文 *

Also Published As

Publication number Publication date
CN112804101A (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN112804101B (en) Master-slave multi-chain cross-link method and system based on voting and credit mechanism
Yu et al. Repucoin: Your reputation is your power
CN109842606B (en) Block chain consensus algorithm and system based on consistent Hash algorithm
CN109982435B (en) Spectrum access and management method based on block chain
Szalachowski et al. {StrongChain}: Transparent and Collaborative {Proof-of-Work} Consensus
CN111090892A (en) Block chain consensus method and device based on VRF and threshold signature
CN110351067B (en) Block chain consensus method for master-slave multi-chains
CN111988137B (en) DPoS (dual port service) consensus method and system based on threshold signature and fair reward
CN109039646B (en) Block chain block packaging and verifying method and system based on node capability
CN112104482B (en) Consensus method based on parallel voting
US11157899B1 (en) System and method for bootstrapping a separate proof of work chain
CN110611701A (en) Parameter configuration and transaction processing method based on block chain
CN113407632A (en) PBFT (proxy-based policy and authorization-based ft) trust certification block chain consensus algorithm
CN112468255B (en) Block link point time synchronization method based on network consensus and VRF algorithm
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
CN112769936B (en) POVT consensus algorithm based on voting and credit mechanism
CN113422805B (en) Fragment consensus method based on verifiable random function
CN112651830A (en) Block chain consensus method applied to power resource sharing network
Wang et al. Game-theoretical analysis of mining strategy for bitcoin-ng blockchain protocol
Shi et al. Pooling is not favorable: Decentralize mining power of PoW blockchain using age-of-work
US11354629B1 (en) Controlling initiation of a blockchain election using a burn quota
Reijsbergen et al. Laksa: A probabilistic proof-of-stake protocol
US11290280B1 (en) Cryptocurrency mining using a single-leader election algorithm
CN115189871A (en) Byzantine fault-tolerant consensus algorithm based on verifiable random function and threshold signature
WO2020199179A1 (en) Method and apparatus for determining consensus node, and computer device and 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