Bitcoin Forum
May 01, 2024, 11:25:31 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: [1]
  Print  
Author Topic: BetKing.io Crash Game Seeding Event  (Read 180 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
BetKing Support (OP)
Member
**
Offline Offline

Activity: 210
Merit: 11


View Profile
October 11, 2018, 01:03:19 PM
 #1

We are launching our own version of what people call Crash games, made popular by Bustabit, at https://betking.io

We use the same provably fair system as Bustabit.

I'll quote RHavar throughout this post.


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 BetKing chain's last  element is 863165db9a59e5720b3ea5659313e1f8c0546d3ef113d0959cb076cc79eec244.

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

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

  // 1. HMAC_SHA256(key=salt, message=seed)
  const hmac = crypto.createHmac("sha256", salt)
  hmac.update(seed)
  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
  let X = r / Math.pow(2, nBits) // uniformly distributed in [0; 1)

  // 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)
}


Before being used to calculate the corresponding result, each game hash is salted with the lowercase, hexadecimal string representation of the hash of a bitcoin block that has not been mined yet, proving that I have not deliberately picked a chain that is unfavorable for players.

The block we will use is bitcoin block 545340

It would be great if someone could quote this post, before the block is mined, to prove I didn't edit it in future
1714605931
Hero Member
*
Offline Offline

Posts: 1714605931

View Profile Personal Message (Offline)

Ignore
1714605931
Reply with quote  #2

1714605931
Report to moderator
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
actmyname
Copper Member
Legendary
*
Offline Offline

Activity: 2562
Merit: 2504


Spear the bees


View Profile WWW
October 11, 2018, 01:04:13 PM
 #2

We are launching our own version of what people call Crash games, made popular by Bustabit, at https://betking.io

We use the same provably fair system as Bustabit.

I'll quote RHavar throughout this post.


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 BetKing chain's last  element is 863165db9a59e5720b3ea5659313e1f8c0546d3ef113d0959cb076cc79eec244.

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

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

  // 1. HMAC_SHA256(key=salt, message=seed)
  const hmac = crypto.createHmac("sha256", salt)
  hmac.update(seed)
  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
  let X = r / Math.pow(2, nBits) // uniformly distributed in [0; 1)

  // 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)
}


Before being used to calculate the corresponding result, each game hash is salted with the lowercase, hexadecimal string representation of the hash of a bitcoin block that has not been mined yet, proving that I have not deliberately picked a chain that is unfavorable for players.

The block we will use is bitcoin block 545340

Quoted for future reference. Also archived. https://archive.is/I9QXR

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!