Saturday 21 October 2017

Fun at work: A lottery ticket Blockchain implementation

Try looking at thousands of lines of code on a daily basis and on top of that, add a layer of cryptography and smart contracts to the mix.

What you get is a bunch of developers just going through the motions.

So in order to spruce up our development work we decided to build something fun instead.

One of our first forays into smart contracts was to implement a Blockchain ticketing token system through a lottery based game.

So we built our lottery game based of a 4/45 Jackpot implementation. Which means you as a user will need to select 4 numbers from 1-45 as your selection and place a bet. Our lottery smart contract is programmed to draw numbers every night at 12:00AM GMT +8 and automatically distribute winnings to one (or more) winners. 

Imagine a lottery implementation with automatic winnings deposited right into your account while you sleep! There is no need to announce the winners, there is no need to wait to someone to present their winning tickets. It's all self executed and self enforced on the Ethereum Blockchain. 

And if by any chance there are more than one winner, the smart contract distributes winnings evenly!

Basically what we did was turn our crypto-token into a ticket. Which stores your identity and the lottery number you picked and which draw it is eligible for.

The rules are simple, but honestly we really didn't want anybody to win our hard earned Kyptos which has absolutely no value what-so-ever. The winner of this lottery must select the exact value and  order of the winning numbers. We calculated the odds and it came up to about 3.5 million to 1 for you to win in this game. I'm sorry... but go ahead and try to play it anyway, for science!

Other real world implementations of this can be to convert tickets for sports, concerts and other such events into a Blockchain smart contract ticketing solution!

Ticketing in general is a highly complex operation involving
  • Management of issuing tickets
  • Recording of tickets sold 
  • Alignment between the event, ticket holder, event owner and ticket resellers

There is a need for a secure way to verify the authenticity and correctness of a ticket to avoid fraudulent activities such as counterfeiting and ticket scalping. Especially when buying tickets from a third party, buyers can never be certain that the ticket they're about to buy is actually valid.

Tickets issued as an email, PDF or barcode image can be shared and copied without a proper method to validate the owner and its authenticity.

These issues magnify themselves when an event involves tens of thousands of attendees and limited seating space, such as the ticketing issues faced during the 2017 SEA Games football final between Malaysia and Thailand.

Implementing a smart contract based ticketing token infrastructure would yield great benefits to the ticketing industry and event goers:
  • Any ticketing agent can now have a secure, trusted and validated online ticketing system without the need to invest in software and hardware architecture
  • Digital tickets are directly linked to the ticket holder and further verification  (ID number, photo or even biometric) can be implemented for additional security
  • Stops fradulent activities such as counterfeit tickets, scalping and price fixing
  • Removes issues of having to replace lost and damaged tickets
  • Digital tickets do not need to be printed, the supply is directly proportionate to the seating availability and  capacity of an event
  • Users can purchase tickets for any event online, reduces the need to stand in long queues and waste time waiting for tickets
  • Open platform allows for any event management systems to connect via API keys
  • Event owners are able to additionally push product placements , advertisements and future events to users via targeted marketing initiatives
You can register for our Kryptosys Demo Framework and follow the instructions on the main page. 

If you would like to take a peek at how the game it played you can download the lottery game  instructions HERE

No comments:

Post a Comment

Popular Posts