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

00:00:20.500 --> 00:00:22.880
<v Aaron van Wirdum>Live from Utrecht, this is Bitcoin.

00:00:23.700 --> 00:00:24.380
<v Sjors Provoost>Explained.

00:00:25.200 --> 00:00:26.620
<v Aaron van Wirdum>Sjors, I have horrible news.

00:00:27.020 --> 00:00:28.440
<v Sjors Provoost>Oh my god, tell me.

00:00:29.920 --> 00:00:30.500
<v Aaron van Wirdum>No one,

00:00:31.960 --> 00:00:37.660
<v Aaron van Wirdum>zero people, a great nil, a great total of nil people used the

00:00:37.660 --> 00:00:41.670
<v Aaron van Wirdum>promo code Sjorsnado. From what I understand.

00:00:42.030 --> 00:00:42.930
<v Sjors Provoost>That's unsurprising.

00:00:43.840 --> 00:00:48.540
<v Aaron van Wirdum>I don't know what that means. It either means we only have hardcore fans that

00:00:48.540 --> 00:00:54.240
<v Aaron van Wirdum>already bought their ticket before we even gave out the code. Or it means no one

00:00:54.240 --> 00:00:55.300
<v Aaron van Wirdum>can remember your name.

00:00:55.950 --> 00:00:59.550
<v Sjors Provoost>Or it means they used the other promo code at the end of the show that was

00:00:59.550 --> 00:01:00.970
<v Sjors Provoost>spliced in by the editor.

00:01:01.600 --> 00:01:03.400
<v Aaron van Wirdum>Oh, was there another one spliced in?

00:01:03.560 --> 00:01:03.700
<v Sjors Provoost>Yeah.

00:01:03.880 --> 00:01:07.220
<v Aaron van Wirdum>You listen to our shows. I sometimes do, but I didn't notice that. Oh, that

00:01:07.220 --> 00:01:09.260
<v Aaron van Wirdum>wasn't easier. That one was easier to remember?

00:01:09.500 --> 00:01:09.820
<v Sjors Provoost>Probably.

00:01:10.300 --> 00:01:14.400
<v Aaron van Wirdum>Oh, okay. Okay. That's a bit sad. Or just no one listens to our podcast. That's

00:01:14.400 --> 00:01:15.260
<v Aaron van Wirdum>option three, I guess.

00:01:15.320 --> 00:01:18.080
<v Sjors Provoost>No, I think some people listen because some people at the conference talk to me

00:01:18.080 --> 00:01:20.400
<v Sjors Provoost>as well that they listened and that they read the book.

00:01:21.980 --> 00:01:23.940
<v Aaron van Wirdum>Which book is this, Sjors? Do you want to shill it?

00:01:24.100 --> 00:01:26.700
<v Sjors Provoost>Yeah, it's a book I wrote called Bitcoin, a work in progress.

00:01:27.510 --> 00:01:33.270
<v Aaron van Wirdum>Very well. Sjors, I have more horrible news. The Lightning Network crashed last

00:01:33.270 --> 00:01:37.590
<v Aaron van Wirdum>week. I know we were both at Bitcoin Amsterdam, or at least maybe it was a couple

00:01:37.590 --> 00:01:41.370
<v Aaron van Wirdum>of days before that. We were in full preparation of Bitcoin Amsterdam. Our mind

00:01:41.370 --> 00:01:45.830
<v Aaron van Wirdum>was occupied, but the Lightning Network crashed. Did you hear about this?

00:01:46.370 --> 00:01:47.110
<v Sjors Provoost>Yes, today.

00:01:47.950 --> 00:01:49.850
<v Aaron van Wirdum>In preparation for this podcast.

00:01:50.770 --> 00:01:51.250
<v Sjors Provoost>Exactly.

00:01:51.690 --> 00:01:57.420
<v Aaron van Wirdum>Great. I'm gonna ask you all of the details so I know you've studied

00:01:57.420 --> 00:02:01.380
<v Aaron van Wirdum>hard the past couple of hours to learn everything about this crash.

00:02:02.650 --> 00:02:05.990
<v Aaron van Wirdum>And you're going to inform our dear listeners. Sjors, what happened?

00:02:06.390 --> 00:02:10.910
<v Sjors Provoost>Yeah, and I have to say, we were both surprised about how little has been written

00:02:10.910 --> 00:02:15.410
<v Sjors Provoost>more thoroughly. Maybe we couldn't find it, but we were expecting to find very

00:02:15.410 --> 00:02:19.850
<v Sjors Provoost>large blog posts explaining everything that went wrong and all the implications

00:02:19.850 --> 00:02:24.290
<v Sjors Provoost>of that. But so far, we only found a couple of tweets and a few fixes, though I

00:02:24.290 --> 00:02:26.130
<v Sjors Provoost>think it's more important than people think it is.

00:02:26.550 --> 00:02:30.850
<v Aaron van Wirdum>Yeah, either a blog post, some kind of post-mortem, or even sort of detailed...

00:02:31.740 --> 00:02:35.700
<v Aaron van Wirdum>conversation somewhere or but yeah the only thing we could really find were some

00:02:35.700 --> 00:02:40.520
<v Aaron van Wirdum>tweets so either these discussions are happening somewhere where we're not aware

00:02:40.520 --> 00:02:44.350
<v Aaron van Wirdum>of it or maybe uh I don't know…

00:02:44.350 --> 00:02:45.930
<v Sjors Provoost>Or maybe we can get them started.

00:02:45.930 --> 00:02:49.820
<v Aaron van Wirdum>Let's see so Sjors, what happens? Uh

00:02:49.820 --> 00:02:55.560
<v Sjors Provoost>Basically a lot of Lightning nodes just stopped working uh at a certain block

00:02:55.560 --> 00:03:00.890
<v Sjors Provoost>height and at the same time there was somebody on twitter uttering the words oh

00:03:00.890 --> 00:03:05.890
<v Sjors Provoost>my god I made this really cool transaction right and then you know he got a lot

00:03:05.890 --> 00:03:08.650
<v Sjors Provoost>of replies saying oh my god you broke uh LND.

00:03:08.650 --> 00:03:13.010
<v Aaron van Wirdum>Can we can we mention do you have the link in front of you who was this?

00:03:13.170 --> 00:03:18.870
<v Sjors Provoost>Yeah he's called Burak at @brqgoo

00:03:18.870 --> 00:03:20.490
<v Sjors Provoost>with two o's

00:03:20.490 --> 00:03:25.290
<v Aaron van Wirdum>Okay so what did he do what did Burak do what did you do Burak?

00:03:25.740 --> 00:03:31.080
<v Sjors Provoost>I just did a 998 of 999 Tapscript

00:03:31.080 --> 00:03:34.820
<v Sjors Provoost>multisig, and it only costs 490 in transaction fees.

00:03:35.570 --> 00:03:36.970
<v Aaron van Wirdum>Okay, let's start there.

00:03:37.150 --> 00:03:41.530
<v Sjors Provoost>This is about as close as... Oops, I accidentally killed it. As we have ever

00:03:41.530 --> 00:03:43.910
<v Sjors Provoost>gotten on Bitcoin, even though he didn't kill Bitcoin.

00:03:44.390 --> 00:03:47.470
<v Aaron van Wirdum>What was that again? Because I remember the term. What happened there?

00:03:47.490 --> 00:03:51.570
<v Sjors Provoost>Oops, I accidentally killed it. It was about the destroyed smart contract that

00:03:51.570 --> 00:03:55.310
<v Sjors Provoost>contained, I don't know, a couple hundred million dollars worth of reserves.

00:03:55.630 --> 00:03:56.770
<v Aaron van Wirdum>That was an Ethereum, right?

00:03:56.970 --> 00:04:01.510
<v Sjors Provoost>Yeah, and apparently somebody accidentally changed that smart contract into a

00:04:01.510 --> 00:04:02.770
<v Sjors Provoost>state where nobody could touch it again.

00:04:03.360 --> 00:04:04.960
<v Aaron van Wirdum>Right. So an Ethereum that happened.

00:04:05.240 --> 00:04:08.060
<v Sjors Provoost>One of those like, I wonder what this button does. I really hope this button

