Bitcoin Forum
June 20, 2024, 12:10:57 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Transaction ID  (Read 647 times)
mikemm (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 31, 2013, 04:21:51 AM
 #1

Maybe someone can answer a question for me.  Are transaction id's random or maybe a better question is how random are they?  I'm thinking of doing a promotion/lottery type giveaway and want to have the transaction id determine who the winner is.  That way it is provably fair.
Foxpup
Legendary
*
Offline Offline

Activity: 4396
Merit: 3062


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
May 31, 2013, 06:13:16 AM
 #2

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.

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
mikemm (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 31, 2013, 10:42:18 PM
 #3

I see.  I wanted to do an auction for multiple items with a chance to get it for free and use for example the last digit of the transaction id as a determiner as to who gets it free.  I guess I can still do that with a hash of some sort of multiplier and reveal it afterwards and apply it to each incoming transaction id to see who won but it is a bit bulky and not easily explained to a regular user.
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!