0

In the Lightning Network, the intermediate hop between the sender and receiver checks for possible errors(like if it has enough balance). And if there is, it sends an HTLCFail message back to the sender.

I was wondering if the HTLCFail message is sent back to the sender via the path it comes from, or it's routed by some new random path as long as it can go back and let the sender know this path cannot route?

Payment relay (intermediate hop). H checks for possible errors (e.g., it checks whether it has enough balance to forward the payment). If there are errors, it sends an HTLCFail message back to S , failing the HTLC; otherwise, it sends an HTLCAdd message to R . (This step occurs multiple times in the general case of a payment going through multiple intermediate hops.)

1

The failure message must go along the same route it came, because any intermediate step does not know where the payment was originally sent from. Every hop only knows the previous and next hops in the sequence, and so the only option it has is to return the information to the previous hop on the route.

  • alright thanks a lot. I saw this and wasn't so sure so just wanna check. Thanks again. – Danni Apr 8 at 13:49
  • i got one more question: since each hop knows the previous and next hops, would that mean the intermediate node needs to record every payment's information on this hop? wouldn't that create large overhead? or the hopping information is not stored on the node. Thanks a lot! – Danni Apr 8 at 14:10
  • Some information must be kept around because it is necessary to keep commitment transactions for all past channel states (in case other party broadcasts an old state), and the commitment and associated htlcs require the payment hash. The other session information for each payment forwarding only needs to be held for the duration that the HTLC is in flight. – Mark H Apr 8 at 14:20

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.