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

in #bot7 years ago (edited)


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


Sort:  

Interesting idea. I think the first prize should be a big bigger. Something like 35-40 %.

Thanks, I obviously pulled the payout distribution out of thin air. I do think that for a lotto a well spread payout is nice. Obviously this can always be changed depending on what people prefer

Cool. I will consider to take part when I have some SBD :)

It works... :)

lottery-capture.PNG

Yes! I still had the guaranteed payout set at 1.00 SBD instead of 0.5 though ;p I did do a lot of testing, but always in real world cases something will happen for what I did not think of

Heh, yes, that's the reality of programming ;)

Hello, I need 1 sbd, do you change me for 1 steem?

Good to see this i hope it will work.

Feel free to try it out ;)

De automatische bevestiging werkt perfect. (minder dan 10sec.)

Dat is vrij snel! Duurt gemiddeld een minuut

Ik was gewoon benieuwd, en toen ik ging kijken stond de klok op 8seconden (!!). Ik dacht wel dat je dergelijke feedback welkom zou zijn.
Maar het is altijd beter te zeggen het duurt 1 minuut, zo ben je zeker dat er niemand in paniek geraakt na 30 seconden. Mensen hebben geen geduld meer...

tweede deelname (test) slechts 20 seconden
test.JPG

The genius has revealed another interesting addition to Steemit. This is awesome @juliank👏👏👏 i like the idea. It would be a lot of fun🖒😉

Update: i just join to the test. Hehehe sent 0.001sbd

I saw it, thank you for participating. Unfortunately you did not win :(

Yeah i got the reaponse of @fairlotto. Its seems working fine as per your description. No worries about winning as long as were having fun. Lol😄 ill bet again soon. Keep it up!

I'm in! This is a great idea. Great stuff @juliank

Thanks, I see you are winning some moneyz ;)

@juliank thank you so much for doing this! With your photocontests and this, you are performing quite the service for this community and I commend you for your efforts. Signed up myself and is working! I look forward to your future applications!

Hey @bitfiend, thanks :D I hope for this to grow in the biggest lotto on Steem. With insane monthly prize pools

You're on a roll :) I love the ideas you're implementing right now. Will try the lotto!

Thanks! A bit little bit of gambling can be fun and this is also easy to automate

I'm by no means a gambler, but in the context of all automation that's going on on steemit I'm happy to try it.
Have you made this code and the code for the photo contest bot public? I'd love to see it and learn from it.

I am not gambler either, but I do like the yearly new years eve lottery. For the code, I will be releasing the photocontest bot, its kinda a mess atm as I had not done programming in some time so I want to clean it up first. This bot I will keep private

first time going to do this...
hope ot will work

Ive been taking part ; i think in 3 so far - however i may or may not have found something that could result in a problem - i may want to do a test, and provide you with my results but just in case i will not be posting the problem here, only because people may want to take advantage of the issue and i dont want to have that happen .
So perhaps you can msg me on steem chat - and ill make sure you know what the issue is .

@juliank i have msged you back - sorry it took me a while, i was helping my grandmother with her tree this year

Coin Marketplace

STEEM 0.16
TRX 0.13
JST 0.027
BTC 57567.29
ETH 2568.29
USDT 1.00
SBD 2.50