Photo by Clint Adair on Unsplash

Chat over your Payment Network with ILRC

Maya Sharafian
Interledger Blog
Published in
3 min readMay 30, 2018

--

Using Interledger, we’ve demonstrated a lot of things that you can do when a payment is as cheap as an HTTP call. Micropayments, streaming payments, and even traditional checkout experiences are all possible with this technology.

If you read Evan Schwartz’s recent post on STREAM, then you’ve seen how data can also be transmitted over the Interledger network. This opens up a whole new set of protocols where payments are fundamentally baked into the communication method.

In this tutorial, I’ll be showing off a protocol based on Interledger, called “Interledger Relay Chat” (ILRC).

Although ILRC is just an experiment, you can use the same techniques to create powerful applications on top of Interledger.

A conversation in ILRC

Prerequisites

What is ILRC?

ILRC is a chat protocol inspired by Internet Relay Chat (IRC). The primary difference is that chat messages go over Interledger instead of the Internet. This also means that messages can natively carry money in them, no matter what currency each participant is using.

ILRC is based on the STREAM transport protocol for Interledger. STREAM makes sure that the data you transmit over Interledger is encrypted and is not tampered with.

The STREAM connection between a user and the ILRC server is bootstrapped by an SPSP lookup over the Internet. This step would be unnecessary if you already had the ILRC server’s shared secret, or if you had some kind of PKI on top of Interledger.

Why does ILRC Matter?

It shows off the flexibility of the Interledger protocol. Experiments like ILRC help us push the limits of ILP and inform protocol design decisions before mainstream adoption happens.

Install an ILRC Client

ILRC is publicly available on Github. It’s also available on NPM. To install the ILRC client, run the following command:

npm install -g ilrc

Connect to an ILRC Server

I’ve set up an ILRC server running on the Interledger testnet, so that you can follow along with this blog post.

Start by running ilrc. Then type the following commands in:

  • /connect https://ilrc.ilp-test.com — This will make a STREAM connection by doing an SPSP lookup at https://ilrc.ilp-test.com. After this point, all data goes over ILP.
  • /nick <yourname> <yourpassword> — Reserves a nickname in the channel. The server doesn’t yet persist these, so it’s not a long-lived identifier.
  • <message> — Now you can send messages to the chat just by typing them in. In the current implementation, there’s just one global channel that everyone is in.
  • /pay <nick> <amount> — Sends an amount of money (denominated in sender’s units) to the user identified by that nick.

That’s really all there is to it!

Further Steps and Ideas

  • Try writing an ILRC chatbot that can do payment-enabled operations
  • Block ilrc.ilp-test.com in your /etc/hosts after the /connect step, to prove that these messages aren’t going over the internet.
  • Try running an ILRC server with ilrc-server. You could even run one on the live network

If you run into any problems or have any feedback, reach out in our Gitter!

--

--