CN112991068A - Method and device for sharing DPoS (certificate of authority) common identification, electronic equipment and storage medium - Google Patents

Method and device for sharing DPoS (certificate of authority) common identification, electronic equipment and storage medium Download PDF

Info

Publication number
CN112991068A
CN112991068A CN202110550794.9A CN202110550794A CN112991068A CN 112991068 A CN112991068 A CN 112991068A CN 202110550794 A CN202110550794 A CN 202110550794A CN 112991068 A CN112991068 A CN 112991068A
Authority
CN
China
Prior art keywords
state
node
nodes
credit
value
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.)
Granted
Application number
CN202110550794.9A
Other languages
Chinese (zh)
Other versions
CN112991068B (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.)
Zhuo Erzhi Lian Wuhan Research Institute Co Ltd
Original Assignee
Zhuo Erzhi Lian Wuhan Research Institute 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 Zhuo Erzhi Lian Wuhan Research Institute Co Ltd filed Critical Zhuo Erzhi Lian Wuhan Research Institute Co Ltd
Priority to CN202110550794.9A priority Critical patent/CN112991068B/en
Publication of CN112991068A publication Critical patent/CN112991068A/en
Application granted granted Critical
Publication of CN112991068B publication Critical patent/CN112991068B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction

Abstract

The embodiment of the invention discloses a share authorization certification (DPoS) consensus method, a device, electronic equipment and a storage medium, which are applied to a block chain network, wherein the block chain network comprises nodes in a normal state, a good state, an abnormal state or a malicious state, and the method comprises the following steps: acquiring a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; under the condition that the new block meets a preset condition, converting the first state of the first node into a second state, and obtaining an initial credit value of the first node in the second state; the initial credit value characterizes a degree of trust of the first node in the second state; obtaining a voting result of the new block, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining credit values of the other nodes; and determining the second node with the credit value smaller than a preset threshold value, and deleting the second node.

Description

