Bitcoin Forum
May 10, 2024, 08:07:18 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Gambling / Fun13.com seeding event on: November 04, 2022, 03:50:49 AM
We will be launching the Fun13 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: d45484be76d31ab9f11b68f8b6280812e4f12f8287567b3b844a30da7103f949

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 761700

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 761700 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!