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,
Bitcoin Stack Exchange is a question and answer site for Bitcoin users, developers, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityHow 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,
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 discusses how to exchange a secret between two parties that can't trust one another. You could use something based on that.
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 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).
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).