Method, system, medium and equipment for realizing random beacon

Through the grouping management of blockchain nodes and quantum random number generation, the instability and security problems of the existing random beacon scheme are solved, and efficient and secure random number generation and output are achieved.

CN120238329APending Publication Date: 2025-07-01GUOKAIKE QUANTUM TECH (ANHUI) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311869532.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

Existing random beacon schemes lead to instability and inefficiency when nodes are overloaded or downtime, and have low security for pseudo-random numbers.

Method used

The nodes in the blockchain are grouped into multiple groups, and the distributed key generation algorithm is used to calculate the group public key and signature private key, and the true random number is generated through quantum random numbers, and random numbers are output in turn between groups, using threshold signature algorithm and group public key verification.

Benefits of technology

It improves the stability and efficiency of the system, ensures the authenticity and security of random numbers, and enhances the fault tolerance and security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238329A_ABST
    Figure CN120238329A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a system, a medium and equipment for realizing a random beacon, and relates to the technical field of communication security, and the method for realizing the random beacon comprises the following steps: grouping M nodes in the same block chain to obtain N groups; based on a distributed key generation algorithm, group public keys of the N groups are calculated respectively, and each node in the N groups generates a signature private key, a verification public key and a group public key of the node; on the basis of the signature private key, each node signs the same message to be signed to obtain a signature message of the node; based on the verification public key, each node verifies the signature message of the node and outputs the signature message passing the verification, and N group signature message sets are generated; respectively verifying the N group signature message sets based on the group public key; and on the basis of the group signature message set passing the verification, each corresponding group is controlled to output the public random number according to the set sequence, so that the efficiency and the stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication security technology, and in particular to a method, system, medium and device for implementing a random beacon. Background Art

[0002] In different scenarios, the requirements for random numbers will vary. Random numbers are widely used in fields such as cryptography, games, auctions, lotteries, etc. Generally speaking, private random numbers and public random numbers are two different types of random numbers. Private random numbers are usually used in scenarios related to personal privacy and security, such as password generation, encryption and decryption. In this case, it is necessary to ensure the randomness and unpredictability of the random numbers to avoid being guessed or cracked by attackers. Public random numbers are usually used in scenarios shared by multiple people, such as lottery draws, game random events, etc. In this case, it is necessary to ensure the fairness and randomness of the random numbers to avoid cheating or forgery. Random numbers can be used in many scenarios, such as random selection, lottery draws and auctions.

[0003] A random beacon is a service for generating public random numbers, which ensures that the generated random numbers are random and unpredictable. Most of the current random beacon implementation schemes have the following defects:

[0004] (1) Regarding multiple nodes as a whole, when a certain node experiences overload or downtime, random numbers cannot be generated normally, affecting normal operation, resulting in instability and low efficiency;

[0005] (2) The random numbers generated based on algorithms are pseudo-random numbers. Since pseudo-random numbers can be predicted, absolute security cannot be guaranteed, resulting in low security. Summary of the Invention

[0006] To at least partially solve the above defects, embodiments of the present invention provide a method, system, medium and device for implementing a random beacon.

[0007] In a first aspect, the method for implementing a random beacon provided by an embodiment of the present invention includes the following steps:

[0008] Step S1, group M nodes in the same blockchain to obtain N groups, where both M and N are natural numbers.

[0009] Step S2, based on the distributed key generation algorithm, calculate the group public keys of the N groups respectively, and each node in the N groups generates its own signature private key and verification public key.

[0010] Step S3, based on the signature private key, each of the nodes signs the same message to be signed to obtain its own signed message.

[0011] Step S4, based on the verification public key, each of the nodes verifies its own signed message respectively and outputs the verified signed messages, generating N sets of group signature messages.

[0012] Step S5, based on the group public key, verify the N sets of group signature messages respectively.

[0013] Step S6, based on the verified set of group signature messages, control each corresponding group to output a common random number in a set order.

[0014] In some examples, step S6 includes:

