I've been playing a bit with writing a little steemit bot. Yesterday I started running the first beta version of @croupierbot.
The goal for @croupierbot is to provide a friendly croupier that you may invite on your own blog post in order to help in soliciting more feedback on your post by running a little lottery. The steps would be as follows:
- Announce in your post that you will be running a @croupierbot lottery for your blog post.
- Await comments on your post.
- Award lottery tickets to contenders by upvoting their 1st level comments.
- Invite @croupierbot to your page.
- Wait for @croupierbot to draw the winner.
As steps one through three are obvious, we shall walk through the final two steps to show the value of @croupierbot as an incorruptible croupier. I will show how you, neither your contenders, need to actually trust the bot given that @croupierbot discloses all its steps that it takes using the blockchain to prove its trustworthiness.
But let's start by inviting @croupierbot after having upvoted the comments.
To invite @croupierbot, simply reply to your own original post mentioning @croupierbot and the word lottery. The syntax is shown above also includes an amount of SBD describing the price money, but for now, you may omit this as it is meant for a future reputation tracking feature that I won't get into in this post.
Within a number of minutes, @croupierbot should respond with a first response that looks something like this:
Here the @croupierbot announces the lottery, that shall commence a number of minutes later. It lists all the tickets you have given out through upvoting and mentions a block number that currently does not yet exist in the steemit blockchain. This first post is created as a way of logging the intent to draw using the designated future block and thus showing the bot won't be able to influence the outcome of the draw in anyone's favor.
A number of minutes later @croupierbot will post a second post
The second post is the most important one. It not only reveals the winner of the lottery, it also provides links to steemd.com that make it possible to validate the impartial and correct operation of the drawing algorithm.
There is a link to the first post. The draw announcement. The fact that the draw announcement has a lower number than the second block number shows that @croupier could not have known the outcome when the first post was posted.
If you follow the link, you can see the link to the post:
If you follow the other link, the drawing block link, there, you can click the Show raw block data link to reveal the info we need.
After clicking, look for witness signature and copy the string:
Now use the string from a python interpreter like this:
The number 3 here is the number of tickets. The response, number 2 is the ticket number of the winning ticket.
I hope some of you will find @croupierbot useful for attracting more feedback to your posts. If you run into any issues, please let me know, @croupierbot is still very much in beta, so there might still be bugs.
I'll be running four $0.15 SBD @croupierbot lottery draws on this page. One tomorrow and then one for on each of the next four days. So please add a comment to this post to partake in the demonstration and beta testing of @croupierbot.
Oh, and if you enjoy my post, remember to vote for me in MAP20.