Welcome to the provably fair seeding event for the upcoming ToTheMoon! game (
https://tothemoon.me).
The
original scheme of turning a multiplayer game in which peers do not trust each other was first proposed by Dooglus, refined by Eric and solidified into code by Steve and follows the procedure by bustabit/moneypot.
The high level of the scheme is as follows:
1) We have generated a chain of 10 million sha256 hashes, starting with the private key of a Bitcoin address, and repeatedly feed the output of sha256 back into itself 10 million times. The sha256 of the final hash in the chain is: 76410c9a43351a748c9cd6fdcab4343b697425c7a50bac4627d594b85d97c338, by publicising it here we are preventing any ability to pick an alternate sha256 chain.
2) ToTheMoon! will play through that chain of hashes, in reverse order, and use the hashes to determine the crash point in a probably fair manner.
3) To avoid criticism that the Bitcoin address 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 362330.
Client seed has not yet been found: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"The reference code (javascript) is as follows:
The method to create the hash chain is simply sha256:
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 multiplier:
exports.crashPointFromHash = function(serverSeed) {
var hash = crypto.createHmac('sha256', serverSeed).update(clientSeed).digest('hex');
// In 1 of 67 games the game crashes instantly. // 1,492%
if (divisible(hash, 67))
return 0;
// Use the most significant 52-bit from the hash to calculate the crash point
var h = parseInt(hash.slice(0,52/4),16);
var e = Math.pow(2,52);
return Math.floor((100 * e - h) / (e - h));
};
The chain could be generated with code such as:
var serverSecret = 'If you knew this, you could steal all my money';
var clientSeed = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
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
76410c9a43351a748c9cd6fdcab4343b697425c7a50bac4627d594b85d97c338.
The server secret is a bitcoin private key, which corresponds to the address:
1QAiSfnjbbsZ1874RDnig69EY4CqFeP2Ef, where a 0.1 bitcoin bounty awaits anyone if they discover the leaked server secret.
PS:
Please quote this post, so people can see that I have not changed to Bitcoin private key to produce a chain that is more favorable for the house.