[0015] Perform a hash calculation on the verified group signature messages, use the obtained calculation result as the common random number, and control each corresponding group to output the calculation result in turn according to the set order.

[0016] In some examples, before step S2, the method further includes:

[0017] S21, each node obtains a first quantum random number from the quantum random number generator respectively;

[0018] S22, based on the first quantum random number, each node generates its own initial quantum key respectively;

[0019] S23, each node divides the initial quantum key into n parts of quantum keys respectively;

[0020] S24, each node obtains one part of the quantum key belonging to itself from the n parts of quantum keys respectively, and sends the remaining n - 1 parts of quantum keys to the remaining n - 1 nodes in turn;

[0021] S25, each node verifies the received n - 1 parts of quantum keys respectively. If all the n - 1 parts of quantum keys are verified successfully, then execute step S2.

[0022] In some examples, before step S2, the method further includes:

[0023] Each of the nodes obtains t second quantum random numbers from the quantum random number generator respectively, and generates its own quantum random number sequence, where n / 2 ≤ t < n, and n is the total number of nodes in each group;

[0024] Each of the nodes generates a proof of knowledge and a common commitment of the first quantum random number in the quantum random number sequence respectively, and broadcasts the proof of knowledge and the common commitment as proof information to the remaining n - 1 nodes;

[0025] Each of the nodes verifies the received knowledge proof and public commitment respectively. If both the knowledge proof and the public commitment pass the verification, then steps S21 - S25 are executed and the knowledge proof and the public commitment are deleted.

[0026] In some examples, step S2 includes:

[0027] Based on the formula Each node calculates its own signature private key respectively, where a ij is the j-th quantum random number among the t second quantum random numbers obtained by the (i + 1)-th node, 0 ≤ i ≤ n - 1, 0 ≤ l ≤ n - 1, l ≠ i.

[0028] In some examples, step S2 further includes:

[0029] Based on the formula Each of the nodes calculates its own verification public key Y i ;

[0030] Based on the formula Calculate the group public key V of each group respectively; where g is the generator of the cyclic group G of order q, s i is the signature private key of the (i + 1)-th node,

[0031] In some examples, after step S2, the method further includes:

[0032] Based on the formula Each of the nodes calculates the verification public key of any node P l in the group, where q is the order of the cyclic group G, randomly and uniformly select k ← Z q Z q is the set of integers modulo q, 1 ≤ l ≤ n, l ≠ i, n / 2 ≤ t < n.

[0033] In a second aspect, the system for implementing a random beacon provided by an embodiment of the present invention includes:

[0034] A grouping module, configured to group M nodes in the same blockchain to obtain N groups, where both M and N are natural numbers;

[0035] A generation module, configured to calculate the group public keys of N groups respectively based on a distributed key generation algorithm, and each node in the N groups generates its own signature private key, verification public key, and group public key;

[0036] A signature module, configured to sign the same message to be signed by each of the nodes based on the signature private key to obtain its own signed message;

[0037] A verification module, configured to verify the signature messages of each node based on the verification public key, output the signature messages that pass the verification, and generate N signature message sets;

[0038] The verification module is further configured to verify the N group signature messages based on the group public key;

[0039] A control module, configured to control each corresponding group to output a common random number in a set order based on the group signature message that passes the verification.

[0040] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, a method for implementing a random beacon as disclosed in the first aspect is implemented.

[0041] In a fourth aspect, an electronic device provided by an embodiment of the present invention includes:

[0042] A processor;

[0043] A memory storing a computer program, and when the computer program is executed by the processor, a method for implementing a random beacon as disclosed in the first aspect is implemented.

[0044] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0045] (1) Group management is performed on each node, and random beacons are independently performed within each group. The tasks are assigned to different groups, and the tasks can be processed in parallel, improving efficiency;

[0046] (2) By having each group perform random beacons in a preset order in turn, it is possible to avoid the situation of a certain node being overloaded or having unbalanced load, improving stability. At the same time, the sequential output can also improve the fault tolerance of the system. Even if a certain group fails, other groups can still normally implement random beacons;

