<p>The transaction hash is determined by the contents of the transaction.  As such the payment sender determines the transaction hash so it is not random.</p>

<p>But the SatoshiDICE bettor does not know the secret that SatoshiDICE will use and the result of the hash after including the secret is <a href="http://bitcointalk.org/index.php?topic=77206.0" rel="noreferrer">for all practical purposes random</a>.  </p>

<p>To know that SatoshiDICE didn't cheat, the hash of the secret is known to the bettor in advance and then released the following day.  So the bettor can verify that correct secret was indeed used, and with that verify that the correct payout occurred.</p>

<p>Since SatoshiDICE wagers are bets against the house, all that is needed is a way to determine that the house properly made each payout.  This method of using the transction hash plus secret (revealed at a later time) succeeds at providing  just that.</p>

CC BY-SA 4.0
2023-02-24T11:16:04.110Z
Correct me if I am wrong, but it is already near impossible to predict the transaction hash. The server seed is not needed, just an added layer of randomness.
ericosg
CC BY-SA 3.0
2013-03-04T07:40:50.833Z
2013-03-04T10:51:29.973Z
2013-03-04T10:51:29.973Z
Stephen Gornick
<p>Why does satoshidice have to re-hash the transaction details in order to determine your "lucky" number?</p>

<p>Are there no publicly viewable randomized numbers or hashes that are impossible for the sender to duplicate without broadcasting the transaction?</p>

<satoshidice><gambling><random>
Are transaction hashes random?
user3145
# Are transaction hashes random?

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

Why does satoshidice have to re-hash the transaction details in order to determine your "lucky" number?

Are there no publicly viewable randomized numbers or hashes that are impossible for the sender to duplicate without broadcasting the transaction?

**Tags:** satoshidice, gambling, random


---

## 1 answers

### Answer by username_1 on 2013-03-04. Score: 9 | Accepted answer

The transaction hash is determined by the contents of the transaction. As such the payment sender determines the transaction hash so it is not random.

But the SatoshiDICE bettor does not know the secret that SatoshiDICE will use and the result of the hash after including the secret is [for all practical purposes random](http://bitcointalk.org/index.php?topic=77206.0).

To know that SatoshiDICE didn't cheat, the hash of the secret is known to the bettor in advance and then released the following day. So the bettor can verify that correct secret was indeed used, and with that verify that the correct payout occurred.

Since SatoshiDICE wagers are bets against the house, all that is needed is a way to determine that the house properly made each payout. This method of using the transction hash plus secret (revealed at a later time) succeeds at providing just that.

> **Comments:**
> **username_2**: Correct me if I am wrong, but it is already near impossible to predict the transaction hash. The server seed is not needed, just an added layer of randomness.  

---

