> For the complete documentation index, see [llms.txt](https://zenon-raffle.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zenon-raffle.gitbook.io/docs/provably-fair.md).

# Provably Fair

Using the end height's `hash` and the `number of tickets` in the round, we can verify that the `winning ticket` is indeed selected deterministically, not randomly or in anyone's favor.

At the end of each round, the following data will be provided:

* end momentum height and its hash
* the number of tickets in the round
* the calculated seed
* the winning ticket

With those variables, anyone can confirm that the winning ticket was sourced correctly.

***

To manually verify the calculation, use the following formula:

1. Convert the momentum hash to decimal -> `seed`
2. Check the following condition: `seed` modulo `number of tickets` == 0
   * If true, then the seed is divided by the number of tickets until that condition is false.
   * The game should never have a winning ticket value of `0`.
3. The winning ticket is the result of: `seed` modulo `number of tickets`
   * There will always be a winner in the ticket range \[1, number of tickets].

***

#### Verification Tools

* <https://www.rapidtables.com/convert/number/hex-to-decimal.html>
* <https://www.calculator.net/big-number-calculator.html>
