“Game for money outside the blockchain must die”

“Game for money outside the blockchain must die”

Dmitry Pichulin, known under the nickname "deemru", became the winner of the game Fhloston Paradisedeveloped by Tradisys on the Waves blockchain.

To win in the game, the player had to make the most recent bet during the period of 60 blocks - before another player made a bet, thereby resetting the counter. The winner got all the money wagered by other players.

The bot he created brought victory to Dmitry Patrollo. Dmitry made only eight bets on one WAVES and eventually won 4700 WAVES (836300 rubles). In an interview, Dmitry spoke about his bot and the prospects for games on the blockchain.

Tell us a little about yourself. What do you do? When did you become interested in blockchain technology?

I am a developer in the field of information security. He came to blockchain with the “hype” of 2017, figured out the technology and stayed for the technology.

What was the main motivation for participating in the game?

First of all - technical interest. I wanted to figure out how it works, find vulnerabilities, prevent the game from ending, and, of course, “troll” other players.

Have you already decided how you will spend your winnings? What will you keep it in if you decide not to spend it yet?

I didn't know what to do with the winnings. I did not expect it, so there are no plans. As long as it stays as it is. Maybe it will flow into some project on Waves.

Why did you decide to take part in the game with the help of a bot? How did the idea for Patrollo come about? Could you tell us more about its development?

It didn't work with vulnerabilities. I "raised" the game in the test network, played with myself, tried all the options, but everything turned out to be "iron", there are no vulnerabilities in the contract. It became clear that this was not the way to win.

How did you look for vulnerabilities? What were your hypotheses? Could you provide a code example?

There were two hypotheses. First, an attack on data type checks in data transaction records. For example, I thought that bad coding would bypass the transaction ID reuse check. The second is an attack on integer overflow. I figured there was a way to set the height too high or too negative and try to be in the past.

$tx = $wk->txBroadcast( $wk->txSign( $wk->txData( [ 'heightToGetMoney' => -9223372036854775807 ] ) ) );

What did you do when you saw that the expectations for vulnerabilities were not confirmed?

In his telegram chat, Tradisys lamented that while everything is quiet on the network, the game will be eternal, but in the confusion (with node updates or unforeseen forks), the chances of good bots increase. There, in the chat, I accepted the challenge - to write a good bot - which I did in a couple of days. I wrote the Patrollo code in PHP, based on my framework WavesKit, in which I try to capture all the best techniques for working with the blockchain.

I checked the work on the test network, posted the code on github, launched the bot on the main network and forgot about it.

My Patrollo configuration had to solve two problems: to bet as little as possible and to work as reliably as possible.

The first is decided by extremely risky bets, preferably in the very last block. In the end, I still put the bot on the penultimate block, but with an additional delay of 29 seconds. This made it possible to make only eight bets for the entire time of the game.

Why exactly 29 seconds? How did you arrive at this number?

29 seconds appeared gradually. At first there was no delay, but I noticed that on the penultimate block there were cases of simultaneous bets - that is, there was no point in betting. Then there was a delay - I think 17 seconds, but it didn't help either: there were still simultaneous bets. Then I decided to risk harder, but certainly not to have simultaneous bets. Why 17, 29, etc.? Just love for prime numbers. 24, 25, 26, 27, 28, 30 are all compound. And more than 30 seconds would have been quite risky.

How was the reliability issue resolved?

Reliability was addressed mainly by the worker node selection mechanism and, to a lesser extent, by conducting a transfer transaction for the stake in advance so that the stake in the data transaction already accurately referenced the existing transaction on the blockchain.

During each round of the loop, all nodes specified in the configuration were polled for their current height, the node with the highest current height was selected, and further interaction took place with it. In my understanding, this was to protect against forks, unavailability, caching and possible errors on the nodes. There is confidence that it was this simple mechanism that led to victory.

What, in your opinion, are the main features and advantages of blockchain games? How promising are public blockchains in general and the Waves blockchain in particular for game development?

The main advantages are known, fixed and unchanging rules of the game, plus equal conditions for access to the game from anywhere in the world.

Off-chain gambling must die.

Waves has a rich technical functionality, but there are nuances, both inherent in any blockchain and specific. Both those and others are not yet well reflected in the existing developer tools.

For example, if you tried to respond to transactions in real time, and not at a distance of 5-10 confirmations, you would learn about rare but occurring phenomena: jumping transactions from block to block, missing transactions in some blocks and appearing in others. All this is critical for the speed and reliability of any applications and should be solved in a general way, but for now, each developer achieves the level of reliability he needs on his own. Over time, of course, all this will be resolved, but for now there is a certain, rather high threshold of entry and fear of the specifics of the work of truly decentralized blockchains in general.

How is FOMO different from other blockchain games you know? What are its advantages and disadvantages?

These are long games. Interest in such games grows with the amount of winnings, and the amount of winnings grows with time.

Ideal if the game never ends. When the game ends, it's sad...

Recently was running game Fhloston Paradise 2. Do you plan to take part in it?

Yes, if there is time and interest, I will take the same steps: vulnerability analysis, playing with myself on the testnet, bot, open source, etc.

In conclusion, please tell us about your plans as a developer.

I am interested in solving unsolved problems, and there are many unsolved problems in the topic of blockchain. This is a real challenge! And he is accepted.

Source: habr.com

Add a comment