Author

Topic: Blaze Crash v2 Game Seeding Event (Read 63 times)

newbie
Activity: 17
Merit: 0
June 28, 2024, 11:22:18 AM
#2
Archived post: https://archive.ph/XXkuW

Client seed has been mined!
00000000000000000002af41eab71bac2f18d8908ccecd35b03240cbff8bd8e7

https://www.blockchain.com/explorer/blocks/btc/849840
newbie
Activity: 17
Merit: 0
June 28, 2024, 10:56:09 AM
#1
Hello all! We're back again prepping another game before our launch. The game for this seeding event will be our original game Crash V2

As usual, we've generated a new chain of 10,000,000 SHA256 hashes where each hash is the hash of the hexadecimal representation of the previous hash. Being the last hash in the chain: 628042d5f25e062f24bfdd5b696c34e66a39af9b9381dfdcd2f30d0fa521545d

Code:
const { createHmac } = require('crypto');

const divisible = (hash, mod) => {
  // So ABCDEFGHIJ should be chunked like  AB CDEF GHIJ
  let val = 0;

  let o = hash.length % 4;
  for (let 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;
};

const calculateCrashPointFromHash = function (hash) {
  // In 1 of 15 games the game crashes instantly.
  if (divisible(hash, 15)) return 0;

  // Use the most significant 52-bit from the hash to calculate the crash point
  let h = parseInt(hash.slice(0, 52 / 4), 16);
  let e = Math.pow(2, 52);

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

// these will be the 10M pre generated rolls to be used
const hashChain = ['random1', 'random2'];

const gameHash = hashChain.pop();

const blockHash = '';

const hash = createHmac('sha256', gameHash).update(blockHash).digest('hex');

const crashPoint = calculateCrashPointFromHash(hash);

console.log({ crashPoint });

We’re gonna be using a BlockHash that hasn’t been mined at the time of this post, we’re expecting to use Bitcoin block 849,840 this to prove we have no influence over the outcome of the game. Please guys feel free to quote this post so this will be all set in stone.

Looking forward to show you guys Crash V2 very soon!
Jump to: