- From: David Fuelling <dfuelling@sappenin.com>
- Date: Fri, 17 Jun 2016 20:46:28 +0000
- To: Evan Schwartz <evan@ripple.com>
- Cc: Interledger Community Group <public-interledger@w3.org>
- Message-ID: <CABq1t64p9NLBj_W1GchwwWbghbf_PinPtmonT=xOZ8uCUacjGA@mail.gmail.com>
Hi Evan, Thanks for your response - very helpful. It's been some time since I started this thread, but I wanted to follow-up since I'm still a bit unclear about the quoting flow for a multi-hop quote. I'll provide an example below, and am wondering if I've got it right (see the end of this message for some questions about the flow I've written). Apologies in advance for such a long, complicated example. If you have a better way to represent this kind of stuff, I'm all ears (maybe in a Google doc or something that can be edited?). Anyway, here goes. So, as an example, imagine Alice has an account on Ledger L1 ($USD). She wants to send $20 USD to Pierre with an account on Ledger L3 (in EUR). During the quoting process, L1 contacts Connector C1 and asks for a quote. C1 doesn't have a direct connection to Ledger L3, but it does have a connection to Ledger L2 (JPY). C1 also knows it can ultimately get money to Ledger3 using a combination of its account on Ledger2 and Connector C2, which has accounts on Ledger2 and Ledger3. Thus, C1 asks C2 for a secondary quote. Here's how I understand this to work: *QuoteRequest: Ledger1 to Connector1* Source LedgerId: http://ledger1.usd (*ledger where the transfer crediting the 1st connector's account will take place*) SourceAmount: $20 Dest LedgerId: http://ledger3.eur (*should this be ledger2? Or should it be the ultimate destination, which is ledger3?*) DestinationAmount: -- Given the above request, C1 doesn't have a direct connection to Ledger3, but it does have an account on Ledger2, so C1 consults its routing table and finds that C2 also has an account on Ledger2, and that C2 *also* has a connection to Ledger3, so C1 asks C2 for a quote. *QuoteRequest: C1 -> C2* Source LedgerId: http://ledger2.yen (*ledger where the transfer crediting the 2nd connector's account will take place*) SourceAmount: ¥2061.97 (*this is $20 USD minus 1%, in JPY as computed by C1* ) Dest LedgerId: http://ledger3.eur DestinationAmount: -- Given the above request, C2 knows it has a direct connection to L3, so it can provide a quote response. It also charges a 1% fee for the transfer. See below for the response: *QuoteResponse: C2 -> C1* Source LedgerId: http://ledger2.yen (*ledger where the transfer crediting the 2nd connector's account will take place*) Source AccountId: http://ledger2.yen/accounts/C2 SourceAmount: ¥2061.97 Dest LedgerId: http://ledger3.eur (*ledger where the transfer debiting the 2nd connector's account will take place*) Dest AccountId: (omitted?) DestinationAmount: €17.37 (*this is *¥2061.97 JPY *minus 1%, in EUR*) C1 receives the quote response above from C2 and combines it with its own quote response, and returns the whole payload to L1, which will evaluate it on behalf of Alice: *QuoteResponse: C1 -> L1* [ Source LedgerId: http://ledger1.usd (*ledger where the transfer crediting the 1st connector's account will take place*) Source AccountId: http://ledger1.usd/accounts/C1 (*account where the transfer crediting the 1st connector will take place*) SourceAmount: $20 Dest LedgerId: http://ledger2.yen (l*edger where the transfer debiting the 1st connector's account will take place*) DestinationAmount: http://ledger2.yen/accounts/C1 <http://ledger1.usd/accounts/C1> (*this is known, but is it supposed to be omitted?*) DestinationAmount: ¥2061.97 (*this is $20 USD minus 1%, in JPY*) ], [ Source LedgerId: http://ledger2.yen Source AccountId: http://ledger2.yen/accounts/C2 SourceAmount: ¥2061.97 Dest LedgerId: http://ledger3.eur Dest AccountId: (unknown or not relevant during quoting?) DestinationAmount: €17.37 (*this is *¥2061.97 minus 1%, in EUR) ] *Additional Questions/Clarifications* 1. Is the quote returned to Alice correct as I've written it? Specifically, will there actually be two quotes like I've written, or should this be condensed into a single quote? 2. Do the quoting payloads need to include additional transfer information, such as: On Ledger3, a transfer will be made between C2 and Pierre? Or is this simply not relevant from the perspective of ILQP since that transfer from C2 to Pierre will arguably be free since it's occurring inside of a single ledger? 3. Looking at the five-bells reference implementation for quoting (here <https://github.com/interledger/five-bells-connector/blob/master/src/controllers/quote.js>), the quote responses never seem to include a destination account id. Why is that? 4. Should we be breaking out the transaction fees and exchange rates as a separate transfer, or as additional data points in each transfer? For example, Alice in this equation probably doesn't know the current exchange rate between USD, JPY, and EUR. Even if she did, it wouldn't be clear from the above how much of the transfer is going to Connector fees vs how much is being lost to exchange rate fluctuations. It seems like all parties involved would want to see these additional data-points for both Exchange-Rate (or computed exchange-rate costs) as well as Connector Fees so that these could be easily compared against different quotes. On Mon, Apr 18, 2016 at 6:49 AM Evan Schwartz <evan@ripple.com> wrote: > We're in the midst of switching the pathfinding from source routing to a > non-source routing architecture at the moment. There isn't much > documentation about this at the moment but we'll be working to get that > written up soon. Do you have specific ideas or questions about that that we > could incorporate or address in the meantime? > > For normal pathfinding we assume that the source and destination ledgers > are known, but not the path of connectors and intermediary ledgers. With > the non-source routing approach, the sender would query all of the > connectors attached to their ledger (the source ledger) for quotes. The > connectors will have a certain amount of routing information cached and may > need to query others if they do not have a path for the given query stored. > Connectors later in the path do not need to know how much the original > source amount is, only how much they're being asked to deliver from one > ledger to the other. Does that make sense? > > On Wed, Apr 13, 2016 at 10:27 PM, David Fuelling <dfuelling@sappenin.com> > wrote: > >> Hey All, >> >> I have a few questions around Connector "quoting" in ILP. >> >> 1. In the Interledger Architecure document >> <https://github.com/interledger/specs/blob/gh-pages/0001-interledger-architecture.md>, >> there's a reference to ILQP, but not much specific information. Are there >> any more details around this, such as a flow-diagram or document that >> outlines how quoting is envisioned to work? >> >> 2. For multi-connector transfers where a source and final destination >> are known, *and* all of the Connector hops are are known, who does the >> source connector "ask" for a quote? Reading the architecture document, it >> appears that the source connector merely queries various connectors >> "connected" to the destination ledger and picks the best one. However, how >> does the final hop connector (the destination) know the total quote that >> any connectors in the path might "charge"? Just wondering how the >> mechanism is envisioned to work. >> >> Thanks for any input! >> >> David >> > > > > -- > Evan Schwartz | Software Architect | Ripple > [image: ripple.com] <http://ripple.com> >
Received on Friday, 17 June 2016 20:47:06 UTC