Blog
How to Accept Bitcoin and Lightning Network Payments

How to Accept Bitcoin and Lightning Network Payments

Bobby Shell
Bobby Shell

December 20, 2021

There are many reasons to run your own Lightning Node, either on a local dedicated device such as a Raspberry Pi, or through a cloud provider like Voltage. Some people who run nodes want to make payments. Some want to route payments or try to sell liquidity to make a profit. And some want to run a self-sovereign point of sale system without any third parties, permissions, or fees that must be passed on to customers.

This article will focus on the latter. How do you accept Bitcoin with Lightning as the backbone of your sales infrastructure? This article will go over how to connect your Lightning Node to your BTCPayServer instance, how to create a sales interface for a brick-and-mortar business, and how to use various BTCPayServer integrations to accept payments at your webshop.

To follow this article, you should have a BTCPayServer instance either through your own installation, Docker, Umbrel, MyNode, etc. or Voltage. If you are interested in the power of BTCPayServer without all the installation complications, you can get your own with Voltage at this link for a low monthly cost.

The first thing you will want to do is connect your Lightning Node to your BTCPayServer which will allow the generation of invoices directly from your node. This is accomplished by first clicking Stores at the top of your screen.

Then click:

Put in a name for your store.

After this, you will see the Store on your Store list. Go into settings and you will see this menu:

This is where you will configure BTCPayServer to connect to your on-chain wallet and your Lightning Node. First, let's set up our on-chain option. Click Setup.

From here, it's fairly self-explanatory. I personally recommend you attach an external hardware wallet xpub for maximum safety, but you can choose whatever option best suits your needs.

You will see now that your Wallet settings have been updated successfully:

Next, let's connect our Lightning Node.

For this we will use a custom node. We will be linking our Node to BTCPay using the LND REST proxy in this example.

Don't be intimidated by this step. Although you do need access to the command line, the instructions are straight forward. Good news though! If you are running a Voltage node you don't have to do any of the below. Simply copy the string given to you on your Voltage dashboard and paste it in the Connection Configuration box on your BTCPayServer. If you are using c-lightning or eclair, click the option in the menu. For LND, keep reading.

If you are running your own node, follow the instructions below:

type=lnd-rest;server=https://mylnd:8080/;macaroon=xxx...;certthumbprint=xxxx

We need three pieces of information to complete the string above. First, we need to define the location of our node. This is your IP address and port. If you are running from home, it will be your IP address and port for the LND REST connection.

Next, we have to get the macaroon. A macaroon is a permissions cookie for your LND node. We have to give BTCPay permission to generate invoices for our node. All you need to do is copy paste this command and edit it for the location of your admin.macaroon file:

xxd -plain /root/.lnd/data/chain/bitcoin/mainnet/admin.macaroon | tr -d '\n'

The output will be a long string of numbers. Paste these numbers after "macaroon=" in the above format.

Finally, copy-paste this command and edit for the location of your tls.cert file.

openssl x509 -noout -fingerprint -sha256 -in /root/.lnd/tls.cert | sed -e 's/.*=//;s/://g'

Take that output and paste it after certthumbprint= in the format above.

Paste the whole thing into the input box and Test Connection.

Click Save. Then click Test Connection. You should get this message if it all went smoothly:

Let's now go to "Apps" at the top and test it out!

Click Create New App

In the drop down, pick the store you are connecting your new app to. An app in this context is your unique point of sale interface. After you name your App, go ahead and click Create. You will be greeted with a screen for customizing your shop!  It gives you a default look of a simple tea shop, but you can go ahead and delete the Tea shop menu items and create your own. When you get it the way you like it, instead of clicking settings in the apps list, click view.

This screen will be the default screen for your customers at your sales location. They can pick any item and buy. After they pick what they want, they will be taken to the payment screen.

This screen will give your customer the option to pay in on-chain bitcoin using an address that is generated from the xpub we configured earlier. Or they can pay with lightning to an invoice generated from your own node! How cool is that? After they purchase you can see orders in the invoices option in the main menu.

This is how you would accept payments through BTCPayServer at a physical business location.

For accepting bitcoin payments through the internet on your own website, there are several built in integrations.

These options are:

ShopifyWooCommerceDrupalMagentoPrestaShopShopWareOr your own Custom Integration

Click which one you would like to use on your website to be taken to the official setup guide. If you are running through Voltage we would be able to help you through this process if you are having difficulties.

For accounting, you can go to the Invoices tab and click export to easily export data to your own accounting software.

That's all there is to it! For a merchant or business accepting bitcoin, this is the best way to go.

You can't. Not only is there no middle-man that can stop your payments or charge any fees (such as square, clover, or stripe), there is no risk of a chargeback with a bitcoin payment, meaning that as a business you will save money from every transaction. This is because once a payment is made, the network confirms it and it cannot be reversed unless the entire network agrees to the reversal (on chain). For lightning, it is even more difficult and some would argue impossible to trigger a chargeback.

If you have any questions or comments either email us at support@voltage.cloud, use our live on-site chat, or join us in Discord. ⚡️

Share this post

Start Building on Bitcoin Now