Author

Topic: please delete mods (Read 120 times)

newbie
Activity: 3
Merit: 0
April 01, 2020, 04:07:05 AM
#1
Seeding event:
We will be releasing our crash game soon and to proof our provably fair system we will be holding this event as we consider this the best way to do it.
We ask everyone to make a snapshot of this page and quote it in replies and such.

Unfair seed:
Each game is salted with the hash of Bitcoin block #623936 which is not mined yet but it will be in a few hours.
By posting it before it was mined, there is no way for me to pick an unfair seed.
Because this information is only released once the block has been mined. And there is no way for us to see the future.


Code to generate the results we will use:

var serverSecret = 'change this';
var clientSeed = 'future bitcoin block hash #623936'

var gamesToGenerate = 200;
var serverSeed = serverSecret;

for (var game = gamesToGenerate; game > 0; --game) {
  serverSeed = crypto.createHash('sha256').update(serverSeed).digest('hex');
  console.log('#' +  game + ' crashes at ' + crashPointFromHash(serverSeed) +'x', '\t\tHash: ' + serverSeed);
}

function crashPointFromHash(serverSeed) {
  var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, serverSeed);
  var hash = hmacHasher.finalize(clientSeed).toString();

  function divisible(hash, mod) {
    var val = 0;
 
    var o = hash.length % 4;
    for (var i = o > 0 ? o - 4 : 0; i < hash.length; i += 4) {
      val = ((val << 16) + parseInt(hash.substring(i, i+4), 16)) % mod;
    }
    return val === 0;
  }

  if (divisible(hash, 25))
      return (1.00).toFixed(2);

  var h = parseInt(hash.slice(0,52/4),16);
  var e = Math.pow(2,52);

  return (Math.floor(((e-h/50)/(e-h))*100)/100).toFixed(2);
};

var terminatingHash = crypto.createHash('sha256').update(serverSeed).digest('hex');
console.log('Tterminating hash is: ', terminatingHash);
Jump to: