Bitcoin Forum
May 13, 2024, 08:23:18 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: xrpbust.com Provably Fair Seeding Event  (Read 214 times)
Dexon (OP)
Full Member
***
Offline Offline

Activity: 230
Merit: 154

I'm a web dev :D


View Profile WWW
February 13, 2018, 08:03:22 PM
Merited by suchmoon (4)
 #1

Disclamer: I was hired by xrpbust.com to make this seeding event and therefor set up the provably fair on the game as well as the game it self. I will not be part of the team that manage/fund this site.

This will reuse the idea posted by Ryan and used for Bustabit v1.

  • A chain of 20 million (2e7) 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: 98eaa51ddd2344c218872caf3c2457045a79a908db281282a52595e4bcb0fa1d, by publicizing it here we are preventing any ability to pick an alternate sha256 chain.
  • xrpbustwill 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 509060.

The reference code (javascript) is as follows:

The method to create the hash chain is simply sha256:
Code:
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:
Code:
function crashPointFromHash(serverSeed, clientSeed) {
  function divisible(hash, mod) {
    // We will read in 4 hex at a time, but the first chunk might be a bit smaller
    // So ABCDEFGHIJ should be chunked like  AB CDEF GHIJ
    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;
  }

  var hash = crypto.createHmac('sha256', serverSeed).update(clientSeed).digest('hex');

  /* In 1 of 101 games the game crashes instantly. */
  if (divisible(hash, 101))
     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:
Code:
var serverSecret =  'If you knew this, you could steal all my money';
var clientSeed = '0000examplehash';

var gamesToGenerate = 2e7;

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 final hash is: ', terminatingHash);


Using our chosen starting serverSeed, the hash terminating the chain is 98eaa51ddd2344c218872caf3c2457045a79a908db281282a52595e4bcb0fa1d. That is to say, the first game's hash played under the new provably fair scheme, when hashed will be 98eaa51ddd2344c218872caf3c2457045a79a908db281282a52595e4bcb0fa1d.
"Your bitcoin is secured in a way that is physically impossible for others to access, no matter for what reason, no matter how good the excuse, no matter a majority of miners, no matter what." -- Greg Maxwell
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715631798
Hero Member
*
Offline Offline

Posts: 1715631798

View Profile Personal Message (Offline)

Ignore
1715631798
Reply with quote  #2

1715631798
Report to moderator
1715631798
Hero Member
*
Offline Offline

Posts: 1715631798

View Profile Personal Message (Offline)

Ignore
1715631798
Reply with quote  #2

1715631798
Report to moderator
1715631798
Hero Member
*
Offline Offline

Posts: 1715631798

View Profile Personal Message (Offline)

Ignore
1715631798
Reply with quote  #2

1715631798
Report to moderator
Dexon (OP)
Full Member
***
Offline Offline

Activity: 230
Merit: 154

I'm a web dev :D


View Profile WWW
February 13, 2018, 08:05:20 PM
 #2

Here is an archive of this page as proof I'm not gonna edit the post.
https://web.archive.org/web/20180213200349/https://bitcointalk.org/index.php?topic=2943152.msg30232389
XRPBust
Newbie
*
Offline Offline

Activity: 20
Merit: 3


View Profile
February 13, 2018, 08:11:36 PM
 #3

I am the owner of XRP Bust. Quoting this post So the hash cannot be changed. 
Disclamer: I was hired by xrpbust.com to make this seeding event and therefor set up the provably fair on the game as well as the game it self. I will not be part of the team that manage/fund this site.

This will reuse the idea posted by Ryan and used for Bustabit v1.

  • A chain of 20 million (2e7) 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: 98eaa51ddd2344c218872caf3c2457045a79a908db281282a52595e4bcb0fa1d, by publicizing it here we are preventing any ability to pick an alternate sha256 chain.
  • xrpbustwill 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 509060.

The reference code (javascript) is as follows:

The method to create the hash chain is simply sha256:
Code:
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:
Code:
function crashPointFromHash(serverSeed, clientSeed) {
  function divisible(hash, mod) {
    // We will read in 4 hex at a time, but the first chunk might be a bit smaller
    // So ABCDEFGHIJ should be chunked like  AB CDEF GHIJ
    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;
  }

  var hash = crypto.createHmac('sha256', serverSeed).update(clientSeed).digest('hex');

  /* In 1 of 101 games the game crashes instantly. */
  if (divisible(hash, 101))
     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:
Code:
var serverSecret =  'If you knew this, you could steal all my money';
var clientSeed = '0000examplehash';

var gamesToGenerate = 2e7;

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 final hash is: ', terminatingHash);


Using our chosen starting serverSeed, the hash terminating the chain is 98eaa51ddd2344c218872caf3c2457045a79a908db281282a52595e4bcb0fa1d. That is to say, the first game's hash played under the new provably fair scheme, when hashed will be 98eaa51ddd2344c218872caf3c2457045a79a908db281282a52595e4bcb0fa1d.
Dexon (OP)
Full Member
***
Offline Offline

Activity: 230
Merit: 154

I'm a web dev :D


View Profile WWW
February 13, 2018, 10:40:45 PM
Last edit: February 13, 2018, 11:31:58 PM by Dexon
 #4

Block 509060 was mined.

Client seed: 0000000000000000000f002542f19cd8ecf5787fdd00b29c590282d4a2aeba75

https://blockchain.info/block-height/509060

The first game: https://www.xrpbust.com/game/1000000
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!