Key Takeaways
- Payment Request: A Lightning Invoice is a detailed request for a specific Bitcoin payment amount.
- Lightning Network Specific: These invoices are exclusively for fast, low-cost transactions on the Lightning Network.
- Time-Sensitive: Invoices have a built-in expiration date, often defaulting to just 1 hour.
What is Lightning Invoice?
A Lightning Invoice is a payment demand generated for use on the Lightning Network, a second layer built on top of Bitcoin. It allows for nearly instant, low-fee transactions. For instance, a merchant can generate an invoice for 25,000 sats (0.00025 BTC) to sell a product. The buyer then scans this invoice with a compatible wallet to complete the payment in seconds, a sharp contrast to on-chain settlement times.
Structurally, an invoice is a string of data, often presented as a QR code for easy scanning with a mobile wallet. It contains critical information: the exact payment amount, the recipient's node ID, and a cryptographic signature. A key feature is its built-in expiry, which often defaults to one hour. This ensures the payment details remain valid for only a short period, improving transaction security.
How to Create a Lightning Invoice
This is how you can generate a Lightning Invoice to request a payment.
- Open your Lightning Network-enabled wallet or application.
- Find and select the option to receive a payment, often labeled 'Receive' or 'Create Invoice'.
- Specify the amount of Bitcoin, usually in satoshis, you wish to request. You can also add a memo for context.
- Confirm the details to produce the invoice. It will be presented as a QR code and a long alphanumeric string for the payer to use.
How to Pay a Lightning Invoice
Paying a Lightning Invoice is a straightforward process designed for speed and efficiency. You'll use a Lightning-compatible wallet to scan or paste the invoice details and authorize the transaction. The payment settles almost instantly, confirming the transfer of funds across the network.
- Open: your Lightning-enabled wallet or application.
- Scan: the QR code or paste the invoice string provided by the recipient.
- Review: the payment details, including the amount and destination.
- Confirm: the transaction to send the payment immediately.
Lightning Invoice Expiry and Validity
A Lightning Invoice has a limited lifespan to maintain network efficiency and security.
- Default: invoices typically expire in one hour, though this can be adjusted.
- Security: prevents old, unpaid invoices from being accidentally paid or clogging the network.
- Invalid: an expired invoice cannot be paid, requiring a new one to be generated.
Common Issues with Lightning Invoices
The Lightning Network represents a major step forward for Bitcoin, but it is still a developing system with known challenges. Users might encounter a few common problems with invoices as the network matures and scales.
- Routing: Payments can fail if the network cannot find a path with sufficient liquidity between the sender and receiver.
- Expiration: Invoices are time-sensitive and become unusable after they expire, often in just one hour, requiring a new one.
- Stuck: A payment can occasionally get stuck in transit if an intermediary node goes offline during the routing process.
Security Considerations for Lightning Invoices
While Lightning Invoices have strong security through cryptographic signatures and fixed amounts, users must remain vigilant. The primary risk involves phishing, where a malicious actor might present a fraudulent invoice. It is critical to verify the recipient's identity before confirming any payment. The built-in expiry also acts as a safeguard, invalidating old payment requests and reducing the window for potential exploits.
The Role of Invoices in the Lightning Network
Lightning Invoices are the starting point for every transaction on the network. They are structured according to the BOLT #11 specification, encoding the payment hash needed to create a Hash Time Locked Contract (HTLC). This contract secures the payment as it travels across multiple nodes to the destination. The invoice acts as a data packet, giving the payer's wallet all the information required to build and route the payment securely, forming the foundation of the network's payment flow.
Join The Money Grid
To put Lightning Invoices to work, you can join the Money Grid, a global payments network built on Bitcoin. Lightspark's platform offers enterprise-grade Lightning Node management, giving you the tools for instant, low-cost Bitcoin transfers without managing the underlying complexity.