Block ———

Module 3 of 4

Lightning Integration

Technical options for integrating Lightning payments into business operations, from simple to advanced.

Film · Lightning Integration · 1:36

Block ———

A short film in the language of this site's homepage: the base layer for settlement and Lightning for payments; three levels of integration, described by kind and never by brand (a self-hosted, open-source payment server, a Lightning address at your own domain, and your own software on a Lightning node's API); inbound capacity and how to get it; a hosted node or your own; a working float on the node and savings in multisig, with its own risks; and the contrast between renting the card rails and running your own. It loops while on screen; use Pause to stop it. Turn on Narration to hear it explained aloud. A transcript follows.

A short film in the language of this site's homepage: the base layer for settlement and Lightning for payments; three levels of integration, described by kind and never by brand (a self-hosted, open-source payment server, a Lightning address at your own domain, and your own software on a Lightning node's API); inbound capacity and how to get it; a hosted node or your own; a working float on the node and savings in multisig, with its own risks; and the contrast between renting the card rails and running your own.
Read the film, with its sources
  1. Module 3 of 4Lightning integration. Not how Lightning works inside, and not how to pay with it, but the owner’s and the developer’s view: how a business plugs Lightning into its tills, checkouts and invoices, from the simple to the advanced, and how it manages its channels.
  2. Two layersBitcoin’s base layer is for settlement: treasury, large transfers, savings. Lightning is the payment layer on top, for the point of sale, the online checkout, the subscription and the invoice.
  3. Level 1The simplest start for most businesses: an open-source payment server that you host yourself, with a Lightning node built in alongside on-chain payments. Your store offers both; the customer chooses. It needs no custom development, gives you accounting exports, and holds no one’s keys but yours: it is non-custodial. We describe the kind, not the product.
  4. Level 2A Lightning address is written like an email address (name@domain, at your own domain), and anyone can pay it at any time. The payer need not ask you for an invoice first: their wallet asks your domain’s server, which makes a fresh one for each payment. It suits tips, donations and informal payments, as a second way to be paid: printed on a business card, or as a tip jar on your website.LUD-16: Paying to static internet identifiers (LNURL specification)
  5. Level 3With developers of your own, you can build Lightning straight into your systems through a Lightning node’s API. Your software asks the node for an invoice (an amount, a description, and an expiry: one hour by default), shows it to the customer, and watches for it to be paid. When it is, the node holds the proof: in the specification’s words, the payment hash’s “Preimage of this provides proof of payment”.BOLT #11: Invoice Protocol for Lightning Payments (Lightning specification)
  6. Level 3That suits checkouts in online shops, subscriptions (a fresh invoice for each billing period), and software that pays out. A newer part of the specification, offers, lets a merchant publish one reusable payment request on a web page or a code, and also covers payments the other way, such as refunds. Custom work makes most sense for high volumes, subscription models, or payments inside a software product; for most small and medium businesses a self-hosted payment server does the job without it.BOLT #12: Negotiation Protocol for Lightning Payments (Lightning specification)
  7. ChannelsA channel’s capacity is the bitcoin locked into it, split between the two sides. You can send only what is on your side, and receive only as much as there is on the far side: that room is your inbound capacity, and liquidity is having enough of it, on each side, where you need it. When a channel opens, the specification counts the funding as “the amount the sender is putting into the channel”, so a channel you open and fund yourself starts with everything on your side: you can pay out, but not yet be paid. For a business that mostly receives, inbound capacity is the main concern.BOLT #2: Peer Protocol for Channel Management (Lightning specification)
  8. LiquidityThere are three common ways to get it: another node opens a channel to you; you buy inbound liquidity from a marketplace that sells it; or you spend over Lightning (paying suppliers, refunds or payouts), which moves balance to the far side of your channels. A self-hosted payment server can help with the basics; as volumes grow, it needs watching.
  9. The nodeSomeone has to run the Lightning node. A hosted node is run for you by a provider, which handles uptime, backups and often channels: less effort, but you trust the provider with your infrastructure, so read exactly what it controls. Your own node gives you full control, and full responsibility: it must stay online, keep backups of its channels, and watch the chain, because, in the specification’s words, once a node has funds at stake “monitoring the blockchain is required” to stop the other side closing a channel on its own terms.BOLT #5: Recommendations for On-chain Transaction Handling (Lightning specification)
  10. The nodeSome services go further and take the payments for you, holding them or converting them: the simplest integration of all, but then your takings are a claim on that company, not bitcoin you hold.
  11. TreasuryA Lightning node has to sign every payment, so its keys are online: hot. Keep only a working float there, and sweep the rest of the takings to cold storage, which on this site means multisig: three keys held by different people in different places, any two of which can spend. Multisig takes care and has risks of its own: lose the wallet descriptor, the record of how the keys fit together, and the keys alone will not recover the funds; when a key-holder leaves, the keys must be changed; and the business needs a plan for succession, so that the right people can still reach the funds. Practise a recovery with a small amount first.
  12. Fiat or bitcoinTake fiat currency by card, and a payment involves at least four parties besides the customer: the business itself, the card scheme, the acquirer that handles the business’s card payments, and the customer’s card issuer. The business pays its acquirer a merchant service charge, which includes fees passed on to the issuer and the scheme: it rents the rails. With Lightning, the business can run the payment server itself, and be paid straight into its own node.Payment Systems Regulator, Market review into card-acquiring services: final report (MR18/1.8, November 2021)
  13. The Bitcoin TransitionIn fiat, you rent the rails. On Lightning, you can run them.

