Welcome avatar! BTCPay Server is the simplest way to start accepting payments in Bitcoin. BTCPay allows you to accept instant, low fee payments on Bitcoin Layer 2 - Lightning Network. We’re going to show you how to set up a c-lightning node for your BTCPay Server and a simple way to open a channel with inbound liquidity to start directly earning no-KYC Bitcoin.
We started with how you set up your own Bitcoin payment processor in 30 minutes using LunaNode. The default setup uses the Bitcoin blockchain. Now we are going to add Bitcoin payments over the Lightning Network using c-lightning.
We have covered how to set up BTCPay Server with LND. LND and c-lightning are two different implementation of the Lightning Network protocol. With LunaNode, we are using a pruned Bitcoin node. BTCPay Server recommends using c-lighting with a pruned node. C-ligtning is less risky than LND for Lightning using our BTCPay Server setup.
WARNING: However, please understand that the Lightning Network is still in the experimental stage. Do not put in money you can’t afford to lose.
We’ll cover 3 steps to set up Lightning payments on your BTCPay Server:
- Configure BTCPay Server for c-lightning
- Open Lightning channel with inbound liquidity
- Enable Lightning option in BTCPay Store
We’ll cover both adding Lightning during initial BTCPay Server setup and adding Lightning to an existing BTCPay Server.
If you haven’t created your BTCPay Server, you can accomplish all of the configuration through through the LunaNode BTCPay Server web form. If you are taking this approach, you want to read through our initial BTCPay Server post first.
clightning lightning option. Then add you SSH pubkey, see Using SSH Keys guide from LunaNode. Leave all other options as default, including
m.4 since we are including Lightning. Lighting Alias is optional.
You’re all set! You can skip ahead to Funding Your Bitcoin Wallet.
If you already deployed your BTCPay Server, you can add Lightning using the LunaNode Dashboard and Command Line.
Use the LunaNode Dashboard to resize from
m.4 per the LunaNode recommendation for running Lightning. Note: this will increase your monthly cost.
You can connect to the VM with SSH using the username and password specified in the Initial Login Details, which you’ll see after selecting the VM from the Dashboard. Alternatively you can save your SSH pubkey during intital set up. See more at https://www.lunanode.com/guides/quickstart.
SSH into your VM replacing
000.00.000.000 with your External IP found in the LunaNode Dashboard. You may also need to provide the filename if you are using a 2nd SSH identity for your anon avatar.
# separate ssh file for my bowtiedchukar identity ssh -i ~/.ssh/id_ed25519_bowtiedchukar firstname.lastname@example.org
Now change to root and cd into the
# on vps email@example.com, change to root sudo su - cd btcpayserver-docker
Add the appropriate environmental variables from the BTCPay Server docs to add
clightning and then restart.
# on vps firstname.lastname@example.org, export new environmental variables and restart export BTCPAYGEN_LIGHTNING="clightning" . ./btcpay-setup.sh -i
Once your VM restarts, you’ll be running c-lightning with Ride The Lighting (RTL) to manage your node. You can verify they are up and running. Log in to your BTCPay Server then click Server Settings then Services. C-Lighting and RTL should be listed along with your Bitcoin Full Node services.
Before you can begin accepting payments, you need to open a channel with inbound liqiudity. This means there are sats on the other side of the channel you open that will move to your side of the channel as you accept payments.
If you are new to Lightning, check out the Bitcoiner LN channel guide to understand the basics of a Lightning Channel.
There are many options for inbound liquidity. One thing to keep in mind is you are setting up a Merchant node for your BTCPay Server. You are not setting up a Routing node to generate a profit forwarding payments within the network.
There are all kinds of tools and techniques for balancing a Routing node. But for our Merchant node, it is easiest to simply buy an incoming channel from one or more well connected and capitalized nodes.
With LNBig, you can buy an inbound channel with 300K sats for around $1. You can also choose to select a larger channel size if you expect more payments immediately.
Once you select a channel size, you will be presented with a Lighitng invoice for the $1 payment to open the channel. You need to pay the invoice with another Lightning wallet (e.g. Strike or Muun). Both of these apps allow you to pay both regular Bitcoin addresses and Lightning invoices.
Once your payment is successful, you will be asked to provide your node info.
We are going to use Ride The Lighting (RTL) to manage our Bitcoin and Lightning nodes. From your BTCPay Server Services tab, click RTL -> See information to visit the page to log in to RTL in your browser.
Click the Public Key tab and click Copy node pubkey
Paste your node public key into the Node Info form then click to verify the info.
After you input your node info, LNBig will verify the info is correct.
Once you click All Right! to confirm your node information, LNBig will provide information to connect your node to LNBig’s node as a peer.
Copy the text string from
Using RTL, add the LNBig node as a peer using the
Once you add LNBig as a peer, LNBig will open the channel with your node.
In RTL, the channel will show in the Pending/Inactive tab until the transaction to create the channel is confirmed on the Bitcoin blockchain.
Once the transaction is confirmed, the channel will be in the Open tab. The channel should show a Local Balance of 0 sats and a Remote Balance of 300,000 sats.
Now that your Lightning Node is up and running, you can add Lightning as a payment option in your store.
Test out the pay button to send $1 using Lightning. You can test it using the same wallet you used to pay LNBig.
Here is the BTCPay Server with Lightning Network selected.
Using RLT, you can monitor you channel to see how much inbound liquidity (i.e. mSatoshi to Us) remains in the channel. Click Actions -> View Info for the channel. The channel will maintain a Reserve on each side for channel closing. You can see the Reserve and the mSatoshi to Us (how many sats you can receive) and Spendable mSats (how many sats you can spend).
With c-lightning, you can set up your own payment processor to accept instant, low fee Bitcoin payments. LNBig is an easy way to buy inbound liquidity for your Merchant node. For a couple dollars, you will be ready to accept donations, tips, or payments to your E-commerce store.