[Lightning-dev] Generalizing proportional routing fees to exchange rates

ZmnSCPxj ZmnSCPxj at protonmail.com
Sat May 20 00:03:20 UTC 2017


Good morning list,

I would like to propose a modification to lightning protocol, regarding the use of proportional routing fees.

Consider Alice with a channel to Bob, who has a channel to Carol, and Alice must pay Carol 1.0BTC.

Bob advertises that he wants a 0.1% proportional fee, translating to 1,000/1,000,000 proportional routing fee.

(I ignore the fixed fee for now)

This means, Alice must send 1.001 BTC to Bob, who then sends 1.0 BTC to Carol.

This translates to Bob actually having approximately 0.999001 BTC-to-BTC exchange rate.

Since part of Lightning Network's roadmap is to eventually have cross-chain nodes, I would like to propose that, in lieu of advertising proportional routing fees, nodes advertise a BTC-to-BTC exchange rate. Then, we can generalize this exchange rate to cross-chain case.

A node needs to advertise multiple exchange rates for various coins. Currently, Lightning designates supported coins by hashes of their genesis blocks (32-byte `chain_hash`). An exchange rate denominated in ratio of 1/1,000,000 can be encoded in 4 bytes. Thus to advertise exchange rates a node provides 64 bytes to identify the coins being referred to, and 4 bytes for the actual exchange rate. For cross-chain exchange rates, a node needs to advertise both directions (e.g. LTC-to-BTC and BTC-to-LTC).

Possibly one way to advertise would be to advertise a BTC-to-LTC exchange rate plus a rate offset. For example, Bob might operate as a cross-chain exchange for LTC and BTC, and advertise a BTC-to-LTC rate of 4,000,000/1,000,000 (4 output LTC's for 1 input BTC), as well as a rate offset of 1,000/1,000,000.

If Alice sends LTC to Bob to be converted to 1.0BTC for Carol, she has to compute the Bob's exchange rate as (4,000,000+1,000)/1,000,000, then compute from the 1.0BTC for Carol to 1.0 * (4,001,000/1,000,000) as 4.001LTC to Bob.

If Carol sends BTC to Bob to be converted to 1.0LTC for Alice, she has to compute the Bob's exchange rate as (4,000,000-1,000)/1,000,000, then compute from the 1.0LTC for Alice to 1.0 / (3,999,000/1,000,000) as 0.25006252BTC to Bob.

Has this been considered and rejected before?

Regards,
ZmnSCPxj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20170519/63319cc9/attachment.html>


More information about the Lightning-dev mailing list