# The Lightning Network

- [Overview](https://docs.lightning.engineering/the-lightning-network/overview.md): Learn how the Lightning Network functions. Get comfortable with its topology, channels, invoices and routing.
- [Payment Channels](https://docs.lightning.engineering/the-lightning-network/payment-channels.md): Payment channels are multisignature contracts between peers. Payments are made inside these payment channels and can be settled on the Blockchain.
- [Lifecycle of a Payment Channel](https://docs.lightning.engineering/the-lightning-network/payment-channels/lifecycle-of-a-payment-channel.md)
- [Watchtowers](https://docs.lightning.engineering/the-lightning-network/payment-channels/watchtowers.md): Watchtowers help secure your channels against breaches. Learn how they function and how to run your own watchtower.
- [Understanding Sweeping](https://docs.lightning.engineering/the-lightning-network/payment-channels/understanding-sweeping.md): Sweeps are transactions from specialized scripts back into your main wallet. They are used in various contexts throughout the Lightning Network.
- [Etymology](https://docs.lightning.engineering/the-lightning-network/payment-channels/etymology.md): Understand how channels might differ from each other and how we describe their characteristics.
- [The Gossip Network](https://docs.lightning.engineering/the-lightning-network/the-gossip-network.md)
- [Identifying Good Peers on the Lightning Network](https://docs.lightning.engineering/the-lightning-network/the-gossip-network/identify-good-peers.md): Learn how to best select other Lightning Nodes for opening channels.
- [Pathfinding](https://docs.lightning.engineering/the-lightning-network/pathfinding.md)
- [Finding routes in the Lightning Network](https://docs.lightning.engineering/the-lightning-network/pathfinding/finding-routes-in-the-lightning-network.md)
- [Channel Fees](https://docs.lightning.engineering/the-lightning-network/pathfinding/channel-fees.md)
- [Multipath Payments (MPP)](https://docs.lightning.engineering/the-lightning-network/pathfinding/multipath-payments-mpp.md): Splitting a payment into smaller parts and route each part separately.
- [Lightning Network Invoices](https://docs.lightning.engineering/the-lightning-network/payment-lifecycle.md)
- [Understanding Lightning Invoices](https://docs.lightning.engineering/the-lightning-network/payment-lifecycle/understanding-lightning-invoices.md): Learn how to identify, decode and create Lightning invoices
- [Making Payments](https://docs.lightning.engineering/the-lightning-network/multihop-payments.md)
- [The Payment Cycle](https://docs.lightning.engineering/the-lightning-network/multihop-payments/the-payment-cycle.md)
- [Timelocks](https://docs.lightning.engineering/the-lightning-network/multihop-payments/timelocks.md): Timelocks allow for limits on when bitcoin can be spent. There are absolute and relative timelocks, existing on the transactional and UTXO level.
- [Hashed Timelock Contract (HTLC)](https://docs.lightning.engineering/the-lightning-network/multihop-payments/hash-time-lock-contract-htlc.md): HTLCs are the centerpiece of every Lightning Network payment. Learn how they are formed to create secure multi-hop transactions.
- [Payment Etymology](https://docs.lightning.engineering/the-lightning-network/multihop-payments/etymology.md): Learn the essentials of payments in the Lightning Network.
- [What Makes a Good Routing Node](https://docs.lightning.engineering/the-lightning-network/multihop-payments/what-makes-a-good-routing-node.md): To successfully route bitcoin in the Lightning Network, a node needs to provide five basic functions.
- [Understanding Submarine Swaps](https://docs.lightning.engineering/the-lightning-network/multihop-payments/understanding-submarine-swaps.md): Submarine swaps allow to exchange off-chain and on-chain Bitcoin safely without counterparty risk.
- [Instant Submarine Swaps](https://docs.lightning.engineering/the-lightning-network/multihop-payments/instant-submarine-swaps.md): Instant submarine swaps are a form of atomic swap that makes onchain funds immediately available without needing to wait for block confirmations.
- [Liquidity](https://docs.lightning.engineering/the-lightning-network/liquidity.md): Learn about liquidity, capacity and how to manage the capital in your Lightning node.
- [Understanding Liquidity](https://docs.lightning.engineering/the-lightning-network/liquidity/understanding-liquidity.md): Liquidity in the Lightning Network is highly contextual. Learn what this means and how you can optimize your node's liquidity.
- [Managing Liquidity on the Lightning Network](https://docs.lightning.engineering/the-lightning-network/liquidity/manage-liquidity.md): Learn about the concept of liquidity in the context of the Lightning network and how to best open, manage, balance and close your channels.
- [Liquidity Management for Lightning Merchants](https://docs.lightning.engineering/the-lightning-network/liquidity/liquidity-management-for-lightning-merchants.md): Learn how to manage your channels as a merchant receiving payments on the Lightning Network
- [How to Get Inbound Capacity on the Lightning Network](https://docs.lightning.engineering/the-lightning-network/liquidity/how-to-get-inbound-capacity-on-the-lightning-network.md): To receive payments on the Lightning Network, you need inbound capacity. This article explains capacity and how you can acquire it.
- [Lightning Service Provider](https://docs.lightning.engineering/the-lightning-network/liquidity/lightning-service-provider.md): A Lightning Service Provider (LSP) deploys liquidity in the Lightning Network on behalf of others.
- [L402: Lightning HTTP 402 Protocol](https://docs.lightning.engineering/the-lightning-network/l402.md): L402 is the standard for selling and buying digital resources. L402 allows services to charge for API endpoints in a way that is easy for AI agents to participate.
- [Macaroons](https://docs.lightning.engineering/the-lightning-network/l402/macaroons.md): Macaroons are fancy cookies for distributed applications.
- [L402](https://docs.lightning.engineering/the-lightning-network/l402/l402.md): Lightning API keys (L402) are Macaroons that include a payment hash. For the L402 to be valid, it must be presented together with the preimage corresponding to the payment hash.
- [Protocol Specification](https://docs.lightning.engineering/the-lightning-network/l402/protocol-specification.md)
- [L402 Quickstart](https://docs.lightning.engineering/the-lightning-network/l402/l402-quickstart.md): Turn any HTTP endpoint into a profit center. Buy resources from any L402-gated API.
- [Implementations and Links](https://docs.lightning.engineering/the-lightning-network/l402/implementations-and-links.md): Projects using L402 today, code examples and further reading
- [Taproot Assets](https://docs.lightning.engineering/the-lightning-network/taproot-assets.md): A Taproot-powered protocol for issuing assets on bitcoin that can be transferred over the Lightning Network for instant, high-volume, low-fee transactions.
- [Taproot Assets Protocol](https://docs.lightning.engineering/the-lightning-network/taproot-assets/taproot-assets-protocol.md): Taproot Assets is primarily an on-chain protocol. Assets are issued on the bitcoin blockchain using taproot transactions.
- [Taproot Assets on Lightning](https://docs.lightning.engineering/the-lightning-network/taproot-assets/taproot-assets-on-lightning.md): Taproot Assets can be deposited into Lightning Network channels and transacted instantly.
- [Edge Nodes](https://docs.lightning.engineering/the-lightning-network/taproot-assets/edge-nodes.md): An Edge Node is a Taproot Assets-aware Lightning Node that routes payments between Taproot Assets channels and Bitcoin channels.
- [Taproot Assets Trustless Swap](https://docs.lightning.engineering/the-lightning-network/taproot-assets/trustless-swap.md): Taproot Assets can be swapped for Bitcoin or other assets through swaps that do not require the two parties to trust each other. The swap completes atomically.
- [FAQ](https://docs.lightning.engineering/the-lightning-network/taproot-assets/faq.md): Frequently asked questions about the Taproot Assets Protocol.
- [Glossary](https://docs.lightning.engineering/the-lightning-network/taproot-assets/glossary.md): Taproot Assets make use of several novel concepts, all of which we attempt to briefly define here.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lightning.engineering/the-lightning-network.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
