WEBVTT - Automatic transcript; recognition may contain errors. Reviewed for technical wording and speaker labels. Times match the published episode.

00:00:08.880 --> 00:00:11.580
<v Aaron van Wirdum>Live from Utrecht, this is the Van Wirdum Sjorsnado.

00:00:11.820 --> 00:00:12.060
<v Sjors Provoost>Hello.

00:00:12.600 --> 00:00:13.060
<v Aaron van Wirdum>Hey Sjors.

00:00:13.220 --> 00:00:14.640
<v Sjors Provoost>I think we've got somebody else here.

00:00:15.020 --> 00:00:19.440
<v Aaron van Wirdum>We've got Joost Jager. Is that how Americans pronounce your name, Joost?

00:00:19.440 --> 00:00:23.580
<v Joost Jager>That's indeed how Americans pronounce my name. But the Dutch people say Joost

00:00:23.580 --> 00:00:24.120
<v Joost Jager>Jager.

00:00:24.280 --> 00:00:30.180
<v Aaron van Wirdum>Joost Jager is in the building. Joost, please introduce yourself

00:00:30.180 --> 00:00:31.560
<v Aaron van Wirdum>for our audience.

00:00:32.420 --> 00:00:37.800
<v Joost Jager>Yeah, I describe myself as a Lightning developer. I've been working at Lightning

00:00:37.800 --> 00:00:43.800
<v Joost Jager>Labs for a year or two and recently switched to Bottlepay. And I've got also my

00:00:43.800 --> 00:00:48.940
<v Joost Jager>own projects on the side, mostly contributing to the LND repository.

00:00:50.100 --> 00:00:55.860
<v Aaron van Wirdum>Right. And I think one of the topics that you've sort of... specialized

00:00:55.860 --> 00:00:59.600
<v Aaron van Wirdum>yourself in or become an expert in is Lightning routing is that correct?

00:00:59.600 --> 00:01:02.060
<v Joost Jager>Yeah that's correct I did a lot of work on that in the past.

00:01:02.060 --> 00:01:06.840
<v Aaron van Wirdum>Yeah, yeah, so Sjors, we did an episode on Lightning in the past.

00:01:06.840 --> 00:01:09.580
<v Sjors Provoost>We've done two episodes on Lightning in the past.

00:01:09.580 --> 00:01:13.900
<v Aaron van Wirdum>We've done some stuff on Lightning in the past and it's all been very…

00:01:15.450 --> 00:01:17.170
<v Aaron van Wirdum>Superficial? Is that a way to describe it?

00:01:17.210 --> 00:01:20.770
<v Sjors Provoost>I think so. So we explained Lightning at a high level, so we can listen to that

00:01:20.770 --> 00:01:24.250
<v Sjors Provoost>episode. And then there was another episode where we talked about RBF replaced by

00:01:24.250 --> 00:01:28.350
<v Sjors Provoost>fee and how it relates to some problems on Lightning. And that was very detailed,

00:01:28.410 --> 00:01:29.310
<v Sjors Provoost>but also very bad.

00:01:29.850 --> 00:01:34.610
<v Aaron van Wirdum>Suffice to say, we're not the biggest Lightning experts in the world. So when it

00:01:34.610 --> 00:01:39.770
<v Aaron van Wirdum>gets to sort of more in detail Lightning stuff, it gets pretty complicated for

00:01:39.770 --> 00:01:45.150
<v Aaron van Wirdum>us, at least pretty fast. So I'm very happy to have a real Lightning expert here

00:01:45.150 --> 00:01:46.710
<v Aaron van Wirdum>today Joost welcome,

00:01:46.710 --> 00:01:48.090
<v Joost Jager>Thanks for having me.

00:01:48.090 --> 00:01:52.630
<v Aaron van Wirdum>And we're hopefully going to so we're going we're going to get into Lightning

00:01:52.630 --> 00:01:58.310
<v Aaron van Wirdum>routing more in more detail and explain what it is what the challenges

00:01:58.310 --> 00:02:03.610
<v Aaron van Wirdum>are what you know what the direction of development is there

00:02:03.640 --> 00:02:08.600
<v Aaron van Wirdum>and really get into it for this episode. All right Sjors, are you ready?

00:02:08.600 --> 00:02:09.780
<v Sjors Provoost>I think I am.

00:02:10.780 --> 00:02:16.240
<v Aaron van Wirdum>All right, Joost, first of all, let's start with a very basic question, just for

00:02:16.240 --> 00:02:22.040
<v Aaron van Wirdum>maybe our new listeners, or just a very brief premise of what is Lightning and

00:02:22.040 --> 00:02:25.960
<v Aaron van Wirdum>what is routing, what are we going to be talking about here, in a very general

00:02:25.960 --> 00:02:26.420
<v Aaron van Wirdum>sense.

00:02:28.110 --> 00:02:30.310
<v Joost Jager>The question, what is Lightning? All right.

00:02:30.550 --> 00:02:32.510
<v Aaron van Wirdum>Yeah, just in a few sentences.

00:02:32.850 --> 00:02:38.470
<v Joost Jager>Okay, I'd say it like this. Bitcoin is awesome, but it has several downsides.

00:02:38.970 --> 00:02:44.430
<v Joost Jager>And Lightning is a technology built on top of Bitcoin to solve those. And then

00:02:44.430 --> 00:02:48.910
<v Joost Jager>we're talking mainly about the fees that you pay to execute a transaction and the

00:02:48.910 --> 00:02:50.870
<v Joost Jager>speed at which a transaction executes.

00:02:51.550 --> 00:02:57.230
<v Aaron van Wirdum>Yeah, it's a payment layer on top of Bitcoin that allows for instant transactions

00:02:57.230 --> 00:03:00.990
<v Aaron van Wirdum>that are also cheaper because not all of the transactions end up in the

00:03:00.990 --> 00:03:06.470
<v Aaron van Wirdum>blockchain. So then the next question would be, what is routing? What are we

00:03:06.470 --> 00:03:10.430
<v Aaron van Wirdum>going to talk about? Why is this a problem or a challenge or what is Lightning routing?

00:03:10.950 --> 00:03:16.790
<v Joost Jager>Yeah, so with regular Bitcoin, you can pay to anyone who gives you an

00:03:16.790 --> 00:03:20.310
<v Joost Jager>address without restrictions. It's a pretty direct

00:03:21.820 --> 00:03:26.680
<v Joost Jager>process, whereas with Lightning your payment needs to travel through channels and

00:03:26.680 --> 00:03:30.960
<v Joost Jager>there's only a limited number of channels so it isn't feasible for everyone to

00:03:30.960 --> 00:03:33.580
<v Joost Jager>have a channel with all the other people on on the globe.

00:03:33.580 --> 00:03:37.040
<v Sjors Provoost>And so maybe we can explain channels a little bit. So I could have a channel to

00:03:37.040 --> 00:03:41.460
<v Sjors Provoost>Aaron which basically allows me to send coins to Aaron and Aaron could have a

00:03:41.460 --> 00:03:46.910
<v Sjors Provoost>channel with you and then he could send coins to you But I can also send coins to

00:03:46.910 --> 00:03:49.860
<v Sjors Provoost>you directly through Aaron. [unclear]

00:03:48.910 --> 00:03:50.430
<v Aaron van Wirdum>So indirectly, yeah.

00:03:50.690 --> 00:03:54.690
<v Sjors Provoost>Yeah, indirectly, exactly. By basically sending it to Aaron first, and then he

00:03:54.690 --> 00:03:57.950
<v Sjors Provoost>forwards it to you in a bunch of ways that that's made safe.

00:03:58.210 --> 00:04:01.030
<v Joost Jager>Yeah, well, that's indeed why you need routing, because there's a limited number

00:04:01.030 --> 00:04:04.870
<v Joost Jager>of those channels. You need to find a path from yourself to the payment

00:04:04.870 --> 00:04:05.430
<v Joost Jager>destination.

00:04:06.890 --> 00:04:07.370
<v Joost Jager>Yeah.

00:04:07.730 --> 00:04:12.630
<v Aaron van Wirdum>Yeah, the general concept is similar to the six degrees of separation idea. where

00:04:12.630 --> 00:04:17.570
<v Aaron van Wirdum>you know everyone in the world through a couple of people only in the end, even

00:04:17.570 --> 00:04:22.810
<v Aaron van Wirdum>though there's billions of people in the world. The theory is that within just a

00:04:22.810 --> 00:04:26.570
<v Aaron van Wirdum>few people who know each other, you actually sort of know everyone. So that's the

00:04:26.570 --> 00:04:29.670
<v Aaron van Wirdum>concept that's being used here. The challenge is...

00:04:31.300 --> 00:04:35.520
<v Aaron van Wirdum>which channels in this case, which channels are you going to use to reach your

00:04:35.520 --> 00:04:39.280
<v Aaron van Wirdum>endpoint? And somehow you need to figure it out. You need to figure out the

00:04:39.280 --> 00:04:42.240
<v Aaron van Wirdum>routes to actually reach the person you want to pay, right?

00:04:42.420 --> 00:04:47.760
<v Joost Jager>Indeed, it's like a roadmap. So you know where you want to go. There's only a

00:04:47.760 --> 00:04:51.540
<v Joost Jager>limited number of roads that you can take. And you'd like to find the best

00:04:51.540 --> 00:04:57.430
<v Joost Jager>possible route to your destination based on... similar to if a car either

00:04:57.430 --> 00:05:01.070
<v Joost Jager>you want the fastest route or the shortest route I like different options and

00:05:01.070 --> 00:05:02.210
<v Joost Jager>this is also at play in Lightning

00:05:02.210 --> 00:05:05.370
<v Sjors Provoost>And this is why it's different from the rest of the internet because on the

00:05:05.370 --> 00:05:10.450
<v Sjors Provoost>internet you just say I want to go to this Google website and all your computer

00:05:10.450 --> 00:05:13.930
<v Sjors Provoost>has to do is send it to your router and then your router sends it to your

00:05:13.930 --> 00:05:17.330
<v Sjors Provoost>internet provider and your internet provider sends it onwards just like the

00:05:17.330 --> 00:05:21.970
<v Sjors Provoost>postal mail like you send it onwards and every hop knows where it where to go

00:05:21.970 --> 00:05:26.430
<v Sjors Provoost>next, they figured it out. But with Lightning, you have to decide in advance

00:05:26.430 --> 00:05:29.190
<v Sjors Provoost>exactly where it's going and which route it's going to take.

00:05:29.470 --> 00:05:33.210
<v Joost Jager>Yeah, that's right. In Lightning, the sender decides what route is going to be

00:05:33.210 --> 00:05:38.970
<v Joost Jager>taken exactly. And the reason for this is that Lightning has privacy properties

00:05:38.970 --> 00:05:43.850
<v Joost Jager>that allow intermediate nodes or that allow the sender to keep himself hidden

00:05:43.850 --> 00:05:48.570
<v Joost Jager>from intermediate nodes. So the intermediate hops, they don't see where...

00:05:50.030 --> 00:05:53.270
<v Joost Jager>the way the payment is going. Sorry, I'm explaining this.

00:05:53.290 --> 00:05:53.910
<v Aaron van Wirdum>Or where it came from.

00:05:54.010 --> 00:05:57.030
<v Joost Jager>Yeah, well, also not where it came from, but they also don't know where it's

00:05:57.030 --> 00:06:00.910
<v Joost Jager>going. And if every of those hops would find out the best path for themselves

00:06:00.910 --> 00:06:04.110
<v Joost Jager>towards the destination, it wouldn't be hidden what the destination is.

00:06:04.290 --> 00:06:08.990
<v Sjors Provoost>And to make an analogy to the real postal mail, like I could send Aaron a letter

00:06:08.990 --> 00:06:14.450
<v Sjors Provoost>and inside the envelope is another envelope that has Joost’s address on it.

00:06:14.750 --> 00:06:17.910
<v Sjors Provoost>And if you do that multiple steps, then, you know, when Aaron opens it, he only

00:06:17.910 --> 00:06:21.970
<v Sjors Provoost>knows it's going to Joost and he might know it comes from me. but not where it's

00:06:21.970 --> 00:06:25.910
<v Sjors Provoost>going ultimately. This is how the Onion Network works too.

00:06:26.110 --> 00:06:30.390
<v Aaron van Wirdum>Yeah, nor did I know that you were the first step. Like that could have been five

00:06:30.390 --> 00:06:30.950
<v Aaron van Wirdum>steps before.

00:06:30.970 --> 00:06:33.510
<v Sjors Provoost>Yeah, there could have been many, many envelopes outside of my envelope.

00:06:33.730 --> 00:06:36.370
<v Aaron van Wirdum>Right, yeah. And like I said, this is also how Tor works.

00:06:36.530 --> 00:06:39.290
<v Sjors Provoost>And you also have to pay all the postage in advance.

00:06:40.230 --> 00:06:44.310
<v Joost Jager>Yeah, that's a great analogy. And also the size of the envelope is always the

00:06:44.310 --> 00:06:48.500
<v Joost Jager>same in Lightning, so you can't even see how many smaller envelopes are in… still inside

00:06:48.500 --> 00:06:51.760
<v Sjors Provoost>So that's where it breaks down because with real envelopes you could put them on a scale.

00:06:51.760 --> 00:06:54.380
<v Joost Jager>Yeah that's where it breaks down indeed.

00:06:54.380 --> 00:06:57.980
<v Sjors Provoost>Yeah well actually yeah no yeah no there's no way to fix that.

00:06:57.980 --> 00:06:59.920
<v Aaron van Wirdum>Let's not get lost in the analogy.

00:06:59.920 --> 00:07:03.980
<v Sjors Provoost>I was thinking about how to how to put fake envelopes inside of it but you can't

00:07:03.980 --> 00:07:04.980
<v Sjors Provoost>really without opening it.

00:07:04.980 --> 00:07:09.470
<v Aaron van Wirdum>You want to get into it Sjors you want to get into the envelope game or?

00:07:09.470 --> 00:07:12.930
<v Sjors Provoost>Well if you did the envelope game then the way you would keep the weight the same

00:07:12.930 --> 00:07:18.530
<v Sjors Provoost>is I guess by replacing… opening it and putting a new envelope

00:07:18.530 --> 00:07:21.850
<v Sjors Provoost>in the innermost envelope without reading it.

00:07:23.330 --> 00:07:28.490
<v Aaron van Wirdum>Could you put pockets of helium in it to sort of counteract the weight balance?

00:07:28.930 --> 00:07:32.070
<v Sjors Provoost>And then release the helium every time you ship it? I don't know.

00:07:32.420 --> 00:07:36.000
<v Joost Jager>But that's indeed what's happening in Lightning. Like extra bytes are padded at

00:07:36.000 --> 00:07:38.900
<v Joost Jager>the end of the packet to keep it of the same size all the time.

00:07:39.440 --> 00:07:41.340
<v Sjors Provoost>Right, so you have no idea where you are in the route.

00:07:41.460 --> 00:07:43.200
<v Joost Jager>Yeah, you don't know what hop you are.

00:07:43.520 --> 00:07:48.980
<v Aaron van Wirdum>Okay, so that's why the sender needs to figure out the whole route. That's why

00:07:48.980 --> 00:07:52.480
<v Aaron van Wirdum>we're getting into the whole envelope thing, just to point out that the sender

00:07:52.480 --> 00:07:57.050
<v Aaron van Wirdum>needs to figure out the whole route. So in order for the sender to do that... The

00:07:57.050 --> 00:07:59.550
<v Aaron van Wirdum>sender needs the map of the network, right?

00:07:59.750 --> 00:07:59.930
<v Joost Jager>Yes.

00:08:00.630 --> 00:08:02.450
<v Aaron van Wirdum>Does the sender need the entire map?

00:08:03.660 --> 00:08:07.260
<v Joost Jager>It doesn't need the entire map. It needs enough routes to find its destination.

00:08:07.520 --> 00:08:11.300
<v Joost Jager>But in practice, you will receive the entire map.

00:08:11.400 --> 00:08:14.460
<v Aaron van Wirdum>Right now, nodes use the entire map to figure out…

00:08:14.660 --> 00:08:19.520
<v Joost Jager>At least the visible part of it. Because there is also private channels, like say

00:08:19.520 --> 00:08:23.540
<v Joost Jager>private roads. They are not on the map, but you need to get that information from

00:08:23.540 --> 00:08:25.780
<v Joost Jager>a different source if you want to use those.

00:08:26.070 --> 00:08:29.690
<v Aaron van Wirdum>Yeah, and private channels can't be used for routing anyways. That's why they're

00:08:29.690 --> 00:08:30.430
<v Aaron van Wirdum>private, I guess.

00:08:30.470 --> 00:08:33.850
<v Joost Jager>You can route over private channels, but you still need to know where they are.

00:08:34.170 --> 00:08:34.610
<v Aaron van Wirdum>Okay.

00:08:34.710 --> 00:08:38.670
<v Joost Jager>So you can have a routing node that has only private channels and is routing for

00:08:38.670 --> 00:08:40.190
<v Joost Jager>users that know those.

00:08:40.370 --> 00:08:45.930
<v Sjors Provoost>So I guess the postal analogy here would be to say, dear postman, like when

00:08:45.930 --> 00:08:50.530
<v Sjors Provoost>you ask your friend, like, what's your address? You say, well, this is where I

00:08:50.530 --> 00:08:56.260
<v Sjors Provoost>live, but I'm... But the postal service doesn't really know my street

00:08:56.260 --> 00:09:00.340
<v Sjors Provoost>name. They only know the city I'm in. So here's what you need to tell the

00:09:00.340 --> 00:09:03.460
<v Sjors Provoost>postman, like how to get from the city to my street or something like that. It's

00:09:03.460 --> 00:09:07.080
<v Sjors Provoost>like a hidden instruction for the last [unclear]. Or maybe the analogy is like

00:09:07.080 --> 00:09:11.060
<v Sjors Provoost>use the mailbox on the left, not the mailbox on the right or something like that.

00:09:11.980 --> 00:09:16.100
<v Sjors Provoost>Maybe we should not do the analogy. In the Lightning Network, basically...

00:09:16.100 --> 00:09:21.520
<v Aaron van Wirdum>You need to be on the road outside of Hill Valley in 1955. Exactly.

00:09:21.900 --> 00:09:23.780
<v Aaron van Wirdum>This is a Back to the Future analogy.

