Foxpup
Legendary
Offline
Activity: 4494
Merit: 3180
Vile Vixen and Miss Bitcointalk 2021-2023
|
|
May 31, 2013, 06:13:16 AM |
|
The transaction ID is a hash of the transaction. It is random, but it is possible to generate many variations of the same transaction (without actually sending them) until you get a transaction with a transaction ID that matches some criteria, and then only send that one. You should not use a transaction ID alone as a source of random data.
The correct way to do what you're trying to do is to generate a secret, then publish a hash of that secret. Add the secret to the transaction ID, then hash that, and use that hash to select the winner. When you announce the winner, reveal the secret at the same time. To verify that the winner was fairly chosen, anyone can hash the secret, verify that the hash matches the hash you published earlier (to prevent you from cheating by changing the secret), and then hash the secret+transaction ID to verify that you selected the winner correctly.
|