Fairness

Change your client seed

This is a random string that is used (in combination with the server seed, and a nonce) to generate a random number. You can change your client seed at any time.

4 to 64 characters: letters, numbers, hyphen or underscore.

Server seed hash

This is the hashed representation of the random string that is used (in combination with the client seed, and a nonce) to generate a random number. The unhashed server seed is revealed when you change your client seed; you can find it in your Pack History and on the verifier. Use it to check the fairness of every result.

Nonce so far: 0

Verify randomness

To maintain transparency, we provide the functions used to verify the fairness of your outcomes. The server seed, client seed and nonce used for a pack opening or battle can be found in your history, or run them in the online verifier.

import crypto from 'crypto'

// Ticket de una apertura: HMAC-SHA256(serverSeed, "clientSeed:nonce"),
// leído en ventanas de 6 bytes y reducido a 1.000.000 sin sesgo.
export const getTicket = (serverSeedHex, clientSeed, nonce) => {
  const key = Buffer.from(serverSeedHex, 'hex')
  const space = 2 ** 48
  const bound = 1_000_000
  const limit = space - (space % bound)
  for (let attempt = 0; ; attempt++) {
    const message = attempt === 0 ? `${clientSeed}:${nonce}` : `${clientSeed}:${nonce}:retry:${attempt}`
    const digest = crypto.createHmac('sha256', key).update(message).digest()
    for (let w = 0; w < 5; w++) {
      const value = digest.readUIntBE(w * 6, 6)
      if (value < limit) return value % bound
    }
  }
}

// El hash publicado antes de abrir debe coincidir con la semilla revelada:
export const serverSeedHash = (serverSeedHex) =>
  crypto.createHash('sha256').update(Buffer.from(serverSeedHex, 'hex')).digest('hex')