Bitcoin Forum
August 20, 2024, 03:39:46 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Gambling / Re: 🔴🔴🔴BET RED IN CRASH!🔴🔴🔴 Find More Unique Games in BC.Game on: October 27, 2020, 01:47:33 PM
Baccarat seed event
Starting with a secret I've generated a chain of 10,000,000 SHA256 hashes. Each element is the hash of the lowercase, hexadecimal string representation of the previous hash. The hash of the chain's last element is
3aa3ac48f926071d6969702dbd7c3c0a85faf498f8a6081866ef4cf12d428c96 .

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 CryptoJS = require("crypto-js");

function seedGenerator(hash, salt) {
  const hmac = CryptoJS.HmacSHA256(CryptoJS.enc.Hex.parse(hash), salt);
  return hmac.toString(CryptoJS.enc.Hex);
}

function createNums(allNums, hash) {
  const nums = [];
  let h = CryptoJS.SHA256(hash).toString(CryptoJS.enc.Hex);
  allNums.forEach((c) => {
    nums.push({ num: c, hash: h });
    h = h.substring(1) + h.charAt(0);
  });
  nums.sort(function (o1, o2) {
    if (o1.hash < o2.hash) {
      return -1;
    } else if (o1.hash === o2.hash) {
      return 0;
    } else {
      return 1;
    }
  });
  return nums;
}

function getTotalPoint(points) {
  let count = 0;
  points.forEach((point) => {
    let _point = point & 0xf;
    count += _point >= 10 ? 0 : _point;
  });
  return count % 10;
}

function playing(allCards, startIndex) {
  const playerCards = [allCards[startIndex], allCards[startIndex + 2]];
  const bankerCards = [allCards[startIndex + 1], allCards[startIndex + 3]];

  const playerTotalPoint = getTotalPoint(playerCards);
  const bankerTotalPoint = getTotalPoint(bankerCards);

  const lastCard = allCards[startIndex + 5];

  const getLastPoint = function (cards) {
    return getTotalPoint([cards[2]]);
  };

  if (bankerTotalPoint >= 8 || playerTotalPoint >= 8) {
    // get result
  } else if (playerTotalPoint >= 6 && bankerTotalPoint >= 6) {
    // get result
  } else {
    if (playerTotalPoint <= 5) {
      playerCards.push(allCards[startIndex + 4]);
    }

    if (playerCards.length == 2) {
      if (bankerTotalPoint <= 5) {
        bankerCards.push(allCards[startIndex + 4]);
      }
    } else if (bankerTotalPoint <= 2) {
      bankerCards.push(lastCard);
    } else if (
      bankerTotalPoint == 3 &&
      playerCards.length == 3 &&
      getLastPoint(playerCards) != 8
    ) {
      bankerCards.push(lastCard);
    } else if (
      bankerTotalPoint == 4 &&
      playerCards.length == 3 &&
      getLastPoint(playerCards) >= 2 &&
      getLastPoint(playerCards) <= 7
    ) {
      bankerCards.push(lastCard);
    } else if (
      bankerTotalPoint == 5 &&
      playerCards.length == 3 &&
      getLastPoint(playerCards) >= 4 &&
      getLastPoint(playerCards) <= 7
    ) {
      bankerCards.push(lastCard);
    } else if (
      bankerTotalPoint == 6 &&
      playerCards.length == 3 &&
      getLastPoint(playerCards) >= 6 &&
      getLastPoint(playerCards) <= 7
    ) {
      bankerCards.push(lastCard);
    }
  }
  let result = {
    player: {
      points: playerCards.map((card) => createCardFram(card)),
      totalPoint: getTotalPoint(playerCards),
    },
    banker: {
      points: bankerCards.map((card) => createCardFram(card)),
      totalPoint: getTotalPoint(bankerCards),
    },
  };
  return result;
}
function getAllCards(hash, salt) {
  const allNums = [
    161,
    180,
    199,
    218,
    162,
    205,
    181,
    200,
    219,
    163,
    182,
    220,
    201,
    177,
    196,
    215,
    170,
    178,
    221,
    197,
    216,
    171,
    179,
    198,
    172,
    217,
    193,
    212,
    167,
    186,
    194,
    173,
    213,
    168,
    187,
    195,
    214,
    188,
    169,
    209,
    164,
    183,
    202,
    210,
    189,
    165,
    184,
    203,
    211,
    166,
    204,
    185,
  ];
  let seed = seedGenerator(hash, salt);
  let finalNums = createNums(allNums, seed);
  seed = String(CryptoJS.SHA256(seed));
  finalNums = createNums(finalNums, seed);
  let allCards = finalNums
    .slice(0, 6)
    .map((m) => m.num)
    .map((item) => item.num);
  return allCards;
}

function createCardFram(card) {
  const CARDS = " ,A,2,3,4,5,6,7,8,9,10,J,Q,K".split(",");
  const SUITS = ["♠️", "♥️", "♣️", "♦️"];
  let suitsIndex = (card & 240) / 16 - 10;
  let suits = SUITS[suitsIndex];
  let point = CARDS[card % 16];
  let color = suitsIndex % 2 === 0 ? "black" : "red";
  return {
    color,
    suits,
    point,
  };
}

function verifyBaccarat(seed, salt) {
  let allCards = getAllCards(seed, salt);
  let result = playing(allCards, 0);
  console.log(Seed: ${seed} Salt: ${salt});
  console.log(Banker points: ${result.banker.totalPoint} cards: ${result.banker.points.map(m => { return m.color + m.suits + m.point; })});
  console.log(Player points: ${result.player.totalPoint} cards: ${result.player.points.map(m => { return m.color + m.suits + m.point; })});
  console.log("")
  return result;
}

