Introducing A Fully Automated Provable Fair Steem Lotto Bot And A 24 Hour Testing Phase With 0.5 SBD Hourly Guaranteed Prizes


Introduction

My main account is @juliank and I am also the developer behind @photocontests. I realised that one of the current issues with SBD is that there are not a lot of services where you can use them for on Steem(it) except for buying upvotes. My idea is to encourage more people to spend SBD in the Steem economy rather than cashing out of the ecosystem. To achieve this I will be building several applications, starting with this lotto.

Lotto

A fun way to spend some SBD is by buying some tickets and maybe winning a grand prize. After the initial testing phase there will be 3 different categories each with different guaranteed prizes and ticket price. Depending on how everything goes there is room for a monthly mega lotto.

FrequencyTicket PriceGuaranteed Prize PoolMin. tickets
hourly0.01 SBD0.10 SBD5
daily0.10 SBD1.0 SBD5
weekly1.0 SBD10 SBD5
monthly10 SBD100 SBD5

For the initial payout sturcture there will be 2 big prizes, first gets 25% and second gets 10%. After that 5% of people will 4x their ticket price, 10% will 2x their ticket price and 20% will get back their money. This adds up to about a 35% win chance. There is 5% fee which will also be used for promotion.

Payout structure

#% of Prize Pool
132%
113%
5%20%
10%20%
20%10%

Provable fair

The most important thing about a lotto is that it is fair. For this reason I have decided to make this lotto provable fair. This means that users will be able to verify the outcome. When you buy a ticket you get an automated response with your ticket numbers, the current prize pool, a server hash and the transaction id of the block from your transaction.

Screenshot 2017-12-07 04.47.33.png

The server hash is obtained by hashing the server seed, which is a secret used to perform the calculations. The sha256 hash of the server seed is unique and can be used to verify after the drawing that I did not change the server seed. As the server seed is revealed after the drawing.

Also used in the calculation is the transaction id of the last person who bought a ticket. This is a random string which I cannot influence. This prevents me from calculating in advance which ticket will win and buying the ticket with a separate bot.

To calculate which tickets will win the server hash, transaction id, a colon and a roll number(starting from 0) are string together. This string is hashed with a hmac-sha512() function that gives a 128 character hex string. From this string the first 5 characters are taken and converted to a decimal number. This number will be between 0 and 1048575. If this number corresponds to a ticket number there is a winner, if not the roll number will increase by 1. This process repeats itself until all winners are decided. Each ticket can only win once.

A post is generated which reveals the server seed and all other relevant information to perform the calculations yourself. I will be releasing the code so you can do this yourself.

Screenshot 2017-12-07 04.59.35.png

How to buy tickets

Buying tickets is rather simple, just send a multitude of the ticket price and the lotto in which you would like to participate. You will get an automated response confirming your order. If something goes wrong, the transaction will be reversed.

Screenshot 2017-12-07 05.01.08.png

Testing Phase

Before fully releasing this application I want to do a test run first. For the next 24 hours only the category 'hourly' is running and ticket prices are just 0.001 SBD. The guaranteed prize pool every hour is set at 0.50 SBD and there needs to be a minimum of 5 tickets sold. This means if you buy just 5 tickets and nobody else does, you can win 95% of 0.50 SBD. The guaranteed prize pool only come into effect when the prize pool from ticket sales is lower.

It takes about 1 minute to get a response

The bot is up and running now, be the first to enjoy some sweet SBD


H2
H3
H4
3 columns
2 columns
1 column
64 Comments