Yesterday I posted a quiz on Twitter about routing payments across the Lightning Network.

The correct answer was “(A) 1 coin.” Below is an animation that shows the flow of money for one of the possible routing paths.

Alice can route one coin to Frank through Carol and Ella.

46% of the 700 poll respondents chose the correct answer.

To understand why “(A) 1 coin” is indeed the correct answer, let’s first go through the wrong answers.

Why the answer is not “4”

If I didn’t know a lot about the Lightning Network, I would have thought the answer was “(D) 4 coins.” Alice has 4 coins on her side of her richest channel, and I would imagine that she could send to Bob, who could forward them to David, who could deliver them to Frank.

But Lightning channels do not work that way. What is critical to understand is that the beads cannot leave their string. The total number of beads on any string must remain constant through the routing process. Beads can shift from side to side, but they cannot “hop” from one string to another.

13% of respondents chose this answer.

Although Alice can push her 4 coins to Bob, Bob cannot move them onto his string with David. Five coins must remain on the string between Alice and Bob.

Why the answer is not “3”

“Incoming liquidity” is a known problem in the Lightning Network that limits how much money a LN user can receive. A recent Coindesk article highlighted how this problem made it difficult for users to receive the Lightning Torch.

Note that Frank’s channel with David has a total of 6 coins, of which 3 are on David’s side. This means Frank’s incoming capacity from David is 3 coins (David could send at most 3 coins to Frank before his side is depleted).

However, “3 coins” is not the correct answer because it is not only Frank’s incoming capacity from David that matters, David’s incoming capacity from his channel partners matters too! As one respondent on Twitter observed, it appears that it might be possible for Alice to send three coins to Frank via Carol and David. He annotated the diagram to illustrate:

It initially appears that Frank may be able to receive 3 coins from Alice through Carol and David

However, this doesn’t work because the 3 coins in the channel between Carol and David are already on David’s side. In other words, David doesn’t have sufficient incoming capacity from Carol to route the three coins.

Another respondent on Twitter edited the figure to highlight the bottleneck:

Upon closer inspection, we see that this route fails as David’s 3-coin channel capacity with Carol is in the wrong direction. David does not have enough incoming capacity to accept the payment from Carol.

32% of respondents chose this answer.

Why the answer is not “2”

“(B) 2 coins” was the best “wrong” answer. It is theoretically possible for Alice to transmit 2 coins to Bob in a single payment, without violating the “beads cannot hop from string to string” rule. Alice could send a payment of 2 coins to Frank simultaneously over two parallel paths: 1 coin routed through Carol and Ella (see animation at the top of this post) and a second coin routed through Bob and David.

The reason this answer is not correct is because the Lightning V1.0 protocol (the one currently in use) does not support such “multipath” payments. Lightning V1.0 only supports routing along a single path.

There is a proposal to implement what has become known as Atomic Multipath Payments (AMP) in a future version of LN (V1.1). If AMP were supported, the correct answer would be “2 coins” rather than only 1.

9% of respondents chose this answer.

The answer is “1”

I hope it is now obvious to the reader why the answer is 1. The key to solving these problems is to remember that beads cannot hop from string to string.

Extra credit

Reddit user cryptocached posted an interesting follow-up question:

How can Carol manipulate the channel state so any payment sent to Alice must pass through her?

The answer is that Carol would route a payment of 1 coin back to herself through Bob and Alice. This will leave Alice with no incoming capacity from Bob. And thus all payments from Bob, David, Ella and Frank must pass through Carol. Because LN payments use onion routing, neither Bob nor Alice will know what Carol is up to.