CN110545170A - Block chain consensus method, device and equipment based on password drawing - Google Patents

Block chain consensus method, device and equipment based on password drawing Download PDF

Info

Publication number
CN110545170A
CN110545170A CN201910872083.6A CN201910872083A CN110545170A CN 110545170 A CN110545170 A CN 110545170A CN 201910872083 A CN201910872083 A CN 201910872083A CN 110545170 A CN110545170 A CN 110545170A
Authority
CN
China
Prior art keywords
preset function
round
decimal
block chain
module
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.)
Pending
Application number
CN201910872083.6A
Other languages
Chinese (zh)
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.)
Fujian Zhongke Zhongxin Intelligent Technology Co Ltd
Original Assignee
Fujian Zhongke Zhongxin Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Zhongke Zhongxin Intelligent Technology Co Ltd filed Critical Fujian Zhongke Zhongxin Intelligent Technology Co Ltd
Priority to CN201910872083.6A priority Critical patent/CN110545170A/en
Publication of CN110545170A publication Critical patent/CN110545170A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures

Abstract

The invention discloses a block chain consensus method, a block chain consensus device and block chain consensus equipment based on password drawing. Wherein the method comprises the following steps: running one round r in the block chain to obtain the seed information of the running round, which is denoted as Sr, updating the seed information of the next round of seeds Sr +1 through a fifth preset function f5, signing and hashing the updated seed information of the next round of seeds Sr +1 through the fifth preset function f5 to obtain the next round of seeds Sr +1 ═ H (SIG (Sr, Br)), and repeatedly entering the loop of the next round. By the mode, the situation that the verifiers of all the bookkeepers in the block chain network do not need to participate in the Hash calculation to prove and verify to reach the consensus can be achieved, and only a small number of users are selected from the verifiers of all the bookkeepers in the block chain network to participate in the Hash calculation to prove and verify to reach the consensus, so that computing resource and energy can be saved.

Description

