CN115392912A - Random number generation method, system, device and storage medium - Google Patents
Random number generation method, system, device and storage medium Download PDFInfo
- Publication number
- CN115392912A CN115392912A CN202211314715.5A CN202211314715A CN115392912A CN 115392912 A CN115392912 A CN 115392912A CN 202211314715 A CN202211314715 A CN 202211314715A CN 115392912 A CN115392912 A CN 115392912A
- Authority
- CN
- China
- Prior art keywords
- transaction
- information
- node
- signature
- consensus
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 230000002776 aggregation Effects 0.000 claims abstract description 42
- 238000004220 aggregation Methods 0.000 claims abstract description 42
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 38
- 238000007781 pre-processing Methods 0.000 claims abstract description 16
- 230000015654 memory Effects 0.000 claims description 13
- 238000012216 screening Methods 0.000 claims description 12
- 238000012795 verification Methods 0.000 claims description 11
- 230000004931 aggregating effect Effects 0.000 claims description 10
- 230000002159 abnormal effect Effects 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 230000008569 process Effects 0.000 description 6
- 230000008878 coupling Effects 0.000 description 5
- 238000010168 coupling process Methods 0.000 description 5
- 238000005859 coupling reaction Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 239000000446 fuel Substances 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 238000013459 approach Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000008929 regeneration Effects 0.000 description 2
- 238000011069 regeneration method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000012067 mathematical method Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3825—Use of electronic signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/389—Keeping log of transactions for guaranteeing non-repudiation of a transaction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic 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/3247—Cryptographic 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic 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/3247—Cryptographic 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
- H04L9/3255—Cryptographic 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 using group based signatures, e.g. ring or threshold signatures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic 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/3297—Cryptographic 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 time stamps, e.g. generation of time stamps
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2209/00—Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
- H04L2209/46—Secure multiparty computation, e.g. millionaire problem
- H04L2209/463—Electronic voting
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a random number generation method, a system, equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: receiving a transaction request sent by a client, enabling a plurality of common identification nodes to respectively acquire initial transaction information according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each common identification node; judging the multiple consensus nodes according to a preset consensus algorithm to determine an agenda node and a conference member node, and enabling the agenda node to aggregate node transaction lists corresponding to the consensus nodes in the block chain network to generate a block transaction list and send the block transaction list to the multiple consensus nodes; if the plurality of common identification nodes verify the block transaction list according to the signature aggregation information, determining the signature aggregation information as target signature information; and generating a random number according to the target signature information. The random number can be safely generated through the embodiment of the disclosure.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, a system, a device, and a storage medium for generating random numbers.
Background
In the related art, the currently used blockchain system includes two types: a decentralized ledger and a decentralized computer. The decentralized account book is a first generation technology, which is only used for recording transaction information transmitted among multiple parties, and generally does not have the capability of automatically executing transactions. While second generation technology decentralized computers can support complex system logic, rather than simple ledgers. These execution logic are implemented by intelligent contracts organized by blockchain participants, and the entire blockchain network will provide an execution environment for the code of the intelligent contracts. The computational power and attributes provided by smart contracts differ from conventional computers because their code is highly transparent and participants can easily predict the outcome of execution, which makes it difficult for a computer to generate pseudo-random numbers. Random numbers have wide application in various real-world scenes, which all limit the application of the blockchain network.
The related art relies on the following models to generate random numbers, and has the following disadvantages:
1. special nodes are elected to centrally generate random numbers. This approach is more demanding for special nodes because randomness is difficult to verify in a single instance and is not suitable for some blockchain scenarios.
2. An external random number is used. In this case, the blockchain requires full trust in the external random number generator, and the external system will generate the random number as a proxy and return it to the blockchain system. In addition to the random number itself, the external system typically submits a cryptographic proof package associated with the generation of the random number to the system for verification. This scheme can provide not only randomness, but also certain authentication capabilities. However, the use of such external systems results in that the block chain will rely heavily on external implementations, and the direct strong data coupling may affect the quality of the data and the usability of the system.
3. A random number based on a verifiable delay function. A drawback of this type of scheme is that as computer power continues to increase and new mathematical methods advance, many cryptographic schemes become more likely to be attacked. For such schemes, which rely on the use of delay function cryptography schemes, there are many potential means by which an attacker may affect the system, thereby posing a potential threat to the system.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a random number generation method, a system, equipment and a storage medium, which can safely generate random numbers and have practicability.
In order to achieve the above object, a first aspect of the embodiments of the present disclosure provides a random number generation method, including:
receiving a transaction request sent by a client, enabling a plurality of common identification nodes to respectively acquire initial transaction information according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each common identification node;
judging the multiple common identification nodes according to a preset common identification algorithm to determine an agenda node and a deputy node, and enabling the agenda node to aggregate node transaction lists corresponding to the common identification nodes in the block chain network to generate a block transaction list and send the block transaction list to the multiple common identification nodes;
if the plurality of common identification nodes verify the block transaction list according to the signature aggregation information, determining the signature aggregation information as target signature information; the signature aggregation information is generated by the agenda node according to the fact that the information quantity of the collected signature information is higher than the preset threshold quantity, and the collected signature information is aggregated;
and generating a random number according to the target signature information.
In some embodiments, pre-processing the initial transaction information to generate a node transaction list and signature information corresponding to each of the consensus nodes comprises:
the multiple consensus nodes verify the initial transaction information according to a preset signature algorithm, screen out the initial transaction information with the effective signature, and determine the initial transaction information with the effective signature as effective transaction information;
the plurality of common identification nodes respectively push the effective transaction information into the corresponding transaction cache pools according to the first-in first-out sequence so as to generate the corresponding node transaction list and the signature information.
In some embodiments, the verifying the initial transaction information according to a preset signature algorithm by the plurality of consensus nodes, screening out the initial transaction information with a valid signature, and determining the initial transaction information with the valid signature as the valid transaction information includes:
screening all initial transaction information under the condition that a preset number of initial node transaction lists are met by the multiple consensus nodes;
and the multiple consensus nodes calculate the time stamp value of each initial transaction information, and screen out abnormal transaction information meeting preset screening conditions in the initial transaction information according to the time stamp values to obtain effective transaction information.
In some embodiments, the pushing, by the plurality of consensus nodes, the valid transaction information into the corresponding transaction cache pools respectively according to a first-in-first-out order to generate the corresponding node transaction lists and the signature information includes:
the multiple consensus nodes calculate average time stamp values corresponding to all the effective transaction information according to the time stamp value corresponding to each effective transaction information;
the multiple consensus nodes sort all the effective transaction information according to the average timestamp value to obtain a transaction sequence corresponding to the effective transaction information;
and the plurality of common identification nodes respectively push the effective transaction information corresponding to the plurality of common identification nodes into the corresponding transaction cache pools according to the transaction sequence and the first-in first-out sequence so as to generate corresponding node transaction lists and signature information.
In some embodiments, after receiving a transaction request sent by a client, and enabling a plurality of consensus nodes to respectively obtain initial transaction information according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each consensus node, the random number generation method further includes:
enabling the consensus node to acquire all subscript information of the same transaction information from a preset number of node transaction lists according to the transaction request;
the method comprises the steps that a plurality of consensus nodes calculate a distance value between each subscript information and other subscript information of the same transaction information in each node transaction list;
the multiple consensus nodes compare the distance values of the same transaction information in all the node transaction lists, determine the initial transaction information of which the error range of the distance values exceeds the preset range as malicious transaction information, and screen out the malicious transaction information and the node transaction list corresponding to the malicious transaction information.
In some embodiments, determining the plurality of consensus nodes according to a predetermined consensus algorithm to determine the agenda node and the agenda node comprises:
acquiring random timing information corresponding to a plurality of consensus nodes, wherein each consensus node sends voting request information to other consensus nodes and receives voting information fed back by other consensus nodes according to the voting request information;
and each consensus node counts the number of votes according to the voting information received in the timing period corresponding to the random timing information, and determines the chairman node and the deputiant node according to the number of votes corresponding to each consensus node.
In some embodiments, the random number generation method further comprises:
if the verification of the block transaction list by the plurality of consensus nodes according to the signature aggregation information fails, a re-consensus instruction is sent to the plurality of consensus nodes so that the plurality of consensus nodes can regenerate the node transaction list.
To achieve the above object, a second aspect of an embodiment of the present disclosure provides a random number generation system, including:
the preprocessing module is used for receiving a transaction request sent by a client, enabling the plurality of consensus nodes to respectively acquire initial transaction information according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each consensus node;
the aggregation transaction list module is used for judging the multiple consensus nodes according to a preset consensus algorithm to determine the agenda node and the candidate node, and enabling the agenda node to aggregate the node transaction lists corresponding to all the consensus nodes in the block chain network to generate a block transaction list and send the block transaction list to the multiple consensus nodes;
the system comprises a block transaction list verification module, a signature aggregation information module and a signature aggregation module, wherein the block transaction list verification module is used for verifying a block transaction list according to signature aggregation information; the signature aggregation information is generated by the agenda node according to the fact that the information quantity of the collected signature information is higher than the preset threshold quantity, and the collected signature information is aggregated;
and the random number generation module is used for generating a random number according to the target signature information.
To achieve the above object, a third aspect of the embodiments of the present disclosure provides an electronic device, including:
at least one memory;
at least one processor;
at least one program;
the programs are stored in a memory, and a processor executes the at least one program to implement:
a method of generating random numbers as described in the first aspect above.
To achieve the above object, a fourth aspect of embodiments of the present disclosure proposes a storage medium which is a computer-readable storage medium storing computer-executable instructions for causing a computer to perform:
a method of generating random numbers as described in the first aspect above.
The random number generation method, the system, the equipment and the storage medium provided by the embodiment of the invention at least have the following beneficial effects: firstly, receiving a transaction request sent by a client, respectively acquiring initial transaction information by a plurality of consensus nodes according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each consensus node; judging the multiple consensus nodes according to a preset consensus algorithm to determine an agenda node and a conference member node, and enabling the agenda node to aggregate node transaction lists corresponding to the consensus nodes in the block chain network to generate a block transaction list and send the block transaction list to the multiple consensus nodes; if the block transaction list is verified by the plurality of common identification nodes according to the signature aggregation information, determining the signature aggregation information as target signature information; the signature aggregation information is generated by aggregating the collected signature information according to the fact that the information quantity of the collected signature information is higher than the preset threshold quantity by the agenda node; and generating a random number according to the target signature information. The random number generation system can safely generate the random number and verify the random number, so that the random number generation system can be suitable for more block chain application scenes, and has higher practicability.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The invention is further described with reference to the following figures and examples, in which:
fig. 1 is a first detailed flowchart of a random number generation method according to the present invention;
FIG. 2 is a flowchart illustrating a specific process of step S100 in FIG. 1;
FIG. 3 is a flowchart illustrating a specific process of step S110 in FIG. 2;
FIG. 4 is a flowchart illustrating the step S120 in FIG. 2;
FIG. 5 is a schematic diagram of a second specific flow chart provided by the present invention to supplement the method for generating random numbers in FIG. 1;
FIG. 6 is a flowchart illustrating a specific process of step S200 in FIG. 1;
FIG. 7 is a schematic diagram of fuel consumption for random number invocation by a random number generation method provided in the present invention;
FIG. 8 is a schematic diagram of the overhead on the chain for a reference implementation of a random number generation method provided by the present invention;
FIG. 9 is a timing diagram of BLS signature aggregation for a random number generation method according to the present invention;
fig. 10 is a timing diagram illustrating initial setting of BLS according to a random number generation method of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings only for the convenience of description of the present invention and simplification of the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality is one or more, the meaning of a plurality is two or more, and the above, below, exceeding, etc. are understood as excluding the present numbers, and the above, below, within, etc. are understood as including the present numbers. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, unless otherwise specifically limited, terms such as set, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention by combining the specific contents of the technical solutions.
In the description of the present invention, reference to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
First, several terms referred to in the present application are resolved:
maximum attainable Value (MEV), maximum Extractable Value: the value that the node actually responsible for generating the block chain in the block chain can obtain by organizing the transaction sequence and temporarily increasing the elimination transaction is referred to.
Bonen-lin-sakemu Signature (transliteration) (BLS Signature, boneh-Lynn-Shacham Signature): a method of digital signing allows a user to verify the authenticity of the signer.
First-In First-Out algorithm (FIFO, first-In-First-Out): an algorithm that organizes data structures typically processes the earliest entering entry first.
Software protection Extensions (SGX, software Guard Extensions): intel corporation provides a hardware trusted execution environment technology.
Practical Byzantine Fault tolerance (PBFT, practical Byzantine Fault Tolerant): PBFT is a consensus algorithm based on voting, namely: byzantine fault tolerance: even if some nodes are faulty or malicious, the activity and security of the network can be guaranteed as long as a minimum percentage of the nodes are connected, working properly and behaving honestly.
The related art relies on the following models to generate random numbers, and has the following disadvantages:
1. special nodes are elected to centrally generate random numbers. This approach is more demanding for special nodes because randomness is difficult to verify in a single instance and is not suitable for some blockchain scenarios.
2. An external random number is used. In this case, the blockchain requires full trust in the external random number generator, and the external system will act as a proxy to generate and return the random number to the blockchain system. In addition to the random number itself, the external system typically presents a cryptographic proof package associated with the generation of the random number to the system for verification. This scheme can provide not only randomness, but also certain authentication capabilities. However, the use of such external systems results in that the block chain will rely heavily on external implementations, and the direct strong data coupling may affect the quality of the data and the usability of the system.
3. A random number based on a verifiable delay function. The verifiable delay function is a function specially constructed in cryptography, the forward calculation of the value of the function requires a certain time, and the calculation process cannot be accelerated significantly; after the forward calculation is finished, the operation of verifying the correctness of the result is usually very easy, and the time consumption is significantly lower than that of the forward calculation, so that all people can easily verify the result. A drawback of such schemes is that as computer power continues to increase and new mathematical approaches advance, many cryptographic schemes are more likely to be attacked. For the delay function cryptography scheme which is used by the scheme, an attacker has many potential means which can influence the system, such as accelerating the execution of the delay function by designing special hardware, and further predicting the value of the related pseudo random number in advance.
Based on this, the random number generation method, system, device and storage medium provided by the embodiments of the present disclosure can realize secure random number generation through a threshold signature algorithm with better stability and robustness.
Specifically, the following embodiments are described, and the random number generation method in the embodiments of the present disclosure is first described.
As shown in fig. 1, which is a schematic diagram of an implementation flow of a random number generation method provided in an embodiment of the present application, the random number generation method may include, but is not limited to, steps S100 to S400.
S100, receiving a transaction request sent by a client, enabling a plurality of consensus nodes to respectively obtain initial transaction information according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each consensus node;
s200, judging the multiple consensus nodes according to a preset consensus algorithm to determine an agenda node and a conference member node, and enabling the agenda node to aggregate node transaction lists corresponding to the consensus nodes in the block chain network to generate a block transaction list and send the block transaction list to the multiple consensus nodes;
s300, if the block transaction list is verified by the multiple consensus nodes according to the signature aggregation information, determining the signature aggregation information as target signature information; the signature aggregation information is generated by the agenda node according to the fact that the information quantity of the collected signature information is higher than the preset threshold quantity, and the collected signature information is aggregated;
and S400, generating a random number according to the target signature information.
In step S100 of some embodiments, a transaction request sent by a client is received, a plurality of consensus nodes respectively obtain initial transaction information according to the transaction request, and the initial transaction information is preprocessed to generate a node transaction list and signature information corresponding to each consensus node. It can be understood that, the client sends a transaction request to the computer program, the random number generation device enables the multiple consensus nodes to respectively obtain initial transaction information according to the received transaction request, that is, each consensus node collects transactions from the BFT consensus network to obtain the initial transaction information, each consensus node respectively preprocesses the initial transaction information, so as to generate a node transaction list and signature information corresponding to each consensus node, and the signature information may be obtained by signing the generated node transaction list for each consensus node according to a local BLS private key.
The method includes the steps that preprocessing is carried out, wherein a plurality of consensus nodes verify initial transaction information according to a preset signature algorithm, the initial transaction information with effective signatures is screened out, and the initial transaction information with the effective signatures is determined to be effective transaction information; and the plurality of common identification nodes respectively push the effective transaction information into the corresponding transaction cache pools according to the first-in first-out sequence so as to generate corresponding node transaction lists and signature information.
In step S200 of some embodiments, a plurality of consensus nodes are determined according to a predetermined consensus algorithm to determine an agenda node and a panelist node, and the agenda node performs aggregation processing on node transaction lists corresponding to the consensus nodes in the blockchain network to generate a block transaction list, and sends the block transaction list to the plurality of consensus nodes. It is understood that the computer program determines the plurality of consensus nodes according to a predetermined consensus algorithm, and determines the agenda node and the agenda node according to the determination. After the chairman node is determined, the chairman node aggregates node transaction lists respectively corresponding to a plurality of common identification nodes in the blockchain network to generate a blockchain transaction list, and broadcasts the blockchain transaction list to the blockchain network so as to facilitate the collection of the common identification nodes in the blockchain network, and therefore the common identification nodes can collect transaction information corresponding to the blockchain transaction list.
It should be noted that the block transaction list is a node transaction list set obtained by aggregating node transaction lists corresponding to a plurality of common nodes in the block chain network.
In step S300 of some embodiments, if the plurality of common identification nodes verify the block transaction list according to the signature aggregation information, determining that the signature aggregation information is the target signature information; and the signature aggregation information is generated by aggregating the collected signature information according to the condition that the information quantity of the collected signature information is higher than the preset threshold quantity by the agenda node. It can be understood that, if it is determined that the number of pieces of signature information collected by the agenda node obtained according to the step S200 is greater than the preset threshold number, where the preset threshold number may be 2/3, the collected signature information is aggregated to generate signature aggregated information, the block transaction list obtained in the step S200 is verified according to the signature aggregated information, and if the block transaction list is verified according to the signature aggregated information by the multiple consensus nodes, it is determined that the signature aggregated information is the target signature information.
In step S400 of some embodiments, a random number is generated from the target signature information. It is understood that a random number is generated from the target signature information obtained in step S300. The target signature information is used as a random number generation seed for generating a random number, and the random number seed is processed according to a preset generation algorithm to generate the random number.
It should be noted that when a consensus node receives enough BLS signatures from the blockchain network, it invokes the BLS aggregation algorithm to aggregate the BLS signatures into a final signature, i.e., the target signature information, and the target signature information is used as a random number, because all consensus nodes run the same BLS algorithm, and thus the random numbers generated by all consensus nodes are the same. The whole block chain network is realized based on a Byzantine fault-tolerant consensus algorithm, and the threshold value of BLS signature aggregation is set to exceed 1/3 of the number of all consensus nodes. For example, when there are seven consensus nodes in the blockchain network, only the signature information of three consensus nodes needs to be collected, and the final signature, that is, the target signature information, that is, the random number seed can be aggregated. Setting the number of nodes to exceed 1/3 is considered because if the threshold is set to be less than 1/3 of the consensus node, then the malicious nodes can combine to construct a false random number seed to affect the correctness of random number generation.
In some embodiments, as shown with reference to fig. 2, step S100 may also include, but is not limited to, steps S110 to S120.
S110, the plurality of consensus nodes verify the initial transaction information according to a preset signature algorithm, screen out the initial transaction information with the effective signature, and determine the initial transaction information with the effective signature as effective transaction information;
and S120, the plurality of common identification nodes respectively push the effective transaction information into the corresponding transaction cache pools according to a first-in first-out sequence so as to generate corresponding node transaction lists and signature information.
In step S110 of some embodiments, the plurality of consensus nodes verify the initial transaction information according to a preset signature algorithm, screen out the initial transaction information with a valid signature, and determine the initial transaction information with the valid signature as valid transaction information. It can be understood that the plurality of consensus nodes verify the initial transaction information according to a locally preset signature algorithm, the signature algorithm may be a BLS private key encryption algorithm and a public key decryption algorithm, and screen out the initial transaction information with a valid signature to prevent some initial transaction information from having no signature or tampering with the signature, so that the initial transaction information with the valid signature is screened out and taken as the valid transaction information.
It should be noted that, the obtaining of the valid transaction information may further include the following steps: screening all initial transaction information under the condition that a preset number of initial node transaction lists are met by the multiple consensus nodes; and the multiple consensus nodes calculate the time stamp value of each initial transaction information, and screen out abnormal transaction information meeting preset screening conditions in the initial transaction information according to the time stamp values, so as to obtain effective transaction information.
In step S120 of some embodiments, the multiple common nodes respectively push the valid transaction information into the corresponding transaction cache pools according to a first-in-first-out order to generate the corresponding node transaction lists and signature information. It can be understood that the plurality of consensus nodes respectively push the effective transaction information obtained in step S120 into the transaction cache pool corresponding to each consensus node according to a first-in first-out sequence, so as to generate a node transaction list corresponding to each consensus node and signature information corresponding to the node transaction list.
It should be noted that the transaction buffer pool is a FIFO transaction buffer pool, which is a first-in first-out transaction buffer pool and exists in each common node. The transaction cache pool is essentially a transaction queue, the consensus node pushes the transactions acquired from the blockchain network into the transaction cache pool from the tail of the transaction queue, and then pops up the transactions from the front of the transaction queue, so that each transaction can be sorted according to the first-in first-out sorting logic. In addition, before the transaction corresponding to the transaction information is pushed into the transaction cache pool, the consensus node verifies the digital signature of each transaction and the account balance of the consensus node. Only those transactions that pass signature verification and have a sufficient balance to pay a commission fee will be pushed into the cache pool. Those transactions that fail the verification are discarded directly. When each round of consensus starts, the consensus node acquires a certain amount of transactions corresponding to the transaction information from the transaction cache pool and packages the transactions corresponding to the transaction information into a node transaction list. These node transaction lists are broadcast into the blockchain network. The chairman node listens to the network for information containing a list of node transactions.
In some embodiments, as shown with reference to fig. 3, step S110 may also include, but is not limited to, steps S111-S112.
S111, screening out all initial transaction information under the condition that a preset number of initial node transaction lists are met by the multiple consensus nodes;
and S112, the multiple consensus nodes calculate the timestamp value of each initial transaction message, and screen out abnormal transaction messages meeting preset screening conditions in the initial transaction messages according to the timestamp values to obtain effective transaction messages.
In step S111 of some embodiments, the plurality of consensus nodes filters out all the initial transaction information under the condition that a preset number of initial node transaction lists are satisfied. It can be understood that the plurality of consensus nodes first screen the initial node transaction lists meeting a preset number, where the preset number may be more than 2/3 of the initial node transaction lists in the block chain consensus network, so as to ensure that the byzantine algorithm can be met, and all initial transaction information corresponding to at least 2/3 of the initial node transaction lists is obtained to obtain effective transaction information.
In step S112 of some embodiments, the multiple consensus nodes calculate a timestamp value of each initial transaction message, and screen out abnormal transaction messages meeting a preset screening condition in the initial transaction messages according to the timestamp value, so as to obtain valid transaction messages. It can be understood that the multiple common identification nodes respectively calculate the timestamp value of each initial transaction information corresponding to each common identification node, and then screen out the abnormal transaction information meeting the preset screening condition according to the timestamp value corresponding to each initial transaction information, that is, screen out 1/3 part of transactions with timestamp values at the edge for each transaction corresponding to each initial transaction information, so as to ensure that nobody can decide the ordering of each transaction in the transaction ordering algorithm, and can only decide by the transaction ordering algorithm, thereby ensuring that someone else is prevented from temporarily constructing transactions, and inserting the transactions into the block transaction list: before the random number is used, the transaction list is already aggregated, and the temporary regeneration needs to exceed 2/3 of the nodes for regeneration, which exceeds the requirements of the original hypothesis; no one can delete a valid transaction from the block transaction list: if the existing transaction in the aggregated transaction list is deleted, the transaction list exceeding 2/3 needs to be changed, which exceeds the requirements of the original hypothesis; the fairness of the block transaction list is verifiable to the consensus node: all normal consensus node transaction lists are FIFO broadcast and anyone can aggregate.
In some embodiments, as shown with reference to fig. 4, step S120 may also include, but is not limited to, steps S121 to S123.
S121, calculating average time stamp values corresponding to all effective trading information respectively by the plurality of consensus nodes according to the time stamp value corresponding to each effective trading information;
s122, sequencing all effective transaction information by the multiple consensus nodes according to the average timestamp value to obtain a transaction sequence corresponding to the effective transaction information;
and S123, the plurality of common identification nodes push the effective transaction information corresponding to the plurality of common identification nodes into the corresponding transaction cache pools respectively according to the transaction sequence and the first-in first-out sequence so as to generate the corresponding node transaction list and the signature information.
In step S121 of some embodiments, the multiple consensus nodes calculate average timestamp values corresponding to all valid transaction information respectively according to the timestamp value corresponding to each valid transaction information. It can be understood that the multiple consensus nodes respectively calculate the timestamp value of each transaction corresponding to each valid transaction message, and each consensus node further calculates an average timestamp value corresponding to each valid transaction message according to the timestamp value of each transaction, so as to sort each valid transaction message corresponding to each transaction according to the average timestamp value.
In step S122 of some embodiments, the plurality of consensus nodes sort all valid transaction information according to the average timestamp value to obtain a transaction order corresponding to the valid transaction information. It is to be understood that the plurality of consensus nodes rank the ordered transaction information obtained in step S112 according to the average timestamp value calculated in step S121, and it is to be noted that the ranking may be performed in an order from a large transaction amount or a small remaining balance, so as to obtain a transaction order of each transaction corresponding to the valid transaction information.
In step S123 of some embodiments, the common nodes respectively push the valid transaction information corresponding to the common nodes into the corresponding transaction cache pools according to the transaction sequence and the first-in-first-out sequence to generate the corresponding node transaction list and the signature information. It can be understood that, according to the transaction sequence obtained in step S122 and the first-in first-out sequence in step S120, each consensus node pushes the transaction corresponding to the ordered transaction information of each consensus node into the transaction cache pool of each consensus node, so as to generate a node transaction list corresponding to each consensus node, and each transaction has a corresponding signature, so that the transaction sequence is determined, the signature sequence is also determined, the node transaction list is obtained, and the signature list is also obtained, and the signature information includes the signature list.
In some embodiments, as illustrated with reference to fig. 5, a random number generation method may further include, but is not limited to, steps S130 to S150.
S130, enabling the consensus node to acquire all subscript information of the same transaction information from a preset number of node transaction lists according to the transaction requests;
s140, calculating a distance value between each subscript information and other subscript information of the same transaction information in each node transaction list by the plurality of consensus nodes;
s150, the plurality of consensus nodes compare the distance values of the same transaction information in all the node transaction lists, determine the initial transaction information of which the error range of the distance values exceeds the preset range as malicious transaction information, and screen out the malicious transaction information and the node transaction list corresponding to the malicious transaction information.
In step S130 of some embodiments, the consensus node obtains all subscript information of the same transaction information from a preset number of node transaction lists according to the transaction request. It can be understood that each consensus node acquires all subscript information of the same transaction information from node transaction lists of a preset number, where the preset number is more than 2/3 of the node transaction lists, the same transaction information is the same transaction corresponding to each transaction information, and then the computer program acquires all subscript information of the same transaction according to the transaction request.
In step S140 of some embodiments, the plurality of consensus nodes calculate a distance value between each subscript information and other subscript information of the same transaction information in each node transaction list. It can be understood that each consensus node respectively calculates a distance value between each subscript information and other subscript information of the same transaction information in each node transaction list, and is used for determining whether the node transaction list is malicious transaction information.
In step S150 of some embodiments, the plurality of consensus nodes compare distance values of the same transaction information in all node transaction lists, determine initial transaction information in which an error range of the distance values exceeds a preset range as malicious transaction information, and screen out the malicious transaction information and the node transaction list corresponding to the malicious transaction information. It can be understood that each consensus node compares the distance values between the subscript information of the same transaction obtained in step S140, regards the initial transaction information of which the error range of the distance values exceeds the preset range as malicious transaction information, and then screens out the transactions corresponding to the malicious transaction information, thereby eliminating the malicious transaction information and the node transaction list corresponding to the malicious transaction information.
It should be noted that, assuming that there are seven common nodes in total, when aggregating transaction lists, only five node transaction lists need to be obtained, and when calculating an aggregation result, that is, a block transaction list, the number of malicious nodes not exceeding 1/3, that is, two outliers, needs to be calculated from the five node transaction lists, so that when finally aggregating, three node transaction lists participate in aggregating to obtain a final block transaction list. The final block transaction list is broadcast to the whole network together with the node transaction list generated by the node, and when other consensus nodes receive the information, the other consensus nodes can generate the block transaction list by themselves according to the same logic to verify whether the block transaction list from the chairman node is true. The method can be verified, and the aggregation result comes from the whole block chain network (consensus network).
In some embodiments, as shown with reference to fig. 6, step S200 may also include, but is not limited to, steps S210-S220.
S210, acquiring random timing information corresponding to a plurality of consensus nodes, wherein each consensus node sends voting request information to other consensus nodes and receives voting information fed back by other consensus nodes according to the voting request information;
and S220, counting the voting number of the voting information received in the timing period corresponding to the random timing information by each consensus node, and determining the chairman node and the panel node according to the voting number corresponding to each consensus node.
In step S210 of some embodiments, random timing information corresponding to a plurality of consensus nodes is obtained, where each consensus node sends voting request information to other consensus nodes, and receives voting information fed back by other consensus nodes according to the voting request information. It can be understood that the plurality of consensus nodes acquire the corresponding random timers and generate random timing information, each consensus node sends voting request information requesting to cast a vote of the chairman node to other consensus nodes, and each consensus node can cast only one vote and feeds back voting information of the vote of the consensus node sending the voting request according to the receiving sequence of the received voting request information.
In step S220 of some embodiments, each consensus node counts the number of votes according to the voting information received in the timing period corresponding to the random timing information, and determines the chairman node and the panelist node according to the number of votes corresponding to each consensus node. It can be understood that each consensus node counts the number of votes of the voting information received in the timing period corresponding to the random timing information, and performs comparison and ordering processing on the number of votes corresponding to each consensus node, so as to determine the consensus node with the largest number of votes as the chairman node, and determine the other consensus nodes as the agenda nodes.
It should be noted that, the example corresponding to the above-mentioned determining the agenda node and the agenda node from the multiple consensus nodes according to the consensus algorithm is as follows: for example, now there are 3 general A, B, C, each of which has a random time countdown, and when the countdown is over, the general will serve itself as a candidate of the big general, then send a messenger to ask other general to choose I from the general, and supposing that the countdown of the general A is over, he sends a message to transmit the information of voting to the general B and C, if the general B and C do not serve themselves as the candidate (the countdown is not over) and no voting is sent to other general, they send a vote to the general A, and when the messenger returns to the general A, the general A knows that he has received enough votes, and becomes the big general. After that, whether to attack is decided by the big general, then the messenger is dispatched to inform the other two general, if the reply is not received after a period of time (the messenger may be killed), then a messenger is dispatched again until the reply is received.
In steps of some embodiments, the random number generation method further comprises:
if the verification of the block transaction list by the plurality of consensus nodes according to the signature aggregation information fails, a re-consensus instruction is sent to the plurality of consensus nodes so that the plurality of consensus nodes can regenerate the node transaction list.
It can be understood that, if the plurality of consensus nodes fail to verify the block transaction list according to the signature aggregation information obtained in step S300, where the signature aggregation information is generated by the agenda node according to the fact that the information amount of the collected signature information is higher than the preset threshold amount, and performing aggregation processing on the collected signature information, a re-consensus instruction is sent to the plurality of consensus nodes, so that the plurality of consensus nodes re-generate the node transaction list to execute the random number generation method.
According to the random number generation method, the threshold signature algorithm with better stability and robustness is adopted to safely generate the random numbers.
Referring to fig. 7 to 10, fig. 7 is a diagram illustrating fuel consumption for random number invocation, fig. 8 is a diagram illustrating overhead on a chain for reference implementation, fig. 9 is a diagram illustrating timing of BLS signature aggregation, and fig. 10 is a diagram illustrating timing of initial setting of BLS. As can be seen from fig. 7, GAS Cost Ratio is fuel consumed by the random number, and GAS Cost is fuel consumed by the transaction, in the random number generation method provided in this embodiment, as the number of times of random number invocation in the contract increases, the average fuel consumption is in a downward trend, and therefore, the overhead related to the random number during the operation of the intelligent contract can be effectively reduced. As can be seen from fig. 8, baseLine is a BaseLine, the method for generating a random number provided in this embodiment uses the BaseLine as overhead of data on a chain under a callback mechanism, and the saving ratio of the overhead on the chain is higher than that of the callback mechanism in terms of the random number ratio, so that overhead related to the random number is saved. As can be seen from fig. 9, the left axis of fig. 9 is the time of aggregating signatures by the BLS algorithm, and the right axis is the standard deviation, and it can be seen from fig. 9 that the average time spent in aggregating signatures by the BLS algorithm decreases as the number of random number calls increases. As shown in fig. 10 and fig. 10 is a time taken for 7 nodes to complete generation of the distributed key, the overall time fluctuates between 0 and 6000ms, and most of the time falls to 3000ms, and 50% of the time can be completed within 1000 ms.
In addition, an embodiment of the present disclosure further provides a random number generation system, which can implement the above random number generation method, and the system includes:
the preprocessing module is used for receiving a transaction request sent by a client, enabling the plurality of consensus nodes to respectively acquire initial transaction information according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each consensus node;
the aggregation transaction list module is used for judging the multiple common identification nodes according to a preset common identification algorithm to determine an agenda node and a conference member node, and enabling the agenda node to aggregate node transaction lists corresponding to all the common identification nodes in the block chain network to generate a block transaction list and send the block transaction list to the multiple common identification nodes;
the system comprises a block transaction list verification module, a signature aggregation information module and a signature aggregation module, wherein the block transaction list verification module is used for verifying a block transaction list according to signature aggregation information; the signature aggregation information is generated by the agenda node according to the fact that the information quantity of the collected signature information is higher than the preset threshold quantity, and the collected signature information is aggregated;
and the random number generation module is used for generating a random number according to the target signature information.
The random number generation system provided by the embodiment of the disclosure can safely generate random numbers and has practicability.
For a specific operation process of the random number generation system, the above-mentioned random number generation method is referred to, and details are not repeated here.
In addition, an embodiment of the present disclosure also provides an electronic device, which includes:
at least one memory;
at least one processor;
at least one program;
the programs are stored in a memory, and a processor executes the at least one program to implement:
a method for generating random numbers as provided in the first aspect of the embodiments of the present disclosure.
In addition, the embodiment of the present disclosure further provides a storage medium storing executable instructions, where the executable instructions can be executed by a computer, so as to enable the computer to execute the method for generating random numbers according to the first aspect of the embodiment of the present disclosure.
The memory, as a non-transitory storage medium, may be used to store non-transitory software programs as well as non-transitory computer-executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiments described in the embodiments of the present disclosure are for more clearly illustrating the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation to the technical solutions provided in the embodiments of the present disclosure, and it is obvious to those skilled in the art that the technical solutions provided in the embodiments of the present disclosure are also applicable to similar technical problems with the evolution of technology and the emergence of new application scenarios.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, 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.
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, 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 solution of the embodiment.
In addition, functional units in the embodiments of the present application 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 application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present disclosure have been described above with reference to the accompanying drawings, and therefore do not limit the scope of the claims of the embodiments of the present disclosure. Any modifications, equivalents and improvements within the scope and spirit of the embodiments of the present disclosure should be considered within the scope of the claims of the embodiments of the present disclosure by those skilled in the art.
Claims (10)
1. A random number generation method, comprising:
receiving a transaction request sent by a client, enabling a plurality of consensus nodes to respectively obtain initial transaction information according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each consensus node;
judging the consensus nodes according to a preset consensus algorithm to determine an agenda node and a conference member node, and enabling the agenda node to aggregate the node transaction lists corresponding to all the consensus nodes in a block chain network to generate a block transaction list and send the block transaction list to the consensus nodes;
if the plurality of common identification nodes verify the block transaction list according to the signature aggregation information, determining the signature aggregation information as target signature information; the signature aggregation information is generated by aggregating the collected signature information according to the fact that the information quantity of the collected signature information is higher than the preset threshold quantity by the agenda node;
and generating a random number according to the target signature information.
2. The random number generation method of claim 1, wherein the preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each of the common identification nodes comprises:
the plurality of consensus nodes verify the initial transaction information according to a preset signature algorithm, screen out the initial transaction information with a valid signature, and determine the initial transaction information with the valid signature as valid transaction information;
and the plurality of the common identification nodes respectively push the effective transaction information into corresponding transaction cache pools according to a first-in first-out sequence so as to generate corresponding node transaction lists and the signature information.
3. The random number generation method according to claim 2, wherein the verifying the initial transaction information by the plurality of consensus nodes according to a preset signature algorithm, and screening out the initial transaction information with a valid signature to determine the initial transaction information with the valid signature as valid transaction information comprises:
screening all initial transaction information under the condition that a preset number of initial node transaction lists are met by the plurality of consensus nodes;
and the multiple consensus nodes calculate the time stamp value of each initial transaction message, and screen out abnormal transaction messages meeting preset screening conditions in the initial transaction messages according to the time stamp values to obtain the effective transaction messages.
4. The random number generating method of claim 2, wherein the plurality of the common node pushes the valid transaction information into the corresponding transaction cache pools according to a first-in first-out order to generate the corresponding node transaction list and the signature information, respectively, and comprises:
the multiple consensus nodes calculate average timestamp values corresponding to all the effective trading information respectively according to the timestamp value corresponding to each effective trading information;
the common identification nodes sort all the effective transaction information according to the average timestamp value to obtain a transaction sequence corresponding to the effective transaction information;
and the plurality of common identification nodes push the effective transaction information corresponding to the plurality of common identification nodes into corresponding transaction cache pools respectively according to the transaction sequence and the first-in first-out sequence so as to generate the corresponding node transaction list and the signature information.
5. The method according to claim 1, wherein after the receiving a transaction request sent by a client, and according to the transaction request, a plurality of consensus nodes respectively obtain initial transaction information, and preprocess the initial transaction information to generate a node transaction list and signature information corresponding to each of the consensus nodes, the method further comprises:
enabling a plurality of the consensus nodes to acquire all subscript information of the same transaction information from a preset number of the node transaction lists according to the transaction request;
calculating a distance value between each subscript information and other subscript information of the same transaction information in each node transaction list by the plurality of consensus nodes;
the plurality of consensus nodes compare the distance values of the same transaction information in all the node transaction lists, determine initial transaction information of which the error range of the distance values exceeds a preset range as malicious transaction information, and screen out the malicious transaction information and the node transaction list corresponding to the malicious transaction information.
6. The random number generation method of any one of claims 1 to 5, wherein the determining a plurality of the consensus nodes according to a predetermined consensus algorithm to determine the chairman node and the agenda node comprises:
acquiring random timing information corresponding to a plurality of consensus nodes, wherein each consensus node sends voting request information to other consensus nodes and receives voting information fed back by the other consensus nodes according to the voting request information;
and counting the voting number of the voting information received in a timing period corresponding to the random timing information by each consensus node, and determining the chairman node and the member node according to the voting number corresponding to each consensus node.
7. The random number generation method of any one of claims 1 to 5, wherein the method further comprises:
if the verification of the block transaction list by the plurality of consensus nodes according to the signature aggregation information fails, a re-consensus instruction is sent to the plurality of consensus nodes, so that the plurality of consensus nodes regenerate the node transaction list.
8. A random number generation system, comprising:
the system comprises a preprocessing module, a data processing module and a data processing module, wherein the preprocessing module is used for receiving a transaction request sent by a client, enabling a plurality of consensus nodes to respectively acquire initial transaction information according to the transaction request, and preprocessing the initial transaction information to generate a node transaction list and signature information corresponding to each consensus node;
the aggregation transaction list module is used for judging the consensus nodes according to a preset consensus algorithm to determine an agenda node and a candidate node, and enabling the agenda node to aggregate the node transaction lists corresponding to all the consensus nodes in a block chain network to generate a block transaction list and send the block transaction list to the consensus nodes;
the aggregated signature information module is used for determining that the aggregated signature information is target signature information if the plurality of common identification nodes verify the block transaction list according to the aggregated signature information; the signature aggregation information is generated by aggregating the collected signature information according to the fact that the information quantity of the collected signature information is higher than the preset threshold quantity by the agenda node;
and the random number generating module is used for generating a random number according to the target signature information.
9. An electronic device, comprising:
at least one memory;
at least one processor;
at least one computer program;
the computer programs are stored in a memory, and a processor executes the at least one computer program to implement:
the random number generation method of any one of claims 1 to 7.
10. A storage medium storing executable instructions executable by a computer to cause the computer to perform:
a method of generating random numbers according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211314715.5A CN115392912B (en) | 2022-10-26 | 2022-10-26 | Random number generation method, system, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211314715.5A CN115392912B (en) | 2022-10-26 | 2022-10-26 | Random number generation method, system, device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115392912A true CN115392912A (en) | 2022-11-25 |
CN115392912B CN115392912B (en) | 2023-03-14 |
Family
ID=84128365
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211314715.5A Active CN115392912B (en) | 2022-10-26 | 2022-10-26 | Random number generation method, system, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115392912B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019071026A1 (en) * | 2017-10-04 | 2019-04-11 | Jintai Ding | Quantumproof blockchain |
CN110300172A (en) * | 2019-06-28 | 2019-10-01 | 深圳市网心科技有限公司 | A kind of the common recognition method and relevant device of block chain data |
CN110399739A (en) * | 2019-07-26 | 2019-11-01 | 深圳市网心科技有限公司 | A kind of thresholding voting method and relevant apparatus based on block chain common recognition |
CN110544095A (en) * | 2019-09-03 | 2019-12-06 | 腾讯科技(深圳)有限公司 | Transaction processing method of block chain network and block chain network |
CN111090892A (en) * | 2020-03-24 | 2020-05-01 | 杭州智块网络科技有限公司 | Block chain consensus method and device based on VRF and threshold signature |
KR20210064803A (en) * | 2019-11-26 | 2021-06-03 | 한양대학교 산학협력단 | Leaderless block-chain consensus method and device |
CN114726517A (en) * | 2022-03-29 | 2022-07-08 | 蚂蚁区块链科技(上海)有限公司 | Method, system and consensus node for generating random number seeds on block chain |
-
2022
- 2022-10-26 CN CN202211314715.5A patent/CN115392912B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019071026A1 (en) * | 2017-10-04 | 2019-04-11 | Jintai Ding | Quantumproof blockchain |
CN110300172A (en) * | 2019-06-28 | 2019-10-01 | 深圳市网心科技有限公司 | A kind of the common recognition method and relevant device of block chain data |
CN110399739A (en) * | 2019-07-26 | 2019-11-01 | 深圳市网心科技有限公司 | A kind of thresholding voting method and relevant apparatus based on block chain common recognition |
CN110544095A (en) * | 2019-09-03 | 2019-12-06 | 腾讯科技(深圳)有限公司 | Transaction processing method of block chain network and block chain network |
KR20210064803A (en) * | 2019-11-26 | 2021-06-03 | 한양대학교 산학협력단 | Leaderless block-chain consensus method and device |
CN111090892A (en) * | 2020-03-24 | 2020-05-01 | 杭州智块网络科技有限公司 | Block chain consensus method and device based on VRF and threshold signature |
CN114726517A (en) * | 2022-03-29 | 2022-07-08 | 蚂蚁区块链科技(上海)有限公司 | Method, system and consensus node for generating random number seeds on block chain |
Non-Patent Citations (2)
Title |
---|
L. LEI 等: "Continuous Distributed Key Generation on Blockchain Based on BFT Consensus", 《2020 3RD INTERNATIONAL CONFERENCE ON HOT INFORMATION-CENTRIC NETWORKING》 * |
雷元娜 等: "区块链共识机制中随机性研究", 《信息安全学报》 * |
Also Published As
Publication number | Publication date |
---|---|
CN115392912B (en) | 2023-03-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220385460A1 (en) | Systems and methods for selecting and utilizing a committee of validator nodes in a distributed system | |
US11966916B2 (en) | Resource transfer method and apparatus, storage medium, and computer device | |
CN110800005B (en) | Split, licensed and distributed ledger | |
EP3811259B1 (en) | Method for signing a new block in a decentralized blockchain consensus network | |
CN107220130B (en) | Method, device and system for realizing information consensus at nodes of block chain | |
CN110189128B (en) | Distributed consensus method and device for block rapid generation | |
CN111427957A (en) | Block chain voting information verification method, device, equipment and storage medium | |
CN110851537A (en) | Consensus method based on block chain fragmentation technology | |
US11190341B2 (en) | System architecture for executing a distributed key generation protocol | |
CN108509615B (en) | Consensus establishing method and device based on drawing mechanism and readable storage medium | |
CN112073483A (en) | Authority certification consensus method and system based on credit and committee endorsement mechanism | |
CN110661656B (en) | Block chain rapid consensus method and device | |
CN110995701A (en) | Block chain consensus method, system, electronic equipment and storage medium | |
CN109981690B (en) | Anti-tamper timing data secret transmission method based on block chain intelligent contract | |
CN110213038B (en) | Method and system for forming consensus of block chain | |
CN108648081B (en) | Transaction processing method and device based on block chain and electronic equipment | |
CN111104460A (en) | Block chain consensus method, system, electronic equipment and storage medium | |
CN114422155B (en) | Proposal consensus execution method, block chain system, device and storage medium | |
CN111062811A (en) | Block chain consensus method, system and storage medium | |
CN115499379B (en) | Information interaction method, device, equipment and medium based on block chain | |
CN110990790B (en) | Data processing method and equipment | |
CN113779642B (en) | Data processing method, device and system thereof, and electronic equipment | |
WO2024055740A1 (en) | Data processing method, computer device, and readable storage medium | |
CN111865595A (en) | Block chain consensus method and device | |
CN115392912B (en) | Random number generation method, system, device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |