Welcome to our seeding event for Rocket Crash launching this week.
We have generated a chain of 10 million SHA256 hashes, starting with a server secret that has been repeatedly fed the output of SHA256 back into itself 10 million times. The SHA256 of the final hash in the chain is: 44ec050ec43cc6e7f579f66d8d9750f083243d307bf859e61c1a5e41d91387ed, by publicising it here we are preventing any ability to pick an alternate SHA256 chain.
Rocket Crash will play through that chain of hashes, in reverse order, and use the hashes to determine the crash point in a probably fair manner.
const crypto = require("crypto")
function gameResult(seed, salt) {
const nBits = 52 // number of most significant bits to use
// 1. HMAC_SHA256(key=salt, message=seed)
const hmac = crypto.createHmac("sha256", salt)
hmac.update(seed)
seed = hmac.digest("hex")
// 2. r = 52 most significant bits
seed = seed.slice(0, nBits/4)
const r = parseInt(seed, 16)
// 3. X = r / 2^52
let X = r / Math.pow(2, nBits) // uniformly distributed in [0; 1)
// 4. X = 99 / (1-X)
X = 99 / (1 - X)
// 5. return max(trunc(X), 100)
const result = Math.floor(X)
return Math.max(1, result / 100)
}
Before being used to calculate the corresponding result, each game hash is salted with the lowercase, hexadecimal string representation of the hash of bitcoin block 632900. This block has not been mined yet, proving that we have not deliberately picked a chain that is unfavourable for players.
Excited to show you the Rocket Crash game very soon!