This guide aims to show you how to open, manage and rent a Lightning state channel, i.e., a state channel supporting Bitcoin. If you haven’t downloaded and configured your version of the Hydranet DEX yet, refer to this guide on how to proceed. Also, to follow this guide you will need native tokens to pay for network fees. Make sure to deposit some BTC to your wallet before proceeding with this guide.
Open a Lightning state channel
Navigate to the Wallet page and select the Channels tab at the top of the window. Select Bitcoin as currency and click on New Channel .
A new window will open that displays the public key to the Lightning node to which you will open your Lightning state channel. In this case, the node will be the Hydranet DEX hub. You are also asked to specify the amount of funds you want to initially send to your Lightning state channel. Once you have entered the desired amount of funds, proceed by clicking Open. The next window that opens will display all the fees associated with opening a Lightning state channel. The total fee includes the network fee paid to network miners. Confirm the fees by clicking Confirm. The last window that opens displays that your Lightning state channel is being opened.
Tip: If the “Opening channel window” does not close (takes longer than 20 minutes), restart the Hydranet DEX application by closing it and opening it again. Wait 2-3 minutes for the application to sync completely, then press “Backup/Restore” (two buttons to the right of the “New channel ” button). This will scan for your open channels and update the interface accordingly.
Before you can use your Lightning state channel for trading you need to wait for 6 blockchain confirmations. You can track the process by looking at the Status column on the channel’s row. The status will change from Pending to Active when the blockchain confirmations have reached 6.
Manage your Lightning state channel
To increase your Can Send balance, use the slider and drag it to the right, and then click Apply. You can only use the slider to deposit funds to your Lightning state channel. To Withdraw funds and close the Lightning state channel, click on the cross on the channel’s row. When depositing/withdrawing funds from your Lightning state channel you will always have to wait for 6 blockchain confirmations before you can use the funds.
Lightning state channel liquidity rental
To increase your Can Receive balance, you need to rent liquidity from the hub. To do so, click on the Channel Rental button next to the New Channel button. The new window that opens will, at first, show a recommended amount of funds for you to rent. You can change this amount by clicking on the Advanced options. By using the sliders, you can specify the amount of funds you want to rent and the duration of your rental. The rental fee you pay will change accordingly. You pay the rental fee using off-chain funds. You can specify which currency you want to pay the rental fee with by clicking on the currency currently displayed under Payment in. Continue and confirm your liquidity rental by clicking Confirm.
If you encounter an error message saying that your balance is not enough (for example, “ETH balance is not enough to rent this channel”), you will need to deposit more off-chain funds in the currency you plan to use for payment of your rental.
Following your deposit of funds and liquidity rental, you should now be able to both send and receive funds using your Lightning state channel. This is indicated by your Can Send and Can Receive balances being larger than 0.
The amount of funds used in this guide were used for illustrative purposes only. You will need to deposit and rent funds according to your specific needs. Remember, upon mainnet release of the Hydranet DEX the amount of liquidity you can rent from the hub will be limited to 100$.