XRPL PathFinding: Currency conversions.
complete
Arturo Portilla
Implement XRPL Pathfinding, so Xumm users can submit transactions to exchange IOUs directly against other IOUs, without being required to buy XRP (the DEX would bridge both IOUs through XRP in the back-end). In the current configuration, it's only possible to exchange XRP again IOUs and vice-versa.
This feature would really make the XRPL DEX shine.
This post was marked as
complete
Wietse Wind
in progress
This is currently being built as xApp :)
Wietse Wind
under review
Here's a basic mockup (suggestion) on how I envision a new sending flow where one can (step by step) compose a transaction involving sending one currency, and delivering another one:
Arturo Portilla
Wietse Wind: The suggestion looks great, so does the proposed UX.
I just have one question. Will this feature be available only when sending funds from one XRPL address to another? - I believe it would be nice to make it extensive to individual purchases, i.e. what if I only hold Bitstamp.USD in my account (x) and want to buy Gatehub.EUR through the DEX to be delivered to that same account (x). - Would pathfinding work there? It would be a great UX.
Wietse Wind
Arturo Portilla: Yes, this same logic will definitely be embedded in:
- The Sign Request flow (for payloads from the XUMM API, like e-commerce/retail environments).
- Transaction exchanging, where you are in fact sending FROM+TO yourself. A minor UX change, same flow.
I think the puzzle fell into place (UX wise) for me, now, as displayed in the mockup I just shared.
For regular "Send" transactions:
To make this less intimidating to users: we could just allow users to enter the sending amount at first, then to just inform them what will be delivered (existing behaviour; xrp<>xrp, same IOU<>same IOU, or sending IOU> XRP. The user could then tap "Change" and go the the more advanced behaviour where they can select SEND/DELIVER and pick currencies.
Arturo Portilla
Wietse Wind: Thanks for the quick answer, but I believe I may not have used the best wording.
As user (x), the Xumm app doesn't allow me to use the DEX to directly exchange my Biststamp.USD for Gatehub.EUR. It seems like I'm forced to exchange my Bitstamp.USD for XRP and then buy Gatehub.EUR.
Seems like the XRPL is technically capable of allowing me to directly trade an IOU for another IOU, without necessarilly buying and selling XRP. This, in the context of a simple trade, not in the context of sending a payment to a different address.
Wietse Wind
Arturo Portilla: Exactly:
Yes, this same logic will definitely be embedded in transaction exchanging, where you are in fact sending FROM+TO yourself. A minor UX change, same flow.
Quote from the Github issue:
When doing this make over, we should implement the same logic for IOU Currency Exchange. When tapping an IOU in the home screen, and tapping the "Exchange" button, we can use this exact same flow, except both the Sending and the Receiving account are the same (Prefilled and hidden)
Arturo Portilla
Wietse Wind: "When doing this make over, we should implement the same logic for IOU Currency Exchange. When tapping an IOU in the home screen, and tapping the "Exchange" button, we can use this exact same flow, except both the Sending and the Receiving account are the same (Prefilled and hidden)"
— My bad, didn't see this earlier. Seems like you got it covered. Awesome!
Wietse Wind
planned
Wietse Wind
I agree, this would be a great addition. It was actually almost easier to add it than to leave it out :P We will optimize existing user interface / user experience workflow, and (after beta) when we feel we got it right, we will enable this.
Niels
Wietse Wind: Pathfinding is super exciting! To add to this, it would be sweet if we could change the main balance to any IOU we like (just interface wise). And then be able to select in which IOU we would like to receive all incoming transactions. For example, I choose to have the Bitstamp USD as my main balance, and somewhere in the settings I select that I would like to receive all incoming transactions (whether XRP or any IOU) in Bitstamp USD. So, if someone sends me XRP, that XRP is automatically exchanged to Bitstamp USD, which I receive.
Wietse Wind
Niels: That's interesting, indeed. That could work with in the XUMM user ecosystem, but outside of the XUMM user ecosystem this would be tricky, as it would require an exchange transaction every time someone sends you XRP (or another IOU) anyway. XUMM can help with that, but it not be really user friendly to keep on signing those exchanges. How do do you envision this? Or did you focus on on XUMM to XUMM XRPL transactions anyway?
Niels
Wietse Wind: I thought that it might work the same as when someone sends an IOU to another wallet that doesn't have any trustlines, and the received transaction automatically exchanges to xrp. Would it be possible to say, like; ''I want to receive everything in Bitstamp USD'', and then through pathfinding all incoming transactions would automatically arrive in Bitstamp USD without the need to sign any transaction? I was looking at it with my understanding of what the Stellar foundation is doing with their IOU to IOU via pathfinding. I believe that this could be pretty cool as there are, for example, non crypto enthusiast on GFam today. What if they could select to receive tips in usd in their XUMM app. Or isn't it possible to let the xrpl know that you prefer to receive transactions in an IOU over XRP?
Wietse Wind
Niels: The fallback to XRP is a XUMM thing, the XRPL can take care of the conversion on one transaction, but the sender will have to decide how to compose the transaction and send it. Except when using XUMM, where that can be part of the "sign
request
". If not using XUMM but any random client, how will that client be able to see what the destination wants to receive ;)?
Niels
Wietse Wind: Hmm, I see. Thanks for clarifying!
Benny
Wietse Wind: As far as I understand it, in this scenario it will be not necessary for the sender to know which currency the receiver wants.
Let's say there is a XUMM user, who does not care about any crypto or other currency at all. He only wants USD (as an IOU) in his account at all times. Whenever something else is being sent to him, he wants it to be exchanged to USD automatically, right away, no matter what.
Automated logic being:
IF (received currency =/= USD), THEN (exchange currency to USD).
Would this be possible in some automated way? Is this something that could work with the hooks amendment? Would it require to be manually signed every time still? 🤔
Wietse Wind
Benny: This won't be possible, as that would require signing, something XUMM cannot (and won't) do headless. Meaning you would have to sign based on a sign request, resulting in an exchange rate at the moment of signing, not at the moment of receiving.
One way to do this would be to allow account owners to store the preferred IOU to be received on an account level, and then make sure clients respect that. The first part is easy, it'll take an amendment or our Hooks proposal. The second part is hard. Look at the X address adoption and other proposals: many (most) clients and senders (like Exchanges) are very conservative or don't update at all.
Benny
Wietse Wind: Ok, that makes sense. Thanks for replying!