[0047] (3) Using quantum random numbers as the entropy source of the random beacon, since quantum random numbers are true random numbers and are not easily cracked, security is improved. Description of the Drawings

[0048] Through the following description in conjunction with the drawings, the above objects and features of the present invention will become clearer.

[0049] Figure 1 Shown is a schematic flowchart of a method for implementing a random beacon provided by an exemplary embodiment of the present invention.

[0050] Figure 2Shown is a schematic block diagram of a device for implementing a random beacon according to an exemplary embodiment of the present invention.

[0051] Figure 3 Shown is a schematic flowchart of sharing quantum keys among nodes in a single group in a method for implementing a random beacon according to an exemplary embodiment of the present invention.

[0052] Figure 4 Shown is a schematic flowchart of a single group implementing a random beacon in a method for implementing a random beacon according to an exemplary embodiment of the present invention.

[0053] Figure 5 Shown is a schematic diagram of a single group implementing a signature verification process in a method for implementing a random beacon according to an exemplary embodiment of the present invention. Detailed implementation manners

[0054] Next, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[0055] Referring to Figure 1 , the method for implementing a random beacon according to an exemplary embodiment of the present invention includes the following steps:

[0056] Step S1, group M nodes in the same blockchain to obtain N groups, where both M and N are natural numbers.

[0057] Specifically, the M nodes can be grouped based on quantum random numbers, which improves the randomness of grouping.

[0058] Specifically, the M nodes are divided into N groups, the number of nodes in each group is equal or close, and the number of nodes in each group cannot be less than a set first threshold and cannot be greater than a set second threshold. Here, the first threshold is the lower limit number of nodes capable of implementing a random beacon, and the second threshold is the lower limit number of nodes capable of implementing a random beacon. Grouping and managing each node in the same blockchain, generating random beacons separately within each group of nodes, and taking turns in each group to generate random beacons to improve efficiency.

[0059] Among them, based on the decentralization and immutability of the blockchain, no third party intervention is required, which increases the reliability and fairness of the random beacon.

[0060] Step S2, based on the distributed key generation algorithm, calculate the group public keys of the N groups respectively, and each of the nodes in the N groups generates its own signature private key and verification public key.

[0061] Specifically, a quantum random number generator is configured for one node. Alternatively, one quantum random number generator can be configured for multiple nodes, or multiple quantum random number generators can be configured for one node, aiming to facilitate each node to obtain quantum random numbers normally and ensure sufficient entropy sources.

[0062] In some examples, before step S2, the method specifically includes:

[0063] Based on the obtained first quantum random numbers, each node respectively generates its own initial quantum key;

[0064] Each node respectively divides the initial quantum key into n portions of quantum keys;

[0065] Each node respectively obtains one portion of the quantum key belonging to itself from the n portions of the quantum keys, and sequentially sends the remaining n - 1 portions of the quantum keys to the remaining n - 1 nodes;

[0066] Each node respectively verifies the received n - 1 portions of the quantum keys. If all the n - 1 portions of the quantum keys are successfully verified, then the above step S3 is executed.

[0067] Specifically, the specific process of each node respectively verifying the received n - 1 portions of the quantum keys is as follows:

[0068] For any node P i , by comparing with to obtain the verification result. When , the verification fails, and the quantum key generation process is aborted. When , the verification is successful, and then the signature private key S of node P i is calculated through the formula i , the signature private key s i is securely stored, and the initial key share f l sent by other nodes P l (i) is deleted, where 1 ≤ l ≤ n, l ≠ i, n is the total number of nodes in the blockchain, and n / 2 ≤ t < n.

[0069] As Figure 3 shown, when the number of nodes in a certain group is 4, the specific process of sharing quantum keys among each node is as follows:

[0070] Node P0 divides its own initial quantum key into 4 quantum keys: f0(0), f0(1), f0(2), f0(3). Among them, f0(0) is reserved by node 0 itself, f0(1) is sent to node P1, f0(2) is sent to node P2, and f0(3) is sent to node P3.

[0071] Node P1 divides its own initial quantum key into 4 quantum keys: f1(0), f1(1), f1(2), f1(3). Among them, f1(1) is reserved by node P1 itself, f1(0) is sent to node P0, f1(2) is sent to node P2, and f1(3) is sent to node P3.

[0072] Node P2 divides its own initial quantum key into 4 quantum keys: f2(0), f2(1), f2(2), f2(3). Among them, f2(2) is reserved by node P2 itself, f2(0) is sent to node P0, f2(1) is sent to node P1, and f2(3) is sent to node P3.

[0073] Node P3 divides its own initial quantum key into 4 quantum keys: f3(0), f3(1), f3(2), f3(3). Among them, f3(3) is reserved by node P3 itself, f3(0) is sent to node P0, f3(1) is sent to node P1, and f3(3) is sent to node P3.

[0074] In some examples, before step S2, the method specifically further includes:

[0075] Each node respectively obtains t second quantum random numbers from the quantum random number generator and generates its own quantum random number sequence, where t is the minimum number of signature private keys required to aggregate the group private key and n / 2 ≤ t < n, and n is the total number of nodes in each group;

[0076] Each node respectively generates a proof of knowledge and a common commitment of the first quantum random number in the quantum random number sequence, and broadcasts the proof of knowledge and the common commitment as proof information to the remaining n - 1 nodes.

[0077] Specifically, when the total number of nodes n on the blockchain is 4, the 4 nodes are node 0, node 1, node 2, and node 3 respectively, and the value of the threshold t is set to 3. Taking node 0 as an example for illustration, other nodes perform the same operations. The quantum random number generator provides quantum random numbers to node 0. Node 0 samples the quantum random numbers provided by the quantum random number generator t = 3 times to obtain 3 quantum random numbers, forming a quantum random number sequence (a 00 , a 01 , a 02 ), where (a 00 , a 01 , a 02 ) are the coefficients of the polynomial .

[0078] Specifically, through the formula σ i = (Ri , μ i ), each node calculates the proof of knowledge σ of the corresponding quantum random number i , where a random number k is uniformly selected from k←Z q , Z q is the set of integers modulo q, and R i = g k , where g is the generator of the cyclic group G of order q, and μ i = k + a i0 ·c i , where Φ is the context string for preventing replay attacks. At the same time, each node generates a common commitment where Each node broadcasts the common commitment as proof information to the remaining all n - 1 nodes respectively and the proof of knowledge σ i , a i0 is the first quantum random number among the t second quantum random numbers obtained by the (i + 1)-th node.

[0079] Each node verifies the received proof of knowledge and the common commitment respectively. If both the proof of knowledge and the common commitment pass the verification, then delete the proof of knowledge and the common commitment.

[0080] Specifically, each node confirms the verification result by calculating whether R l is equal to . If then the verification is successful, and σ l is deleted, and the generation of the quantum key continues; otherwise, if the verification fails, the process of generating the quantum key is aborted, where 0 ≤ l ≤ n - 1, l ≠ i.

[0081] In some examples, step S2 specifically includes:

[0082] Based on the formula each node calculates its own signature private key, where a ij is the j-th quantum random number among the t second quantum random numbers obtained by the (i + 1)-th node, 0 ≤ i ≤ n - 1, 0 ≤ l ≤ n - 1, l ≠ i.

[0083] In some examples, step S2 specifically further includes:

[0084] Based on the formula each of the nodes calculates its own verification public key Y i ;

[0085] Based on the formula Calculate the group public key V of the group where it is located respectively; where g is the generator of the cyclic group G of order q, and s i is the signature private key of the (i + 1)-th node,

[0086] Among them, the signature private key, verification public key, and group public key calculated based on quantum random numbers are all true random numbers, which ensures the security of the signature private key, verification public key, and group public key.

[0087] In some examples, after step S2, the method further includes:

