Welcome to BTCArena.gg's first provably fair seeding event.
The purpose of this seeding event is to generate a series of dice outcomes, which players know and prove are fairly and randomly generated.
1. We have generated 10 Million sha256 hashes, starting with a server secret that has had its sha256 output repeatedly fed back into itself 10 million times.
The sha256 of the final hash is 48c91c34f6ec1b842ab5279098b07dda0679ebaff4cfbbd3c7843b2c51cea325. By making this public we are unable to pick an alternate sha256 chain
2. BTCArena will play through this chain of hashes in reverse order starting from the 10 million'th hash, and working it's way downwards. By this logic, game #1 will have its outcome decided by the 10 millionth hash. These hashes will be used in a provably fair manner, as will be described below.
3. To avoid any possible conflict of interest or criticisms that the chain generated contains lots of unfavourable rolls, each hash in the chain will be salted with a future block hash, which we have no control of. The seed will be the hash of block 598635 which hasn't been mined yet.
sha256(Game#n Hash + Block Hash )
THE CODE
The method to create the sha256 chain
function genGameHash(server_hash) {
return crypto.createHash('sha256').update(server_hash).digest('hex');
}
Method to mix server hash with client seed and convert outcome into a roll % between 0 and 1.
generateRollFromHash (server_hash, client_seed) {
// * Combine server_hash and client_seed
var hash = crypto.createHash('sha256').update(server_seed).update(client_seed).digest('hex');
// Take first 5 characters from hash and convert to base 10
var roll = parseInt((hash).substr(0, 5), 16) / parseInt('fffff', 16)
return roll;
}