r/millionairemakers • u/minlite Mod • Dec 10 '14
Explanation of our new drawing system inspired by suggestions from the community
Over the course of the past few weeks, we received many great suggestions from the community about a new drawing system that could not be faked. We studied all the proposed ideas thoroughly and even debated with their authors at some point to let them defend their idea. We wanted to come up with a system that could be very simple, but also very secure at the same time. While all of the proposed systems were by some extent fake-proof and could be verified, one stood out more because of offering a very interesting feature: being publicly verifiable.
The system was proposed by /u/potatobadger and it relies on using a bitcoin block's hash as the seed for generating a winner. This is ultimately unpredictable since a block's hash is unknown until when its mined. You can read the initial proposal here, but I'm going to explain it briefly below:
The System
The drawing thread is started by a moderator at a pre-announced date and time. It will last for 24 hours to give every person from any country a fair chance to participate.
After 24 hours, the thread is locked by our bot (who goes by the name /u/millionairemakers) and it will begin to generate a list of participants sorted by the old method. This means that the first commenter will be number 1. Because of the 60 request per minute limit enforced by reddit API this will take around 15-20 minutes to complete for around 8000 participants, which is about the number of participants we had in the last drawing. After the list is generated, the bot will upload the list to dropbox and make a post with the link and the SHA-256 sum of the uploaded file. The bot will also check if anyone has posted more than once and will automatically add them to another publicly announced list that we can later use to ban users who have tried cheating multiple times.
Once the participants thread is posted, the bot will watch the Bitcoin blockchain for mined blocks. Our lucky block will be the
6th3rd block mined after the participants list announcement (~1 hourhalf an hour after). We will then use the lucky block's hash to computer 1 + ( hash % number_of_participants) which will be a number between 1 and the number of participants. (Note that the numbering starts from 1 and not from 0 for the sake of simplicity) The winner will be the person who has a number equal to the generated number.The bot will immediately post another thread announcing the winner publicly.
System Features
Users who want to follow the drawing process will be able to view a live log of the script using a pre-announced web address
The script will be open sourced for public audit
The script will be immune from human errors and will produce a very accurate and fair result each time
How is it publicly verifiable?
Because the list is announced before the lucky block has been mined, there is no way for the moderators to predict or fake the results. You can download the list and use the lucky block's hash to reproduce the drawing on your machine. This can be done by writing your own Python script or using the one provided by us for convenience.
Concerns
Mods can fake the results
See the section aboveMods can change the participants list after the block is mined
The participants post will not be edited at any time. Also, by referring to the SHA-256 sum posted in the thread one can verify that the list was not altered in Dropbox and it is in fact the same list that was posted before the block was mined.Additional questions from the thread will be answered here
When will be the next drawing?
The system is ready and it is currently being tested internally for potential bugs. We are planning for a drawing sometime soon (around next week), but we will be announcing the date and time beforehand to allow for preparation.
If you have any questions or concerns regarding this method, please feel free to comment below and I'll happily address them.
A special thanks to /u/potatobadger for proposing this system.
4
u/BFG_9000 Dec 10 '14
Could you explain a bit more about this formula?
1 + ( hash % number_of_participants) Maybe with some specific examples...
4
u/minlite Mod Dec 10 '14 edited Dec 10 '14
Sure.
hash % participantsis the remainder of dividing hash by the number of participants, and as we know, it can be a number between0 and participants - 1. So we have to add 1 to make it from1 to participants. This is pseudorandom since we don't know the hash, and it can be anything.Examples:
Let's say, for instance, the hash is 42 (it will be much bigger, but for simplicity we can assume 42) and the number of participants is 10. 42 % 10 is 2, so the winner will be the third comment (2+1).
2
u/BFG_9000 Dec 10 '14
That's great - thank you.
my confusion arose because I'd never seen 'remainder' expressed that way ^before
→ More replies (1)1
4
u/PotatoBadger Mod Dec 23 '14 edited Dec 23 '14
Wow, thanks for implementing my proposal!
Your description of the process seems correct and appropriately detailed. It looks like you opted not to delay release of the official list. You could release the hash first and not the Dropbox link until after giving the winner time to prepare if you want, but I think you're already aware of this.
Edit:
As pointed out here, you should wait for some number of block confirmations before accepting a block as "The Lucky Block" - I would recommend 6.
Another edit: You should clarify better what the process is for accounts that don't meet the age / throwaway requirements. What exactly do you do in the event that a throwaway is selected?
1
u/minlite Mod Dec 23 '14
Thanks for the remarks.
We have decided to immediately release the list for this one and see how it goes. We might decide to use the proof of existence or the hash method in out next drawings.
I think the block confirmation is a good idea. So if I understand correctly , by confirmations you mean blocks mined later. right? So we wait for 6 blocks then choose the lucky block and then wait for another 6 and retrieve the block associated with the height of the lucky block. It might be the same as the one we had found earlier, or not.
Is that correct?
2
u/PotatoBadger Mod Dec 23 '14 edited Dec 23 '14
So if I understand correctly , by confirmations you mean blocks mined later. right?
Yep.
Blocks usually go something like this:
A -> B -> C -> D -> E -> F
But sometimes two different miners will find blocks at the same height and we end up with two competing chains:
A -> B -> C -> D1
A -> B -> C -> D2
When this happens, some miners end up mining on D1 and some on D2. Eventually (usually at the next block) one chain will become longer than the other and the network reaches consensus to mine on this one.
A -> B -> C -> D1
A -> B -> C -> D2 -> E2 -> F2 -> G2
In this case, the first chain becomes orphaned. Using D1 as the Lucky Block without waiting for confirmations would be a bad thing. D2 should have been used instead, and not waiting would cause some controversy.
2
3
u/Radek_Of_Boktor Dec 10 '14
Great job mods! The next step now needs to be publicity. Anyone have any ideas for how we can get the maximum exposure for the entry post? So far all I can think of is cross-posting to the crypto-currency and freebie/money-related subreddits.
Now that the kinks are ironed out I'm sure more people will upvote, but we need to find a way to get to the top of /r/all as well.
1
u/minlite Mod Dec 10 '14
Thanks. Last time I cross-posted to /r/bestof and honestly to this date I have no idea how it got upvoted and how it wasn't removed by the mods. I even messaged the mods to make sure it is not against their rules, but they didn't even bother to reply. I'm guessing they are not that active. Needless to say, some people were outraged. I'm not sure if we should do that this time.
But, of course, we can post it to crypto-related subs like /r/Bitcoin, /r/dogecoin and also places like /r/Frugal and /r/freebies. The thing is that they don't have many users and it is really unlikely that we will reach the top of /r/all with that.
3
u/apoefjmqdsfls Dec 11 '14
How will you resolve the issue that people can make multiple accounts to participate in the drawing?
2
u/minlite Mod Dec 11 '14
As we said earlier, this is tricky to figure out. We don't want to throw out people just because they don't have karma, and we also don't want to let the alt accounts in. It is hard to figure out the sweet spot in the users spectrum.
3
u/echocage Dec 11 '14 edited Dec 11 '14
Because of the 60 request per minute limit enforced by reddit API this will take around 15-20 minutes to complete for around 8000 participants
That's actually incorrect because you can get comments in batches of 100, and it's 60 requests every 2 minutes, so 1 request every 2 seconds.
>>> import praw
>>> import time
>>> import datetime
>>> r = praw.Reddit("Trying to make a point")
>>> comments = r.get_subreddit("millionairemakers").get_comments(limit=None)
>>> def measure():
... now = time.time()
... print("Comments:", len([x.author.name for x in comments if x.author]))
... return time.time()-now
...
>>> length = measure()
Comments: 892
>>> print(datetime.timedelta(seconds = length))
0:00:16.300408So ~900 comments, ~16 seconds
1
u/minlite Mod Dec 11 '14
Thanks for your suggesstion. The 30 request per min limit is for regular authentication. We use oAuth on the bot to be able to make 60 per min. And also we run
replace_more_commentsto obtain all the comments and that's what takes the most of the time...2
u/echocage Dec 11 '14
Any reason in particular that you don't just use post.comments?
1
u/minlite Mod Dec 11 '14
It's because the
post.commentsarray contains only about 200 comments and the rest areMoreCommentobjects. We should runreplace_more_commentsto replace theMoreCommentobjects with their respective comments.→ More replies (1)1
3
u/IBelieveinBitcoin Dec 23 '14
Did I miss the details of where this method caters for multiple posts from the one user?
2
u/minlite Mod Dec 23 '14
The script is going to remove all the duplicates, but we have decided to still let it in the person. If we see a person tries this for many times, we will ban them.
→ More replies (2)
2
u/Tim-Sanchez Community Mod Dec 10 '14
The first and last comments can't win right? This should be accounted for, maybe Automod or another bot should make the first and last comment.
4
u/minlite Mod Dec 10 '14
I dont think that's the case.
hash % participantsis a number between 0 and (participants - 1), so if we add 1, then it will be a number from 1 to (participants).2
2
u/zluckdog Dec 11 '14
I have a concern about legality of this lottery system. What methods are being implemented to prevent The State from cracking down on this sort of thing?
Thia is an honest question as anyone who understands bitcoin knows that one of the principles is "decentralization" which mitigates unwanted intervention.
Will there be work done to move into a decentralized method for selecting participants?
4
u/minlite Mod Dec 11 '14
Well it is decentralized. We just generate the list. After the list is generated, anyone can count the blocks and find out the winner. So in the case that our system goes down, nothing will keep others from producing the results.
3
2
Dec 11 '14
What will happen if the chosen winner is ineligible for whatever reason. Wait for the next block?
2
u/minlite Mod Dec 11 '14
We would then use the block mined immediately after our initial lucky block to determine the winner.
2
2
u/Klatelbat Dec 21 '14
This is an ingenious idea. How does the bot calculate hash % number_of_participants when the hash is alphanumeric? Is it just simply the corresponding digit % 10? So "S" would be 18 % 10 which would give 8? I'm just curious, this stuff interests me but I have very little experience in this field. I'm sure it's more complicated than that, just curious.
1
u/minlite Mod Dec 21 '14
Thanks for asking.
The hash is a hexadecimal value (0-9 A-F) and it can be easily converted to a big decimal number.
2
u/the_androgynous_name Dec 22 '14
Sorry if this is a dumb Q, but where/how do we donate the $1 to participate in this?
1
u/minlite Mod Dec 22 '14
We are not pooling any money beforehand. When the winner is selected, he/she will make a thread with the options to donate.
→ More replies (1)
2
2
u/curehead Mar 24 '15
Do we need a sob story to be entered or is every subscriber eligible to win? I can't imagine randomers sending money to someone for no reason. I sent last time because i felt the winner was worthy. I dont think i would have if it just said user /xy won.
1
u/minlite Mod Mar 24 '15
No. You don't have to have a sob story. Just comment something random or funny on the drawing thread.
68
u/LOHare Dec 10 '14
It's really great to see the mods taking feedback and improving the system. Hopefully this time we can get more participation in terms of donations.
25
Dec 10 '14
If the thread hits /r/all (which requires about 2k upvotes in an hour or two), we'll have the biggest chance for a good amount of participation
→ More replies (1)
29
14
u/ThresholdLurker Dec 10 '14
Just to clarify, the comment count will only include initial/parent comments and not random conversation comments... correct? Also, if someone posts a comment, deletes it, and then posts another comment will this throw things off somehow?
I'm not as technically savvy as many here, so the information itself might answer these questions. Some clarity on that would be great, though. This is the sort of attention to detail that I was hoping for... thanks guys!
9
Dec 10 '14
Parent comments only. Also, we can scan for double ups on usernames (and remove both for the draw)
2
u/Hedgz Dec 22 '14 edited Oct 27 '25
73e626e0dd5d5a8ab1f25d2528f7bf14b707eb4af161e989e69f4af5bcc24d9d
→ More replies (10)
9
32
u/kixunil Dec 11 '14
I don't know what this subreddit is about but I'd like to warn you that something % number_of_participants is not fair random generator (it is fair in some specific situations). That means some results have greater odds of choosing then others.
To demonstrate this let's talk about small numbers. Let's say that you roll a dice and want to choose from four people. That means map numbers 1-6 (or 0-5) to 1-4 (or 0-3)
Using modulo function above we get this mapping:
0 -> 0
1 -> 1
2 -> 2
3 -> 3
4 -> 0
5 -> 1
We can see that 0 and 1 have greater odds.
So when this is fair? Simply, when (max(something)+1) % number_of_participants == 0 (try it with dice and three participants; (5+1) % 3 == 0)
How to solve the problem? Do something % increased_nop instead. increased_nop is closest number which is fair. In case of dice and four participants, it would be 6. In case of SHA256 it's closest power of 2. I think it can be calculated like this: increased_nop = 2upper_bound(log2(number_of_participants)).
Now there is important question: What if result (something % increased_nop) is greater than number_of_participants? Answer: discard it, generate new random something and try again. You will eventually find right result.
Of course, you don't need to wait for another block. Just do sha256(something) and you are fine.
This is still publicly verifiable.
Edit: formatting
24
u/apoefjmqdsfls Dec 11 '14 edited Dec 24 '14
Since the hash is such a big number in comparison with the number of participants, it's really a negligible difference in chance. I don't really see how your method improves the fairness..
A better solution might be: we know that the hash has a value between 0 and 2256, so that means that every participant from 1 to (2256 %nop) + 1 has a slightly higher chance of winning. If we now say that only the hashes from 0 till (2256 - (2256 % nop)) are valid then we have a fair distribution. If we get a hash that's not in that range, then we need to generate another random number. Bear in mind that 2256 is a very large number so the change that the hash is not in that range is very small.
EDIT: Actually, the number of the hash will be between 0 and the current bitcoin target. To adjust the difficulty of the bitcoin network, miners have to find a hash smaller than the target. So the higher bound is the target, not 2256 . You can find the current target here https://blockexplorer.com/q/hextarget.
12
2
Dec 10 '14
The system looks very good, but it still has the problem that people can just not donate if their name isn't drawn, right?
1
u/minlite Mod Dec 10 '14
Correct. Unfortunately we can't fix that one because of legal issues. Unless someone with a very good knowledge of law steps up to help us make sure everything is legal.
0
Dec 11 '14
[deleted]
2
u/minlite Mod Dec 11 '14
Thanks for yhe suggesstions. We have been considering Square cash and also Stripe checkout because they cost a lot less than PayPal but we havent agreed on one yet..
2
Dec 11 '14
It's up to the winner to provide options. If you know how these methods work, can you offer the winner help if they want it?
2
2
u/drew489 Jun 05 '15
I personally think the money should be donated first...then a winner is selected randomly. I know some people may not donate when they see the winner posting updates and/or explaining the problems in their life. Just a thought and probably the wrong place to put it in but new here.
3
u/minlite Mod Jun 05 '15
As we have said this before, pooling money would be illegal since that will make this whole thing a lottery and subject to gambling laws.
4
1
u/rynmln Dec 22 '14
Can you go ahead and post the source code for the bot? Also, when will the url be announced to view the log?
2
u/minlite Mod Dec 22 '14
Sure. Once the time runs out, I will post a thread with the link to the log and the source code.
→ More replies (1)
1
u/mchaley Dec 22 '14
Do you need a bitcoin wallet to participate?
1
u/minlite Mod Dec 22 '14
Nope. It's all up to the winner. If he/she decides to provide paypal, then you can donate with a credit card as well.
1
u/_Drakkar Dec 22 '14
I'm in. I'm unemployed & got nothing else to lose other than a warm bed with my parents!
1
3
3
3
u/totes_meta_bot Dec 10 '14 edited Jan 19 '15
This thread has been linked to from elsewhere on reddit.
[/r/Bitcoin] /r/millionairemakers/ implemented a really cool prize drawing system using the blockchain
[/r/Buttcoin] The shitshow that is /r/MillionaireMakers uses a broken system to select winners that does not specify which exact block selects the winner.
If you follow any of the above links, respect the rules of reddit and don't vote or comment. Questions? Abuse? Message me ^here.
3
3
3
2
2
2
2
u/avatarr Dec 11 '14
I still feel like 24 hours is too short. 3 days or something like that would allow for significant word of mouth.
2
Dec 11 '14
we could leave it open forever to allow for the maximum amount of entries as possible too. 24 hours seems like the sweet spot. We will pre-warn people of the time window, and if somebody can't free up just a few minutes to comment with 24 whole hours, a special case could be made.
2
2
2
u/bubblesort Dec 23 '14 edited Dec 23 '14
I'd like a million dollars, please. KTHXBAI!
EDIT: Sorry, wrong thread.
2
2
2
2
2
2
2
2
2
2
2
Jan 19 '15
I don't see why I wouldn't want to be a millionaire or give someone a dollar, both seem fun
2
u/danboston Jan 19 '15
I would gladly take this money and do nice things for people.
RemindMe! 2 days "Donation for /r/millionairemakers"
2
u/Wint3riscoming Jan 19 '15
If I win this money I will selfishly and foolishly blow all of it at once. So please pick me RNGeesus.
2
2
2
2
u/building_a_wall Jan 20 '15
A million dollars would probably be nice, I mean I would take it if it was just given to me
2
u/Rukuah Jan 20 '15
infinitesimal chance of winning, but I love this idea. Congrats to whoever wins!
2
1
u/a_random_guy_001 Dec 12 '14
Sounds like some good changes! I'll keep an eye out on the new thread. ;) Thanks for the hard work folks!
1
1
1
1
1
1
1
1
1
u/Barbsss Dec 22 '14
I hope to win so that I can pay for college, but I'd also like to say thanks (even if I don't win) to the organizers of this event. Good luck to all.
1
1
1
1
1
1
1
1
1
1
1
1
1
u/TheLegendarySheep Dec 22 '14
Wow. This is pretty cool, I hope someone's Christmas is gonna be better now.
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/VicareyG Dec 23 '14
This is such a fantastic idea. I if I don't get chosen I'll be sending 5000 Dogecoins ~$1 to the winner.
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/d4d5c4e5 Jan 20 '15 edited Jan 20 '15
You don't really need to go through all this trouble with the Bitcoin blockchain and everything to produce verifiable randomness. The hash of your entrant list itself is just as good a random number as the block header hash of an arbitrary Bitcoin block, and it's impossible to preimage attack in such a way as to produce a desired winner. The is legit randomness because everyone doing anything whatsoever to the page is producing entropy.
1
1
1
1
Jan 20 '15
As cool as a million dollars would be I just want some games on steam. Kerbal Space looks like the tits. Also beer and pizza would be cool.
1
1
1
1
1
1
u/fnxTX Feb 23 '15
Neat idea. I'll join this lovely group. And if I win, well, I guess a couple unSys projects get fed with pizza instead of ramen for a while >.<
1
1
1
u/Arthur_Person Feb 24 '15
What safety measures are there to stop a a script or bot program that makes numerous new users that comment to increase their chance of winning.
1
1
1
1
1
u/enalios Feb 24 '15
This is a really cool experiment - exactly the kind of stuff I like to see on the internet!
I suppose I'd use it help fund my game design hobby while not using up money I'd otherwise use to provide for my family!
1
1
1
u/workaway24 Feb 24 '15
I'll take my stab at it. Just heard about this sub and its freakin' amazing! Good luck everyone.
1
u/keptfloatin707 Mar 24 '15
thats what i said, 9 months later my asshole child was born... jk i got my balls cut off at the age of 9 jk i got a vasectomy jk im afraid of knifes jk ill take a stab at it.
1
1
1
1
1
1
8
u/claymatthewsband Dec 10 '14
Could you have a system where you start a thread, people comment, you choose a winner from the comments, just like it is done now. Then you don't release the winner's username, everyone donates 1 dollar, and after the money is in you release the winner's name.
Is that still considered a lottery in the eye of the law? Cuz that's the only way I can see everyone donating...