00:09:24.020 --> 00:09:28.360
<v Sjors Provoost>Exactly. So in the actual Lightning Network, it's simpler, right? It's just that

00:09:28.360 --> 00:09:33.500
<v Sjors Provoost>some of the channels are not known. So if you're receiving, say, on a mobile

00:09:33.500 --> 00:09:39.440
<v Sjors Provoost>wallet, then what you do is when you make an invoice, you say, this is my

00:09:39.440 --> 00:09:44.520
<v Sjors Provoost>node. And by the way... I am connected to this publicly visible node through this

00:09:44.520 --> 00:09:48.080
<v Sjors Provoost>channel. So you have to use that at the end of your route, but the rest of the

00:09:48.080 --> 00:09:49.100
<v Sjors Provoost>route is up to you.

00:09:50.410 --> 00:09:55.390
<v Aaron van Wirdum>We're getting sidetracked. Let's just assume for convenience sake, I'm going to

00:09:55.390 --> 00:09:59.850
<v Aaron van Wirdum>assume for convenience sake that we're using public channels. So in that case,

00:10:00.010 --> 00:10:03.530
<v Aaron van Wirdum>your node needs to know the entire map of the network of all the public channels.

00:10:03.770 --> 00:10:07.830
<v Aaron van Wirdum>So how does your node, I'm running in the Lightning node, how does my node get

00:10:07.830 --> 00:10:11.810
<v Aaron van Wirdum>all of this public channels? How does my node know where all of the public

00:10:11.810 --> 00:10:12.350
<v Aaron van Wirdum>channels are?

00:10:12.570 --> 00:10:16.630
<v Joost Jager>Yeah, so your node is connected to a few other nodes. And those few other nodes

00:10:16.630 --> 00:10:20.070
<v Joost Jager>are also connected to a few other nodes. And through that, a whole network is

00:10:20.070 --> 00:10:24.610
<v Joost Jager>created. And on that network, gossip is being passed around. So if there's one

00:10:24.610 --> 00:10:29.690
<v Joost Jager>node who knows about the public channel, they gossiped this to their neighbors.

00:10:30.030 --> 00:10:31.890
<v Joost Jager>And those neighbors, they...

00:10:31.890 --> 00:10:36.730
<v Aaron van Wirdum>Gossip, just to be clear, is just sending messages. It's just sharing data.

00:10:36.850 --> 00:10:41.740
<v Joost Jager>Yeah, just sending messages indeed. Yeah. So it slowly propagates throughout the

00:10:41.740 --> 00:10:45.220
<v Joost Jager>network because they're all passing on the new information that they received

00:10:45.220 --> 00:10:45.800
<v Joost Jager>from their peers.

00:10:46.000 --> 00:10:51.020
<v Aaron van Wirdum>So every node basically shares with all of the nodes it connects to which

00:10:51.020 --> 00:10:55.260
<v Aaron van Wirdum>channels it has, And then the next node does that as well.

00:10:56.460 --> 00:11:00.320
<v Aaron van Wirdum>The information it got from the first node, and that's how all of the nodes end

00:11:00.320 --> 00:11:05.460
<v Aaron van Wirdum>up with knowledge of all of the channels and allows all nodes to construct a map

00:11:05.460 --> 00:11:06.880
<v Aaron van Wirdum>of the entire network. Is this correct?

00:11:07.140 --> 00:11:10.520
<v Joost Jager>Yeah, they share the information that they have with their peers indeed. And in

00:11:10.520 --> 00:11:13.920
<v Joost Jager>the end, everybody has the same copy, roughly the same copy of the network.

00:11:14.120 --> 00:11:19.740
<v Aaron van Wirdum>So what is the information that's being shared exactly? What information

00:11:19.740 --> 00:11:23.600
<v Aaron van Wirdum>about these channels is being... Is it just the information that the channels

00:11:23.600 --> 00:11:25.900
<v Aaron van Wirdum>exist? Or is there more that's being shared?

00:11:26.300 --> 00:11:31.320
<v Joost Jager>Yeah, so most important are the endpoints of the channel. So between which nodes

00:11:31.320 --> 00:11:36.560
<v Joost Jager>the channel lives. Another important one is the size of the channel. So you can

00:11:36.560 --> 00:11:40.580
<v Joost Jager>use this to decide whether this channel is big enough to carry the payment that

00:11:40.580 --> 00:11:43.760
<v Joost Jager>you want to send. So if you have a large payment, you can skip all the small

00:11:43.760 --> 00:11:47.380
<v Joost Jager>channels. You don't need to evaluate those because they won't be able to carry it anyway.

00:11:49.760 --> 00:11:52.420
<v Joost Jager>There's also a pointer to the...

00:11:53.740 --> 00:11:59.400
<v Joost Jager>the the output on chain so you can verify on the chain that this

00:11:59.400 --> 00:12:00.820
<v Joost Jager>channel actually exists

00:12:00.820 --> 00:12:02.840
<v Aaron van Wirdum>and and the size of it as well I guess

00:12:02.840 --> 00:12:07.120
<v Joost Jager>yeah you can also observe the size from there. yeah yeah um so this is very

00:12:07.120 --> 00:12:09.340
<v Joost Jager>important to prevent spam on the network.

00:12:09.340 --> 00:12:14.800
<v Aaron van Wirdum>Yeah the size in this context of course mean number of satoshi or number of coins

00:12:14.800 --> 00:12:15.340
<v Aaron van Wirdum>in the channel.

00:12:15.340 --> 00:12:20.660
<v Joost Jager>yeah the capacity of the channel. yeah so the maximum size that it can relay um

00:12:20.660 --> 00:12:26.430
<v Joost Jager>so that's there. And there's also the forwarding policy for that

00:12:26.430 --> 00:12:30.750
<v Joost Jager>channel. So if nodes advertise a channel that can be used for routing other

00:12:30.750 --> 00:12:36.650
<v Joost Jager>payments, those nodes, they charge a fee for that. And the fee is also advertised

00:12:36.650 --> 00:12:38.570
<v Joost Jager>in this peer-to-peer network.

00:12:39.030 --> 00:12:44.290
<v Aaron van Wirdum>Right. So if my node is mapping the entire network, it

00:12:44.290 --> 00:12:49.470
<v Aaron van Wirdum>knows… where all which channels exist or at least which public channels exist it

00:12:49.470 --> 00:12:54.370
<v Aaron van Wirdum>knows how many satoshis or how many coins are in each channels it knows how much

00:12:54.370 --> 00:12:58.230
<v Aaron van Wirdum>it's going to cost me to route through that channel But it does not, for example,

00:12:58.470 --> 00:13:04.030
<v Aaron van Wirdum>know for each channel where the balance is because the balance can be on either

00:13:04.030 --> 00:13:04.990
<v Aaron van Wirdum>side of the channel, right?

00:13:05.190 --> 00:13:05.370
<v Joost Jager>Yeah.

00:13:05.470 --> 00:13:09.470
<v Aaron van Wirdum>So that's not communicated. That's not part of the map that my node has. Is that correct?

00:13:09.830 --> 00:13:10.870
<v Joost Jager>That's right. Yes.

00:13:11.110 --> 00:13:15.430
<v Aaron van Wirdum>So that sounds like that could be a challenge when we actually start routing

00:13:15.430 --> 00:13:19.730
<v Aaron van Wirdum>because it actually does matter. how the balances are divided over the different

00:13:19.730 --> 00:13:20.330
<v Aaron van Wirdum>channels, right?

00:13:20.510 --> 00:13:23.750
<v Joost Jager>That's right. If you start routing and you've picked your route, you've picked

00:13:23.750 --> 00:13:27.110
<v Joost Jager>your channels, it could turn out that one of those channels doesn't have the

00:13:27.110 --> 00:13:29.710
<v Joost Jager>balance on the right side and then your payment fails.

00:13:29.990 --> 00:13:35.990
<v Aaron van Wirdum>Right. So how does my node calculate the best route? How does my node deal with

00:13:35.990 --> 00:13:36.810
<v Aaron van Wirdum>something like that?

00:13:36.950 --> 00:13:42.630
<v Joost Jager>Yeah. So you can look at this in different ways. But one

00:13:42.630 --> 00:13:47.730
<v Joost Jager>way a node can implement this is that it assumes channels to be in balance

00:13:47.730 --> 00:13:53.470
<v Joost Jager>always. So let's say if there's a channel that has one BTC. we will accept that

00:13:53.470 --> 00:13:57.790
<v Joost Jager>it might be a little bit unbalanced, but not too much. So for example, you could

00:13:57.790 --> 00:14:03.750
<v Joost Jager>say a one BTC channel should at least be able to carry a payment of 0.2 BTC,

00:14:04.650 --> 00:14:08.590
<v Joost Jager>for example, because it's not reasonable to expect from a one BTC channel that

00:14:08.590 --> 00:14:10.470
<v Joost Jager>it's always able to carry one BTC.

00:14:12.590 --> 00:14:18.570
<v Joost Jager>So if you assume that good routing nodes keep their channels balanced and that

00:14:18.570 --> 00:14:24.570
<v Joost Jager>they let payments through those channels and it doesn't happen, then you can

00:14:24.570 --> 00:14:28.230
<v Joost Jager>take note of that as a node and avoid this channel the next time.