// entry
verifyBaccarat("GAME_HASH", "SALT");

Before being used to calculate the corresponding result, each game hash is salted with the lowercase, hexadecimal string representation of the hash of bitcoin block 654,460 .
This block has not been mined yet at the time of starting the provably fair seeding event, proving that I have not deliberately picked a chain that is unfavorable for players.




im quoting this because coco asked me to lol
2  Economy / Gambling / Re: 🔴🔴🔴BET RED IN CRASH!🔴🔴🔴 Find More Unique Games in BC.Game on: October 25, 2020, 06:18:44 AM
In my opinion its an awesome idea, since its up ive been trying it and i actually like it. Im actually gonna play crash from now on.
3  Economy / Gambling / Re: Multiplayer Keno seed event - BC.Game on: June 22, 2020, 06:30:26 AM
Get ready for some exciting multiplayer action because at last, Keno is here. You spoke, we listened.
What lucky numbers and patterns will you choose to take the bankroll?
Will you go it alone or will you coordinate a strategy with your friends in chat? There are so many more possibilities with this new and exciting twist on a classic game.

Starting with a secret I've generated a chain of 10,000,000 SHA256 hashes. Each element is the hash of the lowercase, hexadecimal string representation of the previous hash. The hash of the chain's last element is 54fe30623823224ef8379e00f3d88a02ed3333937862ee0383b9cbb3d1e43763

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 CryptoJS = require("crypto-js");

function seedGenerator(hash, salt) {
    const hmac = CryptoJS.HmacSHA256(CryptoJS.enc.Hex.parse(hash), salt);
    return hmac.toString(CryptoJS.enc.Hex);
}
function createNums(allNums, hash) {
    const nums = [];
    let h = CryptoJS.SHA256(hash).toString(CryptoJS.enc.Hex);
    allNums.forEach((c) => {
        nums.push({ num: c, hash: h });
        h = h.substring(1) + h.charAt(0);
    });
    nums.sort(function (o1, o2) {
        if (o1.hash < o2.hash) {
            return -1;
        } else if (o1.hash === o2.hash) {
            return 0;
        } else {
            return 1;
        }
    });
    return nums;
}
function keno(hash) {
    const salt = 'salt waiting to be generated';
    const allNums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]
    const seed = seedGenerator(hash, salt);
    let finalNums = createNums(allNums, seed);
    finalNums = createNums(finalNums, seed);
    return finalNums.slice(0, 10).map(m => m.num)
}

let hash = 'game hash';
console.log('result =>', keno( hash ).map(item => item.num).join(','));


Before being used to calculate the corresponding result, each game hash is salted with the lowercase, hexadecimal string representation of the hash of bitcoin block 635,010
This block has not been mined yet at the time of starting the provably fair seeding event, proving that I have not deliberately picked a chain that is unfavorable for players.
   


Noted too
4  Economy / Gambling / Re: Crash Game Reseeding Event @ BC.Game on: June 19, 2020, 06:05:56 AM
Hello world,

Based on community feedback, we're currently in the process of upgrading the Crash game algorithm with salting as requested. The purpose of this post is to describe the new changes within the game result algorithm in addition to publicizing our reseeding event for Crash. Below are the differences in how the game results are generated:

OLD GAME RESULT FORMULA
Code:

  const gameResult = (seed) => {
    const nBits = 52; // number of most significant bits to use
    // 1. r = 52 most significant bits
    seed = seed.slice(0, nBits / 4);
    const r = parseInt(seed, 16);
    // 2. X = r / 2^52
    let X = r / Math.pow(2, nBits); // uniformly distributed in [0; 1)
    X = parseFloat(X.toPrecision(9));
    // 3. X = 99 / (1-X)
    X = 99 / (1 - X);
    // 4. return max(trunc(X), 100)
    const result = Math.floor(X);
    return Math.max(1, result / 100);
  };


NEW GAME RESULT FORMULA
Code:

  const gameResult = (seed, salt) => {
    const nBits = 52; // number of most significant bits to use

    // 1. HMAC_SHA256(message=seed, key=salt)  
    const hmac = CryptoJS.HmacSHA256(CryptoJS.enc.Hex.parse(seed), salt);
    seed = hmac.toString(CryptoJS.enc.Hex);

    // 2. r = 52 most significant bits
    seed = seed.slice(0, nBits / 4);
    const r = parseInt(seed, 16);

    // 3. X = r / 2^52
    let X = r / Math.pow(2, nBits); // uniformly distributed in [0; 1)
    X = parseFloat(X.toPrecision(9));

    // 4. X = 99 / (1-X)
    X = 99 / (1 - X);

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



Prior to being used for calculation, each game hash is salted with the lowercase + hexadecimal string representation of the hash from pre-selected Bitcoin block 635,380. This block has not been mined yet as of this post, proving that we have not deliberately selected a mined block with a hash that could be favorable to the house. Once block 635,380 has been mined, the results will be posted to this thread as a reply. The game this post is referencing is at https://bc.game/crash.





coco asked me to quote this. So I'm quoting this and fuck coco btw
5  Economy / Games and rounds / Re: BitGame.online 3 mBTC No Deposit Bonus on: January 31, 2020, 05:02:32 PM
username: okseo122
6  Economy / Games and rounds / Re: Free $250+ BTC giveaway! #2 (Stake.com) on: January 21, 2019, 08:58:01 AM
Stake username: Okseo122

Guess: 699
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!