Lightning Network Casino Deposits

When starting a casino game, you might see the Lightning Network as a cryptocurrency deposit option. But upon reaching the cashier, it becomes clear that making a Lightning deposit isn't so straightforward. How does the deposit process work? What can cause a payment to fail? How big a payment can you make, and how long do you have to complete it? What kind of wallet do you need, and how do you handle a withdrawal? Here's what you need to know before trying Lightning at the cashier.
How the Deposit Works
At the casino cashier, making a Lightning deposit begins with opening an invoice that the casino generates. This invoice, housed in the BOLT11 protocol, is a one-time payment request sent to you in a QR code or copied text. The invoice features a payment hash, amount, description, expiry time, route hints, and the casino's node public key. To make the deposit, you have to instruct your Lightning wallet to pay the invoice. You do this by scanning the QR code or pasting the text from your clipboard and hitting the "Pay" button. If the wallet finds a payment route and has ample liquidity, it locks in a payment over Lightning by making a Bitcoin hash time-locked contract (HTLC) with the casino. That money then travels through a series of Lightning channels and ends up in the casino's Lightning node.
Why Lightning Payments Are Small and Time-Sensitive
Once you hit "Pay, " you'll notice you have a short period to complete the transaction. That's because from a network perspective, ensuring any old payments don't just float around forever is crucial. By default, BOLT11 invoices expire after one hour, or, but many casinos set theirs for as short as ten minutes. Expiry exists partly to prevent old HTLCs from clogging the Lightning Network, and after an invoice expires, you can't change it or pay it.
Another factor is the wallet's Lightning liquidity, which can impact your payments' success. If your wallet has too little inbound capacity in a channel, the wallet may not be able to receive the incoming payment. This is something you can look up from the "Receive" tab in a wallet like Electrum. If there's a weird payment hiccup, some wallets propose a channel rebalance or submarine swap which moves liquidity, making the payment possible. This takes time, so it might cause a longer wait.
How a Withdrawal Works
Hoping for a big win? After sorting your winnings out in the game, cashing back to your Lightning wallet involves a minor reversion of the deposit process. When requesting a withdrawal, the casino provides a text box where you have to paste a receive invoice. This is a different kind of invoice you generate from your wallet and serves as the endpoint for a pull payment. So with the casino, you're generating a one-way cashier message, while for yourself, you'll set up a pull endpoint.