Builder's Guide
  • Welcome to the Builder's Guide to the LND Galaxy!
  • The Lightning Network
    • Overview
    • Payment Channels
      • Lifecycle of a Payment Channel
      • Watchtowers
      • Understanding Sweeping
      • Etymology
    • The Gossip Network
      • Identifying Good Peers on the Lightning Network
    • Pathfinding
      • Finding routes in the Lightning Network
      • Channel Fees
      • Multipath Payments (MPP)
    • Lightning Network Invoices
      • Understanding Lightning Invoices
    • Making Payments
      • The Payment Cycle
      • Timelocks
      • ⭐Hashed Timelock Contract (HTLC)
      • Payment Etymology
      • ⭐What Makes a Good Routing Node
      • Understanding Submarine Swaps
      • Instant Submarine Swaps
    • Liquidity
      • ⭐Understanding Liquidity
      • Managing Liquidity on the Lightning Network
      • Liquidity Management for Lightning Merchants
      • How to Get Inbound Capacity on the Lightning Network
      • Lightning Service Provider
    • L402: Lightning HTTP 402 Protocol
      • Macaroons
      • L402
      • 📋Protocol Specification
      • Implementations and Links
    • Taproot Assets
      • Taproot Assets Protocol
      • Taproot Assets on Lightning
      • Edge Nodes
      • Taproot Assets Trustless Swap
      • FAQ
      • Glossary
  • Lightning Network Tools
    • LND
      • 🛠️Get Started
      • lnd.conf
      • First Steps With LND
      • Wallet Management
      • Sending Payments
      • Atomic Multi-path Payments (AMP)
      • Receiving Payments
      • Unconfirmed Bitcoin Transactions
      • Channel Fees
      • Inbound Channel Fees
      • Macaroons
      • Configuring Watchtowers
      • Pathfinding
      • Blinded Paths
      • Key Import
      • Secure Your Lightning Network Node
      • Configuration of a Routing Node
      • Quick Tor Setup
      • Configuring Tor
      • Enable ‘Neutrino mode’ in Bitcoin Core
      • Send Messages With Keysend
      • Partially Signed Bitcoin Transactions
      • Bulk onchain actions with PSBTs
      • Sweeper
      • Debugging LND
      • Fuzzing LND
      • LND API documentation
      • Channel Acceptor
      • RPC Middleware Interceptor
      • HTLC Interceptor
      • NAT Traversal
      • Recovery: Planning for Failure
      • Migrating LND
      • Disaster recovery
      • Contribute to LND
    • Lightning Terminal
      • What is Lightning Terminal?
      • 🛠️Get litd
      • Run litd
      • Integrating litd
      • Demo: Litd Speed Run
      • Connect to Terminal
      • Recommended Channels
      • Rankings
      • Health Checks
      • Liquidity Report
      • Opening Lightning Network Channels
      • Managing Channel Liquidity
      • Autofees
      • AutoOpen
      • LND Accounts
      • Loop and Lightning Terminal
      • Loop Fees
      • Pool and Lightning Terminal
      • Command Line Interface
      • Troubleshooting
      • Lightning Node Connect: Under the hood
      • LNC Node Package
      • LITD API Documentation
      • Privacy and Security
      • Privacy Policy
      • Terms of Use
    • Loop
      • 🛠️Get Started
      • The Loop CLI
      • Autoloop
      • Static Loop In Addresses
      • Instant Loop Outs
      • Peer with Loop
      • Loop API Documentation
    • Pool
      • Overview
      • Quickstart
      • 🛠️Installation
      • First Steps
      • Accounts
      • Orders and Asks
      • Sidecar Channels
      • Zero-confirmation Channels
      • Channel Leases
      • Batch Execution
      • Account Recovery
      • Pool API Documentation
      • FAQs
    • Taproot Assets
      • Get Started
      • First Steps
      • Taproot Assets Channels
      • Asset Decimal Display
      • Become an Edge Node
      • RFQ
      • Collectibles
      • Universes
      • Asset Loop
      • Debugging Tapd
      • Multisignature
      • Minting Assets With an External Signer
      • Lightning Polar
      • Operational Safety Guidelines
      • Taproot Assets API Documentation
    • Aperture
      • ⚒️Get Aperture
      • LNC Backend
      • LNC Mailbox
      • Pricing
    • Faraday
      • 🛠️Get Started
      • The Faraday CLI
      • Faraday API Documentation
  • LAPPs
    • Guides
      • Use Polar to Build Your First LAPP
        • Setup: Local Cluster with Polar
        • Setup: Run the Completed App
        • Setup: Run the App Without LND
      • Add Features
        • Feature 1: Connect to LND
        • Feature 2: Display Node Alias and Balance
        • Feature 3: Sign and Verify Posts
        • Feature 4: Modify Upvote Action
      • Make Your own LNC-powered Application
    • Next Steps
  • Community Resources
    • Resource List
    • Lightning Bulb 💡
    • Glossary
    • FAQ
Powered by GitBook
On this page
  • Create invoice
  • Make the payment
  • Check the payment
  • Other payment types

Was this helpful?

  1. The Lightning Network
  2. Making Payments

The Payment Cycle

PreviousMaking PaymentsNextTimelocks

Last updated 2 years ago

Was this helpful?

Payments in the Lightning network require interaction between sender and receiver, meaning both parties need to be online at the same time. Lightning payments also require both the sender and receiver to be either connected to each other with a payment channel, or for a route through the wider network to exist that connects the two.

Create invoice

The payment cycle begins with an interaction between the sender and receiver, for example a buyer and seller of goods. Upon agreeing on an amount, the recipient generates an invoice on their node, which will contain basic information, such as amount, destination and validity.

Most importantly, the recipient generates a preimage, a random number and provides its hash as part of the invoice. All invoices are cryptographically signed.

lncli addinvoice –amt 10101 –memo “my first invoice”

The whole invoice is passed to the payer out of band, for example by displaying it on a website, on a smartphone, or point of sale terminal. Commonly, invoices are encoded as QR codes, but can also be transmitted by NFC or even sound.

When creating an invoice, you may keep its payment hash (r_hash) around, to later be able to conveniently check whether it has been paid.

Make the payment

The payer passes this invoice to their Lightning Network node and confirms the instructions to pay it. The node will create multiple routes to the destination node, and attempt them. The more invoices you pay, the more your node learns about the reliability of its peers to pass on payments in certain directions.

lncli payinvoice <bolt 11 invoice>

To make the payment, the node will create an HTLC over the amount to be forwarded to one of its peers, who will pass it on to the next peer, and so on until it reaches its destination.

The recipient node will release the preimage to its peers, which are used to settle the HTLCs inside the channels. The sender can use the preimage together with the signed invoice to prove the payment was made.

Invoices can be decoded using any Lightning node. This makes their contents human readable.

lncli decodepayreq --pay_req=<bolt 11 invoice>

Check the payment

The recipient can now look up whether the payment was made using the payment hash.

lncli lookupinvoice --rhash=<r_hash>

Other payment types

It’s also possible to attach messages to Lightning payments or send payments over multiple paths at once.

Lightning Network invoices also exist for situations where the payment amount is not known ahead of time, for example donations. It is also possible to create static invoices that can be reused multiple times . In addition, there are alternative proposals on how to handle Lightning Network payments, such as LNURL or BOLT12.

Read more: Lifecycle of a payment channel
Read more: Understanding Lightning invoices
Read more: Hash Time-lock Contracts
using AMP
Read more: Payment etymology