Bitcoin Forum

Bitcoin => Project Development => Topic started by: bit-lottery on August 28, 2014, 08:05:40 PM



Title: Bit-lottery - Need a transparent idea
Post by: bit-lottery on August 28, 2014, 08:05:40 PM
Hello people,

I am launching this today : http://www.bit-lottery.com
Here is the thread for those interested : https://bitcointalk.org/index.php?topic=760481.0

I am a little bit stuck here, and i am not sure how to do it : I want the random pick of the ticket ID to be completly transparent. Basically, that the user know for sure that the ID that the server picked really is random, and is not just picking an address that i speicifed before or anything like that.

Would anyone have any idea how i could do that ?
I was thinking of using the price of BTC in $, using the last decimal number as the ticket ID, at the time of the pick. But it could become easy for some to know if they should play or not at the moment.
I also thought about using http://www.random.org/API but there again : how would the user know i really used it ?
So i am kind of stuck at this point, and i don t wish to develop half solutions to that specific issue.  I will offer 0.1 btc to the first one who can come with an unbreakable idea ( and something that is no rocket science to code too ) !

Thanks.


Title: Re: Bit-lottery - Need a transparent idea
Post by: gordoh on August 29, 2014, 06:27:20 AM
Why don't you use the UK lottery's numbers as your numbers. You make your draw the same date and time as the UK lottery, and then use the same numbers. That way it will be impossible for you to influence the numbers in any way. Im sure you could add a little widget that shows the lottery numbers in real time. It wont be that difficult to do.  ;D


Title: Re: Bit-lottery - Need a transparent idea
Post by: bit-lottery on August 29, 2014, 11:49:28 AM
The lottery is not based on date but on numbers.
So when 10 tickets are bought, the system pick a winner who gets the pot for all tickets - 1 .
Same will go for the 1/50 and the 1/100 . When 50 or 100 tickets are bought, the system picks a winner.


Title: Re: Bit-lottery - Need a transparent idea
Post by: cloverme on August 29, 2014, 06:27:34 PM
I would base it off of something blockchain related and out of your control... Just an example here to give more ideas:

Since you list the transactions on your site, you can base something off the blockchain.  So let's say the 10th ticket transaction of your 10/10 lotto is in block 318117, the winner could be determined in the next unmined block 318118. An example is maybe the last integer in the hash of the block, so for 318118 the hash was 00000000000000001f1c023df24bece678182e21a73f493d8316d62ee78895ae, so the winner would be ticket #5.

Or something based of anything in the blockchain that is not predictable but fits your pool of tickets to pick a winner, the mod of transactions in the block, etc.

-C


Title: Re: Bit-lottery - Need a transparent idea
Post by: bit-lottery on August 30, 2014, 08:19:05 PM
I would base it off of something blockchain related and out of your control... Just an example here to give more ideas:

Since you list the transactions on your site, you can base something off the blockchain.  So let's say the 10th ticket transaction of your 10/10 lotto is in block 318117, the winner could be determined in the next unmined block 318118. An example is maybe the last integer in the hash of the block, so for 318118 the hash was 00000000000000001f1c023df24bece678182e21a73f493d8316d62ee78895ae, so the winner would be ticket #5.

Or something based of anything in the blockchain that is not predictable but fits your pool of tickets to pick a winner, the mod of transactions in the block, etc.

-C


Alright, that seems like a good idea...
But ... let say i do that. I would then have to explain that on the website. Most won't understand that system... but also, those who will, will be able to decide if it's worth it to play or not. Like :  wait to get 9 tickets in, see if it is worth it to buy the last ticket not...  No ?


Title: Re: Bit-lottery - Need a transparent idea
Post by: doof on August 31, 2014, 06:59:03 AM
I would base it off of something blockchain related and out of your control... Just an example here to give more ideas:

Since you list the transactions on your site, you can base something off the blockchain.  So let's say the 10th ticket transaction of your 10/10 lotto is in block 318117, the winner could be determined in the next unmined block 318118. An example is maybe the last integer in the hash of the block, so for 318118 the hash was 00000000000000001f1c023df24bece678182e21a73f493d8316d62ee78895ae, so the winner would be ticket #5.

