ILPv4 makes some trade-offs compared to ILPv1. However, mixed in with these trade-offs are some - imho - pure improvements. This document describes what it would look like if I had to redesign ILPv1 given what we know now, but weren't willing to make some of the more controversial trade-offs. This work also revealed the surprising conclusion that ILPv1 transactional semantics (non-chunked or "universal mode quasi-atomic") are possible to achieve using ILPv4.
There are two main differences that are relevant for this discussion:
- ILPv4 assumes that all parties in the chain of an ILP transaction understand ILP. ILPv1 is designed around "ledgers" which are systems that act like an ILP connector, but do not understand ILP.
- ILPv4 assumes that all payments are small. ILPv1 is designed to support larger payments as well, which requires support for additional features, such as liquidity curves to deal with different rates for differently sized payments.
As noted in the original ILPv4 ticket, it is possible to model an ILPv1 ledger as a connector whereby the sending party pre-funds with the connector and the connector post-funds with the receiving party. That way, both sides trust the connector.
We also have the concept of simulating a connector in the plugin for example in ilp-plugin-mini-accounts. Putting these ideas together, we can actually use an escrowing ledger like five-bells-ledger in ILPv4.
To use this ilp-plugin-bells-escrow
, you would configure the hosting connector to settle with every payment. Then you would add the following behavior in the plugin. On the sending side, you would prepare on ILPv4-prepare, ignore sendMoney, return successfully on ledger fulfill and throw on ledger reject/cancel. On the receiving side you would emit data
on ledger prepare and emit money
on ledger fulfill.
Other escrowing ledgers such as blockchains could be used the same way.
ILPv4 generally assumes that larger payments will be split into smaller chunks. However, this is only necessary when the maximum packet size is small. In order to get ILPv1 behavior, we simply need to configure connectors with a large packet size.
ILPv1 has various functionality related to handling different exchange rates for differently sized payments. This includes liquidity curves in the routing protocol and the quoting protocol ILQP. This functionality serves two important goals:
- Performance improvements / quote caching
- Quoting by destination amount
When we originally designed ILPv1, we anticipated that quoting would add significant overhead to the payment process. However, in practice, we found that even when doing a one hop payment over the fastest real-money ledger (XRP Ledger), the latency added due to quoting was negligible. As a result, I would say today that all of the caching functionality in the quoting and routing protocols was horribly overengineered and it is better to just quote ahead of every payment. The payment will take one or more orders of magnitude longer anyway and this removes a tremendous amount of complexity.
Quoting by destination amount is difficult without ILQP. It would be possible to create increasingly large prepared payments in an iterative process similar to chunked payments in ILPv4. However, we have to assume that preparing payments is slow and expensive in this context, so this would probably not work for a ILPv1 style network. (It is still an interesting option for doing non-chunked payments quoted by destination amount in ILPv4.)
Based on the considerations above, I would remove the quote-liquidity functionality from ILQP since it presents an unnecessary optimization and keep only the quote-by-source and quote-by-destination messages.
If implemented this way, I believe the resulting solution would be better than canonical ILPv1, but worse than canonical ILPv4. It retains many of ILPv4's architectural and protocol simplifications and contains the workarounds for legacy ledgers to the respective ledger plugins.
Writing this document lead to some interesting realizations for doing non-chunked payments in ILPv4. Iteratively preparing a payment in chunks (which all contain the same condition) is a novel idea which effectively provides a way for receivers to atomically receive a payment, yet allows the sender to "quote by destination amount" without needing ILQP.
It seems worthwhile further exploring the space between and around ILPv1 and ILPv4. That said, my strong recommendation is to focus our efforts on ILPv4 because it is overall the most promising approach and provides the greatest benefit to users: extremely fast and cheap payments, even when payment size is very small - i.e. the Internet of Value.
Our goal (which has not changed in my opinion) is to connect any sender with any receiver on any network. Our realization, in moving from v1 to v4 is that this is better achieved by overlaying a new interoperability layer over existing networks rather than trying to alter those existing networks to work with ILPv1.
In reality, what we have now is a true interoperability layer, whereas what we had before was architecturally broken (assuming the goal was an interoperability layer akin to IP). I honestly believe this and think it will help us move on with ILPv4 if we acknowledge it.
As you know, ILPv1 design had always sat badly with me, hence the many long debates about the right "layers" to carry the different ILP data elements. We made ILPv1 "look" like an interoperability layer but then made a lot of compromises when it came to the design. We couldn't adhere to proper encapsulation because it was impossible to implement a connector if we did. Data that we needed to inspect in both the sending and receiving ledger components had to be pulled out of the ILP packet where it should always have been.
The analogy with the IP stack actually slowed us down in this case because we wanted the ILP Packet to be carried in the ledger layer in the same way that an IP packet is carried by network protocols. But network protocols have very different properties to payment protocols, they have no request/response semantics for one so there is no need for state in the IP modules at each node, but critically they have very low latency. The delivery of an IP packet is only as fast as the networks it travels on, and in ILPv1 that was the same. For many use cases that was a problem. So to accommodate our request/response semantic and improve latency we needed to add a layer to the stack.
What is interesting is that we had already used ILPv4 when we used "dial-up ILP" to create virtual, conditional-payments aware, connections between connectors that had slow ledgers between them or ledgers that didn't support conditional payments. ILPv4 is just a realization that overlaying a new messaging layer on top of the ledger layer should be the norm, not the exception. In effect, ILPv4 is a network of connectors using only ILP-virtual and we have stopped trying to use other ledgers on the basis that they are so slow.
But can you use ILPv1 in an ILPv4 payment?
Yes (kind of). Two connectors absolutely can choose to use a ledger between them that supports conditional payments and only exchange ILP packets if the exchange is underwritten in that ledger using the same condition. But, that would be a bilateral decision with trade-offs.
Example:
where:
One of the trade-offs is that this link is much slower than simply passing the ILP Packet. For any sender that has low timeout requirements routes through
Connector A
andConnector B
are simply not viable.However, I think that this reduced trust requirement could allow for lower costs per payment, so in a use case where the amounts are larger and the sender is happy to use larger timeouts a route through
Connector A
andConnector B
may be the best route.Also, we shouldn't assume there won't be connectors whose business model requires them to hold trust-less accounts with their peers.
Some of the use cases we are exploring like micro-payments may not be viable over this route but others like Web Payments may be. Remember that for most retail payment networks the accepted user experience is payment that complete in the tens of seconds not milliseconds.
What I love about ILv4 is it doesn't preclude this scenario, it leaves it up to the emergent properties of the network to determine if this will be viable or not. We don't have to decide as the protocol designers, we've done the right thing by allowing options without compromising on interoperability.
I feel the same about payment size..
Is ILPv4 designed for small payments?
No. ILPv4 has absolutely no opinion on payment size. In my opinion, everyone who says it does has PSKv2 and their assumed usage of Ledger API v2 in the back of their minds. Happy to be proven wrong but that's my view.
Based on the use cases we are looking at, and our predictions around the emergent properties of the network, we have made assumptions about the maximum amount of liquidity that we believe connectors will make available per payment, and have optimized our transport layer design around those assumptions.
This has allowed us to design a very efficient transport protocol (PSKv2) that can discard the complexities of quoting along a route with possibly variable rates at different amounts. This was only possible after we accepted that quoting doesn't belong in the ILP protocol, it belongs in the transport protocol. (I still think there may be elements of ILQP that are useful for alternative transport protocols but they are not useful in PSKv2)
But, the PSKv2 design has trade-offs like uncertainty around exact delivery amounts (i.e. the ability to deliver an exact amount and transparency around the required send amount before making the payment).
I believe there is room for exploration around the use cases that can't live with that tradeoff, and the design of an alternative transport protocol that attempts to deliver exact amounts and provide the sender with an up-front quote before sending.
If we think our of the box there are a lot of ways of achieving this that don't just involve end-to-end quotes and forcing all connectors on a route to honor their quotes.
Example 1:
There are whole industries that exist to deal with certainty (and hedging). Perhaps the answer is not a new transport protocol but a way for an ILSP to offer the sender a guarantee that they will deliver the exact amount to the receiver and in the background they hedge against the risks of not being able to do that. In return the sender pays a small premium (included in the quote from the ILSP), but they get the desired user experience.
Example 2:
A third-party service can index the liquidity and rates at all of the connectors it knows and provide quoting as a service. Senders will ask this service how much they need to pay and to what initial connector. The SLA with the service will give the sender the certainty and transparency they need.
Zero-risk on a widely distributed system like Interledger will always come at a price. It's either in the form of "insurance" from a third-party, or time in the form of slow ledgers that offer atomicity for the executing of the payment. Even in ILPv1 there is not zero-risk, connectors still need to charge some spread to deal with the possibility they can't deliver a fulfillment and are left out of pocket.
TL:DR;
I believe we have a tendency to say things about ILP that are not factual but rather opinion based on the use cases we are focused on or the implementations we have built so far. There are no normative requirements in ILPv4 to send small amounts Nor is there a normative requirement to forward ILP Packets without a guarantee of payment from the peer that sent the packet.
This "guarantee" could be in the form of pre-payment from the sender or an, already prepared, conditional payment using the same condition and timeouts prepared in favor of the receiving connector (as described with XRP Ledger above).
ILPv1 is not an inter-networking protocol, despite trying to be one through use of the global ILP address space, but it does define some useful standards for conditional payments that, when used with ILPv4, can add additional guarantees at each hop where they are used and allow connectors to use a mutually trusted ledger instead of trusting each other directly.
If that is employed on all hops you have an ILPv1-like route using ILPv4.
Most importantly, I don't think we need to change ILP to solve the challenges that are not currently addressed in PSKv2.
Just as TCP has dominated the Internet as the preferred transport protocol for years, PSKv2 may dominate on the Interledger. But, the recent move toward new protocols built on UDP, suggests the same may happen with ILP and PSKv2 as the network looks for features that PSKv2 can't offer.
We have limited bandwidth and can't solve every use case. I agree with @justmoon that we should stay focused on ILPv4 as it is now and PSKv2 or similar transports with a view to doing something quite revolutionary.
That said, we should encourage exploration of other transport protocols to solve for different use cases and as I mentioned the other day I think there is a path to doing that requires minimal resources from our team.