[0088] Based on the formula Each node calculates the verification public key of any node P l respectively, where q is the order of the cyclic group G, randomly and uniformly select k←Z q , Z q is the set of integers modulo q, 1 ≤ l ≤ n, l ≠ i, n is the total number of each node in each group, and n / 2 ≤ t < n.

[0089] Step S3, based on the signature private key, each of the nodes signs the same message to be signed to obtain its own signed message.

[0090] Specifically, each node respectively uses the threshold signature algorithm to sign the message to be signed. Among them, the threshold signature algorithm starts from the single-signature algorithm and splits the private key among each participant. In the signature stage, each participant can run the signature algorithm to obtain the signature, and any party can use the algorithm for verifying the signature of a single signer to verify the signature. That is to say, the signatures generated by the threshold signature algorithm and the single-signature algorithm are interchangeable. The threshold signature algorithm is a method based on the signer generating a single digital signature. The signature generated by this method looks the same as the signature generated without using the threshold signature algorithm, but the signature generated by the threshold signature algorithm is created by sharing multiple private keys, so that no single participant can fully control the private key.

[0091] Step S4, based on the verification public key, each node respectively verifies its own signed message and outputs the signed message that passes the verification, generating N sets of signed messages.

[0092] Step S5, based on the group public key, verify the N group-signed messages respectively.

[0093] Step S6, based on the set of group-signed messages that pass the verification, control each corresponding group to output the common random number in the set order.

[0094] In some examples, step S6 specifically includes:

[0095] Perform a hash calculation on the verified group signature message, and use the obtained calculation result as the common random number to control each corresponding group to output the corresponding calculation result in a set order.

[0096] Specifically, for the set of verified group signature messages, perform a hash calculation on each signature message set respectively. Each signature message set after the hash calculation is the common random number of the random beacon, thus implementing the random beacon.

[0097] Specifically, according to the preset rounds, each group outputs the common random number generated by itself in turn, which can avoid the situation of overload or uneven load within a certain group node, ensuring balance and stability. At the same time, the sequential output can also improve the fault tolerance of the system. Even if a fault occurs within a certain group, other groups can still continue to output random numbers to implement the random beacon, improving continuity and reliability.

[0098] So far, each node in each group has generated its own signature private key S i and verification public key Y i as well as the group public key V on the blockchain. When it is necessary to perform a global verification on the verified group signature message set using the private key, this group public key can be used for verification.

[0099] Furthermore, a key update smart contract can also be deployed on the blockchain. The key update smart contract mainly provides two functional interfaces: one is a timed automatic update functional interface, and the other is an active application update functional interface. For the automatic update function, the key update smart contract will record the time point of each quantum key generation on the chain. According to the time of the most recent quantum key generation, a certain period is set. After the end of each period, the quantum random number is called again to perform a quantum key generation to cope with the possible leakage of the signature private key on the blockchain; when there is an increase or decrease in nodes on the blockchain, or when a node on the chain discovers that there is a leakage or theft of the signature private key, the active update function of the key update smart contract can be actively called to re-perform the quantum key generation to ensure security.

[0100] Figure 2 The system shown for implementing the random beacon includes:

[0101] A grouping module, configured to group M nodes in the same blockchain to obtain N groups, where both M and N are natural numbers;

[0102] A generation module, configured to calculate the group public keys of N groups respectively based on the distributed key generation algorithm, and each node in the N groups generates its own signature private key and verification public key;

[0103] A signature module, configured to sign the same message to be signed by each of the nodes based on the signature private key, to obtain its own signed message;

[0104] A verification module, configured to verify the signed message of each node by each of the nodes based on the verification public key and output the verified signed message, to generate N sets of signed messages;

[0105] The verification module is further configured to verify the N group signature messages based on the group public key;

[0106] A control module, configured to control each corresponding group to output a common random number in a set order based on the verified group signature message.