00:04:08.060 --> 00:04:10.640
<v Sjors Provoost>doesn't do what I think it does. No, they must have prevented that from

00:04:10.640 --> 00:04:11.980
<v Sjors Provoost>happening. Click. Oops.

00:04:12.680 --> 00:04:16.820
<v Aaron van Wirdum>Yeah. And then everyone who had their money, their ETH in a smart contract

00:04:16.820 --> 00:04:20.040
<v Aaron van Wirdum>basically lost their ETH, right? That's what happened there. Yeah. ETH were

00:04:20.040 --> 00:04:24.500
<v Aaron van Wirdum>frozen. Okay. So it's not that bad in this case, luckily, although, you know,

00:04:24.580 --> 00:04:27.780
<v Aaron van Wirdum>it's still a problem. So we'll get into that. But first of all, so what did he

00:04:27.780 --> 00:04:31.420
<v Aaron van Wirdum>actually do? You mentioned a 908.

00:04:32.230 --> 00:04:37.650
<v Sjors Provoost>998 out of 999. So it turns out with Bitcoin, you can do a multisig address,

00:04:37.870 --> 00:04:41.690
<v Sjors Provoost>which means your multiple keys have to sign, and you can set your own threshold.

00:04:41.950 --> 00:04:45.950
<v Sjors Provoost>So traditionally, you might say, I need two signatures out of these three public

00:04:45.950 --> 00:04:50.930
<v Sjors Provoost>keys. But there was a limit to that based on various constraints, mostly that the

00:04:50.930 --> 00:04:56.090
<v Sjors Provoost>way Bitcoin Core implemented, or the way Satoshi originally implemented the

00:04:56.090 --> 00:04:58.750
<v Sjors Provoost>multisig check was extremely inefficient.

00:05:00.160 --> 00:05:05.500
<v Sjors Provoost>And that means that if you did anything more than, say, 15 or 16, it would just

00:05:05.500 --> 00:05:07.420
<v Sjors Provoost>become too slow to validate any of the blocks.

00:05:07.540 --> 00:05:08.820
<v Aaron van Wirdum>But you could do it technically?

00:05:09.060 --> 00:05:09.940
<v Sjors Provoost>No, there was a limit on it.

00:05:09.960 --> 00:05:11.060
<v Aaron van Wirdum>Do you know what the limit was?

00:05:11.060 --> 00:05:12.140
<v Sjors Provoost>I think it was 15 or 16.

00:05:12.400 --> 00:05:12.600
<v Aaron van Wirdum>Okay.

00:05:12.940 --> 00:05:14.740
<v Sjors Provoost>So a maximum of 15 signatures.

00:05:14.960 --> 00:05:18.240
<v Aaron van Wirdum>So then you could do a 14 out of 15 or 2 out of 15?

00:05:18.420 --> 00:05:21.860
<v Sjors Provoost>Something like that. And that might have even been like, yes, you can do 15, but

00:05:21.860 --> 00:05:25.200
<v Sjors Provoost>you can only do 6 signatures out of that. Some constraint like that.

00:05:26.480 --> 00:05:30.310
<v Sjors Provoost>It's not about the block size that it's using, but about the validation time

00:05:30.310 --> 00:05:33.490
<v Sjors Provoost>going up quadratically, I think, instead of linearly.

00:05:33.870 --> 00:05:38.370
<v Aaron van Wirdum>Right. Okay. So that's sort of the original multisig in Bitcoin, but that was

00:05:38.370 --> 00:05:40.110
<v Aaron van Wirdum>improved upon. Is that right?

00:05:40.350 --> 00:05:44.570
<v Sjors Provoost>Exactly. It was improved upon in Taproot. By making it much simpler, basically,

00:05:44.730 --> 00:05:50.410
<v Sjors Provoost>instead of having one opcode called the OP_CHECKMULTISIG, it has something

00:05:50.410 --> 00:05:54.590
<v Sjors Provoost>called OP_CHECKKEY or something like that. I forgot the name. But basically, you

00:05:54.590 --> 00:06:00.370
<v Sjors Provoost>just tell it to check one key to check the next key, etc. And then it just adds

00:06:00.370 --> 00:06:06.040
<v Sjors Provoost>up the number. And so what he did was basically push that to the maximum and

00:06:06.040 --> 00:06:08.900
<v Sjors Provoost>have these 998 keys in it.

00:06:09.040 --> 00:06:11.880
<v Aaron van Wirdum>Okay, so that is the maximum? 999?

00:06:12.510 --> 00:06:13.270
<v Sjors Provoost>I'm not sure.

00:06:13.270 --> 00:06:15.710
<v Aaron van Wirdum>But x out of 999 I'm not sure.

00:06:15.710 --> 00:06:19.410
<v Sjors Provoost>Okay but it was big it was much bigger than anything we've previously seen before

00:06:19.410 --> 00:06:23.570
<v Sjors Provoost>on the blockchain but it's perfectly valid under Taproot rules so when you're

00:06:23.570 --> 00:06:28.470
<v Sjors Provoost>spending such a thing that means you need to put 998 signatures on the blockchain

00:06:28.470 --> 00:06:30.850
<v Aaron van Wirdum>I guess there are two options right either:

00:06:32.430 --> 00:06:37.090
<v Aaron van Wirdum>999 people have to all agree on how to spend the coins, in which case it looks

00:06:37.090 --> 00:06:40.530
<v Aaron van Wirdum>like a very regular one sig, because that's what Taproot does, right?

00:06:40.530 --> 00:06:46.230
<v Sjors Provoost>If you were to use MuSig, yes. So if you use MuSig to create a sort of

00:06:46.230 --> 00:06:47.930
<v Sjors Provoost>one key...

00:06:47.930 --> 00:06:52.550
<v Aaron van Wirdum>No, that's not what I'm referring to, Sjors. With Taproot, you always have the

00:06:52.550 --> 00:06:56.450
<v Aaron van Wirdum>option that if everyone in the contract agrees, then you should be able to just

00:06:56.450 --> 00:07:00.690
<v Aaron van Wirdum>spend the coin, the UTXO as if it's a very regular transaction, right?

00:07:00.770 --> 00:07:01.210
<v Sjors Provoost>You have that option.

00:07:01.210 --> 00:07:04.630
<v Aaron van Wirdum>So you don't have to reveal what the actual conditions were under the hood.

00:07:04.950 --> 00:07:08.650
<v Sjors Provoost>Ideally, yes. But that's not... You still have to do that yourself. You have to

00:07:08.650 --> 00:07:12.770
<v Sjors Provoost>use software to create that joint signature. And that requires something like MuSig.

00:07:14.060 --> 00:07:17.100
<v Sjors Provoost>So it's not something... Taproot doesn't solve it for you. Taproot just says you

00:07:17.100 --> 00:07:21.580
<v Sjors Provoost>can have one signature, which is just one public key as far as the Bitcoin Core

00:07:21.580 --> 00:07:26.540
<v Sjors Provoost>nodes are... As long as validation is concerned, it's just one public key and one

00:07:26.540 --> 00:07:30.800
<v Sjors Provoost>signature. But you could have made it using a million keys or whatever you want.

00:07:30.960 --> 00:07:34.920
<v Sjors Provoost>But in order to do that, you need something like MuSig or some other algorithm to

00:07:34.920 --> 00:07:36.880
<v Sjors Provoost>make that combined signature.

00:07:37.340 --> 00:07:42.640
<v Aaron van Wirdum>At this point, I'm confused. Are we talking about the same thing? We might be. We

00:07:42.640 --> 00:07:46.420
<v Aaron van Wirdum>might be. Because I thought MuSig was something else. But yeah, go on.

00:07:46.500 --> 00:07:50.680
<v Sjors Provoost>So in Taproot, you have two ways to spend coins. One is to provide a signature

00:07:50.680 --> 00:07:56.560
<v Sjors Provoost>for basically the key path, as it's called. And that's just a public key.

00:07:57.170 --> 00:07:58.590
<v Sjors Provoost>As far as the blockchain is concerned.

