To understand the importance of the lightning network, it’s first essential to understand the turbulent past of Bitcoin’s scaling problem.
In the summer of 2017 the Bitcoin blockchain became sluggish and expensive as fees reached boiling point. Not only were transactions costing an enormous amount (upwards of $20 per transaction) but each transaction was taking an hour or more to confirm on the network. The reason for the high cost and delayed transaction times was due to Bitcoin’s blocks being full. Each block contains transactions and each transaction takes up an amount of space (in bytes). The Bitcoin block size is limited to 1 megabyte and when that limit is reached, all further transactions must wait in the “memory pool” until the next block can be mined. Given that each block is mined every 10 minutes and that more transactions were occurring than could be processed, delays on each transaction increased rapidly. An expensive “fee market” then emerged, where users would send transactions with higher and higher fees as a means to have their transaction processed faster (miners are paid transaction fees and are therefore economically incentivized to process transactions with higher fees first).
This is Bitcoin’s scaling problem, and without consensus from the community to increase the block size beyond 1 megabyte, the only hope was through “second layer solutions” – solutions that did not require a change to the Bitcoin protocol itself. The first second layer solution to receive major attention was the Lightning network. Multiple implementations of Lightning exist (c-lightning, eclair, and lnd), however they are all capable of working together to achieve one thing – to scale the Bitcoin blockchain without compromising security or decentralization.
How does the Lightning Network help casino players?
The Lightning network takes payments “off-chain” through what are known as Lightning channels. In a Lightning channel peers able to send and receive effectively an infinite number of transactions at a low cost without making any contact with the main Bitcoin blockchain; the only transactions recorded by the Bitcoin blockchain are the opening and closing (settlement) of the channel. Consider it the same as entering a casino and buying chips from the cashier; the chips can be won and lost numerous times without the cashier’s knowledge, the only two transactions that matter to the casino are the purchasing of the chips and the cashing in at the end. This concept is analogous to the lightning network – open a channel with one Bitcoin transaction and close it with another; what happens in between does not require recording by the Bitcoin ledger and thus, these transactions are free from the limitations of the Bitcoin protocol.
At this stage in development, a player would have to open a channel directly with a Bitcoin casino in order to deposit and withdraw from it. However, transaction routing is being worked on which will allow players to access other channels by “hopping” through peers on the network. Each peer is connected to another through their channel, and a peer with multiple channels open can help route payments from (for example) A to D without requiring A to also have channels open with B and C. This payment routing becomes easier as more channels are opened and the network expands. In its current state, many channels will be “cut off” from the rest of the network, requiring additional/dedicated channels to be setup.