00:14:28.550 --> 00:14:34.370
<v Aaron van Wirdum>Right. Taking one small step back, so we're now getting into sort of

00:14:34.370 --> 00:14:38.510
<v Aaron van Wirdum>pathfinding. I guess that's the technically correct term, right?

00:14:38.650 --> 00:14:38.850
<v Joost Jager>Yes.

00:14:39.250 --> 00:14:43.290
<v Aaron van Wirdum>And pathfinding, we already mentioned that this is something that a node itself

00:14:43.290 --> 00:14:49.010
<v Aaron van Wirdum>figures out. The paying node essentially figures this out. This isn't like

00:14:49.010 --> 00:14:53.550
<v Aaron van Wirdum>a... protocol thing right this is something that individual nodes can do however

00:14:53.550 --> 00:14:59.070
<v Aaron van Wirdum>they please essentially and and is there a difference between different Lightning

00:14:59.070 --> 00:15:03.830
<v Aaron van Wirdum>implementations how they do this or is this more or less synchronized as far as you know?

00:15:03.830 --> 00:15:09.560
<v Joost Jager>Oh so the part that is synchronized is that uh it is optimized for cost. So

00:15:09.560 --> 00:15:14.080
<v Joost Jager>there's cheap channels, there's expensive channels, and all of these

00:15:14.080 --> 00:15:17.840
<v Joost Jager>implementations, they primarily look for the cheapest path to the destination.

00:15:18.160 --> 00:15:18.620
<v Aaron van Wirdum>Right.

00:15:18.780 --> 00:15:22.360
<v Joost Jager>But then between the node implementation, there's variation in other factors that

00:15:22.360 --> 00:15:23.940
<v Joost Jager>play into this as well.

00:15:24.160 --> 00:15:24.460
<v Aaron van Wirdum>Right.

00:15:24.860 --> 00:15:26.120
<v Joost Jager>Yeah, so one of those factors.

00:15:26.120 --> 00:15:30.600
<v Aaron van Wirdum>Yeah, let's get into these factors. That's an interesting point. Okay, so we want

00:15:30.600 --> 00:15:36.240
<v Aaron van Wirdum>to make a payment. We've mapped out the entire network. We know

00:15:36.240 --> 00:15:40.640
<v Aaron van Wirdum>which channels exist. We know what kind of fees they will charge if they forward

00:15:40.640 --> 00:15:46.300
<v Aaron van Wirdum>the payment. Now, there are obviously, or I mean, I guess in most cases, there

00:15:46.300 --> 00:15:50.170
<v Aaron van Wirdum>are going to be multiple potential paths yeah definitely in the same way that if

00:15:50.170 --> 00:15:53.250
<v Aaron van Wirdum>you're you know you're traveling from one city to another there are probably

00:15:53.250 --> 00:15:59.070
<v Aaron van Wirdum>multiple roads you could potentially take how do you decide on the actual

00:15:59.070 --> 00:16:02.430
<v Aaron van Wirdum>route that you're going to take? How does a Lightning node decide this?

00:16:02.570 --> 00:16:07.590
<v Joost Jager>Yes. So besides the cost factor, there is the time lock factor. So in Lightning,

00:16:07.870 --> 00:16:12.330
<v Joost Jager>it's quite technical, but if you send a payment in Lightning, there is a maximum

00:16:12.330 --> 00:16:17.070
<v Joost Jager>time that this payment can take to complete. And this is a pretty long time. It

00:16:17.070 --> 00:16:22.030
<v Joost Jager>could be like five days or even two weeks in some cases. So this is a parameter

00:16:22.030 --> 00:16:22.470
<v Joost Jager>normally…

00:16:23.130 --> 00:16:28.930
<v Aaron van Wirdum>So it takes long because every hub on the network can potentially wait

00:16:28.930 --> 00:16:31.990
<v Aaron van Wirdum>for a little while before forwarding. Is that the reason?

00:16:32.110 --> 00:16:37.450
<v Joost Jager>So in the happy flow, it's near instant. But in the worst case, a node can sit on

00:16:37.450 --> 00:16:43.190
<v Joost Jager>that payment and not do anything. And then you have to wait until that ultimate

00:16:43.190 --> 00:16:45.570
<v Joost Jager>time lock that you attach to a payment.

00:16:46.850 --> 00:16:50.010
<v Aaron van Wirdum>Until that expires, until you can sort of take the money back, right?

00:16:50.250 --> 00:16:55.210
<v Joost Jager>Yeah, so you can take the money back. And usually you don't see or hear anything

00:16:55.210 --> 00:16:59.890
<v Joost Jager>of this, but only in a rare case that a node indeed does this, you see your money

00:16:59.890 --> 00:17:05.530
<v Joost Jager>locked up for a long time. And if you've got two routes with identical costs,

00:17:05.750 --> 00:17:10.470
<v Joost Jager>while one node only requires you to lock up the money for a maximum of one day

00:17:10.470 --> 00:17:14.110
<v Joost Jager>and the other seven days, we prefer the one-day option.

00:17:14.540 --> 00:17:18.700
<v Aaron van Wirdum>Right, because in the worst case scenario, you'll get your money back faster.

00:17:19.000 --> 00:17:19.160
<v Joost Jager>Yes.

00:17:19.830 --> 00:17:25.770
<v Aaron van Wirdum>So you're making a calculation based on fees, based on time. And

00:17:25.770 --> 00:17:26.590
<v Aaron van Wirdum>was there another factor?

00:17:26.690 --> 00:17:31.310
<v Joost Jager>Yeah, there's another factor, which is reliability. And this ties into the thing

00:17:31.310 --> 00:17:35.930
<v Joost Jager>that we just talked about, where we keep track of the performance of nodes. And

00:17:35.930 --> 00:17:40.210
<v Joost Jager>if certain channels don't perform well, we try to avoid them.

00:17:41.320 --> 00:17:46.200
<v Sjors Provoost>And by not performing well, you mean they previously? Either didn't have enough

00:17:46.200 --> 00:17:50.460
<v Sjors Provoost>capacity, so they immediately said, hey, I'm sorry, I can't actually do this for

00:17:50.460 --> 00:17:52.720
<v Sjors Provoost>you now. Or they timed out?

00:17:53.020 --> 00:17:55.780
<v Joost Jager>Yeah, so there are multiple things that can go wrong. Like one of the most common

00:17:55.780 --> 00:18:00.400
<v Joost Jager>things is that the balance is not sufficient in the channel, but it could also,

00:18:00.500 --> 00:18:05.200
<v Joost Jager>for example, be that a node is offline. That can also happen. So there is

00:18:05.200 --> 00:18:07.920
<v Joost Jager>balance, but the node is offline, so it still can't carry your payment. And

00:18:07.920 --> 00:18:13.680
<v Joost Jager>there's also a variety of more rare exceptions that we also use to

00:18:13.680 --> 00:18:16.140
<v Joost Jager>update those reputation scores of nodes.

00:18:16.550 --> 00:18:20.670
<v Sjors Provoost>Right. And one of the problems with that reputation, as we talked about this

00:18:20.670 --> 00:18:26.170
<v Sjors Provoost>before, so that's why I sound really smart, is that you don't know, you don't

00:18:26.170 --> 00:18:29.690
<v Sjors Provoost>necessarily know which node on the route screwed up, right?

00:18:30.140 --> 00:18:34.540
<v Aaron van Wirdum>Yeah, if a payment fails, you know that the payment fails. But in some cases, or

00:18:34.540 --> 00:18:39.320
<v Aaron van Wirdum>maybe even in all cases, you don't know where it failed exactly. Is that right?

00:18:39.600 --> 00:18:43.920
<v Joost Jager>You do know where it fails. Like a node sends you back an error message to the

00:18:43.920 --> 00:18:49.480
<v Joost Jager>sender, and it contains its identity, a signature. So the node, it signs the

00:18:49.480 --> 00:18:54.110
<v Joost Jager>error. So as a sender, you know where the error occurred, but it's still not

00:18:54.110 --> 00:18:57.810
<v Joost Jager>completely clear whether this node is actually also at fault. So it's actually

00:18:57.810 --> 00:19:02.970
<v Joost Jager>responsible for the error. So it could happen that node A sends a bad payment

00:19:02.970 --> 00:19:08.170
<v Joost Jager>request to node B, and then node B replies with an error message. But it's not

00:19:08.170 --> 00:19:12.250
<v Joost Jager>fair to penalize node B in that case, because it's node A that actually sent the

00:19:12.250 --> 00:19:15.910
<v Joost Jager>wrong request. So it's a little bit more complicated than...

00:19:15.910 --> 00:19:21.310
<v Aaron van Wirdum>So if you're neither A nor B, you're the one that made the payment, then you're

00:19:21.310 --> 00:19:22.610
<v Aaron van Wirdum>not sure if it was A or B?

00:19:22.830 --> 00:19:26.270
<v Joost Jager>Yeah, you're not sure whether it's A or B. So what the sender does in this case

00:19:26.270 --> 00:19:31.770
<v Joost Jager>is they penalize the pair of nodes. So they apply a penalty to the link between A and B.

00:19:33.100 --> 00:19:33.540
<v Aaron van Wirdum>Right.

00:19:33.800 --> 00:19:38.420
<v Sjors Provoost>So this can create guilt by association if you're an unlucky node next to a bad node.