00:07:58.830 --> 00:07:58.990
<v Aaron van Wirdum>Yes.

00:07:59.170 --> 00:08:03.270
<v Sjors Provoost>And the other way is to satisfy a script. Now, in order to make that key, that

00:08:03.270 --> 00:08:08.090
<v Sjors Provoost>public key, you have to make that public key yourself. And you can use all sorts

00:08:08.090 --> 00:08:12.710
<v Sjors Provoost>of ways to combine different public keys into one. One of them is MuSig. So MuSig

00:08:12.710 --> 00:08:16.350
<v Sjors Provoost>is just a way to combine signatures, regardless of how you use it. You don't have

00:08:16.350 --> 00:08:17.150
<v Sjors Provoost>to use it in Taproot.

00:08:19.280 --> 00:08:23.060
<v Aaron van Wirdum>Okay I'll believe you then I thought these were two different things sorry to our

00:08:23.060 --> 00:08:26.340
<v Aaron van Wirdum>listeners who already knew this that we had to go over this again but that's

00:08:26.340 --> 00:08:31.180
<v Aaron van Wirdum>fine. Thanks for clarifying Sjors, yeah okay so but in this case the option that

00:08:31.180 --> 00:08:37.140
<v Aaron van Wirdum>was used was not MuSig and by the way when I see MuSig I don't mean a song.

00:08:37.440 --> 00:08:39.040
<v Aaron van Wirdum>We mean, how do you spell it?

00:08:39.480 --> 00:08:42.660
<v Sjors Provoost>Yeah, with a G sound, not with a C sound.

00:08:42.900 --> 00:08:47.180
<v Aaron van Wirdum>And it stands for multi-sig, I guess, right? Just short, or what does it actually

00:08:47.180 --> 00:08:47.620
<v Aaron van Wirdum>stand for?

00:08:47.400 --> 00:08:48.000
<v Sjors Provoost>I have no idea.

00:08:48.040 --> 00:08:53.520
<v Aaron van Wirdum>We're getting off the track anyways. So he didn't go for the MuSig option. He

00:08:53.520 --> 00:08:56.120
<v Aaron van Wirdum>went for revealing individual signatures.

00:08:56.560 --> 00:09:01.940
<v Sjors Provoost>Now, of course, any of these individual signatures could be a 100,000...

00:09:02.850 --> 00:09:07.610
<v Sjors Provoost>multisig, right? It could be. Through MuSig. We don't know that. The blockchain

00:09:07.610 --> 00:09:13.550
<v Sjors Provoost>doesn't care. It just sees 998 signatures. Each signature is 64 bytes. So

00:09:13.550 --> 00:09:16.650
<v Sjors Provoost>this was a very large transaction. This was, I think, a megabyte or something.

00:09:18.630 --> 00:09:19.570
<v Sjors Provoost>Something bigly.

00:09:20.850 --> 00:09:26.170
<v Sjors Provoost>And so this is no problem because you can make these Taproot scripts can be as

00:09:26.170 --> 00:09:30.130
<v Sjors Provoost>big as you want to. Now, it turns out that with SegWit 0, the old version of

00:09:30.130 --> 00:09:33.290
<v Sjors Provoost>SegWit, they could not be as long as you want to. There was a limit of, I think,

00:09:33.350 --> 00:09:34.390
<v Sjors Provoost>10,000 bytes.

00:09:35.930 --> 00:09:40.170
<v Sjors Provoost>And this probably had something to do with the way multisig was implemented in

00:09:40.170 --> 00:09:42.230
<v Sjors Provoost>all the versions of Bitcoin, but I'm not sure.

00:09:42.490 --> 00:09:46.510
<v Aaron van Wirdum>Okay, hang on. So with SegWit, there was... What were the original SegWit, the

00:09:46.510 --> 00:09:47.750
<v Aaron van Wirdum>first SegWit version?

00:09:47.890 --> 00:09:51.050
<v Sjors Provoost>Yeah, I mean, Taproot is technically SegWit 1, but to make it easier, yeah, with

00:09:51.050 --> 00:09:52.350
<v Sjors Provoost>SegWit, which is SegWit 0.

00:09:52.490 --> 00:09:52.950
<v Aaron van Wirdum>Right, yeah.

00:09:53.380 --> 00:09:54.240
<v Sjors Provoost>There was a limit.

00:09:54.300 --> 00:09:56.900
<v Aaron van Wirdum>There was a limit on how big transactions could be.

00:09:57.040 --> 00:09:58.500
<v Sjors Provoost>How big the witness could be.

00:09:58.660 --> 00:09:59.640
<v Aaron van Wirdum>How big the witness could be.

00:09:59.680 --> 00:10:03.420
<v Sjors Provoost>Okay. So those signatures, you could only fit a certain number of signatures into

00:10:03.420 --> 00:10:09.240
<v Sjors Provoost>the witness, namely 10,000 divided by 64, which is some number less than what he

00:10:09.240 --> 00:10:09.900
<v Sjors Provoost>was doing today.

00:10:10.220 --> 00:10:14.060
<v Aaron van Wirdum>Right. So this would only be revealed when you're spending the coins, right?

00:10:14.460 --> 00:10:14.740
<v Sjors Provoost>Yes.

00:10:14.980 --> 00:10:15.300
<v Aaron van Wirdum>Okay.

00:10:15.860 --> 00:10:16.180
<v Sjors Provoost>Exactly.

00:10:17.540 --> 00:10:18.040
<v Sjors Provoost>So...

00:10:18.500 --> 00:10:23.160
<v Aaron van Wirdum>So then technically, just to finish that thought, the reason I ask is so that

00:10:23.160 --> 00:10:28.390
<v Aaron van Wirdum>would mean that it would be possible to receive coins that you can then never

00:10:28.390 --> 00:10:32.530
<v Aaron van Wirdum>spend. I mean, you shouldn't. You determine under what conditions you receive coins.

00:10:32.570 --> 00:10:36.990
<v Sjors Provoost>Of course, in SegWit, you couldn't make such a multisig anyway. So that wouldn't

00:10:36.990 --> 00:10:42.210
<v Sjors Provoost>be an issue. But yeah, it's possible. If you could send somebody coins using a

00:10:42.210 --> 00:10:46.710
<v Sjors Provoost>set of conditions that the only way to satisfy that is to put too much stuff in

00:10:46.710 --> 00:10:48.470
<v Sjors Provoost>the transaction, namely more than 10 kilobytes.

00:10:48.610 --> 00:10:48.890
<v Aaron van Wirdum>Right, yeah.

00:10:49.190 --> 00:10:53.670
<v Sjors Provoost>And so maybe what you can do is, you know, one multisig can only do 16, but I

00:10:53.670 --> 00:10:58.230
<v Sjors Provoost>think you can just do one multisig and then... do another multisig, and another

00:10:58.230 --> 00:11:01.030
<v Sjors Provoost>multisig, and another multisig, and say all of these multisigs have to be

00:11:01.030 --> 00:11:04.130
<v Sjors Provoost>satisfied. And then you can have as many transactions as you want, and then you

00:11:04.130 --> 00:11:04.930
<v Sjors Provoost>can't satisfy it.

00:11:05.210 --> 00:11:05.350
<v Aaron van Wirdum>Yeah.

00:11:05.610 --> 00:11:05.750
<v Sjors Provoost>Yeah.

00:11:06.050 --> 00:11:11.590
<v Aaron van Wirdum>Anyways, we keep being distracted by some side notes. Let's try to... This is my

00:11:11.590 --> 00:11:16.410
<v Aaron van Wirdum>responsibility. We're going to stay on the track. So SegWit, zero. The original

00:11:16.410 --> 00:11:20.430
<v Aaron van Wirdum>SegWit had a transaction size limit. Taproot or...

00:11:20.430 --> 00:11:22.350
<v Sjors Provoost>A witness limit. Witness size limit.

00:11:22.430 --> 00:11:22.910
<v Aaron van Wirdum>Oh, yeah. Sorry.

00:11:24.210 --> 00:11:28.810
<v Aaron van Wirdum>Taproot does not. Taproot transactions do not have this limit, right?

