Fairness

The RNG Protocol

Fairness: The RNG Protocol

True Randomness (TRNG)

In digital card games, the "Shuffle" is everything. Most Telegram bots use standard pseudo-random number generators (PRNG) which can be predicted if you know the server time or seed.

21 Duel rejects PRNG. We use Cryptographically Secure Pseudo-Random Number Generators (CSPRNG) provided by the OS kernel.

  • The Library: Python’s secrets module (PEP 506).

  • The Source: High-entropy sources from the operating system (e.g., /dev/urandom on Linux).

  • The Result: It is mathematically impossible to predict the next card or the coin toss outcome, even for the developers.

The Coin Toss Integrity

The start of every match (and the tiebreaker in Advanced Mode) is decided by a binary entropy check.

  • The server generates a secure random bit.

  • 0 = Player A starts.

  • 1 = Player B starts.

  • This happens instantly at the moment the match is found, ensuring no "pre-selection" bias.

Open Logic

We do not use "Black Box" algorithms. Our shuffling logic simulates a physical deck:

  1. A fresh 52-card deck is instantiated.

  2. The SystemRandom shuffler randomizes the array.

  3. Cards are "popped" from the list, meaning card counting is theoretically possible within a single hand (just like real Blackjack), but decks are reset every round to prevent advantage play.

Last updated