00:19:38.560 --> 00:19:42.540
<v Joost Jager>Yeah, definitely. So you have to be very careful about which nodes you peer to

00:19:42.540 --> 00:19:45.240
<v Joost Jager>because they are also influencing your own reputation.

00:19:47.050 --> 00:19:52.990
<v Aaron van Wirdum>Okay, so I think you've now mentioned, so yeah, you're basically attaching

00:19:52.990 --> 00:19:58.830
<v Aaron van Wirdum>a score to nodes. Am I saying this right? So you've got a map of the network.

00:19:58.970 --> 00:20:04.690
<v Aaron van Wirdum>You know all of the channels. You know how much funds each channel has. You know

00:20:04.690 --> 00:20:10.290
<v Aaron van Wirdum>how much fees they charge. And now you're also applying a score to all

00:20:10.290 --> 00:20:16.140
<v Aaron van Wirdum>nodes on the network based on their performance. based on your request to

00:20:16.140 --> 00:20:18.200
<v Aaron van Wirdum>route through them. Is this right?

00:20:18.400 --> 00:20:22.560
<v Joost Jager>Yeah, well, not to nodes, but to node pairs. So we attach the score to [unclear]

00:20:22.560 --> 00:20:23.160
<v Joost Jager>node pairs.

00:20:24.640 --> 00:20:30.620
<v Aaron van Wirdum>They're always two pairs. So it doesn't get calculated into individual nodes in the end.

00:20:32.990 --> 00:20:37.230
<v Joost Jager>Yeah, you're right, it does get… it does get… so, like, at the basic level, we

00:20:37.230 --> 00:20:43.230
<v Joost Jager>assign penalties to pairs of nodes. But some nodes have a lot of peers. And

00:20:43.230 --> 00:20:47.910
<v Joost Jager>to prevent us from trying out all the combinations of that node with all its

00:20:47.910 --> 00:20:52.810
<v Joost Jager>peers, we also extrapolate the performance of a specific pair to the performance

00:20:52.810 --> 00:20:53.410
<v Joost Jager>of the node.

00:20:53.730 --> 00:20:57.250
<v Aaron van Wirdum>Right, yeah. So nodes have a specific score, essentially.

00:20:57.250 --> 00:20:58.190
<v Joost Jager>Yes, they have a score.

00:20:58.550 --> 00:21:02.450
<v Sjors Provoost>So I think there was another heuristic you talked about when we prepared this,

00:21:02.830 --> 00:21:07.750
<v Sjors Provoost>which is, I guess, never change a winning team would be a way to describe it. As

00:21:07.750 --> 00:21:13.570
<v Sjors Provoost>in, if you're looking for a route to pay and you found one that's been

00:21:13.570 --> 00:21:17.090
<v Sjors Provoost>used before and it worked really well, then you prefer that one rather than try

00:21:17.090 --> 00:21:17.630
<v Sjors Provoost>something new.

00:21:18.030 --> 00:21:23.960
<v Joost Jager>Yeah, now you're getting to the point… How is this reliability factored into

00:21:23.960 --> 00:21:29.180
<v Joost Jager>the pathfinding? So what's the weight of a reliable or unreliable node? And the

00:21:29.180 --> 00:21:34.760
<v Joost Jager>way this works, at least in LND, is that previously successful routes, they are

00:21:34.760 --> 00:21:40.000
<v Joost Jager>very much preferred until proven otherwise. So if a route is successful, it will

00:21:40.000 --> 00:21:44.560
<v Joost Jager>keep that label until it's proven otherwise, whereas a failure slowly decays

00:21:44.560 --> 00:21:48.420
<v Joost Jager>because if you would hold on to a failure forever, we would never give that node

00:21:48.420 --> 00:21:54.270
<v Joost Jager>another chance. So there's two different ways of dealing with a success versus a failure.

00:21:55.680 --> 00:21:56.300
<v Sjors Provoost>All right.

00:21:56.520 --> 00:22:01.280
<v Aaron van Wirdum>So if I'm understanding correctly, I think the way it essentially works is that

00:22:01.280 --> 00:22:07.260
<v Aaron van Wirdum>your node... has a map of network figures out what the cheapest

00:22:07.260 --> 00:22:12.300
<v Aaron van Wirdum>route is and by cheap cheapest actually factors in these other things so it

00:22:12.300 --> 00:22:17.880
<v Aaron van Wirdum>factors in the fees itself so that's sort of the most plain way of calculating

00:22:17.880 --> 00:22:23.580
<v Aaron van Wirdum>the cost but then it factors in the time locks which you mentioned and the

00:22:23.580 --> 00:22:28.900
<v Aaron van Wirdum>reliability as sort of cost factors and then based on all these three things

00:22:28.900 --> 00:22:34.490
<v Aaron van Wirdum>fees time and reliability, it figures out what sort of the real cheapest

00:22:34.490 --> 00:22:35.790
<v Aaron van Wirdum>route is. Is that right?

00:22:35.810 --> 00:22:40.450
<v Joost Jager>Yeah, I would call that the best route. So best is a little bit unqualified, but

00:22:40.450 --> 00:22:42.710
<v Joost Jager>it means a combination of those things that you mentioned, yes.

00:22:43.050 --> 00:22:48.890
<v Aaron van Wirdum>Right. And just to reiterate this, nodes on the network,

00:22:49.010 --> 00:22:53.430
<v Aaron van Wirdum>so my node makes this calculation, but Sjors’ node could make a different

00:22:53.430 --> 00:22:57.830
<v Aaron van Wirdum>calculation based on the past routing that Sjors has done and based on the past

00:22:57.830 --> 00:23:02.290
<v Aaron van Wirdum>routing that I have done, right? It's an individual calculation for all nodes on the network.

00:23:02.370 --> 00:23:06.430
<v Joost Jager>It is an individual calculation, and it's based indeed on the experiences that a

00:23:06.430 --> 00:23:10.590
<v Joost Jager>node has, but also on how you configure the node. So there's also room for the

00:23:10.590 --> 00:23:16.410
<v Joost Jager>user to decide what they think is important, whether they value cost over

00:23:16.410 --> 00:23:18.010
<v Joost Jager>reliability or the other way around.

00:23:19.800 --> 00:23:24.440
<v Joost Jager>So I've talked about an analogy with restaurants, for example. So if you have

00:23:24.440 --> 00:23:28.400
<v Joost Jager>been to a good restaurant, the question is, will you go to that every time again

00:23:28.400 --> 00:23:31.540
<v Joost Jager>the rest of your life? Or do you sometimes try a new restaurant? And between

00:23:31.540 --> 00:23:35.760
<v Joost Jager>people, there's a difference in how they find this balance. So some people want

00:23:35.760 --> 00:23:38.380
<v Joost Jager>to try something new all the time and have disappointments, and others, they

00:23:38.380 --> 00:23:41.760
<v Joost Jager>never try something new. And this is a parameter that you can also set on your

00:23:41.760 --> 00:23:42.280
<v Joost Jager>Lightning Node.

00:23:43.470 --> 00:23:44.470
<v Aaron van Wirdum>Right. Interesting.

00:23:46.420 --> 00:23:51.700
<v Aaron van Wirdum>So I I've written about Lightning uh type of stuff in the past

00:23:51.700 --> 00:23:56.320
<v Aaron van Wirdum>including routing at some point and I but I think it's been like probably two

00:23:56.320 --> 00:24:00.960
<v Aaron van Wirdum>years since I wrote about this back then the idea was because there was a lot of

00:24:00.960 --> 00:24:06.720
<v Aaron van Wirdum>um criticism I guess or a little concern or maybe concern trolling

00:24:06.720 --> 00:24:11.280
<v Aaron van Wirdum>whatever you want to call it about how these solutions don't really scale because

00:24:11.280 --> 00:24:16.340
<v Aaron van Wirdum>you know it does mean that every node needs to keep track of the entire network.

00:24:17.740 --> 00:24:23.540
<v Aaron van Wirdum>And at that point, the sort of answer to that concern

00:24:23.540 --> 00:24:29.320
<v Aaron van Wirdum>was, for now it works. For now this is scalable enough. For now all

00:24:29.320 --> 00:24:34.560
<v Aaron van Wirdum>nodes can keep track of this. And we'll now just keep track of how the network

00:24:34.560 --> 00:24:37.940
<v Aaron van Wirdum>develops because there's a lot of questions about that. Are we going to see a

00:24:37.940 --> 00:24:42.510
<v Aaron van Wirdum>network with a few power players that do most of the routing? Or are we going to

00:24:42.510 --> 00:24:45.550
<v Aaron van Wirdum>see a very decentralized network? But for now, we're just going to see how it

00:24:45.550 --> 00:24:51.350
<v Aaron van Wirdum>develops. And then we'll make our next decisions based on that. Is that

00:24:51.350 --> 00:24:56.170
<v Aaron van Wirdum>still sort of the status? Or are there other... Are there by now other ideas of

00:24:56.170 --> 00:24:59.030
<v Aaron van Wirdum>how to evolve this over time, how to develop this over time?

00:24:59.210 --> 00:25:03.690
<v Joost Jager>Yeah, so as far as I know, that's still more or less the status. They're just on

