Rank distribution

This section explains how we use a trusted random number to determine the prize amount for each ticket.

When a prize pool is created, it has predetermined "winning probabilities for each prize level" and "the number of tokens each prize level can receive." These are represented by a fixed-length array, Rewards, with a length of M, where each element in the array indicates the number of tokens that can be awarded.

When the prize pool reaches 100% progress or the deadline is reached, the prize pool closes. At this point, SwitchBoard is called as the source of the trusted random number, obtaining a definitive trusted random number R.

For a ticket with number K, the trusted random number R is added to the ticket number K. Let RankIndex = (R + K) % M. The reward for that ticket will be Rewards[RankIndex].

Using SwitchBoard as the source of trusted random numbers eliminates the possibility of malicious behavior by any party, including block producers, providing maximum assurance of transparency and fairness in the prize distribution process.

You can learn more about the details of SwitchBoard's random number generation.

Last updated