Double or nothing on the blockchain

in blockchain •  last year 

Messing around with the blockchain

If you have looked around just a tiny bit then you will have seen a lot of descriptions of how many things can be done "on the blockchain". But when you dig a little deeper you'll see that not much of this seems to be in actual use.

One reason for this is that users and developers of Bitcoin are extremely focussed on Bitcoin being a serious high-value coin. With Bitcoin likely exceeding 10 000 dollars today that also means it is not really a tool for messing around with. This is also seen in the responses of developers to people playing around with stuff like messages on the blockchain: It can be done but is seriously discouraged to the point where you need to be a fairly proficient programmer to use the feature to any extent.

Litecoin does not have the same attitude problem, but has adopted all the same features as Bitcoin, and most of the restrictions, one by one. On the other hand Ethereum has been developed to do things totally differently. Again, Ethereum is not for playing with (and in spite of this it has a bit too many bugs for something as serious as smart business contracts).

Which leads us back to the low-value coins and particularly the Smileycoin, which was developed for fun in the first place!

smiley3-320.jpg

Playing around is encouraged: A recent addition is the sendwithmessage command (accessible in the command window or on the Linux command line) which allows people to send messages encoded into the blockchain. Currently under development are methods to announce intent for atomic swaps between arbitrary cryptocurrencies, using messages on the SMLY blockchain.

Below is an example of such playing around, namely an example of a double or nothing game on the SMLY blockchain.

Betting directly on the blockchain

An address has been set up for testing double or nothing games on the blockchain. Any number of Smileycoins sent to the SMLY address BCJW4iZw7PechFHgtqqSdHmymjnFA6LjNJ will set in motion a double or nothing game. The sender will receive either nothing or double the deposit.

Remember: Never bet anything you can not afford to lose. Use very low amounts for testing. You have no way of knowing whether there is an individual in charge of the address or whether sending to it actually does what is intended. There is certainly no one around to guarantee that it works, there is no casino reception to complain to, no individual willing to claim responsibility etc etc etc. It is just for fun!

That said, the address can be
monitored using a blockchain explorer: and you will note that the address was seeded using 25 M SMLY so it is a dividend-accruing address. Digging around a little bit you will also see both deposits and withdrawals. Of course you need to ignore all the 4500 SMLY deposits as those are dividend payments. Scanning the remaining transactions you can see how some of the withdrawals correspond to twice the earlier deposits but only about half the deposits correspond to such withdrawals. This is exactly the nature of the double or nothing game.

Comments

Things like this are quite easy to implement and tests are encouraged on the SMLY blockchain. Like many (most?) coins, the Smileycoin supports the walletnotify option in the configuration file smileycoin.conf. So on a Linux machine it is possible to insert a line of the form walletnotify=/home/myname/mygame/MyGame %s to have the wallet send every incoming transaction id to your choice of a script to analyse and respond to the transaction.

Future work

Depending on how this is received, someone may want to set up a jackpot-style game. In the simplest version each participant submits a certain number of SMLY to a pre-specified address and at the end of the day the entire amount is sent to a single winner, drawn from the pool of participants. A marginally better version is to allow variable amounts and draw with probabilities proportional to the amounts.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!