Bitcoin Forum
November 11, 2024, 02:54:37 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is transition id random?  (Read 861 times)
ZeroCounts (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
June 29, 2011, 05:45:10 AM
 #1

Hi to all,
I am a student from Germany and have discovered bitcoins some days ago. To get a better understanding
of this whole thing i have written a small gambling game which can be played at:

http://zerocounts.dyndns.org/

You send bitcoins to an address and, depending on your transaction id, you win or lose. If your transaction id contains more then 3 zeros you win some btc. Due to the fact that i am not sure if it works the limit is currently 0.02 BTC but will be increased in the future.

Now lets come to my questions:
- Since the game depends on the transaction id the main question is: is it random, or nearly random?

- To get the probabilities i generated about 1000000 sha256 hashes from random numbers and analyzed them, is there a better way to determine the probability of a zero?

- Is there a problem when i publish links to the last  transactions? You can always get a new address for each transaction if you like.

Answers appreciated :-)

ZeroCountsf
Maged
Legendary
*
Offline Offline

Activity: 1204
Merit: 1015


View Profile
June 29, 2011, 06:09:19 AM
 #2

When it comes to using transaction IDs for this kind of thing, you can't tell the user what the transaction ID must be. That is because the transaction can be generated an unlimited amount of times locally until they find one that works. What you have to do is hash the secret that's supposed to be matched, and then release the secret at the time that you tell them if they win or lose.

Maged
Legendary
*
Offline Offline

Activity: 1204
Merit: 1015


View Profile
June 29, 2011, 06:18:25 AM
 #3

That said, the hash of the block the transaction is included in is (relatively) safe. The only issue is if they bet much more than the block is worth, they can just never submit the block to the network if they know that they lose.

ZeroCounts (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
June 29, 2011, 06:57:48 AM
 #4

Thanks for the fast replay.

Is the block id not a problem when there are many transitions? So all users in the block will win the same amount.

You say, a transaction can be generated unlimited times. Am I right that one would have to manipulate the client for this?

Ok, i will hash the time of the transaction and the block id, or investigate further in this.

Thanks
ZeroCounts
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1140


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
June 29, 2011, 07:01:42 AM
 #5

Thanks for the fast replay.

Is the block id not a problem when there are many transitions? So all users in the block will win the same amount.

Not the block number, but the block hash.  The last 64 bits of the block hash are completely random and unpredictable.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
Maged
Legendary
*
Offline Offline

Activity: 1204
Merit: 1015


View Profile
June 30, 2011, 02:28:32 AM
 #6

Thanks for the fast replay.

Is the block id not a problem when there are many transitions? So all users in the block will win the same amount.
Unfortunately, this would be the case.

You say, a transaction can be generated unlimited times. Am I right that one would have to manipulate the client for this?
Yes, but when you're running a gambling site that has such an obvious vulnerability, it WILL be exploited.

python
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
June 30, 2011, 04:51:03 AM
 #7

Thanks for the fast replay.

Is the block id not a problem when there are many transitions? So all users in the block will win the same amount.
Unfortunately, this would be the case.

You say, a transaction can be generated unlimited times. Am I right that one would have to manipulate the client for this?
Yes, but when you're running a gambling site that has such an obvious vulnerability, it WILL be exploited.
okay
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!