Bitcoin Forum
May 11, 2024, 08:13:09 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Gambling / IsItProvablyFair.org - Instantly verify if the game you just played was fair! on: January 02, 2024, 03:28:51 PM
Hello BitcoinTalk Grin,


Today, I'm thrilled to launch isitprovablyfair.org, a brand new site that will allow players to verify in just a few seconds if the game they just played on Bustabit was provably fair.

It does this by checking if the game hash inputted by the user is on the same hash chain as the terminating hash that was generated in the 2018 seeding event: https://bitcointalk.org/index.php?topic=2807542.0. It can go through millions of games in just a matter of seconds.

How do we do that exactly ? We hash the game hash n times (n being the game ID), and then we check to see if the result matches with the terminating hash. If the result matches with the terminating hash, the game is provably fair. If it doesn't, then the game was altered.

Here is the NodeJs code used to check for the terminating hash:

Code:

function verifyingGameHash(data, gameID) {
    let hashedSeed = data;
    for (let i = 0; i < gameID; i++) {
        hashedSeed = crypto.createHash('sha256').update(hashedSeed).digest('hex');
    }
    return hashedSeed;
}


And finally, we also calculate the game bust with the salted hash of Bitcoin block #505750 to ensure that it matches too.

Code:

const gameResult = (seed, salt) => {
    const nBits = 52;


    const hmac = crypto.createHmac('sha256', salt);
    hmac.update(Buffer.from(seed, 'hex'));
    seed = hmac.digest('hex');


    seed = seed.slice(0, nBits / 4);
    const r = parseInt(seed, 16);


    let X = r / Math.pow(2, nBits);


    X = 99 / (1 - X);


    const result = Math.floor(X);
    return Math.max(1, result / 100);
};


const sha256 = (str) => {
    return crypto.createHash('sha256').update(str).digest('hex');
};


const gameBust = (gameHash, numRounds) => {
    let prevHash = null;
    for (let i = 0; i < numRounds; i++) {
        let hash = prevHash ? sha256(String(prevHash)) : gameHash;
       
        let bust = gameResult(hash, '0000000000000000004d6ec16dafe9d8370958664c1dc422f452892264c59526');
        return bust
        prevHash = hash;
    }
};




All the code for this website is open source and available on Github: https://github.com/drkhero/isitprovablyfair

If this website gains traction and if there's interest for it, I'll be extending support for other casinos too. Do not hesitate to give feedback and let me know what you all think!  Grin


2  Economy / Gambling discussion / Bustabit Bankroll Profit Predictor on: November 07, 2023, 11:39:00 PM
Hi all,

I created a Bustabit Bankroll profit predictor, which uses the total invested and the daily bankroll profit to form an estimate of the amount of returns you can expect to make when investing in the Bustabit bankroll.

To predict future profits, we are using the daily profit average of the past 2 months.

You can access my site here: https://babprofitcalculator.com/

Let me know what you guys think Tongue
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!