[0107] Specifically, in order to ensure the publicly verifiable nature of the system for implementing a random beacon provided by the embodiments of the present invention, the system provides a verification interface to external users. This verification interface can be used to verify whether the services provided by the system are trustworthy and provide necessary evidence and information.

[0108] Specifically, the verification interface has functions such as querying the beacon, verifying the beacon, and querying the algorithm. Among them:

[0109] The function of querying the beacon includes: the user can input the round ID information of the random beacon through the query function provided by the verification interface, and the system will return the beacon value matching the round ID and the generation time of the random beacon.

[0110] The function of verifying the beacon includes: the system provides the function of verifying the beacon. When the user inputs the round ID of the beacon, the system will verify the validity of the beacon and return the verification result. At the same time, the system will also provide the message to be signed in this round, the node information participating in the random beacon in this round, the node signed message, the group signature message of the beacon in this round, and the group public key. The user can use the above parameters to verify the correctness of the random beacon value provided in this round by himself.

[0111] The function of querying the algorithm includes: the user can query the generation steps of the random beacon currently provided by the system, the group public key, and the threshold signature algorithm used through the algorithm query function.

[0112] All users can verify the random beacon by calling the verification interface and the returned result of the interface to confirm whether the provided random beacon is trustworthy.

[0113] Figure 4 Shows a schematic flow diagram of a certain group of groups to implement a random beacon. The entire process of implementing a random beacon is divided into two stages: a distributed quantum key generation stage and a signature verification stage.

[0114] In a blockchain, M nodes in the group are divided into N groups, and each node in each group is represented as P i , where i = 1,..., n. A threshold t is set for the number of blockchain nodes. The threshold t is the number of signature private keys required to construct the group public key, and n is the number of nodes in each group.

[0115] In the distributed quantum key generation phase, each node in each group randomly samples t random numbers (a 00 , a 01 ,..., a 0(t-1) ) as the coefficients of a t - 1 degree polynomial , calculates and broadcasts a proof of knowledge of the zero - order coefficient of the polynomial, that is, a proof of knowledge σ i0 of the first random number a i , and a common commitment C i . When each other node receives σ i and C i , it verifies them. If the verification passes, it proceeds to the next step; if the verification fails, it regenerates the quantum key.

[0116] Each node in each group obtains an initial quantum key from a quantum random number generator, divides the initial quantum key into n quantum keys, keeps one quantum key for itself, and separately sends the remaining n - 1 quantum keys to the remaining n - 1 nodes. When a node receives an initial key share sent separately by other nodes, it verifies the initial key share separately. If any initial key share verification fails, it aborts and regenerates the quantum key. After all the received initial key shares are successfully verified, the node generates its own signature private key s i , and other nodes perform the same operation to generate their own signature private keys.

[0117] Each node P i calculates its own verification public key Y i , and the group public key V. Among them, any node can obtain the verification public key of any other node by calculating Y i . After the above steps are completed, the distributed quantum key generation phase in the process of generating random numbers for the random beacon service is completed. All nodes broadcast the calculated group public key. After on - chain consensus, it is stored on the blockchain and can be used for verification when verifying the signature message set.

[0118] In the signature verification phase, the random beacon service generates random numbers round by round, and each generated random number is one round. A message m to be signed is preset. The message to be signed is generated according to certain rules. In each round of random beacon (i.e., one round of random number generation), the message m to be signed is different. Let r represent the round of the random beacon implementation, then the message to be signed in each round is represented by m r In the process of implementing the random beacon in each round, all nodes use their own signature private keys to sign the message m to be signed r After signing, the signed message is sent to the deployed smart contract.

[0119] In the signature verification phase, the threshold signature algorithm is used to calculate the random number of each round. The threshold signature algorithm is implemented by deploying a smart contract on the blockchain. The smart contract acts as a node signer. The smart contract collects the signed messages sent by the nodes and verifies them. When the correct signed messages of t nodes in each group are collected, the t correct signed messages are aggregated to obtain the group signature result of the message in the current round. The number of correct signed messages is greater than or equal to t. The group public key generated in the distributed quantum key generation phase is used to verify the group signature result. After the verification passes, the group signature result is hashed. The group signature result after hashing is the random number output in the current round.

[0120] As Figure 5 shown, taking the random beacon service of 4 participants to generate random numbers as an example, a node is assigned to each participant to participate in the random beacon service. The 4 nodes on the blockchain are numbered P0, P1, P2, and P3 respectively, and the threshold t is set to 3.

[0121] The four nodes start the random beacon service to calculate random numbers. In the distributed quantum key generation phase, node P0 calculates and obtains its own signature private key S0 and verification public key Y0 through the quantum key generation method. Similarly, nodes P1, P2, and P3 respectively obtain their own signature private keys S1, S2, S3, and verification public keys Y1, Y2, Y3, and all nodes obtain a copy of the group public key V through calculation and on-chain broadcast.

[0122] In the signature verification phase, every successful signature verification realizes one random beacon and outputs one random number.

[0123] As Figure 5 shown, node P0 uses its signature private key S0 to sign the message m r to generate the signed message Sig0(m r ), and sends the signed message Sig0(m r) Send it to the smart contract. Similarly, nodes P1, P2, and P3 also perform the same operation, using their own signature private keys S1, S2, S3 to sign the message m r to generate the signature messages Sig1(m r ), Sig2(m r ), Sig3(m r ), and send the signature messages to the smart contract.

[0124] After receiving the signature messages sent by the nodes, the smart contract uses the nodes' own verification public keys Y0, Y1, Y2, Y3 to verify them, records the signature messages that pass the verification as correct signature messages, and after collecting the correct signature messages sent by any 3 of the four nodes, performs signature processing on them and outputs the group signature result Sig(m r ) of the message m r ).

[0125] Use the group public key V to verify the group signature result Sig(m r ). After the verification passes, perform a hash calculation on the group signature result. The group signature result output after the hash calculation is the public random number of this round of the random beacon service.

[0126] The random beacon can be used to provide on-chain randomness, which is a key factor for fair, secure, and transparent on-chain applications. The technical solution of the present invention implements a random beacon based on a blockchain, encrypts and verifies through the quantum key of the blockchain, and then generates a decentralized random number to implement the random beacon and provide a secure and reliable random number to the outside world. All participants on the blockchain need to reach an agreement on the output (randomness), and malicious participants in the protocol should not be able to bias or predict the output.

[0127] In addition, according to an exemplary embodiment of the present invention, a computer-readable storage medium storing a computer program may also be provided. The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to execute the method for implementing a random beacon according to the exemplary embodiment of the present invention. The computer-readable recording medium is any data storage device that can store data read by a computer system. Examples of computer-readable recording media include: read-only memory, random access memory, compact disc read-only memory, magnetic tape, floppy disk, optical data storage device, and carrier wave (such as data transmission through the Internet via a wired or wireless transmission path).

[0128] In addition, according to an exemplary embodiment of the present invention, a computing device may also be provided. The computing device includes a processor and a memory. The memory is used to store a computer program. The computer program is executed by the processor to cause the processor to execute the method for implementing a random beacon according to the exemplary embodiment of the present invention.

[0129] It should be noted that the first, second, third, fourth, etc. in the above description are used to distinguish features with the same name in the same or different embodiments, and are not limitations in terms of quantity. Moreover, the present invention is not limited to the specific configurations and processes described above or shown in the figures. The above description is only the specific implementation manner of the present invention. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the described system, device, module or unit can refer to their own processes in the method embodiments and will not be elaborated herein again. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. A method for implementing a random beacon, characterized in that, It includes the following steps: Step S1: Group M nodes in the same blockchain to obtain N groups, where both M and N are natural numbers; Step S2: Based on the distributed key generation algorithm, calculate the group public keys of the N groups respectively, and each node in the N groups generates its own signature private key and verification public key; Step S3: Based on the signature private key, each of the nodes signs the same message to be signed to obtain its own signature message; Step S4: Based on the verification public key, each of the nodes verifies its own signature message respectively and outputs the signature messages that pass the verification, generating N group signature message sets; Step S5: Based on the group public keys, verify the N group signature message sets respectively; Step S6: Based on the group signature message sets that pass the verification, control each corresponding group to output a common random number in a set order.

