lightning community – Single-hop Cost vs Multi-hop funds
One cause to make use of HTLCs for single-hop funds within the Lightning Community can be to make them indistinguishable from multi-hop funds to the receiver. This fashion, the receiver doesn’t know whether or not it was their direct peer who initiated the fee, or whether or not they’re merely forwarding the fee on for any person else. Since they give the impression of being an identical to the receiver, the receiver should assume that another node, who they know nothing about, initiated it.
The way in which during which HTLCs are created can be helpful even for the single-hop use case, as a result of they lengthen the RSMC mannequin with conditional funds. With RSMCs alone, if Alice needs to pay Bob, she creates a brand new dedication transaction by lowering the channel steadiness paid to her, and growing the steadiness paid to Bob by way of the RSMC output. This transaction is then signed by Alice. Assuming that no one misbehaves, Alice has successfully already paid Bob. There isn’t a means this fee may be undone by Alice – for instance, if Bob fails to ship a service which was anticipated for the fee.
Within the HTLC case, the fee is conditional on Bob surrendering a secret which is the pre-image of a earlier agreed upon hash. Alice indicators the HTLC with the situation in-built – in such a means that it’s revocable by Alice after a time-out if Bob fails to ship the keys. The remainder of the steadiness of the channel beside the quantity paid within the HTLC is unaffected by this fee and behaves as within the single-hop case.
These conditional funds have a number of benefits. They can be utilized in issues reminiscent of atomic swaps and submarine swaps – the place the receiving of a pre-image is ample to say a steadiness of products elsewhere (one other cryptocurrency for instance). There are in all probability many use instances which are not even explored but.