Bitcoin Forum
May 05, 2024, 11:35:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Gambling / Buststake.com seeding event on: July 26, 2022, 08:25:04 AM
We will be launching the Buststake seeding event this week, To prove our fairness we have generated a chain of 10,000,000 SHA256 hashes where each hash is the hash of the hexadecimal representation of the previous hash. The last hash in the chain is: 4bd4b23738b0450122f8b73983c921835d3903b7e04398281c8943b3e93a8186

Every game maps to a hash in the chain: The 10,000,000th element of the chain is the hash of game #1 and the first element in the chain is the hash of game #10,000,000. To verify that a hash belongs to a game #n, simply hash it n times and compare the result with the terminating hash.

To calculate a game's result from its hash:
Code:
const gameHash = hashChain.pop()

const hmac = createHmac('sha256', gameHash);

// blockHash is the hash of bitcoin block 746,700

hmac.update(blockHash);

const hex = hmac.digest('hex').substr(0, 8);
const int = parseInt(hex, 16);

// 0.01 will result in 1% house edge with a lowest crashpoint of 1

const crashpoint = Math.max(1, (2  32 / (int + 1)) * (1 - 0.01))

blockHash used is Bitcoin block 746,700 which has not been mined at time of posting. Basically we are using the hash of a future bitcoin block as a client seed so players can be certain that we did not pick one in the house's favor.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!