2. The method for implementing a random beacon according to claim 1, wherein Step S6 includes: Perform a hash calculation on the group signature messages that pass the verification, use the obtained calculation result as the common random number, and control each corresponding group to output the calculation result in turn in a set order.

3. The method for implementing a random beacon according to claim 1, wherein Before step S2, the method further includes: S21: Each node respectively obtains a first quantum random number from a quantum random number generator; S22: Based on the first quantum random number, each node respectively generates its own initial quantum key; S23: Each node respectively divides the initial quantum key into n parts of quantum keys; S24: Each node respectively obtains one part of the quantum key belonging to itself from the n parts of the quantum keys, and sequentially sends the remaining n - 1 parts of the quantum keys to the remaining n - 1 nodes; S25: Each node respectively verifies the received n - 1 parts of the quantum keys. If all the n - 1 parts of the quantum keys are verified successfully, then execute step S2.

4. The method for implementing a random beacon according to claim 3, wherein, Before step S2, the method further includes: Each of the nodes respectively obtains t second quantum random numbers from the quantum random number generator, and generates its own quantum random number sequence, where n / 2 ≤ t < n, and n is the total number of nodes in each group; Each of the nodes respectively generates a proof of knowledge and a common commitment of the first quantum random number in the quantum random number sequence, and broadcasts the proof of knowledge and the common commitment as proof information to the remaining n - 1 nodes; Each of the nodes respectively verifies the received proof of knowledge and common commitment. If both the proof of knowledge and the common commitment are verified successfully, then execute steps S21 - S25 and delete the knowledge and the common commitment.

5. The method for implementing a random beacon according to claim 4, characterized in that Step S2 includes: Based on the formula Each node calculates its own signature private key respectively, where a ij is the j-th quantum random number among the t second quantum random numbers obtained by the (i + 1)-th node, 0 ≤ i ≤ n - 1, 0 ≤ l ≤ n - 1, l ≠ i.

6. The method for implementing a random beacon according to claim 5, characterized in that, Step S2 further includes: Based on the formula Each of the nodes calculates its own verification public key Y i ; Based on the formula calculate the group public key V of each group respectively; where g is the generator of the cyclic group G of order q, and s i is the signature private key of the (i + 1)-th node 7. The method for implementing a random beacon according to claim 6, wherein After step S2, the method further includes: Based on the formula Each of the nodes calculates the verification public key of any node P within the group, where q is the order of the cyclic group G, and k is randomly and uniformly selected from Z l , Z q , Z q is the set of integers modulo q, 1 ≤ l ≤ n, l ≠ i, n / 2 ≤ t < n.

8. A system for implementing a random beacon, characterized in that, It includes: A grouping module configured to group M nodes in the same blockchain to obtain N groups, where both M and N are natural numbers; A generation module configured to calculate the group public keys of the N groups respectively based on the distributed key generation algorithm, and each node in the N groups generates its own signature private key and verification public key; A signature module configured to, based on the signature private key, each of the nodes signs the same message to be signed to obtain its own signature message; A verification module, configured to verify the signature messages of each of the nodes based on the verification public key and output the signature messages that pass the verification, generating N sets of signature messages; The verification module is further configured to verify the N group signature messages respectively based on the group public key; A control module, configured to control the respective groups to output a common random number in a set order based on the group signature messages that pass the verification.

9. A computer-readable storage medium storing a computer program, wherein, When the computer program is executed by a processor, it implements the method for implementing a random beacon as described in any one of claims 1 to 7.

10. An electronic device, comprising: A processor; A memory storing a computer program, which when executed by the processor, implements the method for implementing a random beacon as described in any one of claims 1 to 7.