Bitcoin Forum
May 13, 2024, 12:00:58 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: please delete mods  (Read 100 times)
Crashcord (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 01, 2020, 09: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);
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!