00:11:29.030 --> 00:11:32.490
<v Sjors Provoost>Yeah, either it doesn't have a limit at all or it has a very large limit in the

00:11:32.490 --> 00:11:33.250
<v Sjors Provoost>order of megabytes.

00:11:33.490 --> 00:11:37.470
<v Aaron van Wirdum>Right, so now it's possible to create a big transaction like this one, like the

00:11:37.470 --> 00:11:40.510
<v Aaron van Wirdum>998 signatures out of 999.

00:11:40.830 --> 00:11:45.630
<v Sjors Provoost>Yeah, so you're making a very big input of a transaction. And now this is not a

00:11:45.630 --> 00:11:49.610
<v Sjors Provoost>problem for Bitcoin Core nodes. It's also not a problem according to the rules of Taproot.

00:11:50.820 --> 00:11:55.360
<v Sjors Provoost>However, btcd had an implementation mistake, so we should explain what btcd is.

00:11:55.480 --> 00:11:55.680
<v Aaron van Wirdum>Yes.

00:11:56.400 --> 00:12:00.780
<v Sjors Provoost>btcd is another implementation of Bitcoin, essentially. There are a couple of

00:12:00.780 --> 00:12:04.960
<v Sjors Provoost>implementations. There's Libbitcoin, there's Bitcoin Core, there is Bitcoin Rust,

00:12:05.120 --> 00:12:08.900
<v Sjors Provoost>although I don't know if it's a full implementation. There is...

00:12:08.900 --> 00:12:09.660
<v Aaron van Wirdum>Bitcoin, I don't know.

00:12:09.780 --> 00:12:13.500
<v Sjors Provoost>Yeah, Bitcoin is in JavaScript, I think so, yeah. There's a bunch of them, and

00:12:13.500 --> 00:12:15.440
<v Sjors Provoost>some of them implement Taproot, others don't.

00:12:17.520 --> 00:12:21.640
<v Sjors Provoost>And basically, all these nodes implement consensus code from scratch. That's

00:12:21.640 --> 00:12:26.040
<v Sjors Provoost>always a risk. Though I think Libbitcoin will actually use the Bitcoin part of

00:12:26.040 --> 00:12:30.040
<v Sjors Provoost>the consensus code. But in any case, they've all implemented themselves, so they

00:12:30.040 --> 00:12:33.880
<v Sjors Provoost>all have to be very careful to make sure that they copy everything in the spec or

00:12:33.880 --> 00:12:38.600
<v Sjors Provoost>every bug that's in the Bitcoin Core source code. Otherwise, problems happen. And

00:12:38.600 --> 00:12:44.390
<v Sjors Provoost>in this case, in btcd, was... incorrectly checking

00:12:44.390 --> 00:12:49.120
<v Sjors Provoost>that this thing was less than 10 kilobyte, because that was a rule for the old

00:12:49.120 --> 00:12:53.120
<v Sjors Provoost>version of SegWit and not for the new versions of SegWit. And so it would simply

00:12:53.120 --> 00:12:56.870
<v Sjors Provoost>reject the whole block because it thought the transaction was invalid. So it

00:12:56.870 --> 00:12:58.990
<v Sjors Provoost>would just freeze at that cool block.

00:12:59.310 --> 00:13:05.170
<v Aaron van Wirdum>Right. So btcd was applying a rule that really only applied to SegWit.

00:13:05.290 --> 00:13:08.650
<v Aaron van Wirdum>Let's keep it simple. It applied to SegWit, and it was applying it to Taproot.

00:13:09.030 --> 00:13:11.750
<v Aaron van Wirdum>I'm simplifying, but that's basically what happened, right?

00:13:11.810 --> 00:13:17.610
<v Sjors Provoost>And slightly under the hood, btcd has at least two places where it

00:13:17.610 --> 00:13:21.850
<v Sjors Provoost>checks certain rules. One is when it receives a block over the wire, and we'll

00:13:21.850 --> 00:13:27.130
<v Sjors Provoost>kind of get into later what receiving over the wire means. But basically when it

00:13:27.130 --> 00:13:32.840
<v Sjors Provoost>receives a block from another peer, it does some preliminary checks on it. And

00:13:32.840 --> 00:13:37.640
<v Sjors Provoost>then once those checks are passed, it goes to a full validation check. Now, that

00:13:37.640 --> 00:13:40.800
<v Sjors Provoost>full validation will happen even if you feed the block manually, if you

00:13:40.800 --> 00:13:45.420
<v Sjors Provoost>copy-paste it or something like that. But these preliminary checks should only

00:13:45.420 --> 00:13:49.180
<v Sjors Provoost>happen when they receive the block over the network. And it was those checks that

00:13:49.180 --> 00:13:55.040
<v Sjors Provoost>were enforcing this 10-kilobyte limit on all versions of SegWit, essentially, not

00:13:55.040 --> 00:13:59.800
<v Sjors Provoost>just on SegWit 0. Because the way Bitcoin SegWit has been designed is there's

00:13:59.800 --> 00:14:05.610
<v Sjors Provoost>multiple versions of SegWit. And if the version number is more than zero, then in

00:14:05.610 --> 00:14:08.750
<v Sjors Provoost>the beginning, you would always approve the transaction. It would always be

00:14:08.750 --> 00:14:12.850
<v Sjors Provoost>spendable. You would simply not check any rules, including rules about size limits.

00:14:14.130 --> 00:14:19.250
<v Aaron van Wirdum>Yeah. So I would propose from now on, let's just say SegWit and Taproot, even

00:14:19.250 --> 00:14:22.410
<v Aaron van Wirdum>though technically it's SegWit zero and SegWit one, right?

00:14:23.050 --> 00:14:28.830
<v Sjors Provoost>Yeah, in this case, because it's about the witness. And every version of SegWit

00:14:28.830 --> 00:14:32.740
<v Sjors Provoost>will have a witness, but the rules for that witness will change for every version

00:14:32.740 --> 00:14:37.740
<v Sjors Provoost>of SegWit. So with regular SegWit, there was a limit of 10,000, but there was no

00:14:37.740 --> 00:14:39.680
<v Sjors Provoost>limit defined for any other version of SegWit.

00:14:39.960 --> 00:14:40.160
<v Aaron van Wirdum>Yeah.

00:14:40.510 --> 00:14:41.930
<v Sjors Provoost>So it turns out this...

00:14:41.930 --> 00:14:46.030
<v Aaron van Wirdum>Okay, so btcd, they did the same check kind of twice. And you mentioned that the

00:14:46.030 --> 00:14:49.310
<v Aaron van Wirdum>first check happens when they receive it over the wire. And then you said, we'll

00:14:49.310 --> 00:14:51.550
<v Aaron van Wirdum>get into that. So let's get into that. What do you mean by that?

00:14:51.670 --> 00:14:55.130
<v Sjors Provoost>Yeah, and presumably they check it again in the code that checks the consensus.

00:14:55.270 --> 00:14:58.690
<v Sjors Provoost>And there they were probably doing it correctly. So in the code that really, you

00:14:58.690 --> 00:15:01.330
<v Sjors Provoost>know, once they've received the block and put it in their own database, it might

00:15:01.330 --> 00:15:04.850
<v Sjors Provoost>say, okay, is this block actually obeying SegWit? And then it would do it

00:15:04.850 --> 00:15:08.170
<v Sjors Provoost>correctly. It would say, what's the version of SegWit? Okay, version number zero.

00:15:08.390 --> 00:15:12.120
<v Sjors Provoost>Okay, that's the limit. Or if it was Taproot, it would check some other limit.

00:15:14.270 --> 00:15:18.250
<v Aaron van Wirdum>Okay. btcd is an alternative Bitcoin implementation. However, we were talking

00:15:18.250 --> 00:15:21.230
<v Aaron van Wirdum>about Lightning. So how does this tie in with Lightning then?

00:15:21.570 --> 00:15:25.270
<v Sjors Provoost>Yeah. So first I'll describe sort of an imaginary scenario because I don't think

00:15:25.270 --> 00:15:28.970
<v Sjors Provoost>this actually exists in the wild or at least not very often. Let's say you're

