Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Slightly related, I was wondering how the actual lottery tells if your ticket is real - do the machines record your ticket's serial number and number(s) chosen and then send the info to the lottery HQ? Or do the lottery machines compute an HMAC of some kind and encode it in the serial number on the ticket itself?


Considering they can tell which vendor sold a winning ticket, they must have a central database logging the numbers chosen for each ticket. Also, considering the amounts of money involved, I can't imagine them doing anything less secure.


For "online" games (like this one), your picks are transmitted to the lottery office which stores them and then transmits the serial number back to the terminal, which prints the ticket. This prevents a ticket from being issued that the lottery's central computer doesn't know about.

When it is time to verify the ticket, they simply send the serial number to the lottery central computer and that computer sends back the payout command (and invalidates that serial number from being paid by any other terminals.) The retailer is supposed to do some basic sanity checking for small prize amounts (is the ticket really on lottery paper, etc.) and obviously for larger prize amounts, there are several other methods to verify the authenticity of ticket stock that aren't public knowledge.


The lottery HQ has records of all tickets for a particular lottery, which gets checked against when you claim a prize.

I'm not sure whether the has-this-ticket-won-anything machines phone home to check it against those records, or whether they just assume the ticket is authentic and leave the proper verification for when a prize is claimed.


The lottery machine creates a random number that is attached and encoded to your ticket and both the number, and the random bit are sent to HQ.


In California at least one ticket was verified by closed circuit video of the person buying it.


I don't know about this US lottery specifically but in most systems everything is recorded at HQ. Not just the numbers, but the place, the date and time, serial number etc

That way they can also check with CCTV.

It's an interesting topic in database design because the link to the store may fail at any time (remember lotteries started years ago on dialup) and you must not have an issued-unrecorded ticket at any point in the process


From my own experience with buying them, they solve that by saying "machine is down, i can't print any tickets". Not a very high tech solution but it certainly solves that problem completely.


Then why did it take so long for them to announce how many winners there were? First they said "at least one", and then they said "three". If everything was stored in a central database, they could have found out the exact figures (and a lot more) as soon as the last winning number was announced.

Maybe it's due to lack of coordination between states? Or maybe they need to do fraud checking, etc. by watching CCTV footage from the point of sale?


It's because of coordination between states. From the MegaMillions website:

> Unlike some multi-state or multi-country lotteries that have central offices, all Mega Millions duties are shared by member states as part of their membership in the game.

Each state handles their own tickets and they don't all use the same software systems to manage them.


I doubt they use recordings for fraud prevention. I'd be pretty upset if my winning lottery ticket were denied because the store lost the recording, or never had them. It's just too costly to record every purchase.


They don't insist on CCTV but it's a useful tool.

Actually the major source of fraud in most lotteries is the store owner . For small wins the ticket is taken back to the store to scan it to check for a win, the store owner will tell the buyer that it lost, or that it only won a much smaller prize, pay that out of the till and then claim the prize. Especially in poor/immigrant communities where many player may not speak English or have internet access.

There was a story on here about an analyst for an oil company who worked out the random number sequence for a lottery in Ontario. He also analysed the winning claims and discovered that certain stores where claiming a disproportionate number of middle wins.


Most of these lotteries date from the late 80s/early 90s and there isn't a lot of profit in updating them.

I went to some talks about the database design for the UK lottery where they admitted they didn't think it would be so popular and so hadn't really considered sharding.

They also were surprised that the number weren't uniformly distributed. They assumed numbers would be picked totally randomly while the first win was all numbers that could be birthdays and so there was an unusual number of winners and it took several days to work out how many.


In the US, each state hosts its own lottery program. Mega Millions and Powerball are programs where states have teamed up to pool their resources and gambling markets.

I've sold Washington State's "lotto" tickets, and you're entirely correct about the reliability of the system - if the device can't connect to servers in Olympia, tickets can't be sold.

CCTV is up to the retailers here, though it's entirely possible that CCTV is a requirement to be an eligible lottery vendor.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: