1

If Alice opens a channel to Bob and sends a payment directly to Bob, the following messages are exchanged:

    +-------+                            +-------+
    |       |---- update_add_htlc ------>|       |
    |       |---- commitment_signed ---->|       |
    |       |                            |       |
    |       |<--- revoke_and_ack --------|       |
    |       |<--- commitment_signed -----|       |
    |       |                            |       |
    |       |---- revoke_and_ack ------->|       |
    |       |                            |       |
    |   A   |                            |   B   |
    |       |                            |       |
    |       |<--- update_fulfill_htlc ---|       |
    |       |<--- commitment_signed -----|       |
    |       |                            |       |
    |       |---- revoke_and_ack ------->|       |
    |       |---- commitment_signed ---->|       |
    |       |                            |       |
    |       |<--- revoke_and_ack --------|       |
    +-------+                            +-------+

(source: running lnd with TRACE logging and inspecting the logs)

Why is it necessary to use HTLCs at all, instead of just exchanging updated commitment transactions directly?

For example:

    +-------+                            +-------+
    |       |---- commitment_signed ---->|       |
    |       |                            |       |
    |       |<--- revoke_and_ack --------|       |
    |   A   |                            |   B   |
    |       |<--- commitment_signed -----|       |
    |       |                            |       |
    |       |---- revoke_and_ack ------->|       |
    +-------+                            +-------+
1

It is not necessary to use htlcs in the case of a direct payment. However as the protocol was designed with the idea to have a network of payment channels. This should allow multi hop atomicity of payments via htlcs. For that the process with the htlcs to move forward the state in the channel operation protocol were necessary

I think from a design perspective it was cleaner to reuse this protocol for direct payments instead of implementing two protocols and make case distinctions

2
  • 2
    I guess the added complexity with having both would be signaling when it is payment directly to B and when it is a routed payment through B. You wouldn't use the Lightning protocol if you were never interested in the routed aspect. Jan 5 at 19:45
  • reusability is probably the right answer - but has it also privacy implications?
    – user112185
    Aug 1 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.