Research: Maximizing privacy of the interledger protocol (ILP) via Tor-like onion routing circuits

By Tamer Sameeh · Originally published
From the archive: this story describes things as they stood when it was published.

The Interledger Protocol (ILP) is a network protocol that facilitates micropayments and settlements between different payment systems. Nevertheless, it leads to the unmasking of all transaction information including transaction amount, sender wallet address, and recipient wallet address.

A recently published research paper proposes an application layer, named ILP-CEPA, that operates on top of ILP in order to hide transaction information via Tor-style onion routing. ILP-CEPA operates without any alterations to Interledger’s basic protocol and requires no extra coordination between network nodes. Throughout this article, we will overview ILP-CEPA and how onion routing circuits are established.

What is the Interledger Protocol (ILP)?

ILP is a multi-hop network streaming protocol that facilitates micropayments and transactions between different ledgers. It sacrifices some security in order to enable lightweight settlements, oppositely to the Lightning Network.

Note: Even though ILP can be utilized in various payment systems beside cryptocurrency, for the purpose of testing the ILP-CEPA, we will just focus on its integration with ledgers of cryptocurrencies.

When a sender makes a payment to a receiver via the Interledger, the sender will communicate with the Interledger network, creating a payment channel with a connector, which is similar to routers of data packets over a network. Connectors are special forms of payment facilitators that assist in executing payments between a group of senders and receivers without having to create separate payment channels between each sender and receiver. Moreover, they enable atomic cryptocurrency swaps with predefined exchange rates.

Privacy issues arise due to the design of ILP’s packets within the STREAM protocol. Practically speaking, connectors are associated with large flow of small transaction amounts (micropayments) which are facilitated via STREAM. Connectors have access to datasets that are produced via means of packet analysis performed on connected payment peers. Within an Interledger data packet, the source address, the destination address, transaction amount, and expiration date can be visualized by intermediary connectors, whose main responsibility is to forward the transaction amount from the sender to the receiver. With this data, a connector knows the transaction’s sender and receiver. As such, there must be means for avoiding being victim to a revelation of network topology of ILP transactions which link payments to individuals.

System Design of ILP-CEPA:

The ILP-CEPA is designed as a layer that is implemented on top of ILP-STREAM. This guarantees that connectors can operate via ILP-CEPA without having to modify underlying ILP protocols.

The protocol selects a group of CEPA-compatible connectors and utilizes an onion circuit to establish a connection to the destination node. Each link within the onion-circuit represents a STREAM connection, that can be routed via ILP connectors as dictated by the Interledger Protocol.

Diagram of an ILP payment routed from source to destination through three onion routers

Figure (1): The ILP-CEPA circuit

Figure (1) illustrates the completed route. Messages routed to the destination are encrypted in an incremental manner via means of ephemeral symmetric keys which are associated with each of the CEPA-connectors.

Setting up the connector:

When a connector is launched, it instantiates a special server that monitors for incoming ILP-STREAM connectors. This server features an ILP payment address and a secret key that is created as part of the process of server instantiation. For a connector to establish a connection with this server, they require knowledge of the secret key, as well as the address. As per the basic Interledger protocol, this is handled out-of-band. In other words, the sender and receiver verbally exchange the wallet addresses they want to transact funds between. This is somewhat impractical when defining larger blockchains via means of onion routers, so all connectors have to broadcast their addresses as well as the secret keys of their STREAM to a publicly accessible directory service at the time of set-up.

Furthermore, each connector generates a private key and a public key via means of 1024-bit RSA, and then broadcasts the public key to the directory service. This asymmetric key is utilized throughout the key-exchange step to generate shared ephemeral keys. Since the basic Interledger protocol does not define a Public Key Infrastructure, ILP-CEPA will define its very own. In place of a new PKI, it would be theoretically possible to establish Simple Payment Setup Protocol (SPSP) connections between the transaction sender and each of the circuit’s onion routers and then run Diffie-Hellman key exchange over SPSP to set up shared keys. SPSP operates over HTTPS, so it utilizes the PKI of the internet. Nevertheless, this scheme would lead to leakage of an unordered list of the route’s onion routers, so the decision was to deploy a unique PKI instead. The ILP’s roadmap involves developing a custom-addressed based PKI during the upcoming year, so developers of this solution believe that their proposed approach would integrate well into that. The directory service records a key-value mapping between STREAM server’s ILP addresses on a tuple that includes their public key and shared key.

Setting up the client:

When a user (client) decides to send an onion routed transaction to a given destination address, the following steps will be executed:

1- The client will query the directory service for a list that includes all connectors with the CEPA protocol implemented.

2- The client will choose the number of hops on their onion routed circuit. By default, the circuit contains 3 hops, yet this can be increased, as desired by the client, to any number up to 10. The circuit should include at least 2 hops.

3- The client selects 3 or more onion routers from the list saved on the directory service. In ILP-CEPA’s basic implementation, the hops are chosen randomly. Nonetheless, since this takes place on the client side, clients are totally free to choose how to decide which onion routers will be used. For instance, they might have a list of friendly network nodes, identify certain nodes as malicious or untrustable, pick up geographically close nodes, nodes that offer the best exchange rates, etc.

Exchange of keys:

Before the sender (client) can generate the packet payload, they have to share keys with every onion router on the circuit. Generating paired keys with every onion router is more or less insecure, because it would require minimal resources for a passive adversarial observer to correlate flows of network traffic to identify the sender and the onion routers for a certain onion routed circuit. As such, keys are negotiated in an incremental manner via the onion routed circuit.

Setting up the connector and establishing the onion circuit:

Elliptic Curve Diffie-Hellman (ECDH) is the key exchange algorithm used for the solution, as it is relatively fast, requires no more than two messages across the network, and guarantees secrecy of the forwarding procedure.

To establish a new circuit, the client (let’s call him Adam) sends a request to create a message to the first node within the onion routed circuit (call it Judy). The payload of this request includes the first half of the ECDH key exchange handshake (gx) encrypted with Judy’s public key, which Adam obtains from the directory service. Judy will receive this message and calculate the shared secret (gxy) using a random key y. Judy will respond to Adam with a payload that includes gy. Via this, Adam can calculate the same shared secret K1. As such, Adam and Judy have generated a shared secret based on a symmetric key which they can use to encrypt messages exchanged between them.

To add another node to the circuit, Adam sends an extend message request to Judy asking her to extend the onion circuit to include a new connector (call her Tina). This message’s payload includes gx (with an x value different from that used when negotiating with Judy). This message will be encrypted using Tina’s public key, so that Judy does not know the value of the new x. The shared secret and Adam’s and Judy’s shared key will be used to encrypt the payload, as well as Tina’s ILP address, and then forwarded to Judy. Upon receipt, Judy decrypts the message, knows Tina’ ILP address, and routes the payload to her. Tina is capable of decrypting this payload via her asymmetric private key to calculate gx. Tina will generate a new y, calculating a secret key K2= gxy, which will serve as the ephemeral key used in the negotiation between Tina and Adam.

Tina sends an extend message request back to Judy, which includes gy. Judy will forward this message request back to Adam. The same way Judy was used to send the extend message request to Tina, Tina can be used to extend the onion routing circuit further, up to any number of connectors. The last connector within the circuit has to be the destination connector Adam wished to eventually connect to.

This handshake protocol is based on one-sided entity authentication (Adam recognizes that he is handshaking with the onion routing circuit, yet the onion routing circuit does not know who is opening the circuit. Adam does not use a public key and, thus, remains anonymous) and one-sided key authentication (Adam and the onion routing circuit agree on the same key, and Adam knows that only the onion routing circuit knows it). Because it utilizes Diffie Hellman, it also achieves key freshness and forward secrecy.

Tags: Privacy