Block chain consensus method, device and equipment based on password drawing
Technical Field
The invention relates to the technical field of block chains, in particular to a block chain consensus method, a block chain consensus device and block chain consensus equipment based on password drawing.
Background
the Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The block chain is an important concept of the bitcoin, is essentially a decentralized database, and is used as a bottom-layer technology of the bitcoin, namely a series of data blocks which are generated by correlation by using a cryptographic method, wherein each data block contains information of one bitcoin network transaction and is used for verifying the validity of the information, namely anti-counterfeiting and generating the next block.
Blockchains can be divided into three categories: public, federation, and private chains.
The public chain is a block chain which can be used by anyone in the world to read data, send confirmable transactions and compete for billing at any time. Public chains are generally considered to be "completely decentralized" in that no individual or entity can control or tamper with the reading and writing of data therein. Public chains generally ensure data security by encouraging participants to compete for billing through a token mechanism.
In the public chain system, the user can join at any time without applying in advance, and the number of the users is not limited. Each user holds a plurality of public keys, and each public key has a corresponding private key.
In a blockchain system, information is stored in a series of blocks. Each block mainly includes: 1. information from the previous block; 2. a hash pointer, which is equivalent to a summary or a condensation of the information contained in all the preamble blocks; 3. electronic signature of the current biller. Thus, the series of blocks are connected together by the hash pointers, forming a chain of blocks. If the information of a block is tampered with by an "adversary", it will not match the hash pointer stored in the subsequent block. This makes the blockchain difficult to tamper with.
the existing block chain consensus scheme generally adopts a workload proving and verifying mode, all bookkeepers and verifiers in a block chain network need to participate in hash calculation to carry out proving and verifying to achieve consensus, and a large amount of computing resources and energy are consumed.
Disclosure of Invention
in view of this, the present invention provides a block chain consensus method, a block chain consensus device, and a block chain consensus apparatus based on password drawing and signing, which can achieve that a consensus is achieved without all verifiers of the billers in the block chain network participating in the hash calculation, and only a small number of users are selected from all verifiers of the billers in the block chain network to participate in the hash calculation, so as to achieve the consensus, thereby saving computing resources and energy.
According to an aspect of the present invention, there is provided a blockchain consensus method based on password drawing, including:
Running one round r in a block chain to obtain seed information of the running round, and recording the seed information as Sr;
In each round circulation, based on the seed information, calculating to obtain a hash value through a first preset function f1, digitally signing the seed information through a user private key through the first preset function f1, and obtaining a specific hash value through a conversion function;
Obtaining a decimal q between 0 and 1 through a second preset function f2, and writing the obtained character string of the specific hash value to a decimal point through the second preset function f2 (0. H);
Selecting a verifier from all candidate users through a third preset function f3, wherein for a decimal q < ═ p, users meeting the condition are verifiers through the third preset function f 3; wherein p is a selection probability;
broadcasting the signature information of the seed information and the decimal q to a block chain network through the verifier in the current round, packaging the information to be recorded in the block, performing digital signature, and broadcasting to the whole block chain network;
Selecting a bookkeeper from all verifiers through a bookkeeper Ur in the current round according to a fourth preset function f 4;
When the verifier agrees with one of the new blocks Br, the new block Br is authenticated to be a new block of the block chain in the current round;
updating seed information of a next round of seeds Sr +1 through a fifth preset function f5, and signing and re-hashing the updated seed information of the next round of seeds Sr +1 through the fifth preset function f5 on the seed information of the previous round and the block information of the current round to obtain the next round of seeds Sr +1 ═ H (SIG (Sr, Br));
and repeatedly entering the next round of circulation.
the first preset function f1 obtains an almost random function conversion mode through a signature and hash mode.
Wherein, the obtaining a decimal q between 0 and 1 through the second preset function f2, and writing the obtained character string of the specific hash value to a decimal point through the second preset function f2 (0.H) includes:
Obtaining a decimal q between 0 and 1 through a second preset function f2, converting the obtained specific hash value into a 2-system character string through the second preset function f2, and adding '0' in front of the converted character string to construct a binary decimal (0.H) between 0 and 1.
The third preset function f3 selects users smaller than p for the binary decimal 0.H of all the candidate users; wherein p is a selection probability; the third preset function f3 includes a way to select less than a selection probability.
The selecting of the biller from all verifiers by the biller Ur in the current round according to a fourth preset function f4 includes:
and (4) independently confirming the bookkeepers in the current round through the bookkeepers Ur in the current round, and selecting the person with the smallest probability q value from the digital signatures of all the received candidate bookkeepers according to a fourth preset function f4 to be regarded as the bookkeepers in the current round.
According to another aspect of the present invention, there is provided a blockchain consensus device based on password drawing, including:
the system comprises an operation module, a hash value acquisition module, a decimal acquisition module, a verifier selection module, a broadcast module, an bookkeeper selection module, an authentication module, a seed processing module and a repeated circulation module;
The operation module is used for operating one round r in the block chain to obtain seed information of the current round of operation, and the seed information is recorded as Sr;
The hash value obtaining module is configured to calculate, in each round, a hash value through a first preset function f1 based on the seed information, digitally sign the seed information through the first preset function f1 using a user private key, and obtain a specific hash value through a conversion function;
The decimal obtaining module is configured to obtain a decimal q between 0 and 1 through a second preset function f2, and write the obtained specific character string of the hash value to a decimal point through the second preset function f2 (0. H);
the verifier selecting module is configured to select a verifier from all candidate users through a third preset function f3, where for a decimal q < ═ p, a user meeting the condition is a verifier through the third preset function f 3; wherein p is a selection probability;
The broadcast module is used for broadcasting the signature information of the seed information and the decimal q to a block chain network through the verifier in the current round, packaging the information to be recorded in the block, performing digital signature, and broadcasting the information to the whole block chain network;
The bookkeeper selecting module is used for selecting a bookkeeper from all verifiers through a current round bookkeeper Ur according to a fourth preset function f 4;
The authentication module is used for authenticating that one new block Br is a new block of a block chain in the current round when the verifier realizes consensus on the new block Br;
the seed processing module is configured to update seed information of a next round of seeds Sr +1 through a fifth preset function f5, and perform signature and hash on seed information of the updated next round of seeds Sr +1 through the fifth preset function f5 on seed information of a previous round and block information of a current round to obtain a next round of seeds Sr +1 ═ H (SIG (Sr, Br));
And the repeated circulation module is used for repeatedly entering the next circulation.
The first preset function f1 obtains an almost random function conversion mode through a signature and hash mode.
Wherein, the decimal obtaining module is specifically configured to:
Obtaining a decimal q between 0 and 1 through a second preset function f2, converting the obtained specific hash value into a 2-system character string through the second preset function f2, and adding '0' in front of the converted character string to construct a binary decimal (0.H) between 0 and 1.
The third preset function f3 selects users smaller than p for the binary decimal 0.H of all the candidate users; wherein p is a selection probability; the third preset function f3 includes a way to select less than a selection probability.
wherein, the biller selection module is specifically configured to:
And (4) independently confirming the bookkeepers in the current round through the bookkeepers Ur in the current round, and selecting the person with the smallest probability q value from the digital signatures of all the received candidate bookkeepers according to a fourth preset function f4 to be regarded as the bookkeepers in the current round.
It can be found that, in the above scheme, one round r can be run in the block chain, the seed information of the current round of the run is obtained, which is denoted by Sr, and in each round of loop, based on the seed information, a hash value is calculated by a first preset function f1, the seed information is digitally signed by the first preset function f1 using a user private key and is subjected to a conversion function to obtain a specific hash value, and a decimal q between 0 and 1 can be obtained by a second preset function f2, a character string of the obtained specific hash value is written to a decimal point by the second preset function f2 (0.H), and a verifier can be selected from all candidate users by a third preset function f3, the third preset function f3 is a verifier for the decimal q < p, and the user satisfying the condition is the verifier; wherein, the p is a selection probability, the signature information and the decimal q of the seed information can be broadcast to the block chain network by the verifier of the current round, the information to be recorded in the block is packaged and digitally signed at the same time, and then the information is broadcast to the whole block chain network, the bookkeeper can be selected from all verifiers by the bookkeeper Ur of the current round according to a fourth preset function f4, the new block Br can be authenticated as a new block of the block chain when the verifier agrees with one new block Br, the seed information of the next round of seed Sr +1 can be updated by a fifth preset function f5, the seed information of the previous round and the block information of the current round are signed and hashed by the fifth preset function f5, the seed information of the next round of seed Sr +1 is signed and hashed again to obtain the next round of seed Sr +1 ═ H (SIG (Sr, Br)), and the method can repeatedly enter the next round of circulation, can realize that the consensus is achieved without all the bookkeepers and verifiers in the block chain network participating in the Hash calculation, and only a small number of users are selected from all the bookkeepers and verifiers in the block chain network to participate in the Hash calculation for the proof verification, thereby saving the calculation resources and the energy.
Further, in the above scheme, the first preset function f1 may obtain a nearly random function conversion mode through a signature hash mode, or may obtain a nearly random function conversion mode through another mode, which has the advantages of being able to realize the seed information of each round, being able to update in a signature hash mode, and because the block information of each round is unpredictable and is converted by the hash function, the relationship between the seeds is nearly random.
Further, according to the above scheme, a decimal q between 0 and 1 can be obtained through the second preset function f2, the obtained specific hash value is converted into a 2-system character string through the second preset function f2, and "0" is added in front of the converted character string to construct a binary decimal (0.H) between 0 and 1, so that the advantage that candidate user selection of each round can be realized, a decimal between 0 and 1 can be obtained through signature and hash, and the candidate user selection has randomness through selecting users with values smaller than a certain selection probability.
further, in the above scheme, the third preset function f3 may select a user smaller than p for the binary decimal 0.H of all candidate users, where p is a selection probability; the third preset function f3 may include a mode of selecting less than the selection probability, or may include other modes of randomly selecting a conversion function with a plurality of values, which has the advantages of being able to realize the seed information of each round, being able to update in a signature and hash mode, and because the block information of each round is unpredictable and is converted by the hash function, the relationship between the seeds is nearly random.
further, according to the scheme, the current round of bookkeepers Ur can respectively and independently confirm the current round of bookkeepers, the user with the smallest probability q value is selected from the digital signatures of all received candidate bookkeepers according to the fourth preset function f4, and the current round of bookkeepers is considered as the current round of bookkeepers.
Furthermore, in the scheme, the candidate users selected by each round of consensus algorithm are random, if an adversary exists, strong attack can be launched, and any selected user can be quickly and completely controlled, but each round of algorithm needs a plurality of verifiers to achieve consensus to accept a new block, so that the reliability of the algorithm can be guaranteed.
Furthermore, according to the scheme, each round of consensus algorithm only needs part of users to perform short-time calculation, so that a new block can be calculated, the efficiency of consensus is high, and generation of one block in a much shorter time interval, such as one minute, can be supported.
drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating an embodiment of a block chain consensus method based on password drawing according to the present invention;
FIG. 2 is a block chain consensus diagram based on password drawing according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a blockchain consensus device based on password drawing according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be noted that the following examples are only illustrative of the present invention, and do not limit the scope of the present invention. Similarly, the following examples are only some but not all examples of the present invention, and all other examples obtained by those skilled in the art without any inventive work are within the scope of the present invention.
The invention provides a block chain consensus method based on password drawing and signing, which can realize that consensus can be achieved without all the bookkeepers and verifiers in a block chain network participating in Hash calculation for proving and verifying, and only a small number of users are selected from all the bookkeepers and verifiers in the block chain network to participate in Hash calculation for proving and verifying, so that computing resources and energy can be saved.
referring to fig. 1, fig. 1 is a flowchart illustrating a block chain consensus method based on password drawing according to an embodiment of the present invention. It should be noted that the method of the present invention is not limited to the flow sequence shown in fig. 1 if the results are substantially the same. As shown in fig. 1, the method comprises the steps of:
s101: and running one round r in the block chain to obtain the seed information of the running round, which is recorded as Sr.
In this embodiment, the parameters of the seed information cannot be predicted by the user.
S102: in each round, based on the seed information, a hash value is calculated through a first preset function f1, the seed information is digitally signed through the first preset function f1 by using a user private key, and a specific hash value is obtained through a conversion function.
In this embodiment, the digital signature performed on the seed information by the first preset function f1 using a private key of a user may be denoted as Sign (r, Sr).
In this embodiment, a specific hash value may be obtained through a series of specific conversion functions, which may be denoted as h (sign).
The first preset function f1 may obtain a nearly random function conversion mode through a signature hash mode, or may obtain a nearly random function conversion mode through other modes, which is not limited in the present invention, and this has the advantage of realizing the seed information of each round, and being able to update by a signature hash mode, because the block information of each round is unpredictable, and through the hash function conversion, the relationship between the seeds is nearly random.
S103: a decimal q between 0 and 1 is obtained through a second preset function f2, and the obtained character string of the specific hash value is written to a decimal point through the second preset function f2 (0. H).
in this embodiment, the decimal q may be uniformly distributed between 0 and 1, and the invention is not limited.
the obtaining a decimal q between 0 and 1 through the second preset function f2, and writing the obtained specific character string of the hash value to a decimal point through the second preset function f2 (0.H) may include:
The method has the advantages that a decimal q between 0 and 1 is obtained through a second preset function f2, the obtained specific hash value is converted into a 2-system character string through the second preset function f2, 0 is added in front of the converted character string, and a binary decimal (0.H) between 0 and 1 is constructed, so that the candidate user selection of each round can be realized, a decimal between 0 and 1 can be obtained through signature and hash, and the candidate user selection is random through selecting users with the numerical value smaller than a certain selection probability.
In this embodiment, the second preset function f2 may include a decimal with a value range constructed by pre-complementing 0, but is not limited to this method, and may also include other transfer functions that may obtain a value range.
s104: selecting a verifier from all candidate users through a third preset function f3, wherein for the decimal q < ═ p, users meeting the condition are verifiers through the third preset function f 3; where p is the selection probability.
The third preset function f3 may select users smaller than p for the binary decimal 0.H of all the candidate users; wherein p is the selection probability; the third preset function f3 may include a mode of selecting less than the selection probability, or may include other modes of randomly selecting a conversion function with multiple values, and the present invention is not limited thereto, which has the advantages that seed information of each round can be realized, signature hash can be used for updating, and since the block information of each round is unpredictable and is converted by the hash function, the relationship between the seeds is nearly random.
S105: the verifier broadcasts the signature information of the seed information and the decimal q to the block chain network, and simultaneously packages and digitally signs the information to be recorded in the block and broadcasts the information to the whole block chain network.
In this embodiment, the verifier in this round may be a candidate biller, and the present invention is not limited thereto.
S106: and selecting the biller from all verifiers by the biller Ur in the current round according to a fourth preset function f 4.
The selecting of the biller from all verifiers by the current round of biller Ur according to the fourth preset function f4 may include:
The current round of bookkeepers Ur respectively and independently confirm the current round of bookkeepers, the block with the smallest probability q value is selected from the digital signatures of all received candidate bookkeepers according to the fourth preset function f4, and the block is considered as the current round of bookkeepers.
in this embodiment, the fourth preset function f4 may select the number with the smallest value by comparing the binary decimal values 0.H of all candidate users, and the user corresponding to the private key is used as the current round of bookkeeper.
In this embodiment, the fourth preset function f4 may include a mode of selecting a minimum value, or may include other modes of obtaining a conversion function with a unique value selection, and the invention is not limited thereto.
S107: when the verifier agrees with one of the new blocks Br, the new block Br is authenticated as a new block of the block chain in the current round.
In this embodiment, the agreement by the verifier on one of the new blocks Br may include a case that more than half of the verifiers have electronic signatures on the new block Br by using their own private keys, which is not limited by the present invention.
in this embodiment, the verifier of the current round signs the seed, obtains a corresponding hash value, and broadcasts the hash value and the signature to the whole blockchain network; all verifiers receive the hash values and the signatures obtained from other nodes, and select the user with the smallest probability q as the current round of bookkeeper; for the selected bookkeeper, each verifier carries out electronic signature on the block by using a private key of the verifier, which is equivalent to authentication, and broadcasts the signature to the block chain network; once the verifier agrees with a new block Br, i.e. more than half of the verifiers use their private keys to electronically sign the block equivalent to authentication, the block is considered as a new block in the block chain.
s108: the seed information of the next round of seeds Sr +1 is updated by the fifth preset function f5, and the seed information of the updated next round of seeds Sr +1 is signed and re-hashed by the fifth preset function f5 on the previous round of seed information and the current round of block information, so that the next round of seeds Sr +1 is H (SIG (Sr, Br)).
in this embodiment, the fifth preset function f5 may obtain a new hash value, that is, new seed information, by performing hash function transformation after signing the previous round of seeds and the current round of blocks.
in this embodiment, the fifth preset function f5 may include a signature hash method, or other methods that can obtain a nearly random function conversion, which is not limited in the present invention.
s109: and repeatedly entering the next round of circulation.
It can be found that, in this embodiment, one round r can be run in the blockchain, the seed information of the current round of the run is obtained, which is denoted by Sr, and in each round of loop, based on the seed information, a hash value is calculated by a first preset function f1, the seed information is digitally signed by the first preset function f1 using a user private key and is subjected to a conversion function, a specific hash value is obtained, and a decimal q between 0 and 1 can be obtained by a second preset function f2, a character string of the obtained specific hash value is written to a decimal point by the second preset function f2 (0.H), and a verifier can be selected from all candidate users by a third preset function f3, the third preset function f3 is a verifier for the decimal q < p, and the user satisfying the condition is the verifier; wherein, the p is a selection probability, the signature information and the decimal q of the seed information can be broadcast to the block chain network by the verifier of the current round, the information to be recorded in the block is packaged and digitally signed at the same time, and then the information is broadcast to the whole block chain network, the bookkeeper can be selected from all verifiers by the bookkeeper Ur of the current round according to a fourth preset function f4, the new block Br can be authenticated as a new block of the block chain when the verifier agrees with one new block Br, the seed information of the next round of seed Sr +1 can be updated by a fifth preset function f5, the seed information of the previous round and the block information of the current round are signed and hashed by the fifth preset function f5, the seed information of the next round of seed Sr +1 is signed and hashed again to obtain the next round of seed Sr +1 ═ H (SIG (Sr, Br)), and the method can repeatedly enter the next round of circulation, can realize that the consensus is achieved without all the bookkeepers and verifiers in the block chain network participating in the Hash calculation, and only a small number of users are selected from all the bookkeepers and verifiers in the block chain network to participate in the Hash calculation for the proof verification, thereby saving the calculation resources and the energy.
Further, in this embodiment, the first preset function f1 may obtain a nearly random function conversion manner through a signature hash manner, or may obtain a nearly random function conversion manner through another manner, which has the advantages of being able to realize seed information of each round, being able to update in a signature hash manner, and because block information of each round is unpredictable and is converted by a hash function, the relationship between seeds is nearly random.
further, in this embodiment, a decimal q between 0 and 1 may be obtained through the second preset function f2, the obtained specific hash value is converted into a 2-ary character string through the second preset function f2, and "0" is added in front of the converted character string to construct a binary decimal (0.H) between 0 and 1, which has the advantages of being able to realize candidate user selection for each round, being able to obtain a decimal between 0 and 1 through signature and hash, and having randomness through selecting users whose value is less than a certain selection probability.
Further, in this embodiment, the third preset function f3 may select a user smaller than p for the binary decimal 0.H of all the candidate users, where p is a selection probability; the third preset function f3 may include a mode of selecting less than the selection probability, or may include other modes of randomly selecting a conversion function with a plurality of values, which has the advantages of being able to realize the seed information of each round, being able to update in a signature and hash mode, and because the block information of each round is unpredictable and is converted by the hash function, the relationship between the seeds is nearly random.
further, in this embodiment, the current round of bookers may be individually confirmed by the current round of bookers Ur, and the one with the smallest probability q value is selected from the digital signatures of all received candidate bookers according to the fourth preset function f4, which is considered as the current round of bookers.
further, in this embodiment, the candidate users selected by each round of consensus algorithm are random, and if an adversary exists, a strong attack can be launched, and any selected user can be quickly and completely controlled, but each round of algorithm requires a plurality of verifiers to achieve consensus to accept a new block, so that the reliability of the algorithm can be guaranteed.
Further, in this embodiment, each round of consensus algorithm only needs a part of users to perform a short time of calculation, so that a new block can be calculated, the efficiency of consensus is high, and generation of a block in a much shorter time interval, for example, one minute, can be supported.
The invention also provides a block chain consensus device based on password drawing and signing, which can realize that consensus can be achieved without all the bookkeepers and verifiers in the block chain network participating in the Hash calculation, and only a small number of users are selected from all the bookkeepers and verifiers in the block chain network to participate in the Hash calculation for proving and verifying, so that the computing resources and energy can be saved.
referring to fig. 2, fig. 2 is a schematic structural diagram of a block chain consensus device based on password drawing according to an embodiment of the present invention. In this embodiment, the blockchain consensus device 20 based on password drawing includes a running module 21, a hash value obtaining module 22, a decimal obtaining module 23, a verifier selecting module 24, a broadcasting module 25, an biller selecting module 26, an authentication module 27, a seed processing module 28, and a repetitive loop module 29.
The running module 21 is configured to run one round r in the block chain, and obtain seed information of the current round of the running, which is denoted as Sr.
The hash value obtaining module 22 is configured to, in each round, obtain a hash value through calculation by using a first preset function f1 based on the seed information, digitally sign the seed information by using a user private key by using the first preset function f1, and obtain a specific hash value through a conversion function.
The decimal obtaining module 23 is configured to obtain a decimal q between 0 and 1 through a second preset function f2, and write the obtained specific hash value string to a decimal point through the second preset function f2 (0. H).
The verifier selecting module 24 is configured to select a verifier from all candidate users through a third preset function f3, where for a decimal q < ═ p, the user meeting the condition is the verifier by the third preset function f 3; where p is the selection probability.
The broadcasting module 25 is configured to broadcast the signature information of the seed information and the decimal q to the blockchain network through the verifier in the current round, and broadcast the information to be recorded in the block to the entire blockchain network after packaging and digitally signing the information.
The bookkeeper selecting module 26 is configured to select a bookkeeper from all verifiers through the current round of bookkeeper Ur according to a fourth preset function f 4.
the authentication module 27 is configured to authenticate that the new block Br is a new block in the block chain in the current round when the verifier agrees with one of the new blocks Br.
The seed processing module 28 is configured to update the seed information of the next round of seeds Sr +1 through a fifth preset function f5, and sign and hash the updated seed information of the next round of seeds Sr +1 through the fifth preset function f5 on the seed information of the previous round and the block information of the current round to obtain a next round of seeds Sr +1 ═ H (SIG (Sr, Br)).
The repeating cycle module 29 is used for repeatedly entering the next cycle.
Alternatively, the first preset function f1 may be a function conversion mode with almost random function by means of signature and hash.
Optionally, the fraction obtaining module 23 may be specifically configured to:
a decimal q between 0 and 1 is obtained through a second preset function f2, the obtained specific hash value is converted into a 2-system character string through the second preset function f2, and "0" is added in front of the converted character string, so that a binary decimal (0.H) between 0 and 1 is constructed.
Optionally, the third preset function f3 may select users smaller than p for the binary decimal 0.H of all the candidate users; wherein p is the selection probability; the third preset function f3 may include a way to select less than a selection probability.
Optionally, the bookkeeper selecting module 26 may be specifically configured to:
and (4) independently confirming the bookkeepers in the current round through the bookkeepers Ur in the current round, and selecting the person with the smallest probability q value from the digital signatures of all the received candidate bookkeepers according to a fourth preset function f4 to be regarded as the bookkeepers in the current round.
each unit module of the block chain consensus device 20 based on password drawing can respectively execute the corresponding steps in the above method embodiments, so that the detailed description of each unit module is omitted here, and please refer to the description of the corresponding steps above.
the present invention further provides a block chain consensus device based on password drawing, as shown in fig. 3, including: at least one processor 31; and a memory 32 communicatively coupled to the at least one processor 31; the memory 32 stores instructions executable by the at least one processor 31, and the instructions are executed by the at least one processor 31 to enable the at least one processor 31 to execute the above-mentioned blockchain consensus method based on password drawing.
Where the memory 32 and the processor 31 are coupled in a bus, the bus may comprise any number of interconnected buses and bridges, the buses coupling together one or more of the various circuits of the processor 31 and the memory 32. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 31 is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor 31.
the processor 31 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory 32 may be used to store data used by the processor 31 in performing operations.
the present invention further provides a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
It can be found that, in the above scheme, one round r can be run in the block chain, the seed information of the current round of the run is obtained, which is denoted by Sr, and in each round of loop, based on the seed information, a hash value is calculated by a first preset function f1, the seed information is digitally signed by the first preset function f1 using a user private key and is subjected to a conversion function to obtain a specific hash value, and a decimal q between 0 and 1 can be obtained by a second preset function f2, a character string of the obtained specific hash value is written to a decimal point by the second preset function f2 (0.H), and a verifier can be selected from all candidate users by a third preset function f3, the third preset function f3 is a verifier for the decimal q < p, and the user satisfying the condition is the verifier; wherein, the p is a selection probability, the signature information and the decimal q of the seed information can be broadcast to the block chain network by the verifier of the current round, the information to be recorded in the block is packaged and digitally signed at the same time, and then the information is broadcast to the whole block chain network, the bookkeeper can be selected from all verifiers by the bookkeeper Ur of the current round according to a fourth preset function f4, the new block Br can be authenticated as a new block of the block chain when the verifier agrees with one new block Br, the seed information of the next round of seed Sr +1 can be updated by a fifth preset function f5, the seed information of the previous round and the block information of the current round are signed and hashed by the fifth preset function f5, the seed information of the next round of seed Sr +1 is signed and hashed again to obtain the next round of seed Sr +1 ═ H (SIG (Sr, Br)), and the method can repeatedly enter the next round of circulation, can realize that the consensus is achieved without all the bookkeepers and verifiers in the block chain network participating in the Hash calculation, and only a small number of users are selected from all the bookkeepers and verifiers in the block chain network to participate in the Hash calculation for the proof verification, thereby saving the calculation resources and the energy.
Further, in the above scheme, the first preset function f1 may obtain a nearly random function conversion mode through a signature hash mode, or may obtain a nearly random function conversion mode through another mode, which has the advantages of being able to realize the seed information of each round, being able to update in a signature hash mode, and because the block information of each round is unpredictable and is converted by the hash function, the relationship between the seeds is nearly random.
further, according to the above scheme, a decimal q between 0 and 1 can be obtained through the second preset function f2, the obtained specific hash value is converted into a 2-system character string through the second preset function f2, and "0" is added in front of the converted character string to construct a binary decimal (0.H) between 0 and 1, so that the advantage that candidate user selection of each round can be realized, a decimal between 0 and 1 can be obtained through signature and hash, and the candidate user selection has randomness through selecting users with values smaller than a certain selection probability.
Further, in the above scheme, the third preset function f3 may select a user smaller than p for the binary decimal 0.H of all candidate users, where p is a selection probability; the third preset function f3 may include a mode of selecting less than the selection probability, or may include other modes of randomly selecting a conversion function with a plurality of values, which has the advantages of being able to realize the seed information of each round, being able to update in a signature and hash mode, and because the block information of each round is unpredictable and is converted by the hash function, the relationship between the seeds is nearly random.
further, according to the scheme, the current round of bookkeepers Ur can respectively and independently confirm the current round of bookkeepers, the user with the smallest probability q value is selected from the digital signatures of all received candidate bookkeepers according to the fourth preset function f4, and the current round of bookkeepers is considered as the current round of bookkeepers.
Furthermore, in the scheme, the candidate users selected by each round of consensus algorithm are random, if an adversary exists, strong attack can be launched, and any selected user can be quickly and completely controlled, but each round of algorithm needs a plurality of verifiers to achieve consensus to accept a new block, so that the reliability of the algorithm can be guaranteed.
furthermore, according to the scheme, each round of consensus algorithm only needs part of users to perform short-time calculation, so that a new block can be calculated, the efficiency of consensus is high, and generation of one block in a much shorter time interval, such as one minute, can be supported.
In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, 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.
in addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a part of the embodiments of the present invention, and not intended to limit the scope of the present invention, and all equivalent devices or equivalent processes performed by the present invention through the contents of the specification and the drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A block chain consensus method based on password drawing is characterized by comprising the following steps:
running one round r in a block chain to obtain seed information of the running round, and recording the seed information as Sr;
in each round circulation, based on the seed information, calculating to obtain a hash value through a first preset function f1, digitally signing the seed information through a user private key through the first preset function f1, and obtaining a specific hash value through a conversion function;
Obtaining a decimal q between 0 and 1 through a second preset function f2, and writing the obtained character string of the specific hash value to a decimal point through the second preset function f2 (0. H);
Selecting a verifier from all candidate users through a third preset function f3, wherein for a decimal q < ═ p, users meeting the condition are verifiers through the third preset function f 3; wherein p is a selection probability;
broadcasting the signature information of the seed information and the decimal q to a block chain network through the verifier in the current round, packaging the information to be recorded in the block, performing digital signature, and broadcasting to the whole block chain network;
Selecting a bookkeeper from all verifiers through a bookkeeper Ur in the current round according to a fourth preset function f 4;
When the verifier agrees with one of the new blocks Br, the new block Br is authenticated to be a new block of the block chain in the current round;
Updating seed information of a next round of seeds Sr +1 through a fifth preset function f5, and signing and re-hashing the updated seed information of the next round of seeds Sr +1 through the fifth preset function f5 on the seed information of the previous round and the block information of the current round to obtain the next round of seeds Sr +1 ═ H (SIG (Sr, Br));
And repeatedly entering the next round of circulation.
2. The block chain consensus method based on cryptographic lots of claim 1, wherein the first predetermined function f1 is a nearly random function transformation by hashing a signature.
3. The block chain consensus method based on cryptographic lots of claim 1, wherein the obtaining a decimal q between 0 and 1 through a second predetermined function f2, writing the obtained string of specific hash values after the decimal point through the second predetermined function f2 (0.H), comprises:
Obtaining a decimal q between 0 and 1 through a second preset function f2, converting the obtained specific hash value into a 2-system character string through the second preset function f2, and adding '0' in front of the converted character string to construct a binary decimal (0.H) between 0 and 1.
4. The block chain consensus method based on password drawing of claim 1, wherein the third predetermined function f3 selects users smaller than p for the binary decimal 0.H of all candidate users; wherein p is a selection probability; the third preset function f3 includes a way to select less than a selection probability.
5. The password drawing-based blockchain consensus method according to claim 1, wherein the selecting of the biller from all the verifiers by the current round biller Ur according to a fourth preset function f4 comprises:
and (4) independently confirming the bookkeepers in the current round through the bookkeepers Ur in the current round, and selecting the person with the smallest probability q value from the digital signatures of all the received candidate bookkeepers according to a fourth preset function f4 to be regarded as the bookkeepers in the current round.
6. A block chain consensus device based on password drawing is characterized by comprising:
The system comprises an operation module, a hash value acquisition module, a decimal acquisition module, a verifier selection module, a broadcast module, an bookkeeper selection module, an authentication module, a seed processing module and a repeated circulation module;
the operation module is used for operating one round r in the block chain to obtain seed information of the current round of operation, and the seed information is recorded as Sr;
The hash value obtaining module is configured to calculate, in each round, a hash value through a first preset function f1 based on the seed information, digitally sign the seed information through the first preset function f1 using a user private key, and obtain a specific hash value through a conversion function;
The decimal obtaining module is configured to obtain a decimal q between 0 and 1 through a second preset function f2, and write the obtained specific character string of the hash value to a decimal point through the second preset function f2 (0. H);
The verifier selecting module is configured to select a verifier from all candidate users through a third preset function f3, where for a decimal q < ═ p, a user meeting the condition is a verifier through the third preset function f 3; wherein p is a selection probability;
The broadcast module is used for broadcasting the signature information of the seed information and the decimal q to a block chain network through the verifier in the current round, packaging the information to be recorded in the block, performing digital signature, and broadcasting the information to the whole block chain network;
the bookkeeper selecting module is used for selecting a bookkeeper from all verifiers through a current round bookkeeper Ur according to a fourth preset function f 4;
The authentication module is used for authenticating that one new block Br is a new block of a block chain in the current round when the verifier realizes consensus on the new block Br;
the seed processing module is configured to update seed information of a next round of seeds Sr +1 through a fifth preset function f5, and perform signature and hash on seed information of the updated next round of seeds Sr +1 through the fifth preset function f5 on seed information of a previous round and block information of a current round to obtain a next round of seeds Sr +1 ═ H (SIG (Sr, Br));
And the repeated circulation module is used for repeatedly entering the next circulation.
7. the apparatus of claim 6, wherein the first predetermined function f1 is a function transformation that is approximately random by hashing a signature.
8. The apparatus of claim 6, wherein the fraction obtaining module is specifically configured to:
Obtaining a decimal q between 0 and 1 through a second preset function f2, converting the obtained specific hash value into a 2-system character string through the second preset function f2, and adding '0' in front of the converted character string to construct a binary decimal (0.H) between 0 and 1.
9. The apparatus according to claim 6, wherein the third predetermined function f3 selects users smaller than p for the binary decimal 0.H of all candidate users; wherein p is a selection probability; the third preset function f3 includes a way to select less than a selection probability.
10. The apparatus of claim 6, wherein the biller selection module is specifically configured to:
And (4) independently confirming the bookkeepers in the current round through the bookkeepers Ur in the current round, and selecting the person with the smallest probability q value from the digital signatures of all the received candidate bookkeepers according to a fourth preset function f4 to be regarded as the bookkeepers in the current round.
CN201910872083.6A 2019-09-16 2019-09-16 Block chain consensus method, device and equipment based on password drawing Pending CN110545170A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910872083.6A CN110545170A (en) 2019-09-16 2019-09-16 Block chain consensus method, device and equipment based on password drawing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910872083.6A CN110545170A (en) 2019-09-16 2019-09-16 Block chain consensus method, device and equipment based on password drawing