Method and device for sharing DPoS (certificate of authority) common identification, electronic equipment and storage medium
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a method and an apparatus for sharing a certificate of authority (DPoS), an electronic device, and a storage medium.
Background
The common identification method of the current blockchain mainly comprises Proof of workload (Proof of Work, PoW), Proof of rights and interests (Proof of stamp, PoS), and Proof of equity grant (Delegate Proof of stamp, DPos). The PoW consensus method is mature, integrity of data and safety of the data are guaranteed through computing power competition of distributed nodes, but resource waste is caused by strong computing power, mainly power resources are used, and 10-minute transaction confirmation time is not suitable for commercial application of small-amount transactions. The PoS consensus method obtains accounting rights by nodes in the system that have the highest rights, rather than the highest power, in terms of node ownership in a particular currency. The PoS solves the problem of wasted PoW calculation to some extent and can shorten the time to reach consensus, but its credit base is not firm enough and there is a risk of monopoly. DPoS is a democratic centralized accounting mode, and representatives are voted by nodes in the system and are accounted. The DPoS can solve the problem that energy is wasted by PoW, can make up the defect that participants with accounting rights and interests in PoS do not necessarily want to participate in accounting, but cannot timely, effectively and accurately diagnose malicious nodes and reject malicious nodes in the proxy node set, so that potential safety hazards are caused to a network. However, no effective solution is available at present for the above problems.
Disclosure of Invention
In view of the above, embodiments of the present invention are intended to provide a method, an apparatus, an electronic device, and a storage medium for certification of authority of shares (DPoS) consensus.
The technical embodiment of the invention is realized as follows:
the embodiment of the invention provides a share authorization certification (DPoS) consensus method, which is applied to a block chain network, wherein the block chain network comprises nodes in a normal state, a good state, an abnormal state or a malicious state, and the method comprises the following steps:
acquiring a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is any one of the nodes;
under the condition that the new block meets a preset condition, converting the first state of the first node into a second state, and obtaining an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state;
obtaining a voting result of the new block, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining credit values of the other nodes; the other nodes are nodes except the first node in the nodes;
determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is a node of the other node.
In the foregoing solution, the converting the first state of the first node into the second state when the new block meets a preset condition, and obtaining an initial credit value of the first node in the second state includes:
when the new block meets the condition that the new block is an effective block and the number of the effective blocks is greater than a first preset threshold value, converting the normal state of the first node into the good state, and obtaining an initial credit value of the first node in the good state; the valid block characterizes the new transaction as not creating a conflict.
In the foregoing solution, the converting the first state of the first node into the second state when the new block meets a preset condition, and obtaining an initial credit value of the first node in the second state includes:
when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold value, converting the first node from the normal state to the abnormal state and converting the first node from the good state to the abnormal state, and obtaining an initial credit value of the first node in the abnormal state; the invalid block characterizes the new transaction as conflicting.
In the foregoing solution, the converting the first state of the first node into the second state when the new block meets a preset condition, and obtaining an initial credit value of the first node in the second state includes:
when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold value, converting the abnormal state of the first node into the malicious state, and obtaining an initial credit value of the first node in the malicious state; the invalid block characterizes the new transaction as conflicting.
In the above scheme, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining the credit values of the other nodes includes:
performing credit punishment on other nodes according to the voting result and the initial credit value to obtain credit punishment values of the other nodes;
obtaining credit reward values for the other nodes;
and determining the credit value of the other node according to the credit punishment value and the credit reward value.
An embodiment of the present invention provides a share authorization certification (DPoS) consensus device, which is applied to a block chain network, where the block chain network includes nodes in a normal state, a good state, an abnormal state, or a malicious state, and the device includes: an obtaining unit, a converting unit and a determining unit, wherein:
the obtaining unit is configured to obtain a first node in the blockchain network and a new block generated by a new transaction occurring in the blockchain network; the first node is any one of the nodes;
the conversion unit is configured to convert the first state of the first node into a second state when the new block obtained by the obtaining unit meets a preset condition, and obtain an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state;
the determining unit is configured to obtain a voting result of the new block, perform credit reward and punishment on other nodes according to the voting result and the initial credit value obtained by the converting unit, and determine credit values of the other nodes; the other nodes are nodes except the first node in the nodes; determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is a node of the other node.
In the foregoing solution, the converting unit is further configured to convert the first node from the normal state to the good state and obtain an initial credit value of the first node in the good state when the new block satisfies that the new block is an effective block and the number of the effective blocks is greater than a first preset threshold; the valid block characterizes the new transaction as not creating a conflict.
In the foregoing solution, the converting unit is further configured to, when the new block satisfies that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold, convert the normal state of the first node into the abnormal state and convert the good state of the first node into the abnormal state, and obtain an initial credit value of the first node in the abnormal state; the invalid block characterizes the new transaction as conflicting.
In the foregoing scheme, the converting unit is further configured to convert the abnormal state of the first node into the malicious state and obtain an initial credit value of the first node in the malicious state when the new block satisfies that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold; the invalid block characterizes the new transaction as conflicting.
In the above scheme, the determining unit is further configured to perform credit penalty on other nodes according to the voting result and the initial credit value, and obtain credit penalty values of the other nodes; obtaining credit reward values for the other nodes; and determining the credit value of the other node according to the credit punishment value and the credit reward value.
An embodiment of the present invention provides an electronic device, including: a processor and a memory for storing a computer program operable on the processor, wherein the processor is operable to perform any of the steps of the method described above when executing the computer program.
Embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements any of the steps of the above-mentioned method.
The invention provides a share authorization certification (DPoS) consensus method, a device, an electronic device and a storage medium, wherein a first node in a block chain network and a new block generated by new transaction in the block chain network are obtained; the first node is any one of the nodes; under the condition that the new block meets a preset condition, converting the first state of the first node into a second state, and obtaining an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state; obtaining a voting result of the new block, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining credit values of the other nodes; the other nodes are nodes except the first node in the nodes; determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is the node of the other nodes, so that malicious nodes can be timely, effectively and accurately diagnosed, malicious nodes in the proxy node set are eliminated, and potential safety hazards to the network are avoided.
Drawings
Fig. 1 is a schematic flow chart of a DPoS consensus method according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating node state transition in the DPoS consensus method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a configuration structure of a DPoS consensus device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware entity structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, to enable embodiments of the invention described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present invention, terms and expressions mentioned in the embodiments of the present invention are explained, and the terms and expressions mentioned in the embodiments of the present invention are applied to the following explanations.
1) The signature, namely the digital signature, is a section of digital string which can be generated only by a sender of the information and cannot be forged by others, and is also a valid proof for the authenticity of the information sent by the sender of the information; digital signatures typically define two complementary operations, one for signing and the other for verification, the application of asymmetric key cryptography and digital digest technology.
2) In response to the condition or state on which the performed operation depends, one or more of the performed operations may be in real-time or may have a set delay when the dependent condition or state is satisfied; there is no restriction on the order of execution of the operations performed unless otherwise specified.
3) Transactions (transactions), equivalent to the computer term "Transaction," include operations that need to be committed to a blockchain network for execution and do not refer solely to transactions in the context of commerce, which embodiments of the present invention follow in view of the convention colloquially used in blockchain technology.
For example, a deployment (deployment) transaction is used to install a specified smart contract to a node in a blockchain network and is ready to be invoked; the Invoke (Invoke) transaction is used to append records of the transaction in the blockchain by invoking the smart contract and to perform operations on the state database of the blockchain, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (i.e., querying key-value pairs in the state database).
4) A Block chain (Blockchain) is a storage structure for encrypted, chained transactions formed from blocks (blocks).
5) A Blockchain Network (Blockchain Network) incorporates new blocks into a set of nodes of a Blockchain in a consensus manner.
6) Ledger (legger) is a general term for blockchains (also called Ledger data) and state databases synchronized with blockchains. Wherein, the blockchain records the transaction in the form of a file in a file system; the state database records the transactions in the blockchain in the form of different types of Key (Key) Value pairs for supporting fast query of the transactions in the blockchain.
7) Intelligent Contracts (Smart Contracts), also known as chain codes (chaincodes) or application codes, are programs deployed in nodes of a blockchain network, and the nodes execute the intelligent Contracts called in received transactions to perform operations of updating or querying key-value data of a state database.
8) Consensus (Consensus), a process in a blockchain network, is used to agree on transactions in a block among a plurality of nodes involved, the agreed block is to be appended to the end of the blockchain, and the mechanisms for achieving Consensus include Proof of workload (PoW, Proof of Work), Proof of rights and interests (PoS, Proof of equity (DPoS), Proof of granted of shares (DPoS), Proof of Elapsed Time (PoET, Proof of Elapsed Time), and so on.
Based on the above explanations of terms and terms involved in the embodiments of the present invention, it is described below that the present embodiment provides a share authorization verification (DPoS) consensus method, which is applied to a blockchain network, where the blockchain network includes nodes in a normal state, a good state, an abnormal state, or a malicious state, fig. 1 is a schematic flow diagram of an implementation process of the DPoS consensus method according to the embodiments of the present invention, and as shown in fig. 1, the method includes:
step S101: acquiring a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is any one of the nodes.
It should be noted that the number of the nodes in the blockchain network is multiple, and the state of each node has a normal state, a good state, an abnormal state or a malicious state; the normal state may represent an initial state of the node, where the node does not generate invalid transactions, or may be understood as the node does not generate invalid blocks, and the credit value is generally 170-; the normal state may represent an initial state of the node, where the node does not generate invalid transactions, or may be understood as the node does not generate invalid blocks, and the credit value is generally 170-; the good status may indicate that a node generates valid transactions, or may be understood as that the node has a valid block, and the credit value is generally 150-; the abnormal state can represent that the node has invalid transactions, and can also be understood as that the node has invalid blocks, the number of the invalid blocks is less than or equal to a preset threshold, and the credit value is generally 150-; the malicious state can represent that the node generates invalid transactions, and can also be understood as that the node generates invalid blocks, the number of the invalid blocks is greater than a preset threshold, and the credit value is generally less than 150; in practical applications, the normal state may be denoted AS NS, the good state may be denoted AS GS, the abnormal state may be denoted AS, and the malicious state may be denoted AS ES. The first node is any one of a plurality of nodes. Obtaining the first node in the blockchain network may be obtaining any node in the blockchain network.
Obtaining a new block generated by a new transaction occurring in the blockchain network can be understood as that the new transaction occurring in the blockchain network, accounting is performed by nodes in the whole network in a competition mode, and all information of the transaction is recorded in the new block generated by the new transaction occurring in the blockchain network by the nodes in the competition mode.
Step S102: under the condition that the new block meets a preset condition, converting the first state of the first node into a second state, and obtaining an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state.
It should be noted that the preset condition represents whether the new block is a valid block, and the number of times the new block is generated. In practical applications, one new block is generated once, and a plurality of new blocks are generated after a plurality of new blocks are generated, i.e. the number of times of generating new blocks corresponds to the number of new blocks. As an example, the preset conditions may include a first preset condition, a second preset condition, and a third preset condition;
the first preset condition may be that the new block is an effective block, and the number of the effective blocks is greater than a first preset threshold; the first preset threshold may be determined according to an actual situation, and is not limited herein. As an example, the first preset threshold may be 10 times; correspondingly, when the new block meets a preset condition, the first state of the first node is converted into the second state, and obtaining the initial credit value of the first node in the second state may be converting the first state of the first node into the second state when the new block meets the first preset condition, so as to obtain the initial credit value of the first node in the second state. Specifically, when the new block satisfies that the new block is an effective block and the number of the effective blocks is greater than a first preset threshold, the first node is switched from the normal state to the good state, and an initial credit value of the first node in the good state is obtained; that is, in the case where the new block satisfies the first preset condition, a node in a normal state in the block chain network may be converted into a node in a good state. The obtaining of the initial credit value of the first node in the good state may be determined according to actual situations, and is not limited herein. As an example, the initial credit value of the first node in the good state may be 190.
The second preset condition may be that the new block is an invalid block, and the number of the invalid blocks is less than or equal to a second preset threshold, where the second preset threshold may be determined according to an actual situation, and is not limited herein. As an example, the second preset threshold may be 3 times; correspondingly, when the new block meets a preset condition, the first state of the first node is converted into the second state, and obtaining the initial credit value of the first node in the second state may be converting the first state of the first node into the second state when the new block meets the second preset condition, so as to obtain the initial credit value of the first node in the second state. Specifically, when the new block satisfies that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold, the first node is converted from the normal state to the abnormal state and the first node is converted from the good state to the abnormal state, so as to obtain an initial credit value of the first node in the abnormal state; that is, in the case where the new block satisfies the second preset condition, a node in a normal state in the block chain network may be converted into a node in an abnormal state and a node in a good state may be converted into a node in an abnormal state. The obtaining of the initial credit value of the first node in the abnormal state may be determined according to an actual situation, and is not limited herein. As an example, the initial credit value of the first node in the abnormal state may be 150.
The third preset condition may be that the new block is an invalid block, and the number of the invalid blocks is greater than a second preset threshold, where the second preset threshold may be determined according to an actual situation, and is not limited herein. As an example, the second preset threshold may be 3 times; correspondingly, when the new block meets a preset condition, the first state of the first node is converted into the second state, and the obtained initial credit value of the first node in the second state may be obtained by converting the first state of the first node into the second state and obtaining the initial credit value of the first node in the second state when the new block meets a third preset condition. Specifically, when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold, the first node is converted from the abnormal state to the malicious state, and an initial credit value of the first node in the malicious state is obtained; that is, in the case where the new block satisfies the third preset condition, a node in an abnormal state in the blockchain network may be converted into a node in a malicious state. The obtaining of the initial credit value of the first node in the malicious state may be determined according to actual situations, and is not limited herein. As an example, the initial credit value of the first node in the malicious state may be 145.
Step S103: obtaining a voting result of the new block, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining credit values of the other nodes; the other nodes are nodes except the first node.
Here, the obtaining of the voting result of the new block may be obtaining of the voting result of a node in a normal state, a node in a good state, and a node in an abnormal state corresponding to the new block; wherein the voting result comprises a positive vote and a negative vote.
And performing credit punishment on other nodes according to the voting result and the initial credit value, and determining the credit values of the other nodes by performing credit punishment and credit reward on the other nodes according to the voting result and the initial credit value.
As an example, credit penalties and credit rewards are performed on other nodes according to the voting results and the initial credit values, and determining the credit values of the other nodes may be to perform credit penalties on the other nodes according to the voting results and the initial credit values to obtain the credit penalty values of the other nodes; obtaining credit reward values for the other nodes; and determining the credit value of the other node according to the credit punishment value and the credit reward value.
For convenience of understanding, the first node is the ith node, the other nodes are the (i + 1) th nodes, and the voting result is recorded as
Figure 100252DEST_PATH_IMAGE001
Said initial credit value is recordedIs composed of
Figure 585592DEST_PATH_IMAGE002
And the credit penalty value of the other nodes is recorded as
Figure 752743DEST_PATH_IMAGE003
Then, then
Figure 665336DEST_PATH_IMAGE001
Can be represented by the following formula (1),
Figure 491340DEST_PATH_IMAGE003
can be represented by the following formula (2):
Figure 780370DEST_PATH_IMAGE004
(1)
Figure 539379DEST_PATH_IMAGE005
(2)
in the formula (2), t is the time interval from the beginning of the last vote to the next vote; u represents the speed of decreasing the credit value, and is a constant, and may be determined according to actual conditions, and is not limited herein. As an example, U may be 2; t represents a time constant, when T is less than T, namely the time interval between two times of voting is less than T, the credit value of the node is not changed, on the contrary, the credit value is reduced, and the time T is reset after the node votes successfully, namely T =0, so as to encourage the node to participate in voting;
Figure 903100DEST_PATH_IMAGE001
represents a penalty for nodes with malicious voting behaviors in the voting process.
The credit reward of the other node may be recorded as
Figure 747559DEST_PATH_IMAGE006
Then, then
Figure 574701DEST_PATH_IMAGE006
Can be represented by the following formula (3):
Figure 719375DEST_PATH_IMAGE007
(3)
in the formula (3), the reaction mixture is,
Figure 973770DEST_PATH_IMAGE008
the credit reward for the ith node may be determined according to actual conditions, and is not limited herein. As an example of the manner in which the device may be used,
Figure 302595DEST_PATH_IMAGE008
may be 0.
And determining the credit values of the other nodes according to the credit penalty value and the credit reward value by performing preset operation on the credit penalty value and the credit reward value to determine the credit values of the other nodes. The preset operation may be determined according to an actual situation, and is not limited herein. As an example, the preset operation may be an addition operation. For convenience of understanding, it is assumed that the credit values of the other nodes are recorded as
Figure 667849DEST_PATH_IMAGE009
Said credit penalty value is recorded as
Figure 135870DEST_PATH_IMAGE003
Said credit award value is recorded as
Figure 561166DEST_PATH_IMAGE006
Then, then
Figure 645797DEST_PATH_IMAGE009
Can be represented by the following formula (4):
Figure 80321DEST_PATH_IMAGE010
(4)
step S104: determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is a node of the other node.
Here, the preset threshold is determined according to actual conditions, and is not limited herein. The preset threshold may be a credit value corresponding to a node in a malicious state. For convenience of understanding, it is assumed that the credit value corresponding to the node in the malicious state is lower than 150, that is, the credit value corresponding to the node in the malicious state is less than 150, and the preset threshold may be 150.
Determining a second node with the credit value smaller than a preset threshold, wherein deleting the second node can be understood as selecting a node with the credit value smaller than the preset threshold according to the credit values of the other nodes, taking the node as the second node, and deleting the second node; wherein the second node can be understood as a node in a malicious state.
In the DPoS consensus method provided by the embodiment of the present invention, a first node in the block chain network and a new block generated by a new transaction in the block chain network are obtained; the first node is any one of the nodes; under the condition that the new block meets a preset condition, converting the first state of the first node into a second state, and obtaining an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state; obtaining a voting result of the new block, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining credit values of the other nodes; the other nodes are nodes except the first node in the nodes; determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is the node of the other nodes, so that malicious nodes can be timely, effectively and accurately diagnosed, malicious nodes in the proxy node set are eliminated, and potential safety hazards to the network are avoided.
In an optional embodiment of the present invention, the converting the first state of the first node to the second state in a case that the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state includes: when the new block meets the condition that the new block is an effective block and the number of the effective blocks is greater than a first preset threshold value, converting the normal state of the first node into the good state, and obtaining an initial credit value of the first node in the good state; the valid block characterizes the new transaction as not creating a conflict.
It should be noted that the valid block may be understood as a transaction without conflict, i.e. the transaction is successful, and data is recorded.
The first preset threshold may be determined according to actual conditions, and is not limited herein. As an example, the first preset threshold may be 10 times;
and under the condition that the new block meets the condition that the new block is an effective block and the number of the effective blocks is greater than a first preset threshold value, converting the first node from the normal state to the good state, and obtaining the initial credit value of the first node in the good state can be understood as converting the normal state nodes in the block chain network into the good state nodes under the condition that the new block meets the condition that the new block is an effective block and the number of the effective blocks is greater than the first preset threshold value, so as to obtain the initial credit value of the good state nodes in the block chain network. The initial credit value of the good-state node may be determined according to actual conditions, and is not limited herein. As an example, the initial credit value of the good state node may be 190.
In practical applications, one new block is generated once, and a plurality of new blocks are generated after a plurality of new blocks are generated, i.e. the number of times of generating new blocks corresponds to the number of new blocks.
In an optional embodiment of the present invention, the converting the first state of the first node to the second state in a case that the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state includes: when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold value, converting the first node from the normal state to the abnormal state and converting the first node from the good state to the abnormal state, and obtaining an initial credit value of the first node in the abnormal state; the invalid block characterizes the new transaction as conflicting.
It should be noted that the invalid block may be understood as a transaction conflict. The second preset threshold may be determined according to an actual situation, and is not limited herein. As an example, the second preset threshold may be 3 times.
When the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold, converting the normal state of the first node into the abnormal state and converting the good state of the first node into the abnormal state, and obtaining the initial credit value of the first node in the abnormal state can be understood as that when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is less than or equal to the second preset threshold, converting all the nodes in the normal state in the block chain network into the nodes in the abnormal state and converting all the nodes in the good state in the block chain network into the nodes in the abnormal state, and obtaining the initial credit value of the nodes in the abnormal state in the block chain network. The initial credit value of the node in the abnormal state may be determined according to an actual situation, which is not limited herein. As an example, the initial credit value of the node in the abnormal state may be 150.
In practical applications, one new block is generated once, and a plurality of new blocks are generated after a plurality of new blocks are generated, i.e. the number of times of generating new blocks corresponds to the number of new blocks.
In an optional embodiment of the present invention, the converting the first state of the first node to the second state in a case that the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state includes: when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold value, converting the abnormal state of the first node into the malicious state, and obtaining an initial credit value of the first node in the malicious state; the invalid block characterizes the new transaction as conflicting.
It should be noted that the invalid block indicates that the new transaction generates a conflict, i.e., the invalid block may be understood as a new transaction conflict. The second preset threshold may be determined according to an actual situation, and is not limited herein. As an example, the second preset threshold may be 3 times.
And under the condition that the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold value, converting the first node from the abnormal state into the malicious state, and obtaining the initial credit value of the first node in the malicious state can be understood as converting all the nodes in the abnormal state in the blockchain network into the nodes in the malicious state under the condition that the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is greater than the second preset threshold value, so as to obtain the initial credit value of the nodes in the malicious state in the blockchain network. The initial credit value of the node in the malicious state may be determined according to an actual situation, which is not limited herein. As an example, the initial credit value of the node in the malicious state may be 145.
In practical applications, one new block is generated once, and a plurality of new blocks are generated after a plurality of new blocks are generated, i.e. the number of times of generating new blocks corresponds to the number of new blocks.
In an optional embodiment of the present invention, performing credit reward and punishment on the other node according to the voting result and the initial credit value, and determining the credit value of the other node includes: performing credit punishment on other nodes according to the voting result and the initial credit value to obtain credit punishment values of the other nodes; obtaining credit reward values for the other nodes; and determining the credit value of the other node according to the credit punishment value and the credit reward value.
In the embodiment of the present invention, credit punishment is performed on other nodes according to the voting result and the initial credit value, and obtaining the credit punishment value of the other nodes may be to perform credit punishment on the other nodes through a first preset formula according to the voting result and the initial credit value to obtain the credit punishment value of the other nodes; the first preset formula may be determined according to an actual situation, and is not limited herein. The first predetermined formula represents whether a credit penalty is imposed for a normal-state node or a good-state node against a vote, and as an example, the predetermined formula may refer to the above formula (1) and formula (2).
The obtaining of the credit reward value of the other node may be obtaining the credit reward value of the other node based on a second preset formula; the second preset formula may be determined according to an actual situation, and is not limited herein. The second predetermined formula represents whether credit awards are made for a situation in which the node in the abnormal state is subject to a vote or not, and as an example, the second predetermined formula may refer to the above formula (3).
Determining the credit values of the other nodes according to the credit penalty value and the credit reward value, wherein the credit penalty value and the credit reward value are determined according to a third preset formula; the third preset formula may be determined according to an actual situation, and is not limited herein. The third predetermined formula characterizes the credit value of the other node at the moment, and as an example, the third predetermined formula may refer to the above formula (4).
According to the DPoS consensus method provided by the embodiment of the invention, credit punishment is carried out on other nodes according to the voting result and the initial credit value, so that credit punishment values of the other nodes are obtained; obtaining credit reward values for the other nodes; and determining the credit values of the other nodes according to the credit punishment penalty value and the credit reward value so as to solve the problems of potential safety hazard generated by occupation of account rights by malicious nodes in the block chain DPoS consensus method and low voting enthusiasm of scattered nodes.
For convenience in understanding, a practical application scenario is illustrated here, and in practical application, a DPoS consensus method may be a DPoS consensus algorithm based on credit reward and punishment, in order to accurately diagnose and eliminate malicious nodes in a proxy node set, refine node states, and introduce a good state and a malicious state in addition to a normal state and an abnormal state. Meanwhile, in order to enhance the timeliness of eliminating the malicious nodes, the voting node can judge the vote for objection based on the voting node in the node voting process, and the node state change is influenced by the voting behavior so as to accurately and timely eliminate the malicious agent nodes.
In the first step, four states of the node are defined.
Each node has four states, which are as follows: the normal state, which may be denoted as NS, may be understood as the initial state of all nodes, and may also be understood as indicating that the proxy node does not produce invalid blocks, and the range of the credit value is 170-; the good status, which can be marked as GS, can be understood as that the proxy node continuously generates valid blocks and exceeds the threshold of the accumulated times, and the range of the credit value is 190-; the abnormal state, which may be denoted AS, may be understood AS that the proxy node generates an invalid block but does not exceed the accumulated value, and the range of the credit value is 150-; the malicious state, which may be denoted as ES, may be understood as the proxy node producing invalid blocks multiple times, and the range of credit values is below 150.
And secondly, node state conversion, namely after the node state is refined, judging the node behavior of each node according to a given preset condition and carrying out state conversion. The preset conditions at least comprise a first preset condition, a second preset condition and a third preset condition.
The node state transition is performed according to the state transition condition:
the first preset condition is as follows: the valid blocks are generated for a plurality of times continuously, and the number of the valid blocks exceeds the accumulated value N1.
The second preset condition is as follows: and generating invalid blocks, wherein the number of the invalid blocks is less than or equal to the cumulative value N2.
The third preset condition is as follows: the invalid blocks are generated for a plurality of times, and the number of the invalid blocks is larger than the accumulated value N2.
The determination of N1 and N2 is not limited herein, and is performed according to actual conditions. Therefore, the normal state node is converted into a good state node when the first preset condition is met; when a second preset condition is met, the normal state node and the good state node are converted into an abnormal state node; when a third preset condition is met, the abnormal state node is converted into a malicious state node; abnormal state nodes will not be allowed to participate in voting and proxy node election for a period of time.
For convenience of understanding, a schematic node state transition diagram in the DPoS consensus method according to the embodiment of the present invention is illustrated here, and fig. 2 is a schematic node state transition diagram in the DPoS consensus method according to the embodiment of the present invention, AS shown in fig. 2, the normal state may be denoted AS NS, the good state may be denoted AS GS, the abnormal state may be denoted AS, and the malicious state may be denoted AS ES. Under the condition that the first preset condition is met, the normal state node is converted into a good state node; the normal state node is converted into an abnormal state node by the normal state node under the condition that a second preset condition is met, and the good state node is converted into an abnormal state node by the good state node under the condition that the second preset condition is met; and when the third preset condition is met, the node in the abnormal state is converted into the node in the abnormal state from the node in the good state.
Thirdly, credit awarding and punishing model: the voting process based on credit reward and punishment involves 3 basic factors: vote opposition, credit penalty and credit award.
And (3) initializing a credit value: a credit initial value for each node is obtained.
Credit penalty: the credit value of each node is calculated accordingly according to its vote.
And (3) calculating a credit penalty value of the (i + 1) th node by punishment according to the credit value of the ith node, wherein the process can refer to the formula (1) and the formula (2).
Credit reward: in order to improve the accuracy of credit reward, after each round of voting results, whether the AS node which is subjected to vote rejection becomes a proxy node is judged, if not, the AS node which is subjected to vote rejection is rewarded with credit, otherwise, the credit value is unchanged, and the AS node is removed from the proxy node in a centralized manner AS soon AS possible.
The credit reward value of the (i + 1) th node is calculated according to the vote of the (i) th node, and the process can refer to the formula (3) above.
The credit penalty and credit reward of each node are added, and the credit value of the (i + 1) th node at the moment is synthesized, and the process can refer to the above formula (4).
Then, the credit value of the agent node is judged, and the nodes with the credit value lower than 150 malicious states are eliminated.
And fourthly, agent node election is generated.
Voting is carried out on the nodes with the voted right, the credit value of each node is calculated, finally the first N nodes with the maximum credit values are selected to become agent nodes, and the replacement of the agent node set needs to carry out voting and updating of the node credit values regularly.
Fifthly, the proxy node produces the block.
Generating Merkle trees of all transaction data in the blocks, putting the Merkle trees into a block main body, storing root values of the Merkle trees in a block header, calculating hash values of the data of the block header of the last block by adopting an SHA256 algorithm, namely the hash values are parent hash values of the new blocks, storing the current time in a timestamp field, and broadcasting the blocks to a proxy node set of the whole network.
And sixthly, verifying.
After the agent node set receives the broadcast new block, verifying the data and the block information in the block, and mainly verifying the attribute in the block head: including the sequence number, timestamp, Merkle root value, last chunk hash value, and new chunk hash value. The method mainly verifies whether the specific content in the received block is valid, and specifically judges that two thirds of proxy nodes in the whole network are approved according to the data in the block. After all the verifications are passed, the block is judged to be valid.
And seventhly, winding.
The proxy node adds the verified blocks to the block chain to form an electronic certificate information data chain to the latest blocks. When a plurality of branch chains exist in the main chain, a proper one is selected as the main chain according to the judgment standard of the consensus algorithm.
The invention provides a DPoS consensus method for share authorization certification, which aims to solve the problems of potential safety hazards caused by occupation of account rights of malicious nodes in a block chain DPoS consensus method and low voting enthusiasm of scattered nodes.
The present embodiment provides a device for sharing a common identity of a DPoS certificate of share authorization, which is applied to a block chain network, where the block chain network includes nodes in a normal state, a good state, an abnormal state, or a malicious state, fig. 3 is a schematic diagram of a structure of the DPoS common identity device according to the embodiment of the present invention, and as shown in fig. 3, the device 200 includes: an obtaining unit 201, a converting unit 202 and a determining unit 203, wherein:
the obtaining unit 201 is configured to obtain a first node in the blockchain network and a new block generated by a new transaction occurring in the blockchain network; the first node is any one of the nodes;
the converting unit 202 is configured to, when the new block obtained by the obtaining unit meets a preset condition, convert the first state of the first node into a second state, and obtain an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state;
the determining unit 203 is configured to obtain a voting result of the new block, perform credit reward and punishment on other nodes according to the voting result and the initial credit value obtained by the converting unit, and determine credit values of the other nodes; the other nodes are nodes except the first node in the nodes; determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is a node of the other node.
In other embodiments, the converting unit 202 is further configured to convert the first node from the normal state to the good state and obtain an initial credit value of the first node in the good state when the new block satisfies that the new block is a valid block and the number of the valid blocks is greater than a first preset threshold; the valid block characterizes the new transaction as not creating a conflict.
In other embodiments, the converting unit 202 is further configured to, when the new block satisfies that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold, convert the normal state of the first node into the abnormal state and convert the good state of the first node into the abnormal state, and obtain an initial credit value of the first node in the abnormal state; the invalid block characterizes the new transaction as conflicting.
In other embodiments, the converting unit 202 is further configured to convert the abnormal state of the first node into the malicious state and obtain an initial credit value of the first node in the malicious state when the new block satisfies that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold; the invalid block characterizes the new transaction as conflicting.
In other embodiments, the determining unit 203 is further configured to perform credit penalty on another node according to the voting result and the initial credit value, and obtain a credit penalty value of the other node; obtaining credit reward values for the other nodes; and determining the credit value of the other node according to the credit punishment value and the credit reward value.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus according to the invention, reference is made to the description of the embodiments of the method according to the invention for understanding.
It should be noted that, in the embodiment of the present invention, if the aforementioned method for certification of share authorization DPoS consensus is implemented in the form of a software functional module and is sold or used as an independent product, the method may also be stored in a computer-readable storage medium. With this understanding, technical embodiments of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a control server (which may be a personal computer, a server, or a network server) to perform all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present invention provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor, wherein the processor is configured to execute the steps in the certificate authority DPoS consensus method provided by the above embodiments when the computer program is run.
Correspondingly, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the DPoS consensus method for certificate of authority provided in the foregoing embodiment.
Here, it should be noted that: the above description of the storage medium and server embodiments is similar to the description of the method embodiments described above, with similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and the server of the present invention, reference is made to the description of the embodiments of the method of the present invention for understanding.
It should be noted that fig. 4 is a schematic diagram of a hardware entity structure of an electronic device in an embodiment of the present invention, and as shown in fig. 4, the hardware entity of the electronic device 300 includes: a processor 301 and a memory 303, optionally, the electronic device 300 may further comprise a communication interface 302.
It will be appreciated that the memory 303 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 303 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the above embodiments of the present invention may be applied to the processor 301, or implemented by the processor 301. The processor 301 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 301. The Processor 301 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 301 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 303, and the processor 301 reads the information in the memory 303 and performs the steps of the aforementioned methods in conjunction with its hardware.
In an exemplary embodiment, the electronic Device may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field-Programmable Gate arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the foregoing methods.
In the embodiments provided in the present invention, it should be understood that the disclosed method and apparatus can be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another observation, or some features may be omitted, or not performed. In addition, the communication connections between the components shown or discussed may be through interfaces, indirect couplings or communication connections of devices or units, and may be electrical, mechanical or other.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated unit according to the embodiment of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. With this understanding, technical embodiments of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing an electronic device (which may be a personal computer, a server, or a network device) to perform all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The method, the electronic device, and the storage medium for sharing DPoS common knowledge for certification of authority of shares described in the embodiments of the present invention are only examples of the embodiments of the present invention, and are not limited thereto.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention. The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The methods disclosed in the several method embodiments provided by the present invention can be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided by the invention may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided by the present invention may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present invention, and all such changes or substitutions are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (12)

1. A share authorization attestation (DPoS) consensus method is applied to a block chain network, wherein the block chain network comprises nodes in a normal state, a good state, an abnormal state or a malicious state, and the method comprises the following steps:
acquiring a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is any one of the nodes;
under the condition that the new block meets a preset condition, converting the first state of the first node into a second state, and obtaining an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state;
obtaining a voting result of the new block, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining credit values of the other nodes; the other nodes are nodes except the first node in the nodes;
determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is a node of the other node.
2. The method according to claim 1, wherein said converting the first state of the first node into the second state in case that the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state comprises:
when the new block meets the condition that the new block is an effective block and the number of the effective blocks is greater than a first preset threshold value, converting the normal state of the first node into the good state, and obtaining an initial credit value of the first node in the good state; the valid block characterizes the new transaction as not creating a conflict.
3. The method according to claim 1, wherein said converting the first state of the first node into the second state in case that the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state comprises:
when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold value, converting the first node from the normal state to the abnormal state and converting the first node from the good state to the abnormal state, and obtaining an initial credit value of the first node in the abnormal state; the invalid block characterizes the new transaction as conflicting.
4. The method according to claim 1, wherein said converting the first state of the first node into the second state in case that the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state comprises:
when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold value, converting the abnormal state of the first node into the malicious state, and obtaining an initial credit value of the first node in the malicious state; the invalid block characterizes the new transaction as conflicting.
5. The method of any one of claims 1-4, wherein performing credit penalties on other nodes according to the voting results and the initial credit values, and determining credit values of the other nodes comprises:
performing credit punishment on other nodes according to the voting result and the initial credit value to obtain credit punishment values of the other nodes;
obtaining credit reward values for the other nodes;
and determining the credit value of the other node according to the credit punishment value and the credit reward value.
6. A device for certification of authority (DPoS) consensus of shares, applied to a blockchain network including nodes exhibiting a normal state, a good state, an abnormal state, or a malicious state, the device comprising: an obtaining unit, a converting unit and a determining unit, wherein:
the obtaining unit is configured to obtain a first node in the blockchain network and a new block generated by a new transaction occurring in the blockchain network; the first node is any one of the nodes;
the conversion unit is configured to convert the first state of the first node into a second state when the new block obtained by the obtaining unit meets a preset condition, and obtain an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state;
the determining unit is configured to obtain a voting result of the new block, perform credit reward and punishment on other nodes according to the voting result and the initial credit value obtained by the converting unit, and determine credit values of the other nodes; the other nodes are nodes except the first node in the nodes; determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is a node of the other node.
7. The apparatus of claim 6, wherein the converting unit is further configured to convert the first node from the normal state to the good state to obtain an initial credit value of the first node in the good state if the new block satisfies that the new block is a valid block and the number of valid blocks is greater than a first preset threshold; the valid block characterizes the new transaction as not creating a conflict.
8. The apparatus according to claim 6, wherein the converting unit is further configured to, if the new block satisfies that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold, convert the first node from the normal state to the abnormal state and convert the first node from the good state to the abnormal state, and obtain an initial credit value of the first node in the abnormal state; the invalid block characterizes the new transaction as conflicting.
9. The apparatus according to claim 6, wherein the converting unit is further configured to, if the new block satisfies that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold, convert the first node from the abnormal state to the malicious state, and obtain an initial credit value of the first node in the malicious state; the invalid block characterizes the new transaction as conflicting.
10. The apparatus according to any one of claims 6 to 9, wherein the determining unit is further configured to perform credit penalty on another node according to the voting result and the initial credit value, and obtain a credit penalty value of the other node; obtaining credit reward values for the other nodes; and determining the credit value of the other node according to the credit punishment value and the credit reward value.
11. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 5 when running the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN202110550794.9A 2021-05-20 2021-05-20 Method and device for sharing DPoS (certificate of authority) common identification, electronic equipment and storage medium Active CN112991068B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110550794.9A CN112991068B (en) 2021-05-20 2021-05-20 Method and device for sharing DPoS (certificate of authority) common identification, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110550794.9A CN112991068B (en) 2021-05-20 2021-05-20 Method and device for sharing DPoS (certificate of authority) common identification, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112991068A true CN112991068A (en) 2021-06-18
CN112991068B CN112991068B (en) 2021-08-20

Family

ID=76337154

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110550794.9A Active CN112991068B (en) 2021-05-20 2021-05-20 Method and device for sharing DPoS (certificate of authority) common identification, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112991068B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114219650A (en) * 2022-02-21 2022-03-22 浙江数秦科技有限公司 Block chain consensus method with low transaction delay

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
US10304143B2 (en) * 2016-05-05 2019-05-28 Lance Timothy Kasper Consensus system for manipulation resistant digital record keeping
CN109872152A (en) * 2019-01-11 2019-06-11 平安科技(深圳)有限公司 Block chain common recognition method and relevant device based on share authorisation verification mechanism
CN109964446A (en) * 2018-06-08 2019-07-02 北京大学深圳研究生院 A kind of common recognition method based on ballot
US10373129B1 (en) * 2018-03-05 2019-08-06 Winklevoss Ip, Llc System, method and program product for generating and utilizing stable value digital assets
CN110138597A (en) * 2019-04-17 2019-08-16 上海大学 Based on the block chain DPOS of credit score and node clustering common recognition mechanism improved method
CN111080289A (en) * 2019-10-25 2020-04-28 武汉瑞盈通网络技术有限公司 Improved block chain consensus mechanism based on PoW and PoS
CN111131181A (en) * 2019-12-05 2020-05-08 重庆邮电大学 Reputation mechanism and DPBFT algorithm-based block chain dynamic DPoS consensus method
CN111813790A (en) * 2020-06-16 2020-10-23 上海申铁信息工程有限公司 Block chain consensus method and device based on Raft algorithm
KR102171568B1 (en) * 2019-01-07 2020-10-29 한양대학교 에리카산학협력단 A voter terminal, an authentication server, a voting server, and Electronic voting system
CN112333170A (en) * 2020-10-28 2021-02-05 浙江树人学院(浙江树人大学) Protection method for block interception attack in block chain based on ore excavation behavior

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10304143B2 (en) * 2016-05-05 2019-05-28 Lance Timothy Kasper Consensus system for manipulation resistant digital record keeping
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
US10373129B1 (en) * 2018-03-05 2019-08-06 Winklevoss Ip, Llc System, method and program product for generating and utilizing stable value digital assets
CN109964446A (en) * 2018-06-08 2019-07-02 北京大学深圳研究生院 A kind of common recognition method based on ballot
KR102171568B1 (en) * 2019-01-07 2020-10-29 한양대학교 에리카산학협력단 A voter terminal, an authentication server, a voting server, and Electronic voting system
CN109872152A (en) * 2019-01-11 2019-06-11 平安科技(深圳)有限公司 Block chain common recognition method and relevant device based on share authorisation verification mechanism
CN110138597A (en) * 2019-04-17 2019-08-16 上海大学 Based on the block chain DPOS of credit score and node clustering common recognition mechanism improved method
CN111080289A (en) * 2019-10-25 2020-04-28 武汉瑞盈通网络技术有限公司 Improved block chain consensus mechanism based on PoW and PoS
CN111131181A (en) * 2019-12-05 2020-05-08 重庆邮电大学 Reputation mechanism and DPBFT algorithm-based block chain dynamic DPoS consensus method
CN111813790A (en) * 2020-06-16 2020-10-23 上海申铁信息工程有限公司 Block chain consensus method and device based on Raft algorithm
CN112333170A (en) * 2020-10-28 2021-02-05 浙江树人学院(浙江树人大学) Protection method for block interception attack in block chain based on ore excavation behavior

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
付瑶瑶: "授权股份证明共识机制的改进方案", 《计算机工程与应用》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114219650A (en) * 2022-02-21 2022-03-22 浙江数秦科技有限公司 Block chain consensus method with low transaction delay
CN114219650B (en) * 2022-02-21 2022-05-20 浙江数秦科技有限公司 Block chain consensus method with low transaction delay

Also Published As

Publication number Publication date
CN112991068B (en) 2021-08-20

Similar Documents

Publication Publication Date Title
CN109949157B (en) Business data uplink method, device and system
CN108764870B (en) Transaction processing method and device based on block chain and electronic equipment
CN109815657B (en) Identity authentication method and device based on alliance chain, computer readable storage medium and terminal equipment
CN109165945B (en) Representative node device election method and device, computer device and storage medium
CN109791591B (en) Method and system for identity and credential protection and verification via blockchain
CN109481936B (en) Block chain accounting node selection method and device and computer readable storage medium
WO2018158936A1 (en) Block chain management device, block chain management method and program
CN107220130B (en) Method, device and system for realizing information consensus at nodes of block chain
CN111026578B (en) Intelligent contract security detection method based on prophetic machine
US20210049715A1 (en) Blockchain-based data procesing method, apparatus, and electronic device
JP7166380B2 (en) Asset processing method, apparatus, device, storage medium, and program by blockchain
CN110597841B (en) Application comment information processing method and device based on block chain network
EP3963824A1 (en) Methods and devices for recording work history and proving reputation in a blockchain network
US20220092592A1 (en) Methods and Devices for Registering and Authenticating Miner Identity in a Blockchain Network
CN111567009A (en) Declarative intelligent contracts
US10922309B2 (en) Distributed ledger interaction system and methods
CN112991068B (en) Method and device for sharing DPoS (certificate of authority) common identification, electronic equipment and storage medium
TW202008229A (en) Event prediction method and apparatus, and electronic device
CN115641139A (en) Block chain consensus method based on weight plan behavior certification
CN110278246B (en) Certificate storage service transfer method, device and equipment for alliance chain
CN110930158A (en) Block chain DPoS common recognition method based on reward and punishment mechanism
CN113256149A (en) Block chain node reputation adjusting method and device, electronic equipment and storage medium
CN113807802A (en) Block chain-based labor worker salary settlement method and related equipment
CN108416662A (en) A kind of data verification method and device
CN116170162A (en) Selective consensus method, computer storage medium, and terminal device

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