<blockquote>
  <p>Are they truly 100% random (generated by hardware) or is it pseudo-random (generated by software)?</p>
</blockquote>

<p>Pedantic answer: No, they're not random, because the first twenty digits or so will always be zero. </p>

<p>Serious answer: The Bitcoin client does not use any hardware randomness, as far as I know. However, if even a single transaction in the block was generated using hardware randomness, the block hash will incorporate hardware randomness.</p>

<p>Also, I don't think you could predict the hash of a block that hasn't been found yet.</p>

<blockquote>
  <p>Can I rely on it or any other blockchain data to make a 100% trustable raffle?</p>
</blockquote>

<p>As Greg said, a miner can withhold blocks if releasing them would make the miner lose the raffle. Of course, the cost of withholding a block and not broadcasting it to the network is about $9000, so this attack might not be useful.</p>

<blockquote>
  <p>How do I make a trustable raffle</p>
</blockquote>

<p>Your method would probably work. <a href="https://crypto.stackexchange.com/a/1644/6705">This answer</a> discusses how to exchange a secret between two parties that can't trust one another. You could use something based on that.</p>

CC BY-SA 3.0
2014-10-12T19:57:03.177Z
2014-10-12T19:57:03.177Z
2017-04-13T12:48:25.933Z
Nick ODell
<blockquote>
  <p>Are they trully 100% random (generated by hardware) or is it pseudo-random (generated by software)?</p>
</blockquote>

<p>Actually, no, they are 0% random. There is no randomness involved in the mining process whatsoever. The only part in Bitcoin that involves a random generator is the creation of private keys.</p>

<p>As for the <strong>unpredictability</strong> of block hashes (which may appear to be some sort of random), this is because of the <a href="http://en.wikipedia.org/wiki/Avalanche_effect" rel="nofollow">avalanche effect</a> that is typical for cryptographic hash functions. From a practical point of view, you can consider block hashes to be random.</p>

<blockquote>
  <p>Can i rely on it or any other blockchain data to make a 100% trustable raffle?</p>
</blockquote>

<p>The block hashes, yes (although note that they're not perfectly 256-bit distributed, the first n bits are zero). Other blockchain data, probably not, as this can be influenced by others (e.g. miners deciding what transactions to include). </p>

CC BY-SA 3.0
2014-10-14T23:15:36.257Z
2014-10-14T23:15:36.257Z
Maǳi Koǌo
<p>Block hashes can be considered neither random nor pseudo-random. Miners can choose which transactions to include in a block, and don't have to broadcast every block they find. For example, a miner could refuse to broadcast a block unless the block hash ends in a 1 bit. This might not seem important, but it introduces a bias into the resulting block hash and therefore it cannot be considered "random".</p>

<p>In a similar way, none of the other data in a block can be safely considered truly random. Miners get to choose what data goes into each block (even the nonce).</p>

CC BY-SA 3.0
2014-10-12T19:42:09.353Z
2014-10-12T19:42:09.353Z
Greg Hewgill
<p>How are the block hashes generated?</p>

<p>Are they trully 100% random (generated by hardware) or is it pseudo-random (generated by software)?</p>

<p>Can i rely on it or any other blockchain data to make a 100% trustable raffle?</p>

<p>Regards,</p>

CC BY-SA 3.0
2014-10-12T19:34:22.610Z
Your first question: http://bitcoin.stackexchange.com/questions/148/what-exactly-is-mining
Nick ODell
<blockchain><block><hash><random>
Random numbers using blockchain
Egidi
# Random numbers using blockchain

(Asked by: username_0 on 2014-10-12)

How are the block hashes generated?

Are they trully 100% random (generated by hardware) or is it pseudo-random (generated by software)?

Can i rely on it or any other blockchain data to make a 100% trustable raffle?

Regards,

**Tags:** blockchain, block, hash, random

> **Comments:**
> **username_1**: Your first question: http://bitcoin.stackexchange.com/questions/148/what-exactly-is-mining  

---

## 3 answers

### Answer by username_1 on 2014-10-12. Score: 3 | Accepted answer

> Are they truly 100% random (generated by hardware) or is it pseudo-random (generated by software)?

Pedantic answer: No, they're not random, because the first twenty digits or so will always be zero.

Serious answer: The Bitcoin client does not use any hardware randomness, as far as I know. However, if even a single transaction in the block was generated using hardware randomness, the block hash will incorporate hardware randomness.

Also, I don't think you could predict the hash of a block that hasn't been found yet.

> Can I rely on it or any other blockchain data to make a 100% trustable raffle?

As Greg said, a miner can withhold blocks if releasing them would make the miner lose the raffle. Of course, the cost of withholding a block and not broadcasting it to the network is about $9000, so this attack might not be useful.

> How do I make a trustable raffle

Your method would probably work. [This answer](https://crypto.stackexchange.com/a/1644/6705) discusses how to exchange a secret between two parties that can't trust one another. You could use something based on that.


---

### Answer by username_2 on 2014-10-14. Score: 3

> Are they trully 100% random (generated by hardware) or is it pseudo-random (generated by software)?

Actually, no, they are 0% random. There is no randomness involved in the mining process whatsoever. The only part in Bitcoin that involves a random generator is the creation of private keys.

As for the **unpredictability** of block hashes (which may appear to be some sort of random), this is because of the [avalanche effect](http://en.wikipedia.org/wiki/Avalanche_effect) that is typical for cryptographic hash functions. From a practical point of view, you can consider block hashes to be random.

> Can i rely on it or any other blockchain data to make a 100% trustable raffle?

The block hashes, yes (although note that they're not perfectly 256-bit distributed, the first n bits are zero). Other blockchain data, probably not, as this can be influenced by others (e.g. miners deciding what transactions to include).


---

### Answer by username_3 on 2014-10-12. Score: 2

Block hashes can be considered neither random nor pseudo-random. Miners can choose which transactions to include in a block, and don't have to broadcast every block they find. For example, a miner could refuse to broadcast a block unless the block hash ends in a 1 bit. This might not seem important, but it introduces a bias into the resulting block hash and therefore it cannot be considered "random".

In a similar way, none of the other data in a block can be safely considered truly random. Miners get to choose what data goes into each block (even the nonce).


---

