Blockchain-based competitive random number generation method and system
A blockchain-based method generates tamper-proof, fair, and random numbers by combining hash values from user terminals on-chain, addressing decentralization and resource consumption issues in conventional methods, enhancing security and efficiency.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SOOHO IO INC
- Filing Date
- 2025-12-17
- Publication Date
- 2026-07-02
AI Technical Summary
Conventional blockchain systems face challenges in generating random numbers that are fair, random, and tamper-proof, while also being decentralized, due to the reliance on off-chain methods that consume significant computing resources and introduce non-decentralized intermediaries, leading to potential moral hazard and excessive costs.
A blockchain-based method involving user terminals and an encryption module generate hash values from user input seeds, which are verified and combined on-chain to produce a random number, ensuring fairness, randomness, and decentralization, while reducing computational overhead.
The method generates tamper-proof, fair, and random numbers on-chain, reducing computing resource usage and costs, and ensuring decentralization, thus enhancing the security and efficiency of blockchain systems.
Smart Images

Figure KR2025022056_02072026_PF_FP_ABST
Abstract
Description
Blockchain-based competitive random number generation method and system
[0001] The present invention relates to a blockchain-based competitive random number generation method and system, and more specifically, to a blockchain-based competitive random number generation method and system capable of generating random numbers that are impossible to tamper with, in a fair and random manner on a blockchain system.
[0002] As is well known, blockchain systems must use random values when performing block creation and verification tasks. For example, in blockchain systems like Ethereum, if random numbers are not generated literally randomly, the fairness of validator selection and rewards could be compromised, and the system could be exposed to external attacks.
[0003] On the other hand, in a blockchain system environment—that is, an on-chain environment—the generation of random numbers is very difficult because the inputs and results of transactions are transparently disclosed and stored. Furthermore, computational tasks that are complex and consume significant computing resources are practically impossible on-chain.
[0004] Therefore, conventional technology uses a method of generating random numbers off-chain instead of generating them on-chain. Companies known for performing this off-chain random number generation include Chainlink and Supra Oracle.
[0005] This method is generally referred to as a Verifiable Random Function (VRF). However, this method has a problem in that it is not suitable for decentralization, which is a fundamental prerequisite for blockchain. In other words, the mere existence of a random number generation agency makes it non-decentralized, and while one must trust the agents and intermediaries generating the random numbers, the system could be destroyed depending on their moral hazard.
[0006] In addition, random number generation agencies include various specialized and heavy device proofs unique to the agency to increase the complexity and reliability of their random number generation, which is also problematic in that it results in a waste of computing resources.
[0007] In addition, there is also the problem that random number generation costs are excessive because agencies need to make a profit.
[0008] [Prior Art Literature]
[0009] Republic of Korea Published Patent Application No. 10-2023-0025968 (Published Feb. 24, 2023)
[0010] The present invention aims to provide a blockchain-based competitive random number generation method and system capable of generating random numbers that are fair, random, and impossible to tamper with on a blockchain system.
[0011] In addition, another objective of the present invention is to provide a blockchain-based competitive random number generation method and system that can provide random numbers used on a blockchain system at a lower cost compared to conventional methods and significantly reduce the use of computing resources.
[0012] The present invention relates to a blockchain-based competitive random number generation method comprising: a first step in which an encryption module receives user input seeds from a first user terminal and a second user terminal, respectively; a second step in which the encryption module generates a first hash value based on each of the user input seeds and generates a second hash value based on the first hash value, respectively, and transmits the generated first hash value and the second hash value to the first user terminal and the second user terminal, respectively; a third step in which a blockchain system receives and stores the second hash value transmitted from the first user terminal and the second user terminal, respectively; a fourth step in which a blockchain system receives the first hash value transmitted from the first user terminal and the second user terminal, respectively, and verifies the received first hash value, respectively; and a fifth step in which, if the blockchain system succeeds in verifying both the first hash values received from the first and second user terminals, a random number is generated based on the first hash value transmitted from the first user terminal and the first hash value transmitted from the second user terminal. A blockchain-based competitive random number generation method is provided, comprising the sixth step of transmitting the generated random number to at least one of a first user terminal and a second user terminal.
[0013] Here, the first hash value is a result obtained by inputting a timestamp representing user input seed and current time information into a preset hash function, and the second hash value may be a result obtained by inputting the first hash value into a preset hash function.
[0014] In addition, in the fourth step above, the blockchain system may determine that verification is successful if the result obtained by inputting the first hash value transmitted from the first user terminal and the second user terminal into the preset hash function, respectively, is stored in the blockchain system.
[0015] Additionally, in the fifth step, the random number may be a result obtained by the blockchain system performing a preset operation on the first hash value transmitted from the first user terminal, the first hash value transmitted from the second user terminal, and timestamp information representing the current time, and then inputting the result into a preset hash function.
[0016] According to another aspect of the present invention, a blockchain-based competitive random number generation system is provided, comprising: a cryptographic module that receives user input seeds from a first user terminal and a second user terminal, respectively, generates a first hash value based on each of the user input seeds, generates a second hash value based on the first hash value, respectively, and transmits the generated first hash value and the second hash value to the first user terminal and the second user terminal, respectively; and a blockchain system that receives and stores the second hash value transmitted from the first user terminal and the second user terminal, respectively, receives the first hash value transmitted from the first user terminal and the second user terminal, respectively, and verifies the received first hash value, wherein the blockchain system generates a random number based on the first hash value transmitted from the first user terminal and the first hash value transmitted from the second user terminal when the verification of the first hash value received from the first and second user terminals is successful.
[0017] Here, the first hash value is a result obtained by inputting a timestamp representing user input seed and current time information into a preset hash function, and the second hash value may be a result obtained by inputting the first hash value into a preset hash function.
[0018] In addition, the blockchain system may determine that verification is successful if the result obtained by inputting the first hash value transmitted from the first user terminal and the second user terminal into the preset hash function, respectively, is stored in the blockchain system.
[0019] Additionally, the above random number may be a result obtained by the blockchain system performing a preset operation on a first hash value transmitted from the first user terminal, a first hash value transmitted from the second user terminal, and timestamp information representing the current time, and then inputting the result into a preset hash function.
[0020] According to the present invention, a blockchain-based competitive random number generation method and system can be provided that can generate random numbers that are impossible to tamper with, in a fair and random manner on a blockchain system.
[0021] In addition, the present invention can provide a blockchain-based competitive random number generation method and system that can provide random numbers used on a blockchain system at a lower cost compared to conventional methods and significantly reduce the use of computing resources.
[0022] FIG. 1 shows the overall configuration and connection relationships of a blockchain-based competitive random number generation system (1000) according to the present invention.
[0023] FIG. 2 is a diagram showing an embodiment of a blockchain-based competitive random number generation method performed under the same configuration as FIG. 1.
[0024] Hereinafter, embodiments according to the present invention will be described in detail with reference to the attached drawings.
[0025] FIG. 1 shows the overall configuration and connection relationships of a blockchain-based competitive random number generation system (1000) according to the present invention.
[0026] Referring to FIG. 1, a blockchain-based competitive random number generation system (1000, hereinafter simply referred to as "system (1000)") includes a blockchain system (100) and an encryption module (200), and a first user terminal (300) and a second user terminal (400) are connected to each other through a network.
[0027] The first and second user terminals (300, 400) refer to terminals such as conventionally known computers and smartphones, and are terminals used by a user who intends to generate random numbers through the system (1000) or a user who participates in generating random numbers.
[0028] The users of the first and second user terminals (300, 400) are independent participants who compete for their own interests.
[0029] The encryption module (200) performs the function of generating a first hash value and a second hash value based on user input seeds transmitted from the first and second user terminals (300, 400), respectively, and transmitting them to the first and second user terminals (300, 400), respectively.
[0030] Here, the encryption module (200) is an off-chain entity that operates without being directly coupled to the blockchain system (100).
[0031] The blockchain system (100) refers to a conventionally known system such as Ethereum, and performs the function of generating a random number based on a first hash value and a second hash value transmitted from a first and second user terminal (300, 400), respectively, and transmitting it to at least one of the first and second user terminals (300, 400).
[0032] The basic configuration of such a blockchain system (100) is conventionally known and is not the direct purpose of the present invention, so a detailed description is omitted.
[0033] Hereinafter, a random number generation method performed in such a system (1000) will be explained in more detail with reference to FIG. 2 and below.
[0034] FIG. 2 is a diagram showing an embodiment of a blockchain-based competitive random number generation method performed under the same configuration as FIG. 1.
[0035] Referring to FIG. 2, first, a first user terminal (300) used by a user who wants to generate a random number or a first user who wants to participate in generating a random number transmits a user input seed to an encryption module (200), and the encryption module (200) receives the user input seed transmitted from the first user terminal (300) (S100).
[0036] Here, the user input seed can be a string of a preset number of digits.
[0037] The encryption module (200) sequentially generates a first hash value and a second hash value based on the received user input seed (S110).
[0038] Here, the second hash value can be generated based on the first hash value.
[0039] The first hash value is a result obtained by inputting an input value containing a user input seed into a preset hash function, and the second hash value may be a result obtained by inputting the first hash value into a preset hash function.
[0040] While conventionally known hash functions may be used, it is preferable to use a function whose cryptographic security has been sufficiently verified, such as the Keccak256 function.
[0041] In this case, it is preferable to use “user input seed + timestamp” as the input value for Keccak256.
[0042] Timestamps are intended to increase the input entropy of user input seeds, and have the effect of fundamentally blocking vulnerability attacks such as brute force.
[0043] As a timestamp, you can use “nowUnixTimestamp,” which represents the current time converted to a Unix timestamp in seconds.
[0044] In this case, the first hash value can be represented as follows.
[0045] 1st hash value = Keccak256Hash(user input seed + nowUnixTimestamp)
[0046] The second hash value is generated based on the first hash value, and may be the result obtained by inputting the first hash value back into a preset hash function.
[0047] As previously mentioned, the Keccak256 function can also be used as the hash function here. That is, the second hash value can be represented as follows.
[0048] Second hash value = Keccak256Hash(First hash value)
[0049] Then, the encryption module (200) forms the generated first hash value and second hash value into a tuple and transmits it to the first user terminal (300) (S120).
[0050] Meanwhile, the second user terminal (400) also transmits a user input seed to the encryption module (200) as described above (S130), and the encryption module (200) sequentially generates a first hash value and a second hash value based on the user input seed transmitted from the second user terminal (400) as described in step (S110), and then transmits the generated first hash value and second hash value to the second user terminal (400) (S140, S150).
[0051] Steps (S100) to (S140) have been described as the first user terminal (300) transmitting the user input seed first for convenience of explanation, but the order does not matter and they can be performed simultaneously as long as they are performed independently.
[0052] Next, the first user terminal (300) transmits a second hash value to the blockchain system (100) (S160), and the blockchain system (100) receives and stores the second hash value transmitted from the first user terminal (300) (S170).
[0053] The storage of the second hash value can be performed by the execution of a smart contract, and the transmission of the second hash value can be transmitted in the form of a transaction to execute the corresponding smart contract of the blockchain system (100).
[0054] Additionally, the second user terminal (400) also transmits the second hash value to the blockchain system (100) (S180), and the blockchain system (100) executes a smart contract as described above to store the second hash value transmitted from the second user terminal (400) (S190).
[0055] Next, the first user terminal (300) transmits the first hash value to the blockchain system (100) (S200), and the blockchain system (100) receives and verifies the first hash value transmitted from the first user terminal (300) (S210).
[0056] Verification of the first hash value can be performed by the execution of a smart contract, and transmission of the first hash value can be transmitted in the form of a transaction to execute the corresponding smart contract of the blockchain system (100).
[0057] Verification of the first hash value can be performed in the following way.
[0058] The blockchain system (100) checks whether the result obtained by inputting the transmitted first hash value into the same hash function used to generate the second hash value in the previous step (S110) as a preset hash function is stored in the blockchain system (100), and if it is stored, it determines that the verification is successful.
[0059] In the previous step (S110), since the second hash value = Keccak256Hash (the first hash value), the transmitted first hash value is input into the Keccak256 hash function to obtain a result value, and it is checked whether this result value is stored in the blockchain system (100).
[0060] As described above, in a normal case, since the second hash value transmitted by the first user terminal (300) in step (S170) is stored, the blockchain system (100) determines that the verification is successful.
[0061] If it is not stored, it is a tampered value, so the process terminates without performing any further steps.
[0062] In addition, the second user terminal (400) also transmits the first hash value to the blockchain system (100) in the same manner as in steps (S200) and (S210) (S220), and the blockchain system (100) verifies the first hash value transmitted from the second user terminal (400) (S230).
[0063] When verification is successful for both the first hash value received from the first and second user terminals (300, 400), the blockchain system (100) generates a random number based on the first hash value transmitted from the first user terminal (300) and the first hash value transmitted from the second user terminal (400) (S240).
[0064] The generation of random numbers can also be performed by a pre-set hash function.
[0065] In this case, a pre-set operation can be performed on the first hash value transmitted from the first user terminal (300), the first hash value transmitted from the second user terminal (400), and timestamp information representing the current time in the blockchain system (100), and then the result can be input into a hash function.
[0066] For example, when using the Keccak256 hash function described earlier, a random number can be obtained by the following formula.
[0067] Random number = Keccak256Hash(1st hash value transmitted from 1st user terminal (300) + 1st hash value transmitted from 2nd user terminal (400) + block.timestamp)
[0068] Here, block.timestamp is a timestamp (unix timestamp) representing the current time in seconds on the blockchain system (100).
[0069] Meanwhile, in steps (S200) to (S230), for the sake of convenience of explanation, it was described that the first user terminal (300) first transmits the first hash value to the blockchain system (100) and verifies it, but the order does not matter and it is obvious that they can be performed simultaneously as long as they are performed independently.
[0070] Next, the blockchain system (100) transmits the generated random number to the first user terminal (300) (S250).
[0071] Figure 2 shows only the transmission of a random number to the first user terminal (300), but this is exemplary and may be transmitted to the second user terminal (400) or to both the first and second user terminals (300, 400).
[0072] In addition, it goes without saying that it can be implemented to transmit to a third service server (not shown) rather than the first and second user terminals (300, 400).
[0073] According to the present invention, the following advantages are available.
[0074] In other words, at least two competitive participants are required when generating random numbers, and since each participant competes for their own benefit, the reliability of the random number generation can be perfectly guaranteed.
[0075] Even if only one of the two participants participates competitively and the other participates in an abnormal way, the first and second hash values of the two participants are combined to generate a hash value, so this hash value is still unpredictable.
[0076] Therefore, the possibility of manipulation that may occur during random number generation by a single participant can be fundamentally eliminated.
[0077] In addition, since random numbers are generated on-chain in the blockchain system, decentralization and transparency, which are important prerequisites of the blockchain system, can be guaranteed.
[0078] Although the present invention has been described above with reference to preferred embodiments, the invention is not limited to the above embodiments, and it is understood that various modifications and variations are possible within the scope of the invention.
[0079] For example, in the above embodiment, two users using two terminals, the first and second user terminals (300, 400), were described as examples, but it is obvious that more than two users may be used.
[0080] In addition, depending on the case, only one user may be used.
[0081] In addition, although the Keccak256 hash function was primarily used as an example to explain the generation of hash values in the above embodiment, it goes without saying that other hash functions may also be used.
Claims
1. As a blockchain-based competitive random number generation method, A first step in which an encryption module receives user input seeds from a first user terminal and a second user terminal, respectively; A second step in which an encryption module generates a first hash value based on each of the user input seeds and generates a second hash value based on the first hash value, and transmits the generated first hash value and second hash value to a first user terminal and a second user terminal, respectively; A third step in which the blockchain system receives and stores a second hash value transmitted from the first user terminal and the second user terminal, respectively; A fourth step in which the blockchain system receives a first hash value transmitted from a first user terminal and a second user terminal, respectively, and verifies the received first hash value, respectively; Step 5, in which, if the blockchain system succeeds in verifying both the first hash values received from the first and second user terminals, a random number is generated based on the first hash value transmitted from the first user terminal and the first hash value transmitted from the second user terminal; and Step 6, in which the blockchain system transmits the generated random number to at least one of the first user terminal and the second user terminal. A blockchain-based competitive random number generation method including 2. In Claim 1, A blockchain-based competitive random number generation method characterized in that the first hash value is a result obtained by inputting a timestamp representing user input seed and current time information into a preset hash function, and the second hash value is a result obtained by inputting the first hash value into a preset hash function.
3. In Claim 2, A blockchain-based competitive random number generation method characterized in that, in the fourth step above, the blockchain system determines that verification is successful if the result obtained by inputting the first hash value transmitted from the first user terminal and the second user terminal into the preset hash function, respectively, is stored in the blockchain system.
4. In Claim 3, In the above fifth step, A blockchain-based competitive random number generation method characterized in that the above random number is a result obtained by the blockchain system performing a preset operation on a first hash value transmitted from the first user terminal, a first hash value transmitted from the second user terminal, and timestamp information representing the current time, and then inputting the result into a preset hash function.
5. As a blockchain-based competitive random number generation system, An encryption module that receives user input seeds from a first user terminal and a second user terminal, respectively, generates a first hash value based on each of the user input seeds, generates a second hash value based on the first hash value, respectively, and transmits the generated first hash value and second hash value to the first user terminal and the second user terminal, respectively; and A blockchain system that respectively receives and stores a second hash value transmitted from a first user terminal and a second user terminal, respectively receives a first hash value transmitted from the first user terminal and the second user terminal, respectively, and verifies the received first hash value. Includes, A blockchain-based competitive random number generation system characterized by generating a random number based on a first hash value transmitted from a first user terminal and a first hash value transmitted from a second user terminal when the blockchain system succeeds in verifying both of the first hash values received from the first and second user terminals.
6. In Claim 5, A blockchain-based competitive random number generation system characterized in that the first hash value is a result obtained by inputting a timestamp representing user input seed and current time information into a preset hash function, and the second hash value is a result obtained by inputting the first hash value into a preset hash function.
7. In Claim 6, A blockchain-based competitive random number generation system characterized by determining that verification is successful when the result obtained by inputting the first hash value transmitted from the first user terminal and the second user terminal into the preset hash function, respectively, is stored in the blockchain system.
8. In Claim 7, A blockchain-based competitive random number generation system characterized in that the above random number is a result obtained by the blockchain system performing a preset operation on a first hash value transmitted from the first user terminal, a first hash value transmitted from the second user terminal, and timestamp information representing the current time, and then inputting the result into a preset hash function.