Author

Topic: Are Transaction IDs unpredictable? (Read 1122 times)

legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
September 17, 2013, 07:43:08 PM
#7
I run a lotto where I use 7 secrets.

1. My secret.
2 to 6. Other gambling site secrets
7. Random.org secret.

All secrets are verifiable, and all secrets except for the last one have hashes.

So I have a secret I control which no one else has, a bunch of other secrets which their owners will never give to me, and the planet has a secret that won't be known until the morning of that day.
legendary
Activity: 2506
Merit: 1010
September 17, 2013, 02:48:41 PM
#6
I want to use this for a provably fair betting system.

SatoshiDICE uses the transaction ID to determine the lucky number but the reason it doesn't matter if it is random is because the transaction ID is just part of the input used to get the results, with the remainder kept secret at the time the bet is placed.

Another "provably fair" service, BitLotto (whose operator has since cut and run with the last month's worth of winnings) used the results of an external event (a state-run lottery) that occurred after the betting deadline as its apporach to offering provably fair.

But as others mentioned, the Trx ID is the result of the contents of a transaction, and thus can be manipulated.
donator
Activity: 1218
Merit: 1079
Gerald Davis
September 17, 2013, 12:50:29 PM
#5
As others have pointed out each tx hash is random however an atacker can generate as many as he wants and only broadcast the ones he wants to.

Compare that to a dice roll is random but allowing a gambler to roll as many times as he wants and then pick the dice roll would not be a good idea.
pc
sr. member
Activity: 253
Merit: 250
September 17, 2013, 12:38:03 PM
#4
Exactly. One can't know the hash before the transaction has been made, but one does know the hash before one sends that transaction to anybody else. If your betting system is "hash wins if it ends in a 0 bit", then it's easy to only send you winning transactions. If your betting system is "hash txid along with a secret-of-the-day-that-gets-revealed-tomorrow, win if that ends in a 0 bit", then you're probably fine.
legendary
Activity: 1050
Merit: 1000
You are WRONG!
September 17, 2013, 11:47:57 AM
#3
Simple question, is it possible to predict a transaction ID/hash before the transaction has been made?

I want to use this for a provably fair betting system.
depending on your system, an attacker might only broadcast transactions which he will win on.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
September 17, 2013, 11:46:28 AM
#2
As the ECDSA signatures require a random K value (which unfortunately was shown *not* to be random for some broken Java implementations which caused people to lose BTC) and the tx hash includes this information (am pretty sure the tx hash is a hash of all of the raw tx bytes) then I think you should be pretty safe in assuming it should *normally* be random.

Understand that as K values that are non-random *can* be used it could be a potential vector of attack to use non-random values in order to screw up the "fairness" (at the risk of losing at least some small amount of BTC).
full member
Activity: 238
Merit: 100
September 17, 2013, 11:38:58 AM
#1
Simple question, is it possible to predict a transaction ID/hash before the transaction has been made?

I want to use this for a provably fair betting system.
Jump to: