DAO.Casino charges up Dice Game with GC Technology

New implementation of DAO.Casino Game Channels

Any gambling project, based on blockchain technology, faces challenges of in-game action speed and transaction fee. Recently DAO.Casino development team made a research of Lightning Network, and it helped us to develop our own solution to this issue called Game Channels.

We have already described Payment Channel technology, implemented in our BlackJack game. Game Channels is an upgrade for it — a symbiosis of Game contract and Payment Channels contract. To demonstrate results, we have implemented Game Channels in our Dice game.

“The experience gained by crossing the game contract and payment channels will help us to integrate new games faster and smoother”
Alexander Davidov, DAO.Casino Solidity Developer

Background

So what are these problems of Ethereum gambling? The point is that each time player interacting with a game — any in-game action has been sent to blockchain. Obviously it takes time and cost some money to process a transaction.

There is a possible option of solving this problems — state channels. It boosts up speed, removes fees — game participants pay only for opening and closing channel. But state channels have vulnerabilities which allow cheating. So gambling projects have a difficult choice — between security from one side, speed and additional payments — from another.

Game Channels is a new step in evolution of channel technology, that solves security, speed and payment issues simultaneously. Below is a brief overview of the mechanism of this technology.

Game Channels work mechanism

Player and bankroller deciding to start game. Player sends signed hash, bankroller check it and creates transaction to open a channel. When game begins, player sends game state with seed (which is needed for Signidice algorithm) to bankroller. Bankroller signs seed and sends it back — that’s a game process. Depending on game results, participants refresh channel state.

Channel can be closed at any time. To do this, player sends the last state of the channel to the bankroller with a request for closure, after which the bankroller closes the channel. It is worth mentioning, that we have developed three types of security mechanisms, to prevent sides from cheating during the closure. We will describe it in part 2 of our Lightning Network Research, which will be published in a few days.

Technical summary

During the implementation of Game Channels, developers also did some technical and UI upgrades. We bring to your attention a brief overview of the improvements made.

New Version of web3.js Library Implementation

DAO.Casino devs have implemented a new library web3.js ver.1.0 (by Ethereum). Here is a preview release. All functions of web3.utils work the same way, as in Solidity, which is needed for proper channel work.

Recently we have been looking for solution, how to launch some functions, such as sha3 in Javascript, so that they work just like in Solidity. Thanks to the web3 v1.0, our devs completed this task. This functions was needed to check game state, so it would be valid both on contract (Solidity) and client (Javascript).

“Web3 version 1.0 works great even though it’s just a preview release. We are looking forward to fully-featured release”
Alexander Stepanchenko, DAO.Casino Full Stack Developer

Other features

  • From now on, there is no need of keeping all the seeds on contract. We can generate random numbers from players seed, channel id and round number, without need of keeping seeds on contract;
  • We can now immediately receive random number on game client right after sending signed seed;
  • Implemented an insurance mechanism, that allows to upload channel state to blockchain, without need in closing channel;
  • UI tweaks. We have added an interface elements, which allows to check a channel state in blockchain and interact with it.
UI tweaks. 1. Shows current channel state; 2. Close the channel and end the game session

DAO.Casino Essential Links

Website: https://dao.casino
Telegram: https://t.me/daocasino
Prototype: https://platform.dao.casino
GitHub: https://github.com/daocasino
Email: team@dao.casino
White Paper: https://github.com/DaoCasino/Whitepaper/blob/master/DAO.Casino%20WP.md
Slack Invite: https://dao.casino/slack-invite.html
Facebook: https://www.facebook.com/Dao.casino/
Twitter: https://twitter.com/daocasino
Blog: https://medium.com/@dao.casino/
YouTube: https://www.youtube.com/channel/UCkggi9VnPJ0qUzfj7h70-pQ