00:15:28.970 --> 00:15:33.370
<v Sjors Provoost>running LND, which is the Lightning implementation built by the same people who

00:15:33.370 --> 00:15:34.510
<v Sjors Provoost>also built btcd.

00:15:34.930 --> 00:15:36.270
<v Aaron van Wirdum>So that's Lightning Labs, right?

00:15:36.570 --> 00:15:40.970
<v Sjors Provoost>Yeah. Now you can use Lightning LND using different node software. If you were

00:15:40.970 --> 00:15:46.270
<v Sjors Provoost>using it with btcd, then this bug would very clearly occur because your btcd node

00:15:46.270 --> 00:15:49.710
<v Sjors Provoost>is talking to other nodes in the network might be Bitcoin Core nodes it sees this

00:15:49.710 --> 00:15:54.390
<v Sjors Provoost>block it receives it over the wire and it says this is wrong and then it stops syncing

00:15:55.130 --> 00:15:58.010
<v Aaron van Wirdum>You still haven't explained what over the wire is, by the way.

00:15:58.230 --> 00:16:03.230
<v Sjors Provoost>Yeah, just over the internet, something like that. So it basically rejects it

00:16:03.230 --> 00:16:07.930
<v Sjors Provoost>that way. And then how would this impact Lightning? Your Lightning node wants to

00:16:07.930 --> 00:16:10.990
<v Sjors Provoost>see all the new blocks in order to make sure that its channels are still okay,

00:16:11.010 --> 00:16:15.770
<v Sjors Provoost>nobody's trying to cheat on it, etc. And so if your Lightning node is not seeing

00:16:15.770 --> 00:16:18.990
<v Sjors Provoost>any new transactions anymore, it's going to get increasingly unhappy.

00:16:20.230 --> 00:16:24.350
<v Sjors Provoost>At some point, it may even be talking to its peers on the Lightning Network, and

00:16:24.350 --> 00:16:27.070
<v Sjors Provoost>its peers are saying, no, no, no, there are much newer blocks than what you're

00:16:27.070 --> 00:16:31.010
<v Sjors Provoost>talking about. Why don't you follow the newest blocks? And maybe the peers will

00:16:31.010 --> 00:16:35.810
<v Sjors Provoost>say, hey, the fees have gone up. Why don't you increase the fees on the penalty

00:16:35.810 --> 00:16:39.670
<v Sjors Provoost>transactions? Because Lightning nodes will constantly renegotiate what the

00:16:39.670 --> 00:16:40.970
<v Sjors Provoost>penalty transactions should be, etc.

00:16:42.350 --> 00:16:45.570
<v Sjors Provoost>But you're noticing, no, no, no, the blockchain hasn't moved. Why are you talking

00:16:45.570 --> 00:16:49.170
<v Sjors Provoost>about these higher fees? And at some point saying, fuck you. I'm going to

00:16:49.170 --> 00:16:52.310
<v Sjors Provoost>disconnect from you. I'm going to close all the channels now. And so some people

00:16:52.310 --> 00:16:55.030
<v Sjors Provoost>on the internet were reporting that they were seeing their channels getting

00:16:55.030 --> 00:16:59.370
<v Sjors Provoost>closed by the other side because of some miscommunication because their node was

00:16:59.370 --> 00:17:04.650
<v Sjors Provoost>basically stuck. And that can cascade, of course, if lots of nodes start closing

00:17:04.650 --> 00:17:05.670
<v Sjors Provoost>the channels at the same time.

00:17:11.440 --> 00:17:12.100
<v Aaron van Wirdum>Okay, yeah.

00:17:13.300 --> 00:17:18.840
<v Aaron van Wirdum>So we were explaining or you were explaining that if LND uses

00:17:18.840 --> 00:17:23.620
<v Aaron van Wirdum>btcd to read the blockchain, to get the blockchain, then the problem is obvious.

00:17:23.920 --> 00:17:26.040
<v Aaron van Wirdum>And then you hinted at some problems.

00:17:26.420 --> 00:17:26.580
<v Sjors Provoost>Yeah.

00:17:29.120 --> 00:17:33.900
<v Aaron van Wirdum>So do all LND nodes use btcd? Is this a requirement for LND?

00:17:34.060 --> 00:17:39.570
<v Sjors Provoost>I think they... They do under some circumstances, and they don't under others. So

00:17:39.570 --> 00:17:45.490
<v Sjors Provoost>generally, most people, I think, run Bitcoin Core as the node. However, if you're

00:17:45.490 --> 00:17:49.530
<v Sjors Provoost>running a mobile app, then you may want to not download all the blocks from your

00:17:49.530 --> 00:17:53.310
<v Sjors Provoost>mobile app. You want to use these filters, BIP158, Neutrino filters that we

00:17:53.310 --> 00:17:56.670
<v Sjors Provoost>talked about in some other episode. So those filters basically give you a quick

00:17:56.670 --> 00:18:00.550
<v Sjors Provoost>summary of the block, and then you only request the blocks that you want. And

00:18:00.550 --> 00:18:05.610
<v Sjors Provoost>that also, under the hood, is btcd. So what's possible on the mobile app

00:18:05.640 --> 00:18:11.040
<v Sjors Provoost>is that your btcd node on the mobile app will get stuck because of this.

00:18:11.300 --> 00:18:15.980
<v Sjors Provoost>Because the mobile app will fetch a block, it will fetch the magic bad block,

00:18:16.000 --> 00:18:20.000
<v Sjors Provoost>because you happen to have asked for that one, and then your mobile app will stop

00:18:20.000 --> 00:18:24.920
<v Sjors Provoost>too. But that does not really explain what we saw people remark. Because people

00:18:24.920 --> 00:18:27.320
<v Sjors Provoost>were complaining that, first of all, they were complaining that their node

00:18:27.320 --> 00:18:30.240
<v Sjors Provoost>stopped, their Lightning node stopped. And I don't think a mobile app would

00:18:30.240 --> 00:18:33.820
<v Sjors Provoost>necessarily stop, but maybe it would. But they were also complaining about

00:18:33.820 --> 00:18:37.920
<v Sjors Provoost>channels getting closed. And mobile apps tend to be very patient in this stuff.

00:18:38.080 --> 00:18:42.980
<v Sjors Provoost>Like you can have your, I don't know, your Phoenix wallet or Breez wallet or

00:18:42.980 --> 00:18:48.660
<v Sjors Provoost>whatever. You can ignore it for weeks and it'll start annoying you, warn you, but

00:18:48.660 --> 00:18:53.570
<v Sjors Provoost>it generally doesn't start closing channels on you. So that doesn't seem to be

00:18:53.570 --> 00:18:57.310
<v Sjors Provoost>what's going on. When people have forced closes of their channels, I think

00:18:57.310 --> 00:18:59.690
<v Sjors Provoost>they're actually running their own node. They might be using something like

00:18:59.690 --> 00:19:04.680
<v Sjors Provoost>Umbrel or something. And at the same time, today I saw on Twitter, on October

00:19:04.680 --> 00:19:10.060
<v Sjors Provoost>10th, Umbrel said, hey guys, there's a new update. Please install this hotfix

00:19:10.060 --> 00:19:14.150
<v Sjors Provoost>because there's a problem with Lightning. So then my question is, why would

00:19:14.150 --> 00:19:17.640
<v Sjors Provoost>Umbrel nodes have a problem with this? And this is where I would have loved to

00:19:17.640 --> 00:19:22.220
<v Sjors Provoost>have read a good postmortem because now I have to guess because I don't know

00:19:22.220 --> 00:19:27.220
<v Sjors Provoost>exactly how Umbrel works. But as far as I know, software like Umbrel uses Bitcoin

00:19:27.220 --> 00:19:32.790
<v Sjors Provoost>Core to download all the blocks. So when people say over the wire... I would

00:19:32.790 --> 00:19:37.710
<v Sjors Provoost>assume that the wire is Bitcoin Core receiving blocks from other nodes out there.

00:19:38.070 --> 00:19:42.390
<v Sjors Provoost>And Bitcoin Core doesn't have this bug. So then the question is, why are we still

00:19:42.390 --> 00:19:45.610
<v Sjors Provoost>running into this bug, even though we're using Bitcoin Core to validate the

