Welcome to the new FaucetPay.io V2 Provably Fair Seeding Event for Crash!
This will reuse the idea posted by Ryan and used for Bustabit v1.
A chain of 10 million (1e7) sha256 hashes was generated, starting with a Server Secret that has been repeatedly fed the output of sha256 hash back into itself 10 million times.
The final hash in the chain is:
6f2860fd02aaa414a5e9bd518801bed060fb8baa20243c0fc37b96ecde9d449c, by publicizing it here we are preventing any ability to pick an alternate sha256 chain.
FaucetPay.io will play through that chain of hashes, in reverse order, and use the hashes to determine the crash point.
To avoid criticism that the Server Secret used in step 1 was carefully chosen to generate lots of "bad" crash points, each hash in the chain will be salted with a client seed, which we have no control of.
The client seed will be the block hash of a Bitcoin block that hasn't yet been mined: block
772214The reference code (javascript) is as follows:
function genGameHash(serverSeed) {
return crypto.createHash('sha256').update(serverSeed).digest('hex');
}
The method to convert a game hash, mix it with the picked client seed to a money pot multiplier:
function toFixed(num, fixed) {
var re = new RegExp('^-?\\d+(?:\.\\d{0,' + (fixed || -1) + '})?');
return num.toString().match(re)[0];
}
function crashPointFromHash(serverSeed, clientSeed) {
var actual_hash = CryptoJS.SHA512(clientSeed + "-" + serverSeed).toString();
var p1 = parseInt((actual_hash.substr(0, 2) + '').replace(/[^a-f0-9]/gi, ''), 16);
var p2 = parseInt((actual_hash.substr(2, 2) + '').replace(/[^a-f0-9]/gi, ''), 16);
var p3 = parseInt((actual_hash.substr(4, 2) + '').replace(/[^a-f0-9]/gi, ''), 16);
var p4 = parseInt((actual_hash.substr(6, 2) + '').replace(/[^a-f0-9]/gi, ''), 16);
var roll = Math.floor(((p1 / Math.pow(256, 1)) + (p2 / Math.pow(256, 2)) + (p3 / Math.pow(256, 3)) + (p4 / Math.pow(256, 4))) * 1000000);
var crash_point = toFixed(parseFloat(1000000 / (roll + 1) * 0.96), 2);
return crash_point;
}
The chain could be generated with code such as:
var serverSecret = 'If you knew this, you could steal all my money';
var clientSeed = '0000examplehash';
var gamesToGenerate = 1e7;
var serverSeed = serverSecret;
for (var game = gamesToGenerate; game > 0; --game) {
serverSeed = genGameHash(serverSeed);
console.log('Game ' + game + ' has a crash point of ' + (crashPointFromHash(serverSeed, clientSeed) / 100).toFixed(2) +'x', '\t\tHash: ' + serverSeed);
}
var terminatingHash = genGameHash(serverSeed);
console.log('The terminating hash is: ', terminatingHash);
Using our chosen starting serverSeed, the hash terminating the chain is
6f2860fd02aaa414a5e9bd518801bed060fb8baa20243c0fc37b96ecde9d449c. That is to say, the first game's hash played under the new provably fair scheme, when hashed will be
6f2860fd02aaa414a5e9bd518801bed060fb8baa20243c0fc37b96ecde9d449c.