Bitcoin Forum

Other => Beginners & Help => Topic started by: TTBit on September 20, 2012, 06:21:53 PM



Title: Are transaction IDs random(ish)?
Post by: TTBit on September 20, 2012, 06:21:53 PM

By random, I mean not predictable. I ask because SatoshiDice takes the hash of a txid. Would it be possible for someone to calculate the id (or part of an ID) before sending? Why doesn't SD just use the txid?


Title: Re: Are transaction IDs random(ish)?
Post by: Stephen Gornick on September 20, 2012, 06:36:23 PM

By random, I mean not predictable. I ask because SatoshiDice takes the hash of a txid. Would it be possible for someone to calculate the id (or part of an ID) before sending? Why doesn't SD just use the txid?

You can fabricate a transaction ID, so there is no guarantee that the transaction id is random.

The reason it doesn't matter to SatoshiDICE is because the bettor doesn't know the secret used in determining the resulting answer (a number, from zero to 65,535).  If just one bit to the transaction ID is different from another, the resulting answer ends up being a totally different number that is random(ish)ly generated.

At the end of each day, the daily secret that was used can be safely revealed, providing a method for the bettor (or anyone else) to verify the that each bet was addressed fairly.

Here's a thread addressing the use of SHA hashing as random number generation:

 - http://bitcointalk.org/index.php?topic=77206.0


Title: Re: Are transaction IDs random(ish)?
Post by: TTBit on September 20, 2012, 07:17:12 PM
You can fabricate a transaction ID, so there is no guarantee that the transaction id is random.

Thank you.


Title: Re: Are transaction IDs random(ish)?
Post by: scintill on September 20, 2012, 07:52:36 PM
You can fabricate a transaction ID, so there is no guarantee that the transaction id is random.

How much control can you have?  It's a matter of brute force: repeatedly changing inputs and outputs, creating the txid, and seeing if it's what you want, right?


Title: Re: Are transaction IDs random(ish)?
Post by: FactoredPrimes on September 20, 2012, 08:47:37 PM
You can fabricate a transaction ID, so there is no guarantee that the transaction id is random.

How much control can you have?  It's a matter of brute force: repeatedly changing inputs and outputs, creating the txid, and seeing if it's what you want, right?

I beleive this is the case.


Title: Re: Are transaction IDs random(ish)?
Post by: Stephen Gornick on September 21, 2012, 05:25:33 AM
You can fabricate a transaction ID, so there is no guarantee that the transaction id is random.

How much control can you have?  It's a matter of brute force: repeatedly changing inputs and outputs, creating the txid, and seeing if it's what you want, right?


Essentially, yes:

 - http://bitcointalk.org/index.php?topic=54451.msg649253#msg649253
 - http://bitcoin.stackexchange.com/a/2233/153