Interledger Protocol (ILP)

Usman Iqbal
5 min readFeb 12, 2019

--

Interledger is an open source protocol developed by the W3C Interledger Community Group. ILP is used to connect two or more different ledgers. It enables secure payment transfer between two ledgers. E.g if you want to pay in bitcoin and at the same time you want that the receiver should get US dollars , you can simply connect the bitcoin ledger and a bank ledger to make such a transaction. How this transaction will be processed?

The transaction will be processed with the help of connectors. Anyone having account on both ledgers will be a connector.

image credits: https://cdn-images-1.medium.com/max/1000/1*64mmXFvFLreLgWD2uZitgQ.png

In simple words, connector has account on bitcoin ledger and ethereum ledger. Sender pays the BTC to connector and connector pays the ETH to receiver. But how to make sure that funds will be transferred securely and connector will not steal the BTC. Here comes the part of ILP which provides a cryptographic escrow to hold funds.

Processing of payment through ILP takes 3 steps to be done succesfully.

Proposal Phase

In propose phase, sender notifies the connector for upcoming payment. Upon receiving the proposal, connector will accept the proposal of payment if he has no issue with exchange rate, its charge fee (will be given to connector for successful Tx), and record the transaction details. At this phase nothing will be change or recorded on ledger. If connector accepts the proposal next phase will be processed.

Here Alice wants to send 0.028 BTC to Bob but Bob wants the payout in USD. Chaloe will act as a connector.

Preparation Phase

In preparation phase, the sender prepares the transfer to connector at BTC ledger which means amount is held in cryptographic escrow (provided by ILP). After that sender request the connector to prepare the transaction at bank ledger. This transaction is also held in cryptographic escrow.

Execution Phase

In execution phase, the receiver submits the signature to the ledger if connector has escrowed his funds and requests to execute the funds. The funds are then transferred to receiver account. Now Bob has received 100 USD but chaloe did not get 0.028 BTC. So the connector has strong incentive to pass signature that he has paid the money but has not yet been paid. After that, funds from cryptographic escrow is released to connectors.

Modes in ILP

If no such connector exists who can convert the BTC to USD, you can have multiple connectors for conversion. E.g connector 1 can convert BTC to ETH and connector 2 can convert ETH to USD.

Atomic mode and universal mode are two modes in ILP to process payment with multiple connectors.

Atomic Mode

image credits: ILP white paper https://interledger.org/interledger.pdf

Firstly sender and receiver has to find out the path (connectors) between them. All the participants including connector agree on selected notaries. Notaries serve as source of truth regarding success and failure of payment. Each connector p(i) has an account on ledger l(i-1) (sender ledger) and l(i) (receiver ledger).

Execution Process

Sender propose the transaction to all connector. If all connectors accept the transaction, sender p(i) prepared the transaction, funds are being escrowed and then sender p(i) requests the connector p(i+1) to prepare the transaction to escrow his funds. This process of preparing a transaction is executed till last connector. When last connector prepared the transaction, receiver will ensure that funds of last connector have escrowed by submitting signature to the notaries. If all notaries agree that the signature was received in time, they submit the signature and a signed D_Execute message to all participants P except sender. Each participant submits the signature and D_Execute message to p(i−1) to execute payment and claim the funds they are due. When participant received payment, it notifies the participant p(i-1) about the payment execution.

Universal Mode

image credits: ILP white paper https://interledger.org/interledger.pdf

Firstly sender and receiver has to find out the path (connectors) between them. Each connector p(i) has an account in ledger l(i-1) (sender ledger) and l(i) (receiver ledger).

Execution Process

In Universal mode, there are no notaries. Instead of having a global timeout (in atomic mode), each transfer has its own expiration time enforced by the ledger l(i) . After the last connector prepared the transfer ,receiver will ensure that funds of last connector have escrowed by submitting signature directly to their ledger l(n−1). If it is before the transfer’s expiration time, transfer will be executed immediately from escrow to receiver account. Once transfer is executed and the recipient is paid, connector p(n−1) has a very strong incentive to pass the signature back to ledger l(n−2), as they have paid out money but have not yet been paid. When each connector learns of the execution of the transfer, they must get the signature from l(i) and submit it to l( i−1) to claim the money waiting in escrow for them. Thus, the transfers are executed in “backwards” order, from the recipient (n) to the sender p(1). Once the first transfer is executed, the sender p(1) can get the signature from their ledger l(1). If the last transfer times out before p(n) submits the signature, all transfers will expire and the escrowed funds will be returned to their originator.

Resource

https://interledger.org/interledger.pdf

--

--