Using VRF's RNG

Instant Win Games

Every time a user interacts, a random number is obtained through Chainlink VRF. This random number is then taken modulo a large prime number. Subsequently, this number is expanded into a polynomial, and the result is again taken modulo the large prime number. This produces a result that is randomly distributed and aligns with the prize outcome.

pageGame Result Algorithm

Lottery Games

Every time a user interacts, a random number is obtained through Chainlink VRF. This random number is then taken modulo 1000000. The result corresponds to the winning numbers of the Lottery Games.

Table Games

Shuffling

At the end of each betting phase, a random number is obtained through Chainlink VRF. Using different immutable parameters, the random number undergoes 52 times hash operations and modulo calculations, obtaining 52 random numbers from 0-51: (a0, a1 ... a51) set as {pokerList}. Card positions in {pokerList} are then swapper: the 0th card with (a0)th card, 1st card with the (a1)th card, and so on until the 51st card swaps with (a51)th card. At this point, the deck has been randomly shuffled using VRF.

Dealing

Sequentially deal cards in the following order: (Banker) (Banker) (Player) (Player) - Cut - (Flop) (Flop) (Flop) - Cut - (Turn) - Cut - (River)

Banker's hand is composed of {pokerList[1]} and {pokerList[3]}, Player's hand consists of {pokerList[0]} and pokerList[2]}, Public cards are {pokerList[5]}, {pokerList[6]}, {pokerList[7]}, {pokerList[9]}, {pokerList[11]}. ​

Numbers 8-59 correspond to 52 cards. The number is taken modulo 4, the result correspond to: Diamond (β™’) = 0,Club (♧) = 1,Heart (β™₯️) = 2 and Spade (♀) = 3

The number is divided by 4, the result is the value of the card. For example: 8 mod 4 = 0, the card suit corresponding to 8 is Diamond 8/4 = 2, the card value is 2. So, 8 is the 2 of Diamonds. ​

59 mod 4 = 3, the card suit corresponding to 59 is Spade 59/4 = 14, the card value is Ace(the largest one) So, 59 is the Ace of Spade.

Last updated