00:25:03.690 --> 00:25:08.270
<v Joost Jager>the part of the mobile nodes. There has been some developments in those areas.

00:25:09.490 --> 00:25:14.780
<v Joost Jager>Like a copy of the network is not that big for like a modern time computer; it's

00:25:14.780 --> 00:25:17.140
<v Joost Jager>very easy to keep track of what’s… what’s… what’s… there now.

00:25:17.400 --> 00:25:18.240
<v Aaron van Wirdum>For now, it's very doable.

00:25:18.500 --> 00:25:21.460
<v Joost Jager>Yeah, only for mobile nodes it's different. So you see that these mobile wallets,

00:25:21.540 --> 00:25:27.100
<v Joost Jager>they look for different solutions. So either they outsource the route finding

00:25:27.100 --> 00:25:32.580
<v Joost Jager>completely to a server or partially. And in the case of

00:25:32.580 --> 00:25:38.480
<v Joost Jager>partial outsourcing, they use trampoline nodes. So these are nodes on the network

00:25:38.480 --> 00:25:44.280
<v Joost Jager>that have a copy of... all the channels that exist, and you can delegate part of

00:25:44.280 --> 00:25:45.720
<v Joost Jager>your pathfinding to that node.

00:25:46.160 --> 00:25:52.120
<v Aaron van Wirdum>So how this works, I think, but do correct me if I'm wrong, is that

00:25:52.120 --> 00:25:57.800
<v Aaron van Wirdum>your mobile wallet, in this case, would find a route to a

00:25:57.800 --> 00:26:03.280
<v Aaron van Wirdum>special node, a trampoline node, which is, I guess, relatively close or something

00:26:03.280 --> 00:26:05.190
<v Aaron van Wirdum>like that. I'm speculating here.

00:26:05.430 --> 00:26:09.470
<v Sjors Provoost>It doesn't matter where it is. It's just that you might, as a note, decide to

00:26:09.470 --> 00:26:14.180
<v Sjors Provoost>only know the trampoline nodes. So as a mobile client, instead of downloading...

00:26:13.300 --> 00:26:16.340
<v Aaron van Wirdum>you just know much fewer nodes, right?

00:26:16.260 --> 00:26:20.820
<v Sjors Provoost>Yeah. So when you listen to the gossip, you might tell your peers, like, only

00:26:20.820 --> 00:26:22.500
<v Sjors Provoost>send me gossip about trampoline nodes.

00:26:22.620 --> 00:26:22.960
<v Aaron van Wirdum>Right.

00:26:23.140 --> 00:26:27.440
<v Sjors Provoost>And then that's a much smaller network. And then what you do is when you're

00:26:27.440 --> 00:26:32.240
<v Sjors Provoost>creating a route, you create a route to a trampoline node. And then you tell the

00:26:32.240 --> 00:26:35.960
<v Sjors Provoost>trampoline node, essentially, that's sort of the inner envelope, like, go to this

00:26:35.960 --> 00:26:36.760
<v Sjors Provoost>final destination.

00:26:38.170 --> 00:26:40.450
<v Aaron van Wirdum>The trampoline node figures it out from there.

00:26:40.630 --> 00:26:44.910
<v Sjors Provoost>Yeah, so you're compromising a bit on your privacy and on your ability to find

00:26:44.910 --> 00:26:50.240
<v Sjors Provoost>the cheapest route. But the upshot is that you don't have to know the map of the

00:26:50.240 --> 00:26:55.340
<v Sjors Provoost>entire network. And there's some intermediate solutions where you might

00:26:55.340 --> 00:27:00.500
<v Sjors Provoost>use multiple trampoline routes, nodes in your routes, so the trampoline nodes

00:27:00.500 --> 00:27:05.810
<v Sjors Provoost>also don't know everything about you. And there's other things you can do to

00:27:05.810 --> 00:27:10.030
<v Sjors Provoost>improve your privacy even a little bit more despite these trampoline nodes doing

00:27:10.030 --> 00:27:10.930
<v Sjors Provoost>some of the work for you.

00:27:11.310 --> 00:27:11.430
<v Aaron van Wirdum>Right.

00:27:11.730 --> 00:27:14.630
<v Sjors Provoost>So there's interesting trade-offs there. I don't think that's been totally

00:27:14.630 --> 00:27:19.470
<v Sjors Provoost>figured out because I guess mobile clients, you just have to use them in the

00:27:19.470 --> 00:27:20.750
<v Sjors Provoost>field and see how well they work.

00:27:22.470 --> 00:27:28.230
<v Aaron van Wirdum>Yeah. Another challenge I think is or was that a lot of channels probably...

00:27:28.980 --> 00:27:33.320
<v Aaron van Wirdum>Just because of network topology or something, a lot of channels are probably

00:27:33.320 --> 00:27:39.050
<v Aaron van Wirdum>mostly used in one direction. So sooner or later, they always

00:27:39.050 --> 00:27:43.880
<v Aaron van Wirdum>end up... depleted on one end and all of the funds on the other end at which

00:27:43.880 --> 00:27:47.900
<v Aaron van Wirdum>point they're no good for routing or at least you know not not anymore in that

00:27:47.900 --> 00:27:53.800
<v Aaron van Wirdum>direction is there any sort of solution is that a problem first of all and if so

00:27:53.800 --> 00:27:59.360
<v Aaron van Wirdum>is there a solution for [unclear] to sort of get a better balance or rebalance or

00:27:59.360 --> 00:28:01.180
<v Aaron van Wirdum>rebalancing strategies or…

00:28:02.400 --> 00:28:04.000
<v Aaron van Wirdum>in that context.

00:28:04.300 --> 00:28:08.900
<v Joost Jager>Yeah, so the way I see this is that, as I mentioned earlier, a node should keep

00:28:08.900 --> 00:28:14.580
<v Joost Jager>their channels available, like they should be available for routing. So if this

00:28:14.580 --> 00:28:19.180
<v Joost Jager>happens, if a channel ends up depleted on one side, the fix should be to open a

00:28:19.180 --> 00:28:23.320
<v Joost Jager>new channel so that apparently there is traffic in that direction. There's money

00:28:23.320 --> 00:28:24.700
<v Joost Jager>to be made in routing fees.

00:28:26.300 --> 00:28:30.560
<v Joost Jager>That pair of nodes should coordinate among themselves to open a fresh channel to

00:28:30.560 --> 00:28:32.080
<v Joost Jager>keep that link lively.

00:28:32.710 --> 00:28:38.510
<v Aaron van Wirdum>You think it's better to open a new channel rather than rebalance or

00:28:38.510 --> 00:28:41.730
<v Aaron van Wirdum>refund or whatever we want to call it, the existing channel?

00:28:42.030 --> 00:28:46.160
<v Joost Jager>Yeah, so... We need to define what's rebalanced and refund.

00:28:47.840 --> 00:28:52.060
<v Joost Jager>There's different ways to do it. So you can open a fresh channel. That's the

00:28:52.060 --> 00:28:57.460
<v Joost Jager>easiest way. You can also use a service like Loop, for example. So with Loop, and

00:28:57.460 --> 00:29:02.020
<v Joost Jager>there's also other providers that do the same thing, you can push money out

00:29:02.020 --> 00:29:06.800
<v Joost Jager>through a channel into an on-chain address. So you're basically loading money off

00:29:06.800 --> 00:29:10.960
<v Joost Jager>Lightning into an on-chain address, and this changes your balance so that you can

00:29:10.960 --> 00:29:15.740
<v Joost Jager>route more payments. But I'm always thinking, what does it cost in terms of chain

00:29:15.740 --> 00:29:21.180
<v Joost Jager>fees? If you do a loop, there's two chain transactions involved. If you do

00:29:21.180 --> 00:29:25.320
<v Joost Jager>open a channel and close a channel, it's also two chain transactions. So you have

00:29:25.320 --> 00:29:30.900
<v Joost Jager>to be careful. Is this really the best option for me if I can simply open a fresh

00:29:30.900 --> 00:29:34.180
<v Joost Jager>channel and that allows me to route more payments?

00:29:34.340 --> 00:29:38.800
<v Sjors Provoost>I guess one downside would be that because this reputation system you just

00:29:38.800 --> 00:29:43.580
<v Sjors Provoost>described is based on channels, not on nodes. Like if you open a fresh channel,

00:29:43.740 --> 00:29:47.480
<v Sjors Provoost>that doesn't have the great reputation of the previous channel. But I guess that

00:29:47.480 --> 00:29:48.060
<v Sjors Provoost>can be solved.

00:29:48.240 --> 00:29:50.160
<v Joost Jager>No, in LND, it's based on node pairs.

00:29:50.560 --> 00:29:51.980
<v Sjors Provoost>Oh, node pairs, not the channel name.

00:29:52.020 --> 00:29:56.660
<v Joost Jager>So it's the pair of node keys. So indeed, we thought about this. And this is

00:29:56.660 --> 00:29:59.340
<v Joost Jager>indeed to get around the problem that if you open fresh channels, you would lose

00:29:59.340 --> 00:30:00.920
<v Joost Jager>your reputation. So that's not the case.

00:30:01.380 --> 00:30:02.120
<v Sjors Provoost>Nice. Great.

00:30:03.630 --> 00:30:04.730
<v Sjors Provoost>Okay, then everything is solved.

