Method, application and device for generating random numbers in game, equipment and storage medium
A random number and game technology, applied in the blockchain field, can solve problems such as block hash random number instability, random number fragility, blockchain games cannot be played, etc., to achieve flexible and controllable lottery time, random number The effect of high entropy source and stable game result
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0037] A random number generation method for games, suitable for blockchain nodes, such as figure 1 Shown, including:
[0038] S101. Receive a first transaction sent by a first party; wherein the first transaction includes a first random number hash value generated locally by the first party at the current block height, and the first party is in the Nth block The first random number generated locally at the previous block height, N is a positive integer, and the value of N can be the block rollback height to further strengthen the stable source of random numbers;
[0039] In different blockchain systems, the value of the block rollback height N is different, because the block rollback height in each blockchain system is different. For the public chain Chain33, there are 6 blocks. For Ethereum it is 12. By limiting the locally generated first random number to be published after the rollback interval, it is ensured that the first random number will not be published after the block i...
Embodiment 2
[0069] This embodiment proposes a game random number application, which is suitable for blockchain nodes. According to the game random number generation method described in Embodiment 1, such as image 3 Shown, including:
[0070] After the second random number passes the designated remainder operation, it is compared with the predicted content of the second trading game that meets the set lottery conditions received before the current block, and the current zone is determined according to the game rules of the first game contract. The winning or losing of the second undrawn transaction that meets the set lottery conditions received before the block.
[0071] Take the guessing game as an example. Because the random number of the guessing game only needs to be large or small, the decimal value of the second random number can be taken as a standard, with 1 representing large and 0 representing small.
[0072] Use this standard to compare with the second party's game prediction content ...
Embodiment 3
[0075] This embodiment provides a game random number generation device, which is suitable for blockchain nodes. According to the game random number generation method described in Embodiment 1, such as Figure 4 Shown, including:
[0076] The game opens the interface for receiving the first transaction sent by the first party; the first transaction includes the first random number hash value generated locally by the first party at the current block height, and the first party is in the Nth The first random number generated locally under the block height before the block;
[0077] It is also used to detect whether there is an undrawn second transaction that meets the set lottery conditions received before the current block;
[0078] If it is, it is further used to generate a hash value as the second random number by using the first random number and the second transaction that satisfies the set lottery conditions received before the current block to generate a hash value as the second ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


