DAO.Casino exploring Lightning Network (Part 1)
The DAO.Casino development team is constantly monitoring all recent blockchain technologies. After the successful Token Sale, we pay special attention to the possibilities of improving our protocol by implementing advanced technical solutions.
Blockchain technology issues
Once blockchain was founded, the pioneers saw in it a solution of many modern problems, like scalability, security, speed, legal issues, trust. But since the beginning, blockchain technology is also being attacked by critics. Part of them was just afraid of something innovating, they imagined it like something infernal, or just an another way to earn easy money. But to be honest, another part of critics had a point — just like any other informational technology, blockchain had both “pro” and “contra”. And one of the main “contra” was a transaction speed and fee.
The problem was not so critical a few years ago, although even at that time the transaction could take up to 10 minutes. But it was constantly growing up, and had a real splash in June 2017 — some transaction took up to few days to confirm.
Almost the same situation took place in other blockchain networks. For example, Ethereum network had a major crash during Status.im token sale. Some people payed 1000$ gas for transaction and critics arrived shortly, claiming ineffectiveness of the Ethereum.
The logic of this problem is pretty simple. The more new users arrive — the more blocks are created — the more pressure on the blockchain network. Several teams worked on solving the transactions speed/fee problems and one of the first was the Lightning Network, which offered its solution in January 2017.
Lightning Network solution
A new technical solution was favorably received by the community. Some even said, that it could replace the whole blockchain, but the founders protested. According to them, Lightning Network depends on the blockchain and was created to solve its problems, and not to replace it.
So what exactly Lightning Network? This is a P2P network system, that operates above the blockchain, building a straight bidirectional payment channel between two or more addresses. It allows to make simple micropayments safe and secure, without need in trust to a third party.
By creating a channel, participants have no need to refer to blockchain, which means all of the transactions will take place only between them. When participants decide to quit the channel, the outcome of all operations would be added to the blockchain. Needless to say, this solution significantly reduces the pressure on the Bitcoin network (or any other blockchain network).
Also, Lightning Network solves the issue with transactions fee. Participants will have to pay only twice — to open and to close channel. Once the channel is open, they adding a certain amount of funds, and can make as many transactions, as they want to, with almost instant speed.
But the beauty of Lightning Network is in multiplicity! For example, Alice and Bob creates a channel, where Alice sending 2 BTC to Bob. Bob adds Charlie to this channel, and then transfer 1 BTC to him. The thing is, there could be more than two participants in existing channel, which simplifies payments without any need to access the blockchain.
DAO.Casino LN implementation
Just as Bitcoin, DAO.Casino’s blockchain protocol has the same set of problems — transaction speed and fee. For example, let’s take the BlackJack game. Any in-game action, like split, deal, double or remove bet normally acts through the blockchain. But such method slowed down the game, raised fee and made it nearly impossible to play.
Back in March 2017, DAO.Casino’s CTO Alexander Noxon on his Github explained a variation of Lightning Network idea named Payment Channels and this summer we have implemented it in our prototype. For now, we have tested it on BlackJack game, and it acts just as we planed — smooth, fast and cheap. It lowered down the commision payment and boosted game speed.
Another our development with implemented Lightning Network technology is the BET wallet. Thanks to Lightning Network, it is able to quickly transfer tokens BET between the player and the bankroller. You can check it on our Github. In the next part of our research article, we will demonstrate how the Lightning Network works in our dice game.