Publications (1)

Publication Number Publication Date
CN110545170A true CN110545170A (en) 2019-12-06

Family

ID=68713674

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910872083.6A Pending CN110545170A (en) 2019-09-16 2019-09-16 Block chain consensus method, device and equipment based on password drawing

Country Status (1)

Country Link
CN (1) CN110545170A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111083221A (en) * 2019-12-13 2020-04-28 北京菲林方德科技有限公司 Transaction verification method and device
CN111125259A (en) * 2019-12-31 2020-05-08 预言机(重庆)科技有限公司 Random seed providing method based on block chain bottom layer
CN113269570A (en) * 2021-06-11 2021-08-17 深圳番多拉信息科技有限公司 Extraction result verification method and related device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566124A (en) * 2017-08-24 2018-01-09 深圳市易成自动驾驶技术有限公司 Common recognition method for building up, block catenary system and storage medium based on lottery mechanism
WO2018119930A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Transaction verification processing method, apparatus and node device
CN108509615A (en) * 2018-03-30 2018-09-07 深圳市元征科技股份有限公司 Common recognition method for building up, device and readable storage medium storing program for executing based on lottery mechanism
CN108964879A (en) * 2018-07-20 2018-12-07 杭州复杂美科技有限公司 A kind of drawing method, common recognition method, equipment and storage medium
CN110210967A (en) * 2018-02-28 2019-09-06 成都高新信息技术研究院 A kind of high speed, the block chain POS common recognition calculation method of frequency conversion and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018119930A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Transaction verification processing method, apparatus and node device
CN107566124A (en) * 2017-08-24 2018-01-09 深圳市易成自动驾驶技术有限公司 Common recognition method for building up, block catenary system and storage medium based on lottery mechanism
CN110210967A (en) * 2018-02-28 2019-09-06 成都高新信息技术研究院 A kind of high speed, the block chain POS common recognition calculation method of frequency conversion and system
CN108509615A (en) * 2018-03-30 2018-09-07 深圳市元征科技股份有限公司 Common recognition method for building up, device and readable storage medium storing program for executing based on lottery mechanism
CN108964879A (en) * 2018-07-20 2018-12-07 杭州复杂美科技有限公司 A kind of drawing method, common recognition method, equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111083221A (en) * 2019-12-13 2020-04-28 北京菲林方德科技有限公司 Transaction verification method and device
CN111083221B (en) * 2019-12-13 2023-08-04 北京菲林方德科技有限公司 Transaction verification method and device
CN111125259A (en) * 2019-12-31 2020-05-08 预言机(重庆)科技有限公司 Random seed providing method based on block chain bottom layer
CN111125259B (en) * 2019-12-31 2023-08-18 预言机(重庆)科技有限公司 Random seed providing method based on blockchain bottom layer
CN113269570A (en) * 2021-06-11 2021-08-17 深圳番多拉信息科技有限公司 Extraction result verification method and related device
CN113269570B (en) * 2021-06-11 2024-04-09 深圳番多拉信息科技有限公司 Extraction result verification method and related device