Or something based of anything in the blockchain that is not predictable but fits your pool of tickets to pick a winner, the mod of transactions in the block, etc.

-C


Alright, that seems like a good idea...
But ... let say i do that. I would then have to explain that on the website. Most won't understand that system... but also, those who will, will be able to decide if it's worth it to play or not. Like :  wait to get 9 tickets in, see if it is worth it to buy the last ticket not...  No ?

You don't have to explain it to people that don't understand.  To them you say "picked a winner at random"


Title: Re: Bit-lottery - Need a transparent idea
Post by: serje on August 31, 2014, 07:04:27 AM
why don't you use the blockchain for the winner?

if you announce to draw winners 2014-08-31 07:00:00 you just have to use the hash of the block that was mined closer to the date of the drawing

for example this hash 00000000000000000a82584441886fba86bd4753c9def3158a2bd38dbe5bd893 witch belongs to block 318393 mined on     2014-08-31 06:55:27


or if a block is found before 07:04:33 you use that one :)

and the hash can be converted to a number or you can use the numbers in the hash :)


Title: Re: Bit-lottery - Need a transparent idea
Post by: PvP on August 31, 2014, 08:37:56 AM
is random.org not good enough?


Title: Re: Bit-lottery - Need a transparent idea
Post by: rz20 on August 31, 2014, 01:40:30 PM
is random.org not good enough?
You can't base a lottery on random.org if you want to make it legal. You can simply modify the source of the website and pick the number that you want. The number of the block system seems to be the most fair as nobody will be able to modify it. You can explain it in a verification tab or something as the gambling sites, I really don't see a problem there-


Title: Re: Bit-lottery - Need a transparent idea
Post by: Miitch on August 31, 2014, 02:05:07 PM
Another option would be to use the provably fair model. Pick a number in advance and create a SHA256 hash of that number. Everyone when they buy their ticket also gets the 'secret hash' along with their ticket number. When the winner is drawn you can reveal the initial number and people can run it through a SHA256 hasher and verify that it matches the 'secret hash' they were given before the draw.

Might that work? Or is it absolutely vital that the number isn't known in advance?


Title: Re: Bit-lottery - Need a transparent idea
Post by: PvP on August 31, 2014, 04:06:40 PM
Another option would be to use the provably fair model. Pick a number in advance and create a SHA256 hash of that number. Everyone when they buy their ticket also gets the 'secret hash' along with their ticket number. When the winner is drawn you can reveal the initial number and people can run it through a SHA256 hasher and verify that it matches the 'secret hash' they were given before the draw.

Might that work? Or is it absolutely vital that the number isn't known in advance?

I am not an expert of the Provably Fair option, but a serious Provably Fair option should do the trick imho. and then random.org RNG should be fine or am I wrong?


Title: Re: Bit-lottery - Need a transparent idea
Post by: cloverme on August 31, 2014, 05:02:00 PM
Provably fair is only semi effective (search reddit) and random.org might not be too bad, but it's not fool proof either and subject to future collusion because it's run by people at some level. Suppose bit-lottery got big and you had multi-million dollar jackpots, our friend here could have his friend offer to buy random.org for "educational purposes"  for $1 million and then collude on the back end for bit-lottery to win 10 million, etc. Or just spend a little time and money and start a competitor to random.org and make it legit for a year then collude with bit-lottery later on.

I think the best option would be something completely out of the control of the bit-lottery and beyond influence or collusion, like a blockhain or multiple blockchains to avoid the 51% stuff (say bitcoin and litecoin blockchains).


Title: Re: Bit-lottery - Need a transparent idea
Post by: serje on August 31, 2014, 08:36:34 PM
Provably fair is only semi effective (search reddit) and random.org might not be too bad, but it's not fool proof either and subject to future collusion because it's run by people at some level. Suppose bit-lottery got big and you had multi-million dollar jackpots, our friend here could have his friend offer to buy random.org for "educational purposes"  for $1 million and then collude on the back end for bit-lottery to win 10 million, etc. Or just spend a little time and money and start a competitor to random.org and make it legit for a year then collude with bit-lottery later on.

