Understanding Bitcoin Lightning Network forwarding

Posted about 1 year ago by LN+

Bitcoin’s Lightning Network (LN) is a remarkable innovation that enables instant and low-cost Bitcoin transactions. But beyond simply sending and receiving payments, one of the essential functions within this network is "forwarding." In this post, I'll explore how funds get forwarded across the Lightning Network, the channels involved, the fees associated, and strategies to maximize node earnings. For a foundational understanding of the Lightning Network read this post first.

Forwarding: A Vital Cog in the LN Machine

In the Lightning Network, payments often traverse through multiple nodes before reaching their intended destination. This process is known as forwarding. Rather than a direct connection between the payer and payee, payments take a route through several intermediaries, leveraging existing payment channels.

Imagine Alice wants to send payments to Zoe, but they don’t have a direct channel between them. If Alice has a channel with Bob, and Bob has a channel with Carol, who in turn has a channel with Dave, and Dave has a channel with Frank, and Frank has a channel with Zoe, then Alice can forward her payment through Bob, Carol, Dave and Frank to get to Zoe.

Each hop along this path requires the node in question to forward the payment onto the next node, essentially moving funds from one channel to another until it reaches the final destination.

The Role of Public Channels in Forwarding

Only public channels participate in forwarding on the Lightning Network. When a channel is created, it can be designated as either public or private. Public channels are announced to the entire network and are listed in the network’s directory. This means any node can see them and use them as potential routes for payments. On the other hand, private channels are only known to the two parties involved, and they won't be used by others for forwarding.

The Cost of Forwarding: Two Types of Fees

Forwarding isn’t done for free; there are fees associated with it. The two main types of fees are:

  • Base Fee: This is a fixed fee that a node charges for every payment it forwards, irrespective of the payment amount.
  • Fee Rate (or Proportional Fee): This fee is proportional to the amount being forwarded. For example, if a node charges a fee rate of 1,000 ppm (parts per million), then for every 1 Bitcoin it forwards, it will charge 0.001 Bitcoin.

The total fee for forwarding a payment is a combination of these two fees. Different nodes can set their own fees, leading to a competitive marketplace for routing payments.

Reasons Why a Forwarding Request May Fail

In the intricate dance of forwarding payments through the Lightning Network, not every request goes through smoothly. There are several reasons why a forwarding request might fail:

  1. Insufficient Funds in Channels: The most common reason is that one of the intermediary channels doesn’t have enough funds on the sending side. For instance, if Alice is trying to send funds through Bob to Charlie, but Bob doesn't have enough funds in his channel with Charlie, the payment will fail.
  2. Channel Capacity: Even if funds are available, a channel might not have the required capacity to handle a large payment. Payments on the Lightning Network can't exceed the capacity of the smallest channel in their route.
  3. Fee Mismatch: If the total fee required by intermediaries is more than the fee provided by the sender, the forwarding request can fail.
  4. Channel Closure: If one of the channels in the route gets closed while the payment is in transit, the payment will not go through.
  5. Route Unavailability: The Lightning Network tries to find the shortest and cheapest path for the payment. If no route is found that can handle the payment size or if all possible routes are exhausted, the payment fails.
  6. Node Unreliability: If one of the nodes in the chosen path is frequently offline or unstable, it can lead to payment failure.
  7. HTLC Limits: The Lightning Network uses Hashed Time-Locked Contracts (HTLCs) for secure fund transfers. There's a limit to how many concurrent HTLCs a channel can have. If this limit is reached, the channel can't forward any more payments until some of the current ones are settled.
  8. Time Locks Expiry: Payments in the Lightning Network are locked for a certain time duration to ensure security. If the payment isn’t completed within this time frame (perhaps due to long routes or slow nodes), it will fail.
  9. Privacy Concerns: Some nodes, due to privacy concerns, might reject payments that originate from or are destined to certain nodes, causing a forwarding failure.

Strategies to Maximize Earnings on a Node

If you're running a node and want to maximize your earnings from forwarding, consider these strategies:

  • Optimal Channel Balancing: Regularly monitor and balance your channels. If a channel is imbalanced (e.g., most funds are on one side), it may not be able to forward many payments. Using tools and services that help in rebalancing can be advantageous. However if you have a channel that always forwards only one way, balancing may not be necessary and even disadvantageous. Check each channel individually to see what kind of behaviour they demonstrate.
  • Competitive Fee Setting: Set your fees at competitive rates. If they're too high, users might opt for cheaper routes. If they're too low, you might not make a worthwhile profit. Monitoring the network's average fees can guide your pricing.
  • Strategic Channel Openings: Open channels with well-connected and active nodes. This increases the chances of your node being in the path of payment routes. However, large nodes are already well connected so you are competing with other channels that can handle the forwarding already. Smaller nodes could be a good source of traffic, especially if they are operated by active economic actors, like stores, payment systems, etc.
  • Uptime is Key: Ensure your node is online and reliable. If it frequently goes offline or is unstable, it will be less likely to be chosen for forwarding payments.

By understanding the intricacies of forwarding on the Lightning Network, one can better appreciate its decentralized and dynamic nature. Whether you're a casual user or a node operator looking to maximize profits, a deep dive into forwarding reveals yet another layer of the LN's innovative approach to scaling Bitcoin.

0 Comments

Please login to post comments.