# Provably Fair Algorithms &#x20;

When a new game of Russian Roulette begins, the location of the bullet in the revolver's chamber is randomly determined. Each time a player pulls the trigger, the system checks if the bullet is in the next chamber to be fired.

To ensure fairness, the number determining the bullet's position must be publicly known at the start of the game. However, simply publishing this number would give away the bullet's location, rendering the game meaningless.

The solution is to encrypt the random number and publish it at the start of the game. Then, the decryption key is revealed at the end. This way, the randomness of the bullet's position can be verified, but the players don't know its exact location until the game is over.

The challenge lies in proving that the initial random number was not manipulated by the system operator to influence the outcome. This can be addressed by using a verifiable random function (VRF) to generate the random number cryptographically securely. By publishing the VRF proof alongside the decryption key, players can verify that the number was truly random and not subject to tampering.

This approach balances the need for randomness, verifiability, and game integrity. The initial encrypted number ensures the bullet's location is unknown, while the final VRF proof demonstrates the number's fairness without revealing sensitive information during gameplay.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://russian-roulette.gitbook.io/russian-roulette-game/security-and-fairness/provably-fair-algorithms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