00:19:45.610 --> 00:19:50.000
<v Sjors Provoost>blocks? You know, the Lightning software shouldn't be doing extra consensus

00:19:50.000 --> 00:19:55.400
<v Sjors Provoost>checks. So this is where I think what's going on is that on your little node,

00:19:55.560 --> 00:20:00.660
<v Sjors Provoost>you have Bitcoin Core running and you have LND running. But LND, under the hood,

00:20:00.740 --> 00:20:04.180
<v Sjors Provoost>uses bits and pieces of btcd. It just uses some of the building blocks from btcd.

00:20:04.600 --> 00:20:06.300
<v Sjors Provoost>And one of those building blocks...

00:20:06.300 --> 00:20:07.760
<v Aaron van Wirdum>For example, for Neutrino.

00:20:08.180 --> 00:20:12.720
<v Sjors Provoost>Yeah, for Neutrino. And then, again, there's two sort of paths that I would

00:20:12.720 --> 00:20:18.400
<v Sjors Provoost>imagine could have gone wrong. One path is that the node, the LND software,

00:20:18.700 --> 00:20:24.500
<v Sjors Provoost>is talking to your full node, not directly in the sense it is talking using these

00:20:24.500 --> 00:20:30.200
<v Sjors Provoost>filters. So it might be asking your node, so it's on the same device, but your

00:20:30.200 --> 00:20:33.660
<v Sjors Provoost>LND software is asking the node for the filters on the same device, and then

00:20:33.660 --> 00:20:37.010
<v Sjors Provoost>given the filters, it asks the node for the blocks. And those blocks are still

00:20:37.010 --> 00:20:40.910
<v Sjors Provoost>going over a wire. Even though the wire is inside your own computer, it's still a

00:20:40.910 --> 00:20:44.990
<v Sjors Provoost>wire from the point of view of the software. And so then it would also run into

00:20:44.990 --> 00:20:49.190
<v Sjors Provoost>this bug where the block briefly goes on the wire from your Bitcoin Core node to

00:20:49.190 --> 00:20:55.060
<v Sjors Provoost>this little piece of btcd, really. And so that's a problem because

00:20:55.060 --> 00:20:58.820
<v Sjors Provoost>you don't want to have these extra valid... You don't want to be reliant on some

00:20:58.820 --> 00:21:02.060
<v Sjors Provoost>other implementation than Bitcoin Core for your consensus checks because there

00:21:02.060 --> 00:21:07.570
<v Sjors Provoost>could be other bugs in there. That's one possibility. The other possibility is

00:21:07.570 --> 00:21:13.530
<v Sjors Provoost>that it's even different there. Maybe LND talks directly to Bitcoin Core and

00:21:13.530 --> 00:21:17.630
<v Sjors Provoost>just asks for every block, which would make sense. I mean, Lightning nodes, if

00:21:17.630 --> 00:21:20.230
<v Sjors Provoost>it's on the same machine anyway, it might as well just ask every block from

00:21:20.230 --> 00:21:25.490
<v Sjors Provoost>Bitcoin Core, just in raw form. And that could also still be interpreted as if it

00:21:25.490 --> 00:21:28.410
<v Sjors Provoost>was going over the wire. So maybe it was still running those same checks, even

00:21:28.410 --> 00:21:34.330
<v Sjors Provoost>though there was nothing going over a wire. In any case, somehow some of the

00:21:34.330 --> 00:21:40.250
<v Sjors Provoost>btcd consensus code is, you know, network code, but network is kind of, you

00:21:40.250 --> 00:21:41.750
<v Sjors Provoost>know, important for consensus too.

00:21:43.290 --> 00:21:48.250
<v Sjors Provoost>Somehow it's getting run, even though you're not running btcd as the node, which

00:21:48.250 --> 00:21:53.210
<v Sjors Provoost>is kind of worrying from an architectural point of view. Because again, in

00:21:53.210 --> 00:21:56.990
<v Sjors Provoost>general, other implementations than Bitcoin Core can cause problems when they

00:21:56.990 --> 00:21:59.870
<v Sjors Provoost>have even the slightest different interpretation of what the rules are.

00:22:00.880 --> 00:22:06.640
<v Aaron van Wirdum>Right okay so we so to summarize that we know what the

00:22:06.640 --> 00:22:11.990
<v Aaron van Wirdum>bug in btcd was what we're unsure about and we've tried to look for it

00:22:11.990 --> 00:22:17.770
<v Aaron van Wirdum>is why it affected the Lightning network or to the extent that it

00:22:17.770 --> 00:22:20.110
<v Aaron van Wirdum>did why it affects LND nodes.

00:22:20.110 --> 00:22:25.110
<v Sjors Provoost>Why why it affected nodes even though you'd think they were not running btcd at

00:22:25.110 --> 00:22:29.310
<v Sjors Provoost>least not the full version of btcd right so that's that's an open question I

00:22:29.310 --> 00:22:32.310
<v Sjors Provoost>think we've we've postulated some possibilities I would also observe…

00:22:32.310 --> 00:22:33.390
<v Aaron van Wirdum>Someone has the answer.

00:22:33.390 --> 00:22:34.690
<v Sjors Provoost>Let us know.

00:22:34.690 --> 00:22:35.270
<v Aaron van Wirdum>Let us know.

00:22:35.270 --> 00:22:38.590
<v Sjors Provoost>We'll mention maybe by the time this airs it's already been explained by somebody

00:22:38.590 --> 00:22:41.470
<v Sjors Provoost>and they're like oh you guys are wrong you didn't read this post it's because you

00:22:41.470 --> 00:22:45.290
<v Sjors Provoost>wrote it after we recorded it so one more thing is that I think some people

00:22:45.970 --> 00:22:51.490
<v Sjors Provoost>framed this as a Taproot-related bug, but it really

00:22:51.490 --> 00:22:56.050
<v Sjors Provoost>wasn't, because I work on this other project called Fork Monitor, which is by

00:22:56.050 --> 00:23:00.170
<v Sjors Provoost>BitMEX Research, and Fork Monitor checks different nodes to see if they have any

00:23:00.170 --> 00:23:04.250
<v Sjors Provoost>problems compared to each other. And because I was also busy with the conference,

00:23:04.510 --> 00:23:08.170
<v Sjors Provoost>I completely ignored what Fork Monitor was doing, but it actually turned out that

00:23:08.170 --> 00:23:12.960
<v Sjors Provoost>Fork Monitor, the btcd node on Fork Monitor, was also stuck at this magical

00:23:12.960 --> 00:23:17.380
<v Sjors Provoost>block, or one block before the magical block. But just nobody noticed it. Or

00:23:17.380 --> 00:23:21.200
<v Sjors Provoost>maybe people did notice it and told me about it, and I ignored it anyway because

00:23:21.200 --> 00:23:23.200
<v Sjors Provoost>I didn't know there was this drama going on.

00:23:23.300 --> 00:23:24.440
<v Aaron van Wirdum>Busy partying in Amsterdam.

00:23:24.700 --> 00:23:28.520
<v Sjors Provoost>Exactly. That has to happen. But basically, this particular node and fork monitor

00:23:28.520 --> 00:23:32.140
<v Sjors Provoost>has not been updated for a while because I was being extremely lazy. It was

00:23:32.140 --> 00:23:35.720
<v Sjors Provoost>running a very old version. Actually, it was running a version that was from

00:23:35.720 --> 00:23:40.090
<v Sjors Provoost>before they had Taproot support. So the node that stopped did not support

00:23:40.090 --> 00:23:44.740
<v Sjors Provoost>Taproot, which means this bug is not related to Taproot at all. And in fact,

00:23:44.940 --> 00:23:49.680
<v Sjors Provoost>somebody could have triggered this bug before Taproot was even created. Depending

00:23:49.680 --> 00:23:53.780
<v Sjors Provoost>on when the bug was introduced, probably when SegWit was introduced, I'm guessing

00:23:53.780 --> 00:23:58.480
<v Sjors Provoost>this check was written when SegWit was introduced. So this bug has been sitting

00:23:58.480 --> 00:23:59.780
<v Sjors Provoost>there for like five years.

00:23:59.980 --> 00:24:05.820
<v Aaron van Wirdum>But then someone had to make a SegWit version one transaction before there was a

00:24:05.820 --> 00:24:06.600
<v Aaron van Wirdum>SegWit version one.

00:24:06.720 --> 00:24:09.980
<v Sjors Provoost>Yes, but that's possible. And we've talked about this in the earlier episode

00:24:09.980 --> 00:24:14.200
<v Sjors Provoost>about accidental hard forks or what is a hard fork or what isn't a hard fork. You

00:24:14.200 --> 00:24:18.110
<v Sjors Provoost>can use features that don't exist yet in Bitcoin Core. And the thing is, you're

00:24:18.110 --> 00:24:22.710
<v Sjors Provoost>giving away your money, but you can give away your money in a way that, you know,

00:24:22.830 --> 00:24:26.230
<v Sjors Provoost>causes other nodes to crash or causes half the Lightning network to crash in this

00:24:26.230 --> 00:24:30.750
<v Sjors Provoost>case. Or maybe not half the network. I don't know how big the explosion was. This

00:24:30.750 --> 00:24:34.190
<v Sjors Provoost>is why I'd like to see a postmortem. Like how many nodes actually went down

00:24:34.190 --> 00:24:34.770
<v Sjors Provoost>because of this?

00:24:35.720 --> 00:24:41.620
<v Aaron van Wirdum>Right. Yes, me too. And so are we done with this part? Are we done

00:24:41.620 --> 00:24:42.520
<v Aaron van Wirdum>with the speculation part?

00:24:42.880 --> 00:24:43.620
<v Sjors Provoost>Yep, I think so.

00:24:43.880 --> 00:24:48.370
<v Aaron van Wirdum>Okay, so then I guess to sort of close this off. And you did allude to it already

00:24:48.370 --> 00:24:53.870
<v Aaron van Wirdum>a little bit but what is actually the problem or the harm or

00:24:53.870 --> 00:24:59.820
<v Aaron van Wirdum>how does this affect users so to say because I would assume that at

00:24:59.820 --> 00:25:04.620
<v Aaron van Wirdum>least initially a Lightning node would actually continue to operate like normal

00:25:04.620 --> 00:25:08.750
<v Aaron van Wirdum>even if it's not on the latest block because it doesn't require blockchain

00:25:08.750 --> 00:25:12.210
<v Aaron van Wirdum>confirmations to make transactions or to forward payments, right?

00:25:12.610 --> 00:25:15.610
<v Sjors Provoost>Yeah, but a lot of it depends on the internal details. I think one of the tweets

00:25:15.610 --> 00:25:20.850
<v Sjors Provoost>I read was saying that nodes couldn't open new channels or close them, which you

00:25:20.850 --> 00:25:24.270
<v Sjors Provoost>think should be possible, right? Because you don't need to wait for a new block

00:25:24.270 --> 00:25:28.850
<v Sjors Provoost>to close a channel. But there may be some implementation detail that causes those

00:25:28.850 --> 00:25:32.850
<v Sjors Provoost>two things to depend on each other. Even though that's not intentional. So that's

00:25:32.850 --> 00:25:36.510
<v Sjors Provoost>not really related, I guess. I mean, that's more of a matter of robustness. Like

00:25:36.510 --> 00:25:41.290
<v Sjors Provoost>what does a node do when it stops syncing? What does a Lightning node do when the

00:25:41.290 --> 00:25:45.110
<v Sjors Provoost>underlying node stops? That needs to be thought through a bit. Because one of the

00:25:45.110 --> 00:25:48.980
<v Sjors Provoost>things that could go wrong is, let's say somebody's trying to cheat on you. And

00:25:48.980 --> 00:25:53.200
<v Sjors Provoost>then it depends on all your settings. If you set things that it waits for a month

00:25:53.200 --> 00:25:57.180
<v Sjors Provoost>and you can punish the cheater for a whole month, then as long as you figure out

00:25:57.180 --> 00:26:01.140
<v Sjors Provoost>there's a problem within a couple of days and upgrade, you're fine. But let's say

00:26:01.140 --> 00:26:05.160
<v Sjors Provoost>you've really tightened all the screws to maximize your fee revenue or whatever.

00:26:05.800 --> 00:26:10.120
<v Sjors Provoost>And you've set it so that if you don't respond within 12 hours, let's say. Now,

00:26:10.240 --> 00:26:15.670
<v Sjors Provoost>let's say 24 hours that's a bit of a better example let's say you don't respond

00:26:15.670 --> 00:26:18.630
<v Sjors Provoost>within 24 hours if somebody can cheat on you that means you meet you need to make

00:26:18.630 --> 00:26:21.470
<v Sjors Provoost>sure your your Lightning node is not down for 24 hours

00:26:21.530 --> 00:26:27.490
<v Aaron van Wirdum>Yeah so to just to clarify this real quick anyone who knows a bit about Lightning

00:26:27.490 --> 00:26:30.730
<v Aaron van Wirdum>knows this but maybe some of our listeners don't so the idea with Lightning is

00:26:30.730 --> 00:26:34.370
<v Aaron van Wirdum>you're updating the balance between each other people have balances with each

00:26:34.370 --> 00:26:39.250
<v Aaron van Wirdum>other and what's stopping people from out from broadcasting

00:26:40.060 --> 00:26:44.880
<v Aaron van Wirdum>older channel states where they get more money than the latest channel state is

00:26:44.880 --> 00:26:47.680
<v Aaron van Wirdum>that you can respond by

00:26:49.380 --> 00:26:51.160
<v Aaron van Wirdum>basically taking all of the coins, right?

00:26:51.460 --> 00:26:55.320
<v Sjors Provoost>I think so, at least a fair chunk of it. Yeah, so it's a deterrent.

00:26:55.620 --> 00:27:00.320
<v Aaron van Wirdum>Yes, it's a deterrent. However, in order to see if someone is broadcasting an old

00:27:00.320 --> 00:27:04.380
<v Aaron van Wirdum>transaction or if someone is trying to steal from you, you kind of need to know

00:27:04.380 --> 00:27:07.820
<v Aaron van Wirdum>what's going on on the blockchain. So if you can't see that, you can't respond

00:27:07.820 --> 00:27:11.120
<v Aaron van Wirdum>and then someone can steal from you. That's a problem you're explaining here, right?

00:27:11.280 --> 00:27:15.280
<v Sjors Provoost>Exactly. Now, to add some nuance to that, it doesn't have to be in the

00:27:15.280 --> 00:27:18.590
<v Sjors Provoost>blockchain. You can look at the mempool. We've explained the mempool in earlier

00:27:18.590 --> 00:27:22.930
<v Sjors Provoost>episodes. Typically, your mempool is set to 300 megabytes. That's the default on

00:27:22.930 --> 00:27:23.430
<v Sjors Provoost>Bitcoin Core.

00:27:23.610 --> 00:27:26.370
<v Aaron van Wirdum>Hang on, you say you can look at the mempool, but...

00:27:26.370 --> 00:27:29.870
<v Sjors Provoost>You can see if somebody's cheating by looking at the cheat transaction inside the mempool.

00:27:30.270 --> 00:27:34.890
<v Aaron van Wirdum>Yeah, but you can't see it with your eyes, right? So I would assume that software

00:27:34.890 --> 00:27:37.590
<v Aaron van Wirdum>is written in a certain way. Do they look at the mempool?

00:27:37.830 --> 00:27:40.750
<v Sjors Provoost>Yeah, so that's another question I don't know the answer to. I think it would be

00:27:40.750 --> 00:27:44.390
<v Sjors Provoost>wise if your Lightning software checks what's happening in the mempool. I don't

00:27:44.390 --> 00:27:48.410
<v Sjors Provoost>know if that means it should immediately respond to it. Maybe that's overzealous,

00:27:48.530 --> 00:27:52.370
<v Sjors Provoost>you know, because maybe it was a mistake and the other side corrects it with, you

00:27:52.370 --> 00:27:56.410
<v Sjors Provoost>know, bumps it into a non-[unclear]. I don't know what the game theory is there.