00:30:06.830 --> 00:30:07.510
<v Aaron van Wirdum>Nice. Done.

00:30:08.570 --> 00:30:09.730
<v Sjors Provoost>I don't know. Did we have any?

00:30:10.010 --> 00:30:10.590
<v Joost Jager>We are close.

00:30:10.790 --> 00:30:10.970
<v Aaron van Wirdum>No.

00:30:13.510 --> 00:30:19.210
<v Aaron van Wirdum>Is everything solved, Joost? I guess that's actually a good question. Are we done?

00:30:19.630 --> 00:30:25.490
<v Joost Jager>I think on the routing side, we have very few problems. At the moment, payments

00:30:25.490 --> 00:30:31.430
<v Joost Jager>do succeed quite well. Only it's difficult to get a definitive answer

00:30:31.430 --> 00:30:35.350
<v Joost Jager>to that because everything is so private. You can't have a master view showing

00:30:35.350 --> 00:30:38.110
<v Joost Jager>you payment success rates across all of the network.

00:30:40.640 --> 00:30:44.780
<v Joost Jager>If there are problems, it's mostly at the upper end of the amount range. So if

00:30:44.780 --> 00:30:48.780
<v Joost Jager>you start to send larger payments, there are fewer channels that are available.

00:30:49.480 --> 00:30:53.780
<v Joost Jager>And yeah. So if you see failed payments, they're usually there. If you want to

00:30:53.780 --> 00:30:57.620
<v Joost Jager>send a one BTC payment, you need to find for channels that are able to carry

00:30:57.620 --> 00:31:01.600
<v Joost Jager>that. And there may not be that many. But the solution for that is, in my

00:31:01.600 --> 00:31:05.400
<v Joost Jager>opinion, just for the network to mature further, more of those bigger channels to

00:31:05.400 --> 00:31:05.880
<v Joost Jager>be opened.

00:31:07.620 --> 00:31:10.800
<v Sjors Provoost>Along with the multi-path solutions.

00:31:11.460 --> 00:31:15.080
<v Joost Jager>Yeah, that's another way to get around that, to send it to multiple smaller

00:31:15.080 --> 00:31:15.780
<v Joost Jager>shards. Yeah,

00:31:17.160 --> 00:31:22.820
<v Aaron van Wirdum>so before Sjors declared Lightning done, I think the idea here is

00:31:22.820 --> 00:31:28.400
<v Aaron van Wirdum>basically that, yeah, it's a thing that channels get depleted, but the solution

00:31:28.400 --> 00:31:34.060
<v Aaron van Wirdum>is simply that there is money to be made in offering.

00:31:35.520 --> 00:31:40.360
<v Aaron van Wirdum>non-depleted channels and you think these incentives will work itself out and

00:31:40.360 --> 00:31:44.520
<v Aaron van Wirdum>there were people willing to make money on offering these kinds of channels so

00:31:44.520 --> 00:31:49.340
<v Aaron van Wirdum>that's sort of the solution is incentives and economics. Yes. And you think this

00:31:49.340 --> 00:31:52.160
<v Aaron van Wirdum>aligns well enough for it to actually work itself out?

00:31:52.160 --> 00:31:52.760
<v Joost Jager>Yes.

00:31:52.760 --> 00:31:58.030
<v Sjors Provoost>So, that brought me to sort of a separate related point I guess let's say I have

00:31:58.030 --> 00:32:02.870
<v Sjors Provoost>a Lightning node and I started it many years ago and I have a bunch of channels

00:32:02.870 --> 00:32:08.870
<v Sjors Provoost>but I'm super lazy So the only thing I do is when I see that some of the channels

00:32:08.870 --> 00:32:13.800
<v Sjors Provoost>are closed, I just open another channel to somewhere. What's going to happen to

00:32:13.800 --> 00:32:17.380
<v Sjors Provoost>my node? Is it going to be left alone in the universe because it's not balanced

00:32:17.380 --> 00:32:20.240
<v Sjors Provoost>correctly? Because I'm not doing that because that's work.

00:32:20.860 --> 00:32:25.120
<v Joost Jager>Yeah, so if you're very lucky, you will get perfectly balanced traffic on your

00:32:25.120 --> 00:32:28.300
<v Joost Jager>node and you will keep getting free money forever.

00:32:28.620 --> 00:32:29.540
<v Sjors Provoost>I like that.

00:32:29.740 --> 00:32:30.580
<v Aaron van Wirdum>That sounds great.

00:32:31.510 --> 00:32:36.070
<v Joost Jager>But it's probably not going to be like that because what's the chance that your

00:32:36.070 --> 00:32:40.110
<v Joost Jager>traffic is exactly balanced? Probably not. So you will end up with depleted

00:32:40.110 --> 00:32:45.210
<v Joost Jager>channels and then you will need to open new ones to be able to keep routing or

00:32:45.210 --> 00:32:46.970
<v Joost Jager>other people need to open channels to you.

00:32:47.470 --> 00:32:52.390
<v Sjors Provoost>Right. And I guess, so on a related note, like if too much money is on one side,

00:32:52.950 --> 00:32:56.710
<v Sjors Provoost>you know, you might think, well, I opened the channel, so all the money is, you

00:32:56.710 --> 00:33:00.370
<v Sjors Provoost>know, on the other side. But, you know, whose problem is that? But of course, the

00:33:00.370 --> 00:33:04.530
<v Sjors Provoost>other side might want access to that money. So they might have an incentive to

00:33:04.530 --> 00:33:05.310
<v Sjors Provoost>close it.

00:33:06.080 --> 00:33:12.000
<v Joost Jager>Yes. So if from your node there's no economical destination to go

00:33:12.000 --> 00:33:16.520
<v Joost Jager>through, this channel towards you will also be useless. Like suppose you charge a

00:33:16.520 --> 00:33:20.540
<v Joost Jager>very high routing fee. Like nobody will pick your outgoing channels on their

00:33:20.540 --> 00:33:24.580
<v Joost Jager>routes, meaning your incoming channel is also not seeing any traffic. And if on

00:33:24.580 --> 00:33:28.340
<v Joost Jager>that incoming channel the balance is fully on the side of the other node, they

00:33:28.340 --> 00:33:33.180
<v Joost Jager>will basically have a useless channel with money locked up into it. So the

00:33:33.180 --> 00:33:34.800
<v Joost Jager>reasonable thing to do then is to close it.

00:33:35.150 --> 00:33:38.430
<v Sjors Provoost>Yeah, and I guess this problem is bigger for mobile wallets because mobile

00:33:38.430 --> 00:33:42.370
<v Sjors Provoost>wallets tend to be at the edge of the network. So if I have a mobile wallet and I

00:33:42.370 --> 00:33:47.190
<v Sjors Provoost>open a channel to Amazon and I'm buying a couple of things in Amazon, then

00:33:47.190 --> 00:33:50.970
<v Sjors Provoost>there's a whole bunch of money sitting on Amazon's side of that channel. But it

00:33:50.970 --> 00:33:55.770
<v Sjors Provoost>can go the other direction unless I also get my salary on the mobile phone

00:33:55.770 --> 00:34:00.340
<v Sjors Provoost>through Lightning in the other direction. So I guess what would you… how would

00:34:00.340 --> 00:34:00.880
<v Sjors Provoost>you solve that?

00:34:01.440 --> 00:34:04.780
<v Joost Jager>Yeah, that's a good question. It's not just mobile wallets, but probably any

00:34:04.780 --> 00:34:10.520
<v Joost Jager>end-user wallet that doesn't function as a routing node because

00:34:10.520 --> 00:34:14.660
<v Joost Jager>the policies or the connections or the sizes of the channels, they are not right

00:34:14.660 --> 00:34:20.440
<v Joost Jager>for being a routing node. If you have a channel, you open it

00:34:20.440 --> 00:34:24.880
<v Joost Jager>and you're only spending very slowly and you accumulate more money on the other

00:34:24.880 --> 00:34:30.870
<v Joost Jager>side. Yeah. How does it need to be compensated? So one idea could be that you

00:34:30.870 --> 00:34:36.230
<v Joost Jager>would actually need to pay for this. So to pay for the channel to stay alive.

00:34:37.090 --> 00:34:38.990
<v Sjors Provoost>Yeah, you're renting the channel.

00:34:39.170 --> 00:34:42.610
<v Joost Jager>Yeah, and if you look at Lightning Labs Pool service, for example, you're buying

00:34:42.610 --> 00:34:48.410
<v Joost Jager>a channel and the same thing is at play there because you get a guarantee

00:34:48.410 --> 00:34:52.750
<v Joost Jager>that the channel stays open for a bit. I think this is something that can be,

00:34:52.870 --> 00:34:57.550
<v Joost Jager>it's a parameter in the system. But after that, the other party is free to close

00:34:57.550 --> 00:35:01.690
<v Joost Jager>the channel again. So if you buy a channel... Let's say you buy a 10 BTC channel,

00:35:01.830 --> 00:35:05.370
<v Joost Jager>like extremely big channel, and nothing is happening on the channel. Like there's

00:35:05.370 --> 00:35:09.070
<v Joost Jager>a lot of money locked up there. So after the obligatory period that it needs to

00:35:09.070 --> 00:35:13.050
<v Joost Jager>remain open, the other party will probably close it because there's so much money in there.

