Lottery systems are the software and terminals that run a government lottery. A central system records every ticket sold across a state or a country, often millions in a day, while terminals in shops sell the tickets and pay the prizes. Many governments run lotteries to raise money for public causes. They usually hire a private company to build and run these systems, often under a contract of ten years or more.
The central system holds the official record. A ticket exists only after the central system has recorded it. This is how the lottery can prove, later, which tickets were bought before the draw closed.
Here is a typical case from Italy, whose national lottery systems are run by one of the large lottery companies. A customer at a tobacconist's shop in Milan picks her numbers for the next draw and pays €2. The shop's terminal sends her numbers to the central system. The central system records the ticket with a unique serial number and the exact time. Only then does the terminal print the ticket. At the published closing time, the central system stops accepting tickets for that draw. After the draw, it finds every winning ticket within minutes.
Say her ticket wins €50. She brings it back to the shop. The terminal scans the barcode on the ticket. The central system confirms that the ticket is genuine, that it has won and that it has not already been paid. Then the shop pays her the prize. A large prize must be claimed at the lottery's own office, where the winner's identity is checked.
The system must be reliable and secure. Just before a big draw, millions of people may buy tickets in the last hour. If the system failed, or if anyone could add a ticket after the draw, people would stop trusting the lottery. So the system keeps copies of every record in separate data centres, and the regulator's auditors check it. Large prizes are also checked through AML transaction monitoring. A criminal can launder money by buying a winning ticket from its owner for cash, and then claiming the prize as if he had won it.
A lottery pays out in prizes only part of the money from ticket sales; this works like the house edge of a casino. Lotteries also have duties under responsible gambling. Many sell scratch cards as well, and some sell online instant-win games.
In India, about a dozen states run lotteries, such as Kerala and Punjab, mostly with paper tickets sold through agents. Engineers in Bengaluru and Hyderabad build the lottery systems used in America, Italy and many other countries.