Opening a Channel, Outbound Liquidity, Inbound Liquidity, and Payment Routing

This series aims to explore the market for liquidity that is rapidly emerging on bitcoin’s lightning network. In future parts I will cover more nuanced parts of the market like liquidity swaps, buying/selling and pricing liquidity, arbitrage opportunities, and more. But before we get there I need to catch everyone else up to speed, so for part 1 I’m just going to cover the basics: opening a channel, outbound liquidity, inbound liquidity, and payment routing.

To walk through these examples we are going to consider a fake company called “Cool App”, a custodial wallet app that supports lightning payments for their customers (definitely no relation to the very popular first public company to launch lightning and my former employer Cash App).

Opening a Channel and Inbound vs. Outbound Liquidity

The first thing Cool App needs to do is establish a connection to existing lightning nodes. They can do this simply by taking some of their bitcoin and “opening a channel”.

<aside> 💡 A channel is basically an escrow account that’s mutually controlled by the two members of the channel. Together they keep track of each other’s balances in the account, and either party can exit at any time without having to worry about getting cheated. Opening a channel requires one ”on-chain” bitcoin transaction, and exiting the channel requires another transaction. But while the channel is open the two parties can do as many payments back and forth as they want without having to use the blockchain. The payments can be instant and cheap because they don’t require using the slow and expensive blockchain, and the blockchain can be reserved for larger more important transactions.

</aside>

So Cool App finds Deezy (my node!) and puts one of their bitcoin into a channel.

Screen Shot 2022-10-10 at 6.45.04 PM.png

Some notes on the diagram above: notice how there is 1 BTC on Cool App’s side and 0 BTC on Deezy’s side. This is because Cool App provided all the funding for the channel, while Deezy hasn’t contributed anything yet. If either party wanted to exit the channel, they could do so right now and 1 BTC would just go back to Cool App, and 0 to Deezy.

Also notice the arrows. The arrows are pointing only in one direction, meaning funds can flow from Cool App to Deezy. Cool App now has what we call outbound liquidity, meaning they have the ability to send

<aside> 💡 outbound liquidity = ability to send

</aside>

Conversely, Deezy now has gained 1 bitcoin worth of inbound liquidity, meaning Deezy has the ability to receive

<aside> 💡 inbound liquidity = ability to receive

</aside>

So if we’re looking at just this channel, Cool App has 1 BTC of outbound liquidity and 0 BTC of inbound liquidity. This is great if Cool App only cares about the ability to send, but they’re gonna need to do more work if they want the ability to receive (more on that later). Conversely, Deezy has 1 BTC of inbound liquidity, but 0 BTC of outbound liquidity.

Sending