I think the best option would be something completely out of the control of the bit-lottery and beyond influence or collusion, like a blockhain or multiple blockchains to avoid the 51% stuff (say bitcoin and litecoin blockchains).

Hahahha

OK i'm paranoid, I admit it .... but you sir are way ahead of me .... who the fuck would do a 51% on bitcoin to win a lottery??? if you do that you have all the bitcoins you wnat you don't need the jackpot :P


Title: Re: Bit-lottery - Need a transparent idea
Post by: cloverme on September 01, 2014, 02:46:52 AM
lol I don't deny there's a nice collection of tin foil hats somewhere...Saved me from getting Gox'd though   ;D


Title: Re: Bit-lottery - Need a transparent idea
Post by: Nobitcoin on September 01, 2014, 03:34:40 PM
How about you take it from a dice site the roll of the dice at the time will be random


Title: Re: Bit-lottery - Need a transparent idea
Post by: bit-lottery on September 04, 2014, 01:41:13 PM
Alright people, Thanks a lot for your contributions !

So, i think , by reading you all, the very best is to base that on the blockchain block hash somehow like you said. This way, everyone can easily verify the random pick.  "Cloverme" solution is the best i can think of right now : Base the winner on the next block hash found :
Quote
so for 318118 the hash was 00000000000000001f1c023df24bece678182e21a73f493d8316d62ee78895ae, so the winner would be ticket #5.

Although, i have question. I am not good enough with bitcoin internal systems, so what i would like to know is :
What if i use the last ticket bought TXID instead of the next hash block.
Like that : i am user 10... i get a ticket, send the payment  : the website gets the payment, and the txid. And pick the winner with the last integer from the last txid ? Basically... i guess the question is: is there anyway for user 10 to know in advance what the txid will be ?

The reason i would prefer to base it on the txid, is that this way i have no lag : As soon as i get 10 tickets in, i can pick a winner, instead of waiting for the next block.

PS : Cloverme, gimme your btc address, you get the 0.1 btc. 
PS 2 : random.org is not free :-( If i wish to create a draw and keep the results online on their website, i have to pay for it, and the minimum price is 3.75 $. Actually, i think i am gonna make a website like random.org, payable in bitcoin, for a much lower fee th... That will be for another project !




Title: Re: Bit-lottery - Need a transparent idea
Post by: Ditto on September 05, 2014, 12:20:30 PM
is there anyway for user 10 to know in advance what the txid will be ?
Yes, that's pretty simple. You just need to repeatedly generate the transaction until you have the txid you want. Then, discard the rest and only broadcast that one.


Title: Re: Bit-lottery - Need a transparent idea
Post by: bit-lottery on September 05, 2014, 12:53:07 PM
is there anyway for user 10 to know in advance what the txid will be ?
Yes, that's pretty simple. You just need to repeatedly generate the transaction until you have the txid you want. Then, discard the rest and only broadcast that one.

Alright... lets go with the block hash.

Although, same question here : There is no way for anyone to know in advance what the next block hash will be ? right ?


Title: Re: Bit-lottery - Need a transparent idea
Post by: bit-lottery on September 05, 2014, 03:04:13 PM
I just modified the system to test the pick based on the next block hash found by the network.
I need testers now :-)
I will pay for your ticket, please read here if interested :
https://bitcointalk.org/index.php?topic=760481.0


Title: Re: Bit-lottery - Need a transparent idea
Post by: Dabs on September 26, 2014, 04:10:45 PM
You might want to look at how I ran my lotto last year. Provably Fair. No one can cheat it, not even me.


Title: Re: Bit-lottery - Need a transparent idea
Post by: Miitch on October 05, 2014, 02:50:27 PM
I just modified the system to test the pick based on the next block hash found by the network.
I need testers now :-)
I will pay for your ticket, please read here if interested :
https://bitcointalk.org/index.php?topic=760481.0

Cool - will check it out :)