00:27:56.610 --> 00:28:00.450
<v Sjors Provoost>But if we run through this example, let's say, so let's say your node is no

00:28:00.450 --> 00:28:04.130
<v Sjors Provoost>longer catching up with blocks because some exploit caused it to stop. It caused

00:28:04.130 --> 00:28:09.290
<v Sjors Provoost>it to stop syncing new blocks. Then that means you will see transactions appear

00:28:09.290 --> 00:28:13.320
<v Sjors Provoost>in the mempool. And your mempool will get very big very quickly. If it's two

00:28:13.320 --> 00:28:18.780
<v Sjors Provoost>megabytes per block within 150 blocks, you have a full mempool, and any new

00:28:18.780 --> 00:28:22.940
<v Sjors Provoost>transaction that comes in is probably going to be ignored. It kind of overflows.

00:28:23.060 --> 00:28:27.260
<v Sjors Provoost>Depends, maybe it's paying a high fee, maybe not. That means that's about a day,

00:28:27.480 --> 00:28:32.540
<v Sjors Provoost>150 blocks. So that means if your timeouts are set to about a day, you could be

00:28:32.540 --> 00:28:37.180
<v Sjors Provoost>in a situation where somebody's cheating on you. That transaction is in other

00:28:37.180 --> 00:28:40.600
<v Sjors Provoost>people's mempool, but not in your mempool because your mempool is already

00:28:40.600 --> 00:28:41.580
<v Sjors Provoost>overflowed through the bug.

00:28:42.160 --> 00:28:46.740
<v Aaron van Wirdum>Yeah, and because there's no new blocks coming in from your perspective. So every

00:28:46.740 --> 00:28:48.400
<v Aaron van Wirdum>transaction just stays in the mempool.

00:28:48.620 --> 00:28:51.720
<v Sjors Provoost>So unless you have a giant alarm system, you might not even know that this is

00:28:51.720 --> 00:28:55.150
<v Sjors Provoost>going on and you've already been cheated. But let's say there is a big alarm

00:28:55.150 --> 00:28:59.050
<v Sjors Provoost>system, then you have another problem because you still have this one-day

00:28:59.050 --> 00:29:03.650
<v Sjors Provoost>deadline. So even though you know there's a problem, you can't act because the

00:29:03.650 --> 00:29:07.070
<v Sjors Provoost>node is broken and you don't know how to fix your own node because you'd have to

00:29:07.070 --> 00:29:11.510
<v Sjors Provoost>be able to write consensus code. So if there's not a patch within that 24 hours,

00:29:11.650 --> 00:29:14.990
<v Sjors Provoost>you're still in trouble. So that's kind of one of the things I would be worried

00:29:14.990 --> 00:29:17.810
<v Sjors Provoost>about here. Now, that's not a problem if you set the timeouts as something more

00:29:17.810 --> 00:29:23.270
<v Sjors Provoost>reasonable. But, yeah, if you're reliant on somebody making a hot fix within 24

00:29:23.270 --> 00:29:28.330
<v Sjors Provoost>hours while you're on a plane, it's not good. So, you know, maybe this is

00:29:28.330 --> 00:29:31.090
<v Sjors Provoost>completely exaggerated, but I'm just trying to illustrate why these things could

00:29:31.090 --> 00:29:35.230
<v Sjors Provoost>be bad and why I think it's good to have a good post-mortem on thinking, in

00:29:35.230 --> 00:29:39.270
<v Sjors Provoost>general, thinking through all these scenarios. And maybe the Lightning developers

00:29:39.270 --> 00:29:40.890
<v Sjors Provoost>are thinking through all those scenarios.

00:29:41.430 --> 00:29:45.250
<v Aaron van Wirdum>Yeah, I was going to say, I mean, it might be a hard attack to pull off or a

00:29:45.250 --> 00:29:47.450
<v Aaron van Wirdum>niche risk, but you've got to think about it, right?

00:29:48.320 --> 00:29:49.420
<v Sjors Provoost>Yeah, I think so.

00:29:49.800 --> 00:29:54.280
<v Aaron van Wirdum>Okay. What about routing? Would routing be affected? I think routing was

00:29:54.280 --> 00:29:58.630
<v Aaron van Wirdum>affected. I'm not sure how, but I think there were less routes available, I

00:29:58.630 --> 00:29:59.730
<v Aaron van Wirdum>guess, because nodes were going down.

00:29:59.370 --> 00:30:01.990
<v Sjors Provoost>It could be the same reason. It could be that a node says, hey, I'm too far

00:30:01.990 --> 00:30:06.750
<v Sjors Provoost>behind the real world, or I'm not seeing any new blocks. So generally, nodes have

00:30:06.750 --> 00:30:09.750
<v Sjors Provoost>a heuristic. At least Bitcoin Core has a heuristic. I think that if you don't see

00:30:09.750 --> 00:30:14.270
<v Sjors Provoost>a new block within two hours, some alarm bells go off internally. It tries to

00:30:14.270 --> 00:30:19.290
<v Sjors Provoost>make more connections. Perhaps Lightning software has similar things that after a

00:30:19.290 --> 00:30:21.990
<v Sjors Provoost>few hours of no update, it says, you know what? I'm not sure what's going on in

00:30:21.990 --> 00:30:26.510
<v Sjors Provoost>the world. I'm going to stop forwarding payments now. So maybe it just refuses to

00:30:26.510 --> 00:30:30.710
<v Sjors Provoost>forward any new payments until it's up to date again. Things like that could happen.

00:30:31.050 --> 00:30:31.170
<v Aaron van Wirdum>Right.

00:30:32.530 --> 00:30:36.930
<v Sjors Provoost>So that would definitely cause some systemic effects where you would certainly

00:30:36.930 --> 00:30:40.570
<v Sjors Provoost>find that all your routes are not working or a lot of them because some of them

00:30:40.570 --> 00:30:43.050
<v Sjors Provoost>are running as a piece of software that's down.

00:30:43.510 --> 00:30:46.190
<v Aaron van Wirdum>Yep. Okay Sjors, is that it?

00:30:46.700 --> 00:30:48.080
<v Sjors Provoost>I think so.

00:30:48.080 --> 00:30:53.120
<v Aaron van Wirdum>Yeah I think so. So clearly this was a little bit of a guessing episode or

00:30:53.120 --> 00:30:57.610
<v Aaron van Wirdum>speculation informed speculation how you want to call it we're trying to figure

00:30:57.610 --> 00:31:02.230
<v Aaron van Wirdum>out what went wrong and we weren't exactly sure and we've we weren't really

00:31:02.230 --> 00:31:07.060
<v Aaron van Wirdum>finding the answer we're looking for so again if anyone knows more than us Let us

00:31:07.060 --> 00:31:09.400
<v Aaron van Wirdum>know. Maybe we'll cover it in the next episode.

00:31:09.520 --> 00:31:09.780
<v Sjors Provoost>Who knows?

00:31:09.780 --> 00:31:14.060
<v Aaron van Wirdum>We'll definitely mention it in the next episode. I don't know if we'll do a whole

00:31:14.060 --> 00:31:18.240
<v Aaron van Wirdum>other episode about it. But please let us know if you know anything more. Sjors,

00:31:18.340 --> 00:31:19.300
<v Aaron van Wirdum>is Lightning still reckless?

00:31:21.000 --> 00:31:23.600
<v Sjors Provoost>It depends on what you're doing. I think generally it's fine.

00:31:23.640 --> 00:31:28.700
<v Aaron van Wirdum>Such a nuanced answer. Just say yes. Reckless. Lightning is reckless. Everyone's

00:31:28.700 --> 00:31:30.540
<v Aaron van Wirdum>reckless. That's what we want to hear.

00:31:31.020 --> 00:31:35.140
<v Sjors Provoost>It's not too bad. I mean, Bitcoin is still an experiment, right? So I guess

00:31:35.140 --> 00:31:37.680
<v Sjors Provoost>that's all. Then thank you for listening to Bitcoin.

00:31:38.320 --> 00:31:38.740
<v Aaron van Wirdum>Explained.

