THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Why Can a Lightning Payment Fail with a Valid Invoice?

permalink THAMER
#htlc#invoice#lightning-payment-failure#liquidity#routing

A valid Lightning invoice identifies a payment request, but it does not guarantee that the sender can deliver the payment. The route may lack sufficient liquidity, an intermediary may be unavailable, or the attempt may violate routing or fee constraints.

What are common failure causes?

Directional channel liquidity may be insufficient for the payment amount. An invoice may expire before settlement. Peers may be offline, channel policies may change, or an attempted route may fail to forward an HTLC.

Does a failed attempt mean Bitcoin was lost?

Not necessarily. A failed Lightning attempt is generally resolved through the protocol's failure and timeout mechanisms. However, implementations must correctly manage pending HTLCs and channel state; a pending payment should not be presented as either definitively successful or failed without evidence.

What should applications display?

Show whether a payment is pending, settled, or failed, along with safe error details. Avoid treating a successful API submission as proof that the recipient received funds. Set retry, fee, and timeout limits, and use payment identifiers to avoid accidental duplicate sends.

Primary references

BOLT 11 — Invoice Protocol: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md

BOLT 4 — Onion Routing Protocol: https://github.com/lightning/bolts/blob/master/04-onion-routing.md

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects