Bitcoin Forum

Economy => Gambling discussion => Topic started by: leomedina on July 13, 2023, 03:14:49 PM



Title: MoneyPot.com - Seeding event
Post by: leomedina on July 13, 2023, 03:14:49 PM
Welcome to MoneyPot (https://moneypot.com)'s provably fair seeding event.

Our provably fair system is based on the first seeding event (https://bitcointalk.org/index.php?topic=922898.0), but instead of salting each hash in the chain with a client seed, a Vx signature (https://www.provablyhonest.com) will be used. This preserves all provably fair guarantees while allowing third-party auditing.

Starting with a server secret, I have generated a chain of 100,000,000 sha256 hashes by recursively hashing the previous hash. The hash of the chain's last element is cd01fbf68ac526970f016e07d7b92e58d49322f02387e4a952037dc5f605f016. This is also our commitment (https://www.provablyhonest.com/apps/moneypot/vx/summary/cd01fbf68ac526970f016e07d7b92e58d49322f02387e4a952037dc5f605f016) to Vx.

The reference code we use to determine game results is as follows:

Code:
const crypto = require("crypto")

// The function that calculates game results
function gameResult(hash, vxSignature, casinoBankroll, playerBetting) {
  const X = scaledOutcome(hash, vxSignature)
  return (casinoBankroll + 2 * playerBetting) / (-scaledOutcome * casinoBankroll + casinoBankroll + 2 * playerBetting)
}

// The pure probability of the casino winning, before taking into account any edge
function scaledOutcome(hash, vxSignature) {
  const nBits = 52 // number of most significant bits to use

  // 1. HMAC_SHA256(key=vxSignature, message=hash)
  const hmac = crypto.createHmac("sha256", vxSignature)
  hmac.update(hash)
  seed = hmac.digest("hex")

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

  // 3. X = r / 2^52
  return r / Math.pow(2, nBits) // uniformly distributed in [0; 1)
}

To compute the hash chain and verify game results, you can use this open-source tool (https://stackblitz.com/edit/moneypot-verifier?file=index.js&view=editor).

The technical details of our game result generation scheme can be found in our maths page (https://www.moneypot.com/maths).


Title: Re: MoneyPot.com - Seeding event
Post by: leomedina on July 13, 2023, 05:52:27 PM
Locking this thread as I have decided to mix in an actual client seed to prove that MoneyPot and ProvablyHonest are not collaborating.