<p>Obviously many gambling websites cheat. Most of them are not transparent.</p>

<p>An important thing is that most gambling websites that use a government-backed currency are subject to gambling laws in the country of that government.</p>

<p>Bitcoin isn't. <em>Bitcoin is currently not subject to any gambling law</em> and so it would be easier for gambling site owners to be unfair. <em>For this reason, it can be very important for a Bitcoin business to be transparent if they want to gain traction in the masses.</em></p>

<p>Another reason, Bitcoin offers a unique way to prove fairness of such applications from within it's own workings. Why wouldn't you use it if you plan to offer a fair service after all??</p>

CC BY-SA 3.0
2013-04-01T20:50:03.693Z
Also, they have a "secret value/hash" so that you can't predict beforehand what the outcomes will be. They often will post the hashes of the secret values so you can verify that they didn't change the secret values and the actual secret values a few weeks later.
lurf jurv
CC BY-SA 3.0
2013-03-26T20:04:33.997Z
2013-03-26T20:04:33.997Z
Steven Roose
<p>Doesn't the <em>block hash</em> or the <em>transaction id</em> provide enough entropy
(for example, by using <code>block_hash % 37</code> to generate a random number between 0 and 36)?</p>

<p><a href="http://www.blockchainroulette.com/" rel="nofollow noreferrer">Block Chain Roulette</a> determines the lucky number as a function of the hash of newest block in the chain: </p>

<blockquote>
  <p>Everytime a new block is created on the Bitcoin block chain, the roulette wheel is spun and a random number between 0 and 36 is generated... <code>random hash = hmac_sha512(secret hash, block hash)</code> ...
  the random decimal integer is then multiplied by 37 and divided by (72057594037927935 + 1), decimal places dropped, resulting in a number between 0 and 36. 14 hex charecters are used because this represents a maximum random number of 72057594037927935, a number which is divisable equally by 37 (Or at least very very close to being equally divisable, when working with such large numbers). This ensures each number between 0 and 36 has an equal probability of being chosen. <a href="http://www.blockchainroulette.com/secrets" rel="nofollow noreferrer">Continue reading...</a></p>
</blockquote>

<p><a href="http://satoshidice.com/" rel="nofollow noreferrer">SatoshiDice</a> determines win/lose by using a pre-determined secret as well:</p>

<blockquote>
  <p>The lucky number used to determine the winner of games is simple. It is simply the first bytes of <code>hmac_sha512(secert,txid:out_idx)</code>. That would be the secret string as the key and the transaction ID of your bet transaction as the data.</p>
</blockquote>

<p>Can someone generate a transaction in such a way that its hash is known ahead of time?<br>
<strong>Edit</strong>: It seems like the second part of the question has <a href="https://bitcoin.stackexchange.com/questions/8107/are-transaction-hashes-random">already been answered</a>.</p>

<hash><satoshidice><gambling><random>
Why do transaction/blockchain based gambling sites use such complicated methods for proving fairness?
nivs
# Why do transaction/blockchain based gambling sites use such complicated methods for proving fairness?

(Asked by: username_0 on 2013-03-24)

Doesn't the *block hash* or the *transaction id* provide enough entropy
(for example, by using `block_hash % 37` to generate a random number between 0 and 36)?

[Block Chain Roulette](http://www.blockchainroulette.com/) determines the lucky number as a function of the hash of newest block in the chain:

> Everytime a new block is created on the Bitcoin block chain, the roulette wheel is spun and a random number between 0 and 36 is generated... `random hash = hmac_sha512(secret hash, block hash)` ...
> the random decimal integer is then multiplied by 37 and divided by (72057594037927935 + 1), decimal places dropped, resulting in a number between 0 and 36. 14 hex charecters are used because this represents a maximum random number of 72057594037927935, a number which is divisable equally by 37 (Or at least very very close to being equally divisable, when working with such large numbers). This ensures each number between 0 and 36 has an equal probability of being chosen. [Continue reading...](http://www.blockchainroulette.com/secrets)

[SatoshiDice](http://satoshidice.com/) determines win/lose by using a pre-determined secret as well:

> The lucky number used to determine the winner of games is simple. It is simply the first bytes of `hmac_sha512(secert,txid:out_idx)`. That would be the secret string as the key and the transaction ID of your bet transaction as the data.

Can someone generate a transaction in such a way that its hash is known ahead of time?  
**Edit**: It seems like the second part of the question has [already been answered](https://bitcoin.stackexchange.com/questions/8107/are-transaction-hashes-random).

**Tags:** hash, satoshidice, gambling, random


---

## 1 answers

### Answer by username_1 on 2013-03-26. Score: 1

Obviously many gambling websites cheat. Most of them are not transparent.

An important thing is that most gambling websites that use a government-backed currency are subject to gambling laws in the country of that government.

Bitcoin isn't. *Bitcoin is currently not subject to any gambling law* and so it would be easier for gambling site owners to be unfair. *For this reason, it can be very important for a Bitcoin business to be transparent if they want to gain traction in the masses.*

Another reason, Bitcoin offers a unique way to prove fairness of such applications from within it's own workings. Why wouldn't you use it if you plan to offer a fair service after all??

> **Comments:**
> **username_2**: Also, they have a "secret value/hash" so that you can't predict beforehand what the outcomes will be. They often will post the hashes of the secret values so you can verify that they didn't change the secret values and the actual secret values a few weeks later.  

---