00:35:14.840 --> 00:35:17.140
<v Sjors Provoost>Yeah. Okay. Aaron, you had a question?

00:35:18.610 --> 00:35:24.210
<v Aaron van Wirdum>No, I was just wondering, I mean, are there any solutions for lazy people like

00:35:24.210 --> 00:35:28.470
<v Aaron van Wirdum>Sjors to automate all of this stuff so we can actually be lazy and still make money?

00:35:28.630 --> 00:35:32.310
<v Sjors Provoost>Yeah, but I'm not just lazy, I'm also paranoid. So I don't want to run sort of

00:35:32.310 --> 00:35:34.710
<v Sjors Provoost>like autopilot like software.

00:35:36.230 --> 00:35:41.570
<v Aaron van Wirdum>Is there a solution for lazy and paranoid people like Sjors so they can make

00:35:41.570 --> 00:35:42.230
<v Aaron van Wirdum>money for free?

00:35:43.530 --> 00:35:45.070
<v Joost Jager>This is an impossible question.

00:35:45.250 --> 00:35:49.170
<v Sjors Provoost>I'm actually okay with not making money for free. What I would like the situation

00:35:49.170 --> 00:35:52.850
<v Sjors Provoost>to be is that the next time I want to make a Lightning payment, I still have peers.

00:35:53.650 --> 00:35:56.790
<v Joost Jager>Ah, right. So you don't want to earn any money, but just want to keep healthy

00:35:56.790 --> 00:35:57.950
<v Joost Jager>channels. That's what you want.

00:35:58.130 --> 00:36:01.130
<v Sjors Provoost>Yeah, pretty much. I want to have the ability to make payments when I feel like

00:36:01.130 --> 00:36:02.870
<v Sjors Provoost>it and to receive payments when I feel like it.

00:36:04.500 --> 00:36:08.480
<v Sjors Provoost>Yeah, but other than that, I don't care too much. But if I don't look at the node

00:36:08.480 --> 00:36:12.400
<v Sjors Provoost>for a year and I log into it again and it's disconnected, which, by the way,

00:36:12.440 --> 00:36:16.720
<v Sjors Provoost>hasn't happened so far. Usually some of these channels are very old, so it's fine.

00:36:17.100 --> 00:36:19.860
<v Joost Jager>Yeah, it's a very good question. How does it come to play out in the end? Because

00:36:19.860 --> 00:36:24.600
<v Joost Jager>if you have a channel and not all of it balances in your side, it is a cost to

00:36:24.600 --> 00:36:28.180
<v Joost Jager>the other party. And if you don't look at it for 10 years, it doesn't work out

00:36:28.180 --> 00:36:31.260
<v Joost Jager>for the channel to remain open for that long.

00:36:31.560 --> 00:36:33.360
<v Sjors Provoost>Unless, I guess, the other side also doesn't care.

00:36:33.770 --> 00:36:38.190
<v Joost Jager>Yeah, if nobody cares. But in the end, I think there is always people who care

00:36:38.190 --> 00:36:42.070
<v Joost Jager>because it's money. So they can also do something else with that. So I'd say that

00:36:42.070 --> 00:36:46.390
<v Joost Jager>it is unavoidable over time to make some kind of a payments in the channel to

00:36:46.390 --> 00:36:50.490
<v Joost Jager>keep it open, to pay for your checking account.

00:36:51.430 --> 00:36:55.630
<v Sjors Provoost>Right. I guess I would be okay with automation at the level of, you know, this

00:36:55.630 --> 00:36:57.770
<v Sjors Provoost>channel has a certain rent, so to speak.

00:36:59.670 --> 00:37:01.050
<v Sjors Provoost>Yeah, just not too much magic.

00:37:01.370 --> 00:37:05.590
<v Joost Jager>Yeah, and it could be based on the balance on the other side. So if you just open

00:37:05.590 --> 00:37:08.570
<v Joost Jager>the fresh channel, all the balance is still on your side. The rent will be very

00:37:08.570 --> 00:37:13.030
<v Joost Jager>low because your counterparty will have very few funds locked up into it at that point.

00:37:14.360 --> 00:37:20.060
<v Joost Jager>Whereas if you are a merchant and you expect lots of incoming payments, you

00:37:20.060 --> 00:37:24.880
<v Joost Jager>get a large channel from a routing node. Then initially in that channel, you will

00:37:24.880 --> 00:37:27.880
<v Joost Jager>probably need to pay a higher rent because there's still so much value at the

00:37:27.880 --> 00:37:32.460
<v Joost Jager>other side. And as you sell your goods and you're receiving money, the balance

00:37:32.460 --> 00:37:34.520
<v Joost Jager>will shift to your side and the rent can go down.

00:37:35.570 --> 00:37:36.010
<v Sjors Provoost>Okay.

00:37:36.870 --> 00:37:41.630
<v Aaron van Wirdum>All right. Joost, is there anything else our listeners need to know about routing

00:37:41.630 --> 00:37:43.890
<v Aaron van Wirdum>and pathfinding or do we cover everything?

00:37:46.010 --> 00:37:49.530
<v Joost Jager>I think one thing that's interesting to be aware of, especially if you are a

00:37:49.530 --> 00:37:53.410
<v Joost Jager>routing node, we already touched on that briefly, but I think it's still good to

00:37:53.410 --> 00:37:57.970
<v Joost Jager>say that at least LND as a sender tries to extrapolate…

00:38:02.460 --> 00:38:06.720
<v Joost Jager>the experiences that they have with some of your channels. So if you are a large

00:38:06.720 --> 00:38:10.720
<v Joost Jager>routing node and you have a lot of channels and a few of those channels are bad

00:38:10.720 --> 00:38:15.520
<v Joost Jager>and all the other ones are good, then it's good to be aware that if senders use

00:38:15.520 --> 00:38:20.100
<v Joost Jager>those bad channels, they may not also try all your good channels.

00:38:21.470 --> 00:38:25.890
<v Joost Jager>It's not that you just want to accept channels from anyone because accepting a

00:38:25.890 --> 00:38:30.130
<v Joost Jager>channel from a bad peer could lead to your node’s [unclear] being degraded, and

00:38:30.130 --> 00:38:33.910
<v Joost Jager>then your routing revenue going down and then there's no more free money.

00:38:34.430 --> 00:38:39.590
<v Aaron van Wirdum>Yeah, so it's a business that Sjors mentioned that guilt by association thing. So

00:38:39.590 --> 00:38:43.450
<v Aaron van Wirdum>that is something to be aware of, especially if you're in it for the money and

00:38:43.450 --> 00:38:45.090
<v Aaron van Wirdum>you want to make a profit by routing.

00:38:45.310 --> 00:38:49.590
<v Sjors Provoost>And quite strongly by association. So it's not just like... you know, you had

00:38:49.590 --> 00:38:55.270
<v Sjors Provoost>this guy on the podcast. No, no, no. It's like this guy tweeted about you and now

00:38:55.270 --> 00:38:58.290
<v Sjors Provoost>your reputation is soiled because somebody can make a connection.

00:38:59.470 --> 00:39:03.310
<v Aaron van Wirdum>A channel is still a bidirectional thing, right? You still need to agree to be

00:39:03.310 --> 00:39:04.170
<v Aaron van Wirdum>part of the channel.

00:39:04.450 --> 00:39:07.990
<v Sjors Provoost>Yeah, but it's automatic. If I open a channel to you, then by default, you're

00:39:07.990 --> 00:39:09.910
<v Sjors Provoost>just going to accept it within certain parameters.

00:39:10.190 --> 00:39:13.190
<v Joost Jager>By default, but this is something you can configure. You can create a channel

00:39:13.190 --> 00:39:18.810
<v Joost Jager>acceptor plugin where you screen your potential peers, but it's all not

00:39:19.050 --> 00:39:21.950
<v Joost Jager>out of the box, really, that that's going to happen. But the routing nodes are

00:39:21.950 --> 00:39:25.050
<v Joost Jager>not something that work out of the box. Well, they do work, but if you want to be

00:39:25.050 --> 00:39:26.910
<v Joost Jager>a good routing node, you need to do more than that.

00:39:28.100 --> 00:39:30.660
<v Aaron van Wirdum>Yeah, so it sounds like it's a job, Sjors. I'm sorry.

00:39:31.760 --> 00:39:34.800
<v Sjors Provoost>Yeah, well, we'll see how it goes. Okay, I think that's all we got, right?

00:39:35.100 --> 00:39:35.840
<v Aaron van Wirdum>I think so.

00:39:36.060 --> 00:39:37.720
<v Sjors Provoost>So thank you for listening to this.

00:39:39.040 --> 00:39:42.940
<v Aaron van Wirdum>Joost, thanks for coming. Sjors, do you feel like a Lightning expert now? Do you

00:39:42.940 --> 00:39:44.040
<v Aaron van Wirdum>feel like a routing expert?

00:39:44.420 --> 00:39:45.180
<v Sjors Provoost>A little bit more.

00:39:45.380 --> 00:39:46.380
<v Aaron van Wirdum>A little bit more. Me too.

00:39:47.010 --> 00:39:49.710
<v Sjors Provoost>So thank you for listening to the Van Wirdum Sjorsnado.

00:39:50.030 --> 00:39:50.710
<v Aaron van Wirdum>There you go.

