Lottery verification method, apparatus and storage medium based on verifiable random numbers
By using a lottery verification method based on verifiable random numbers, and by generating public key information and digest messages using user terminals, the problem of cumbersome lottery verification steps and complex identity verification in existing technologies is solved, and a simple and secure lottery verification is achieved.
Patent Information
- Application Number
- CN202211118725.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-13
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-09-13
AI Technical Summary
Existing lottery verification methods are cumbersome, especially lacking effective verification of the identity of winning lottery players, and offline purchase and verification methods are prone to identity theft.
A lottery verification method based on verifiable random numbers is adopted. Public key information is generated through the user terminal and sent to the lottery system. Verifiable random numbers are generated by combining the digest message and the verification result of lottery information is determined by using private key information, thus simplifying the identity verification process.
It eliminates the need for offline paper verification, simplifies lottery verification steps, ensures the security and uniqueness of verification results, prevents identity theft, and improves the convenience and security of verification.
Smart Images

Figure CN115546961B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lottery technology, and more specifically to a lottery verification method, apparatus, and storage medium based on verifiable random numbers. Background Technology
[0002] Currently, lotteries offer the potential for high returns with low investment, promising players the hope of a sudden surge in wealth. Furthermore, government welfare lotteries typically channel a large portion of their sales revenue into welfare programs, addressing funding shortages and demonstrating significant social value. However, many people harbor suspicions about the lottery process, such as the possibility of internal cheating.
[0003] Furthermore, current offline lottery purchases mostly involve players buying tickets at specific lottery outlets. Lottery verification typically uses paper-based verification, which only verifies the selected lottery numbers and does not involve verifying the actual winner's identity. Since verifying the actual winner's identity is quite cumbersome and complicated, adding this step to the lottery verification process would create cumbersome and complex technical issues.
[0004] Therefore, existing technologies need to be improved. Summary of the Invention
[0005] The main objective of this invention is to propose a lottery verification method, apparatus, and storage medium based on verifiable random numbers, so as to at least solve the technical problem of cumbersome verification steps in existing lottery verification methods.
[0006] In a first aspect, the present invention provides a lottery verification method based on verifiable random numbers, applied to a user terminal, the lottery verification method comprising:
[0007] Obtain lottery information purchased by lottery buyers; wherein the lottery information includes at least the selected numbers corresponding to the lottery purchase item;
[0008] Generate public key information corresponding to the lottery information based on the selected private key information and the selected numbers, and send the public key information to the lottery system;
[0009] Obtain the digest message corresponding to the public key information published by the lottery system, and generate a verifiable random number based on the digest message and the private key information;
[0010] The verification result corresponding to the lottery information is determined based on the verifiable random number and the winning number corresponding to the lottery purchase item.
[0011] A second aspect of the present invention provides a lottery verification method applied to a lottery system, the lottery verification method comprising:
[0012] Obtain the public key information corresponding to the lottery information purchased by the lottery buyer, sent by the user terminal; wherein the lottery information includes at least the selected numbers corresponding to the lottery purchase item, and the public key information is generated based on preset private key information and the selected numbers;
[0013] The public key information of all lottery buyers participating in the lottery purchase project will be published, and the public key information will be processed into a corresponding digest message using a preset algorithm.
[0014] The summary message and the winning numbers corresponding to the lottery purchase item will be published; wherein, the summary information is used by the user terminal to generate a verifiable random number, and the winning numbers and the verifiable random number are used by the user terminal to determine the verification result corresponding to the lottery information.
[0015] A third aspect of the present invention provides an electronic device, including a memory, a processor, and a bus;
[0016] The bus is used to enable communication between the memory and the processor;
[0017] The processor is used to execute computer programs stored in the memory;
[0018] When the processor executes the computer program, it implements the steps in the lottery verification methods provided in the first and second aspects.
[0019] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps in the lottery verification methods provided in the first and second aspects.
[0020] This invention provides a lottery verification method, apparatus, and storage medium based on verifiable random numbers. The method involves acquiring lottery information purchased by a lottery buyer, generating a public key corresponding to the lottery information based on the selected private key information and selected numbers, sending the public key information to the lottery system, obtaining a digest message corresponding to the public key information published by the lottery system, generating a verifiable random number based on the digest message and private key information, and determining the verification result corresponding to the lottery information based on the verifiable random number and the winning numbers corresponding to the lottery purchase item. In practice, since the private key information is chosen by the lottery buyer and is independent of the lottery system, the verification result can be determined by a verifiable random number and the winning number corresponding to the purchased lottery item during the final lottery verification. This means only the lottery player knows whether their ticket has actually won, eliminating the need for a specific lottery station. Furthermore, this verification method is not paper-based, eliminating the need to bring paper lottery tickets to the lottery center for verification. This also eliminates the risk of unauthorized claims (as only the lottery player knows their chosen private key). Therefore, during lottery verification (where the lottery player provides the private key information corresponding to the winning ticket), there is no need to verify the actual winner's identity, greatly simplifying the verification process and making it both convenient and secure. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating the lottery verification method provided in this embodiment of the invention;
[0023] Figure 2 This is a flowchart illustrating the lottery verification method provided in this embodiment of the invention;
[0024] Figure 3 This is a flowchart illustrating the lottery verification method provided in this embodiment of the invention;
[0025] Figure 4 This is a flowchart illustrating the lottery verification method provided in this embodiment of the invention;
[0026] Figure 5 This is a schematic diagram illustrating the synchronous generation of verifiable random numbers and proof information in an embodiment of the present invention;
[0027] Figure 6 This is a schematic diagram illustrating the interaction between the user terminal of a lottery purchaser and the lottery system in an embodiment of the present invention.
[0028] Figure 7 This is a schematic diagram illustrating the verification of verifiable random numbers in this embodiment of the invention;
[0029] Figure 8 This is a schematic diagram of the module connections inside the electronic device provided in an embodiment of the present invention.
[0030] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0031] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0032] It should be noted that related terms such as "first" and "second" can be used to describe various components, but these terms do not limit the component. These terms are only used to distinguish one component from another. For example, without departing from the scope of the invention, the first component can be referred to as the second component, and the second component can similarly be referred to as the first component. The term "and / or" refers to any one or more combinations of related and descriptive terms.
[0033] Please see Figure 1 , Figure 1 The diagram illustrates a flowchart of a lottery verification method provided in an embodiment of the present invention. This lottery verification method can be applied to user terminals, such as mobile phones, iPads, and other portable devices with communication functions. The lottery verification method includes:
[0034] Step S10: Obtain information about the lottery tickets purchased by the lottery buyer;
[0035] Specifically, when the lottery system announces a lottery purchase item (and usually generates the winning numbers at the same time), lottery buyers can select their desired numbers from a lottery purchase item through their user terminal. That is, the user terminal can access the lottery information purchased by the buyer, which includes at least the selected numbers corresponding to the lottery purchase item. For example, if a lottery buyer believes that the number 5 (the desired number) is highly likely to be a winning number in a lottery purchase item, then the buyer selects the number 5 as their selected number when purchasing the lottery.
[0036] Step S20: Generate public key information corresponding to the lottery information based on the selected private key information and the selected numbers, and send the public key information to the lottery system;
[0037] Specifically, each lottery purchaser selects a private key and selected numbers through their corresponding user terminal. A preset algorithm is then used to generate the corresponding public key information. All user terminals corresponding to all lottery purchasers will send the obtained public key information to the lottery system, and the lottery system will then obtain all the public key information corresponding to the lottery information purchased by all lottery purchasers.
[0038] Step S30: Obtain the digest message corresponding to the public key information published by the lottery system, and generate a verifiable random number based on the digest message and the private key information;
[0039] Specifically, after the lottery system publishes the public key information of all lottery buyers participating in the lottery purchase project (the purpose of the publication is to allow all lottery buyers to see the public keys of other lottery buyers, preventing possible cheating later), the lottery system will calculate all corresponding digest messages based on all public key information (the digest messages formed here are generally in binary format). Then, each lottery buyer obtains the digest messages corresponding to the public key information published by the lottery system through their user terminal. That is, after the user terminal obtains each digest message, it generates a verifiable random number based on the digest message and private key information. The generated verifiable random number is generally a number.
[0040] The lottery system works as follows: After the lottery purchase ends (i.e., after the lottery event concludes), the lottery system collects the public keys of all lottery buyers, publishes all public keys, and sorts them lexicographically. For those who purchased multiple tickets, the public key is copied multiple times. The sorted public key strings are then hashed using the SHA256 hash algorithm. The hash 'm' is used as the message, that is, the hash 'm' is used as the digest message corresponding to the public key information. All lottery buyers can then verify the correctness of the calculation process and check for any cheating.
[0041] Step S40: Determine the verification result corresponding to the lottery information based on the verifiable random number and the winning number corresponding to the lottery purchase item.
[0042] Specifically, after the lottery system publishes the winning numbers for a lottery purchase, the lottery purchaser's user terminal receives a verifiable random number and the winning numbers. Based on the verifiable random number and the winning numbers corresponding to the lottery purchase, the system determines the verification result for the lottery information. For example, if the verifiable random number contains the winning numbers, it indicates that the lottery information is a winning ticket, meaning the verification result is a win. If the verifiable random number does not contain the winning numbers, it indicates that the lottery information is not a winning ticket, meaning the verification result is a loss.
[0043] Therefore, during the purchase and verification process of lottery tickets, since the private key information is chosen by the lottery buyer themselves and is unrelated to the lottery system, and is unknown to other lottery buyers, only the lottery player can know whether their purchased ticket has actually won when the lottery is finally verified. This eliminates the need for a specific lottery station, and since the above verification method is a software verification method, not a paper verification method, there is no need to bring paper lottery ticket information to the lottery center for verification. This means there is no issue of other people fraudulently claiming the prize (the private key information chosen by the lottery player is known only to themselves). Consequently, when verifying the lottery ticket (the lottery player provides the private key information corresponding to the winning ticket), there is no need to verify the identity of the actual winning lottery player again, greatly simplifying the lottery verification process, making it very convenient and secure.
[0044] Please see Figure 2 , Figure 2 The diagram illustrates a flowchart of the lottery verification method provided in this embodiment of the invention. The steps of generating public key information corresponding to lottery information based on preset private key information and selected numbers specifically include:
[0045] Step S201: Obtain a random integer selected by the lottery purchaser and use the random integer as the private key information selected by the lottery purchaser;
[0046] Step S202: The public key information corresponding to the private key information is calculated using a preset elliptic curve algorithm to obtain the public key information corresponding to the lottery information.
[0047] Specifically, after a lottery purchaser acquires lottery information—that is, after the user terminal obtains the selected numbers from the lottery information—the purchaser can choose a random integer on the user terminal. Then, using the user terminal's private-to-public key conversion function (for example, an app pre-installed on the user terminal that provides this function), the public key information corresponding to the private key information is calculated, thus obtaining the public key information corresponding to the lottery information. The conversion of private key information to public key information can be performed using a preset elliptic curve algorithm. Since the selection of the private key and the generation of the public key can be implemented using an app on the user terminal, the purchaser can store the selected private key information and the generated public key information locally on the user terminal (in the storage module) for future use as proof of winning the prize, preventing forgetting. The random integer is at least 100 bits long to improve security.
[0048] Please see Figure 3 , Figure 2 The flowchart illustrating the lottery verification method provided in this embodiment of the invention includes the following steps: calculating the public key information corresponding to the private key information using a preset elliptic curve algorithm.
[0049] Step S301: Select a base point on the elliptic curve corresponding to the preset elliptic curve equation.
[0050] Specifically, when converting private key information into public key information, a base point is first selected on the elliptic curve corresponding to the preset elliptic curve equation. For example, the preset elliptic curve equation is... , a and b are the parameters of the elliptic curve equation, where a and b are numbers over a finite field. q is the modulus parameter of the elliptic curve equation, which is generally a very large integer (larger than both a and b). If a point (x, y) satisfies the elliptic curve equation... Then the point (x, y) is called the base point on the elliptic curve. Here, mod represents the modulo function.
[0051] Step S302: Calculate the public key information corresponding to the private key information using preset elliptic curve addition and elliptic curve multiplication operations; wherein the public key information is the product of the value corresponding to the base point and the private key information.
[0052] Specifically, the relationship between public key information and private key information satisfies the calculation formula: Let K represent the public key information, k represent the private key information (i.e., a random integer), and O represent the base point value. To calculate the public key information K, we can directly calculate kO. The specific value of kO can be obtained through elliptic curve addition and elliptic curve multiplication. The following explains elliptic curve addition and elliptic curve multiplication:
[0053] The addition operation for elliptic curves is as follows: (The rest of the text appears to be a series of seemingly unrelated characters and symbols, possibly due to OCR errors. A more accurate translation would require the original, coherent text.) Define their addition as The formula for calculating the coordinates of R is:
[0054]
[0055] Specifically, elliptic curve multiplication can be achieved through addition. For example, to calculate the multiplication of a point g on an elliptic curve, multiply it by a number r, convert r to a power of 2, and repeat this process; elliptic curve addition achieves multiplication. For instance, we can calculate elliptic curve multiplication. First, use elliptic curve addition to calculate The sum of powers of 57 is 57 = 1 + 8 + 16 + 32, that is... Therefore, when calculating kO, k is equivalent to r mentioned above, and O is equivalent to point g mentioned above. It can also be calculated through the addition and multiplication operations of elliptic curves. That is, the corresponding public key information (K) can be calculated from the private key information (k).
[0056] In this embodiment, after the step of obtaining the digest message corresponding to the public key information published by the lottery system, the method further includes:
[0057] The public key information is converted into the corresponding actual digest information using a preset digest conversion algorithm;
[0058] When the actual digest information is the same as the digest message corresponding to the public key information published by the lottery system, the step of generating a verifiable random number based on the digest message and the private key information is executed.
[0059] Specifically, after the lottery system publishes all the digest information corresponding to all lottery buyers, since there may be cases where this digest information does not correspond to the lottery information purchased by the lottery buyer (possibly due to errors in calculation or allocation by the lottery system), the lottery buyer first uses a preset digest conversion algorithm on their user terminal to convert the public key information corresponding to their purchased lottery information into the corresponding actual digest information. The actual digest information is then compared with the digest message published by the lottery system corresponding to the public key information. If the two are the same, it indicates that the lottery system has not encountered the aforementioned errors in calculation or allocation, and only then will the lottery buyer perform the operation of generating verifiable random numbers through their user terminal.
[0060] The preset digest conversion algorithm can be either the SHA256 digest algorithm or the Chinese national cryptographic algorithm SM3.
[0061] Public key information can be converted into a binary digest. Generally, the default digest conversion algorithm is a one-way algorithm. Calculating the digest from text is very simple, but piecing together the text to obtain the specified digest is extremely difficult, almost impossible. Furthermore, the output digest is a binary string of a specified length. For the SHA256 digest algorithm, the output is a 256-bit binary string. This allows all lottery buyers to verify the calculation process and check for cheating.
[0062] Please see Figure 4 The steps for generating verifiable random numbers based on the digest message and private key information specifically include:
[0063] Step S401: Map the digest message into a first integer using a preset first hash function;
[0064] Specifically, the first hash function can be defined in advance as By using the first hash function Map the digest message m to the first integer H, i.e. .
[0065] Step S402: Calculate the first parameter based on the first integer and the private key information; wherein, the first parameter is the product of the first integer and the private key information;
[0066] Specifically, according to the calculation formula V=kH, where k represents the private key information, H represents the first integer, and V represents the first parameter, the first parameter V can be calculated using the private key information k and the first integer H.
[0067] Step S403: The first parameter is encoded using a preset second hash function to generate a corresponding verifiable random number.
[0068] Specifically, the second hash function can be defined as The first parameter V is encoded to obtain a verifiable random number v, i.e. This verifiable random number is used to verify whether the lottery information purchased by the lottery buyer has won.
[0069] In this embodiment, after generating a verifiable random number based on the digest message and private key information, the method further includes: calculating proof information corresponding to the verifiable random number; wherein, the proof information is used to verify the legality of the verifiable random number. That is, upon obtaining the verifiable random number, proof information f corresponding to the verifiable random number can be further calculated, and this proof information f can be used to verify the legality of the verifiable random number. (In subsequent processes, if the proof information f passes verification, it indicates that the verifiable random number is legal, thus verifying that the random number, digest information, and proof information indeed belong to the lottery purchaser; conversely, if the proof information f fails verification, it indicates that the verifiable random number is illegitimate, thus verifying that the random number, digest information, and proof information are indeed fabricated or forged by the lottery purchaser.)
[0070] Specifically, during the calculation, a second integer r is first selected, and HO and rO are calculated using elliptic curves. Then, the second parameter s is obtained through the third hash function h3. Then, the third parameter t is further calculated based on the calculation formula. , The third parameter t can be calculated using elliptic curve multiplication. Finally, the first parameter V, the second parameter s, and the third parameter t are combined to form the proof information f corresponding to the verifiable random number, i.e., f = (V; t; s). This proof information is used by the lottery system to verify the validity of the verifiable random number.
[0071] It should be understood that when generating the corresponding verifiable random numbers, the corresponding proof information can also be calculated simultaneously (for example, see [reference]). Figure 5 There is no specific requirement for the calculation order of the two; it can be adjusted according to the actual situation. When the two are calculated simultaneously, the verification efficiency can be improved.
[0072] In this embodiment, after determining the verification result of the lottery information based on the verifiable random number and the winning number corresponding to the lottery purchase item, the method further includes: when the verification result is that the verifiable random number contains the winning number corresponding to the lottery purchase item, the verifiable random number, the corresponding proof information f, and the summary information m are sent to the lottery system. That is, after the lottery purchaser determines the verification result through their user terminal, for example, if the verification result is a winning result, the lottery purchaser's user terminal sends the summary information m, the corresponding proof information f, and the verifiable random number to the lottery system. Thus, the lottery system can obtain the corresponding summary information m and proof information f to verify the proof information f, thereby verifying the legality of the verifiable random number. In subsequent processes, if the proof information f passes verification, it indicates that the verifiable random number is legal, thus verifying that the random number, summary information, and proof information indeed belong to the lottery purchaser; conversely, if the proof information f fails verification, it indicates that the verifiable random number is illegal, thus verifying that the random number, summary information, and proof information are indeed fabricated or forged by the lottery purchaser.
[0073] The present invention also provides a lottery verification method, applied to a lottery system, the lottery verification method comprising:
[0074] Obtain the public key information corresponding to the lottery information purchased by the lottery buyer; wherein, the lottery information includes at least the selected numbers corresponding to the lottery purchase item, and the public key information is information generated based on the preset private key information and the selected numbers;
[0075] The public key information of all lottery buyers participating in the lottery purchase project will be published, and a preset algorithm will be used to process the public key information into corresponding digest messages.
[0076] The summary message and the winning numbers corresponding to the lottery purchase items will be published.
[0077] In practice, the lottery system cannot access the private key information selected by the lottery purchaser. It only calculates the digest information using the public key information and publishes the digest information and the winning numbers. Since the private key information is chosen by the lottery purchaser and is unrelated to the lottery system, the verification result can be determined during the final lottery verification process using a verifiable random number and the winning numbers corresponding to the purchased lottery item. This means only the lottery player knows whether their ticket has actually won, eliminating the need for a specific lottery station. Furthermore, this verification method is not paper-based, eliminating the need to bring paper lottery tickets to the lottery center for verification. This eliminates the risk of unauthorized claims (as only the lottery player knows their chosen private key information). Therefore, during lottery verification (where the lottery player provides the private key information corresponding to the winning ticket), there is no need to verify the actual winner's identity, greatly simplifying the verification process and making it both convenient and secure.
[0078] Please see Figure 6 This invention also provides a lottery verification method, which is achieved through the interaction between the lottery system and the user terminal of the lottery purchaser. The steps performed by the lottery system and the user terminal are as described in the above embodiments, and will not be repeated here.
[0079] Please see Figure 7 , Figure 7 This diagram illustrates the verification of verifiable random numbers in an embodiment of the present invention. Specifically, when a winning lottery player (whose actual winning identity still needs confirmation) needs to claim their prize, receive their winnings, or verify their winning eligibility, they can send the summary information m and the corresponding proof information f to the lottery system. The lottery system then uses the summary information m corresponding to the lottery player through a first hash function. Mapped to the preset elliptic curve equation is The system calculates the standard parameter P according to the preset first and second calculation formulas, and compares the standard parameter P with the second parameter s in the proof information. If the two are consistent, it indicates that the verifiable random number provided by the lottery player is legal (that is, the verifiable random number, proof information f, and summary information m provided by the lottery player do indeed belong to him / her, are verified, are legal, and are not fictitious or forged); otherwise, they are illegal (that is, the verifiable random number, proof information f, and summary information provided by the lottery player are not verified, are very likely to be forged, and are illegal).
[0080] The first calculation formula is: The second calculation formula is: U1 represents the first calculated value, t is the third parameter in the proof information, s is the second parameter in the proof information, V is the first parameter in the proof information, and H= U2 represents the second calculated value, O represents the base point value, K represents the public key information, and h3 represents the third hash function.
[0081] Specifically, after obtaining the first and second calculated values, they are substituted into the third hash function h3 to obtain the standard parameter P, i.e. .
[0082] It should be understood that all lottery buyers can access the aforementioned summary and proof information. Therefore, all lottery buyers can verify the summary and proof information to determine the validity of the winning lottery player's verifiable random number. In other words, all buyers' public keys (credentials), message calculations, and the winner's proof are publicly released and can be monitored by everyone, ensuring the transparency and openness of the entire lottery process.
[0083] It should be noted that the elliptic curve equation, the first hash function, the second hash function, the third hash function, and the digest conversion algorithm pre-stored by both the lottery purchaser's user terminal and the lottery system should be the same. This allows each lottery purchaser to verify the legitimacy of the verifiable random number by inputting digest information and proof information through their own user terminal or through the lottery system, ensuring the transparency, openness, fairness, and impartiality of the entire lottery process.
[0084] Figure 8 An electronic device provided in an embodiment of the present invention is shown, which can be used to implement the lottery verification method in any of the foregoing embodiments. The electronic device includes:
[0085] The system includes a memory 801, a processor 802, a bus 803, and a computer program stored on the memory 801 and executable on the processor 802. The memory 801 and the processor 802 are connected via the bus 803. When the processor 802 executes the computer program, it implements the lottery verification method described in the foregoing embodiments. The number of processors can be one or more.
[0086] The memory 801 can be a high-speed random access memory (RAM) or a non-volatile memory, such as a disk storage device. The memory 801 is used to store executable program code, and the processor 802 is coupled to the memory 801.
[0087] Furthermore, embodiments of this application also provide a computer-readable storage medium, which may be disposed in the electronic device in the above embodiments, and the computer-readable storage medium may be a memory.
[0088] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the lottery verification method described in the foregoing embodiments. Furthermore, the computer-readable storage medium can also be a USB flash drive, external hard drive, read-only memory (ROM), RAM, magnetic disk, or optical disk, or any other medium capable of storing program code.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0090] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0091] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0092] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned readable storage medium includes various media capable of storing program code, such as USB flash drives, external hard drives, ROM, RAM, magnetic disks, or optical disks.
[0093] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0094] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0095] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A lottery verification method based on verifiable random numbers, applied to a user terminal, characterized in that, The lottery verification method includes: Obtain lottery information purchased by lottery buyers; wherein the lottery information includes at least the selected numbers corresponding to the lottery purchase item; Generate public key information corresponding to the lottery information based on the selected private key information and the selected numbers, and send the public key information to the lottery system; Obtain the binary-formatted digest message corresponding to the public key information published by the lottery system, and generate a verifiable random number based on the digest message and the private key information; Calculate the proof information corresponding to the verifiable random number; wherein the proof information is used to verify the legality of the verifiable random number; The verification result corresponding to the lottery information is determined based on the verifiable random number and the winning number corresponding to the lottery purchase item.
2. The lottery verification method based on verifiable random numbers as described in claim 1, characterized in that, The step of generating public key information corresponding to the lottery information based on the selected private key information and the selected numbers specifically includes: Obtain a random integer selected by the lottery purchaser, and use the random integer as the private key information selected by the lottery purchaser; The public key information corresponding to the private key information is calculated using a preset elliptic curve algorithm to obtain the public key information corresponding to the lottery information.
3. The lottery verification method based on verifiable random numbers as described in claim 2, characterized in that, The step of calculating the public key information corresponding to the private key information using a preset elliptic curve algorithm specifically includes: Select a base point on the elliptic curve corresponding to the preset elliptic curve equation; The public key information corresponding to the private key information is calculated using preset elliptic curve addition and elliptic curve multiplication operations; wherein the public key information is the product of the value corresponding to the base point and the private key information.
4. The lottery verification method based on verifiable random numbers as described in claim 1, characterized in that, After the step of obtaining the digest message corresponding to the public key information published by the lottery system, the method further includes: The public key information is converted into the corresponding actual digest information using a preset digest conversion algorithm; When the actual digest information is the same as the digest message published by the lottery system corresponding to the public key information, the step of generating a verifiable random number based on the digest message and the private key information is executed.
5. The lottery verification method based on verifiable random numbers as described in claim 1, characterized in that, The step of generating a verifiable random number based on the digest message and the private key information specifically includes: The digest message is mapped to a first integer using a preset first hash function; A first parameter is calculated based on the first integer and the private key information; wherein, the first parameter is the product of the first integer and the private key information; The first parameter is encoded using a preset second hash function to generate a corresponding verifiable random number.
6. The lottery verification method based on verifiable random numbers as described in claim 1, characterized in that, After the step of determining the verification result corresponding to the lottery information based on the verifiable random number and the winning number corresponding to the lottery purchase item, the method further includes: When the verification result indicates that the verifiable random number contains the winning number corresponding to the lottery purchase item, the verifiable random number and the corresponding proof information are sent to the lottery system.
7. A lottery verification method, applied to a lottery system, characterized in that, The lottery verification method includes: Obtain the public key information corresponding to the lottery information purchased by the lottery buyer, sent by the user terminal; wherein the lottery information includes at least the selected numbers corresponding to the lottery purchase item, and the public key information is generated based on preset private key information and the selected numbers; The public key information of all lottery buyers participating in the lottery purchase project will be published, and the public key information will be processed into a corresponding binary format digest message using a preset algorithm. The summary message and the winning numbers corresponding to the lottery purchase item are published; wherein, the summary message and private key information are used by the user terminal to generate a verifiable random number and proof information corresponding to the verifiable random number, the proof information is used to verify the legality of the verifiable random number, and the winning numbers and the verifiable random number are used by the user terminal to determine the verification result corresponding to the lottery information.
8. An electronic device, characterized in that, Includes memory, processor, and bus; The bus is used to enable communication between the memory and the processor; The processor is used to execute computer programs stored in the memory; When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Lottery claiming method and device based on block chain
CN109672693A
Implicit certificate key generation method based on SM2 digital signature
CN112367175A
Method and apparatus for conducting fair lottery while reducing transaction cost by using blockchain network
US20220005311A1