Lightning is the payment layer that makes bitcoin practical for business. Base-layer bitcoin is excellent for treasury settlement and large transfers. Lightning is for the point of sale, the e-commerce checkout, the subscription payment, and the invoice.

Three Levels of Integration

BTCPay Server includes a built-in Lightning node. When you deploy a BTCPay instance, you can enable Lightning alongside on-chain payments. Your store generates both payment types automatically. Customers choose which to use. Settlement from Lightning arrives in your BTCPay wallet instantly.

This is the right starting point for most businesses. It requires no custom development, handles both on-chain and Lightning, and provides accounting exports. The entire setup is open-source and non-custodial.

Level 2: Lightning Address

A Lightning Address looks like an email address (e.g., shop@yourdomain.com) and allows anyone to send you Lightning payments without generating an invoice first. It is a simple receive endpoint, useful for tips, donations, and informal payments.

BTCPay Server supports Lightning Addresses natively. You can also set one up through services like Alby or your own LNDhub instance. For businesses, the Lightning Address is most useful as a secondary receive channel — for example, printed on business cards or on a website "tip jar."

Level 3: Custom API Integration

For businesses with development resources, Lightning can be integrated directly into existing systems via APIs. The main options:

  • LND (Lightning Network Daemon) — the most mature Lightning implementation. Provides a REST and gRPC API for generating invoices, checking payment status, and managing channels.
  • CLN (Core Lightning) — a modular, plugin-based Lightning implementation. More flexible for custom workflows.
  • Voltage — a managed Lightning node provider that handles the infrastructure. You interact via API; they handle uptime, backups, and channel management.
  • Strike API — a custodial option that converts Lightning payments to fiat automatically. Simplest integration but introduces a custodian.

Custom integration is appropriate for businesses processing high volumes, running subscription models, or embedding payments into software products. For most small and medium businesses, BTCPay Server provides everything needed without custom code.

Channel Management

Lightning channels require liquidity — both outbound (to send) and inbound (to receive). For a business primarily receiving payments, the main concern is inbound liquidity: ensuring there is enough capacity on the receiving side of your channels to accept customer payments.

BTCPay Server handles basic liquidity management automatically. For higher volumes, services like Lightning Pool and Magma allow you to acquire inbound liquidity from the Lightning marketplace. This is a solved problem at typical small-business payment volumes.