Similar Documents

Publication Publication Date Title
CN109075964B (en) Block chaining supporting multiple one-way functions for block verification
CN107438002B (en) Block chain based system and electronic device and method in system
CN108667632B (en) Credit record sharing method and device based on block chain and electronic equipment
CN109493204B (en) Service accounting method based on block chain and terminal equipment
CN112541757A (en) Method for enabling a first entity of a blockchain system to prove to other entities
CN110855432B (en) Asynchronous BFT &amp; DPOS consensus mechanism for assigning verifier rewards based on verifiable random functions
CN110599173A (en) Block chain consensus node determination method, device, equipment and storage medium
CN111008863B (en) Lottery drawing method and system based on block chain
CN110545170A (en) Block chain consensus method, device and equipment based on password drawing
CN102983971B (en) Certificateless signature algorithm for user identity authentication in network environment
EP3721582B1 (en) Blockchain-implemented security systems and methods for blinded outcome selection
EP3857814A1 (en) Computer-implemented system and method for transferring access to digital resource
CN110601815B (en) Block chain data processing method and equipment
CN112839041B (en) Block chain-based power grid identity authentication method, device, medium and equipment
CN112769548B (en) Block chain numerical information transmission method, system, device and computer medium
WO2014068427A1 (en) Reissue of cryptographic credentials
CN114503146A (en) Method and apparatus for registration and authentication of miner identity in a blockchain network
CN111461799B (en) Data processing method, data processing device, computer equipment and medium
CN110990790B (en) Data processing method and equipment
US20090271631A1 (en) Electronic signature system and electronic signature verifying method
CN113939821A (en) System and method for non-parallel mining on a workload justification blockchain network
CN116506134B (en) Digital certificate management method, device, equipment, system and readable storage medium
CN113988831A (en) Transfer method based on alliance chain
CN115705601A (en) Data processing method and device, computer equipment and storage medium
Boontaetae et al. RDI: Real digital identity based on decentralized PKI

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191206

RJ01 Rejection of invention patent application after publication