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

00:00:19.600 --> 00:00:21.820
<v Aaron van Wirdum>Live from Utrecht, this is Bitcoin,

00:00:22.520 --> 00:00:22.960
<v Sjors Provoost>Explained.

00:00:23.600 --> 00:00:28.500
<v Aaron van Wirdum>Sjors, it's been a month. That means you had a whole month to think about this

00:00:28.500 --> 00:00:33.760
<v Aaron van Wirdum>poem that you told me you're going to tell our dear listeners for this episode.

00:00:33.960 --> 00:00:35.040
<v Aaron van Wirdum>Let's hear it. Let's hear it.

00:00:35.160 --> 00:00:40.840
<v Sjors Provoost>That's right. So it's cold outside. The government is cold. You know what else is cold?

00:00:42.450 --> 00:00:43.630
<v Aaron van Wirdum>Sjors, our sponsor.

00:00:44.090 --> 00:00:44.830
<v Sjors Provoost>That's right.

00:00:45.050 --> 00:00:50.770
<v Aaron van Wirdum>The COLDCARD. The COLDCARD. If you have coins, you want to store them. COLDCARD

00:00:50.770 --> 00:00:53.960
<v Aaron van Wirdum>is the place for that. Is the audio okay? Are we too loud?

00:00:53.960 --> 00:00:54.900
<v Sjors Provoost>It's too much echo.

00:00:54.900 --> 00:01:00.640
<v Aaron van Wirdum>Too much echo? Okay, uh, COLDCARD COLDCARD COLDCARD

00:01:00.640 --> 00:01:06.440
<v Aaron van Wirdum>COLDCARD COLDCARD COLDCARD I think that was like our 20

00:01:06.440 --> 00:01:09.500
<v Aaron van Wirdum>seconds that we're obligated to talk about the COLDCARD. What do you think?

00:01:09.500 --> 00:01:12.440
<v Sjors Provoost>I think it's great, but it's a hardware wallet, for people who don't know.

00:01:12.440 --> 00:01:15.680
<v Aaron van Wirdum>Yes. Why did you say the government is cold?

00:01:15.680 --> 00:01:18.020
<v Sjors Provoost>Well, that's a segue to our next section.

00:01:18.020 --> 00:01:23.740
<v Aaron van Wirdum>So this episode we're going to talk about the Great Consensus

00:01:23.740 --> 00:01:29.200
<v Aaron van Wirdum>Cleanup Revival, which is a proposed soft fork, which sort of

00:01:29.200 --> 00:01:33.760
<v Aaron van Wirdum>includes several soft forks into one, you could kind of argue, right? Basically,

00:01:33.760 --> 00:01:38.480
<v Aaron van Wirdum>that's what it comes down to. But before that, a lot has happened in the Bitcoin

00:01:38.480 --> 00:01:44.480
<v Aaron van Wirdum>and Ethereum space in a way that's relevant to Bitcoin as well. So you want

00:01:44.480 --> 00:01:48.380
<v Aaron van Wirdum>to touch on that a little bit first. You've been following it pretty closely.

00:01:49.660 --> 00:01:54.380
<v Aaron van Wirdum>Let's start with... Where do we start? Let's start with what happened with

00:01:54.380 --> 00:01:55.720
<v Aaron van Wirdum>Tornado Cash in the Netherlands.

00:01:56.040 --> 00:01:59.980
<v Sjors Provoost>Yeah, in case anybody was living under a rock, the Tornado Cash, we talked about

00:01:59.980 --> 00:02:05.680
<v Sjors Provoost>that in episode 69. But he got convicted, so

00:02:05.680 --> 00:02:06.480
<v Sjors Provoost>that's bad.

00:02:08.210 --> 00:02:13.830
<v Aaron van Wirdum>Yeah, Alexey Pertsev, one of the Tornado Cash developers, got convicted for 64

00:02:13.830 --> 00:02:14.790
<v Aaron van Wirdum>months in prison.

00:02:15.210 --> 00:02:15.390
<v Sjors Provoost>Yep.

00:02:16.090 --> 00:02:21.500
<v Aaron van Wirdum>Which does seem to have a lot of relevance for Bitcoin because... really he was

00:02:21.500 --> 00:02:25.680
<v Aaron van Wirdum>just writing codes, uh, you know, he was writing privacy code, but he was never…

00:02:25.680 --> 00:02:29.800
<v Aaron van Wirdum>Maybe you should give the context. Well, why do you think it's relevant for Bitcoin?

00:02:30.440 --> 00:02:34.500
<v Sjors Provoost>Well, the main point of relevance for us, I think, is the fact that he was

00:02:34.500 --> 00:02:39.120
<v Sjors Provoost>building a non-custodial system. So a system that does not hold the coins

00:02:39.120 --> 00:02:42.320
<v Sjors Provoost>yourself. I mean, there's a website and those kind of tools.

00:02:43.740 --> 00:02:48.140
<v Sjors Provoost>So that's a very dangerous precedent, I think, because it's not very clear where

00:02:48.140 --> 00:02:49.000
<v Sjors Provoost>that line is.

00:02:49.260 --> 00:02:54.140
<v Aaron van Wirdum>Yeah, we already knew that running a custodial mixer, which a lot of other mixers

00:02:54.140 --> 00:02:57.840
<v Aaron van Wirdum>were, where you just send coins to someone and that someone sends different coins

00:02:57.840 --> 00:03:02.420
<v Aaron van Wirdum>back. That was always illegal, and everyone knew that was illegal. If you're

00:03:02.420 --> 00:03:05.300
<v Aaron van Wirdum>doing that, that's basically money laundering, and that is illegal.

00:03:05.500 --> 00:03:10.080
<v Sjors Provoost>Well, I think you can narrow it down slightly. It's not illegal to mix the coins,

00:03:10.200 --> 00:03:14.540
<v Sjors Provoost>but it is when you don't do KYC, I guess. That's maybe a different

00:03:14.540 --> 00:03:15.000
<v Sjors Provoost>interpretation.

00:03:15.480 --> 00:03:15.660
<v Aaron van Wirdum>Right.

00:03:15.800 --> 00:03:21.380
<v Sjors Provoost>But for all practical purposes, you can't build a mixer with KYC in an ethical

00:03:21.380 --> 00:03:26.850
<v Sjors Provoost>way anyway. So it, you know, effectively mixers are illegal, but technically I

00:03:26.850 --> 00:03:30.130
<v Sjors Provoost>think the the non-KYC part of the mixer is what makes it illegal.

00:03:30.130 --> 00:03:35.170
<v Aaron van Wirdum>Fair enough. In either case, so far it was generally assumed that, yeah, if

00:03:35.170 --> 00:03:39.330
<v Aaron van Wirdum>you're taking coins and they're sending other coins, then you you're at risk, but

00:03:39.330 --> 00:03:43.870
<v Aaron van Wirdum>if you're just developing software which allows other people to send their coins

00:03:43.870 --> 00:03:47.710
<v Aaron van Wirdum>to other people, then, you know, that that then you're not the one money

00:03:47.710 --> 00:03:52.500
<v Aaron van Wirdum>laundering. However, the Dutch court just struck that down. And now it looks

00:03:52.500 --> 00:03:57.360
<v Aaron van Wirdum>like, nope, just developing code can make you responsible for how other people

00:03:57.360 --> 00:03:58.180
<v Aaron van Wirdum>use that code, right?

00:03:58.660 --> 00:04:02.260
<v Sjors Provoost>Well, probably, but we don't really know because this verdict was extremely

00:04:02.260 --> 00:04:06.900
<v Sjors Provoost>unclear about that. So we don't know if it's simply the act of writing code or it

00:04:06.900 --> 00:04:12.440
<v Sjors Provoost>is the, you know... making that code available on your own website, or

00:04:12.440 --> 00:04:18.380
<v Sjors Provoost>making that code available on some automatic website-like system, or whether

00:04:18.380 --> 00:04:22.820
<v Sjors Provoost>it's about maintaining this code after you've written it once, or if it's about

00:04:22.820 --> 00:04:27.140
<v Sjors Provoost>promoting the code or making money from the code, it's very unclear. And in fact,

00:04:27.380 --> 00:04:32.060
<v Sjors Provoost>the prosecutor seemed to emphasize making money from the code, but the judge much

00:04:32.060 --> 00:04:32.600
<v Sjors Provoost>less so.

00:04:33.820 --> 00:04:39.120
<v Aaron van Wirdum>Yeah, the prosecutor really... honed down on it essentially being a business.

00:04:39.730 --> 00:04:44.670
<v Aaron van Wirdum>And that's why you say the making money part was important. But the judge didn't

00:04:44.670 --> 00:04:48.710
<v Aaron van Wirdum>even really seem to focus on that. The judge just said, look, if you write this

00:04:48.710 --> 00:04:52.430
<v Aaron van Wirdum>code knowing that it can be used for this purpose and you don't do anything to

00:04:52.430 --> 00:04:57.110
<v Aaron van Wirdum>stop that, then you're responsible if it's really used for that purpose, right?

00:04:57.430 --> 00:04:58.410
<v Sjors Provoost>Yeah, pretty much.

00:04:58.870 --> 00:05:01.550
<v Aaron van Wirdum>The purpose here, of course, being money laundering.

00:05:01.890 --> 00:05:05.770
<v Sjors Provoost>Yeah, what was especially interesting, though not clear entirely how that's going

00:05:05.770 --> 00:05:09.540
<v Sjors Provoost>to apply to Bitcoin, was the argument that... he made the whole thing

00:05:09.540 --> 00:05:13.960
<v Sjors Provoost>unstoppable. So in Ethereum, part of the system at least is unstoppable. It's a

00:05:13.960 --> 00:05:16.160
<v Sjors Provoost>smart contract, unless you stop Ethereum itself, of course.

00:05:17.400 --> 00:05:21.280
<v Sjors Provoost>And the fact that he did that, where the prosecutor just tried to argue, well,

00:05:21.480 --> 00:05:25.380
<v Sjors Provoost>it's not all decentralized. Some of it is fake decentralization. Others is real.

00:05:25.860 --> 00:05:29.140
<v Sjors Provoost>The judge completely ignored that and basically said, well, the fact that you

00:05:29.140 --> 00:05:32.120
<v Sjors Provoost>even tried to make it decentralized, that is actually making it worse.

00:05:34.140 --> 00:05:37.980
<v Sjors Provoost>And that argument, of course, can apply extremely broadly because you could say,

00:05:38.080 --> 00:05:41.460
<v Sjors Provoost>well, if you just publish source and you know that other people are using that

00:05:41.460 --> 00:05:45.520
<v Sjors Provoost>source and you just keep updating that source code, well, that's also kind of

00:05:45.520 --> 00:05:46.560
<v Sjors Provoost>unstoppable in a way.

00:05:46.820 --> 00:05:47.220
<v Aaron van Wirdum>Yeah.

00:05:47.400 --> 00:05:52.020
<v Sjors Provoost>So that might also be a problem. And of course, we all know somebody, or we don't

00:05:52.020 --> 00:05:57.060
<v Sjors Provoost>know them, somebody who created an unstoppable system a long time ago and kept

00:05:57.060 --> 00:05:57.760
<v Sjors Provoost>working on it.

00:05:59.050 --> 00:06:01.330
<v Aaron van Wirdum>So you're referring to Satoshi Nakamoto.

00:06:01.330 --> 00:06:04.690
<v Sjors Provoost>Exactly. So we're waiting for his arrest warrant, I guess.

00:06:04.690 --> 00:06:09.910
<v Aaron van Wirdum>Yeah, well, the short way of looking at it, I would say, is we all thought so far

00:06:09.910 --> 00:06:15.730
<v Aaron van Wirdum>that there was a fairly clear line of what would make you, you know, what would

00:06:15.730 --> 00:06:21.510
<v Aaron van Wirdum>be… what would make you responsible, which is custody in a way. And

00:06:21.510 --> 00:06:24.850
<v Aaron van Wirdum>now it's kind of an all bets are off type of situation.

00:06:25.150 --> 00:06:29.210
<v Sjors Provoost>Yeah, and this creates a bit of a problem because we assumed that this line

00:06:29.210 --> 00:06:34.550
<v Sjors Provoost>existed, we did not do much to defend people who built custodial mixers. And in

00:06:34.550 --> 00:06:38.230
<v Sjors Provoost>retrospect, that was probably a mistake because as soon as you lose that line of

00:06:38.230 --> 00:06:44.020
<v Sjors Provoost>defense, now... I guess the only way to win now is to go all the way back

00:06:44.020 --> 00:06:47.860
<v Sjors Provoost>and say, no, all mixers should be legal, including custodial ones. But now you

00:06:47.860 --> 00:06:51.200
<v Sjors Provoost>have all this precedent that wasn't stopped. So that's a problem.

00:06:51.560 --> 00:06:57.470
<v Aaron van Wirdum>Right. Okay, let's move on to the actual

00:06:57.470 --> 00:07:00.270
<v Aaron van Wirdum>Bitcoin case, which is the Samourai devs.

00:07:00.450 --> 00:07:04.770
<v Sjors Provoost>And just add one little detail. As far as I know, he is going to appeal. So we'll

00:07:04.770 --> 00:07:08.070
<v Sjors Provoost>see what happens. And appeals can quite dramatically change things.

00:07:09.390 --> 00:07:11.110
<v Aaron van Wirdum>Yeah, is there any timeline?

00:07:11.810 --> 00:07:12.510
<v Sjors Provoost>I don't know.

00:07:13.270 --> 00:07:16.070
<v Aaron van Wirdum>Okay, so let's move to the more Bitcoin relevant case.

00:07:16.810 --> 00:07:18.510
<v Sjors Provoost>The more direct Bitcoin case.

00:07:18.610 --> 00:07:24.580
<v Aaron van Wirdum>Yeah, exactly. So the Samourai wallet developers, Keonne Rodriguez

00:07:24.580 --> 00:07:29.350
<v Aaron van Wirdum>and Bill Hill, William Hill. Both of them you know, right?

00:07:29.970 --> 00:07:34.710
<v Sjors Provoost>Yep, yeah. I used to work with them when I was at blockchain.com. Back in time,

00:07:34.790 --> 00:07:35.450
<v Sjors Provoost>blockchain.info.

00:07:35.710 --> 00:07:40.350
<v Aaron van Wirdum>Right, so they were arrested as well. One of them in Portugal, one of them in the

00:07:40.350 --> 00:07:45.310
<v Aaron van Wirdum>United States, but both on, uh, behalf of the Department of Justice.

00:07:45.310 --> 00:07:51.230
<v Aaron van Wirdum>Justice, DOJ. Uh, so, how… What what do you want to say

00:07:51.230 --> 00:07:52.690
<v Aaron van Wirdum>about that, if anything? How…

00:07:52.690 --> 00:07:58.570
<v Sjors Provoost>Well, I'm not surprised that this happened, because, you know, the fact that, uh,

00:07:58.570 --> 00:08:01.390
<v Sjors Provoost>they were going after Tornado Cash made it clear that they would go after

00:08:01.390 --> 00:08:02.190
<v Sjors Provoost>non-custodial

00:08:03.950 --> 00:08:07.390
<v Sjors Provoost>systems after non-custodial mixer. So it seemed like a matter of time before they

00:08:07.390 --> 00:08:11.250
<v Sjors Provoost>would go after it. And then obviously they always go after the biggest or at

00:08:11.250 --> 00:08:15.150
<v Sjors Provoost>least a big one. So the only question was, were they going to go after Wasabi or

00:08:15.150 --> 00:08:18.870
<v Sjors Provoost>were they going to go after Samourai? Samourai has some interesting marketing

00:08:18.870 --> 00:08:23.370
<v Sjors Provoost>that maybe made them more interesting to prosecute, but I don't know if the

00:08:23.370 --> 00:08:27.630
<v Sjors Provoost>difference, you know, and of course we know that Wasabi was doing some proactive

00:08:27.630 --> 00:08:30.310
<v Sjors Provoost>compliance-ish things.

00:08:32.440 --> 00:08:36.500
<v Sjors Provoost>But I don't know why they picked one and the other. Ultimately, we'll find out.

00:08:39.460 --> 00:08:40.840
<v Sjors Provoost>What else was I going to say about it?

00:08:40.840 --> 00:08:44.940
<v Aaron van Wirdum>Well, it was my suggestion to just sort of explain how the Samourai mixing

00:08:44.940 --> 00:08:50.830
<v Aaron van Wirdum>actually worked. But at this point, should we just move on to

00:08:50.830 --> 00:08:52.630
<v Aaron van Wirdum>the main topic of the episode?

00:08:52.930 --> 00:08:56.310
<v Sjors Provoost>No, I think it may make sense to briefly explain a little bit. So there's three

00:08:56.310 --> 00:09:00.850
<v Sjors Provoost>aspects to Samourai Wallet, I think, that are relevant. But one is it's not just

00:09:00.850 --> 00:09:05.850
<v Sjors Provoost>a mixer. Definitely not. It's a wallet, right? It's a non-custodial wallet. And

00:09:05.850 --> 00:09:09.850
<v Sjors Provoost>so far, it seems that that wallet was taken down mostly as a side effect of

00:09:09.850 --> 00:09:15.690
<v Sjors Provoost>taking the mixer down, not as a direct target. But it is down. But fortunately,

00:09:15.710 --> 00:09:19.530
<v Sjors Provoost>it was a non-custodial wallet and people wrote down their 12 words, hopefully.

00:09:20.190 --> 00:09:23.550
<v Sjors Provoost>And so they should be fine because they can just import it into another wallet.

00:09:24.010 --> 00:09:29.570
<v Sjors Provoost>But there was also a mixer component. I think the two most important parts of

00:09:29.570 --> 00:09:35.470
<v Sjors Provoost>that are something called the Whirlpool, which is a five input, five output

00:09:35.470 --> 00:09:37.290
<v Sjors Provoost>mixer that you can use multiple times.

00:09:37.670 --> 00:09:40.850
<v Aaron van Wirdum>Yeah, it's just a CoinJoin which uses equal amounts.

00:09:41.290 --> 00:09:46.860
<v Sjors Provoost>Yeah. And then there is something called Ricochet, which basically just, as far

00:09:46.860 --> 00:09:49.700
<v Sjors Provoost>as I understand it, just forwards your coins a couple of times. So you're making

00:09:49.700 --> 00:09:53.700
<v Sjors Provoost>a couple of unnecessary transactions and then you send the amount that you want

00:09:53.700 --> 00:09:58.500
<v Sjors Provoost>to send. And that might help when you're dealing with an exchange that only looks

00:09:58.500 --> 00:10:01.140
<v Sjors Provoost>at, say, five hops ago or two hops ago.

00:10:02.430 --> 00:10:06.070
<v Sjors Provoost>then maybe you can get around that. I don't know how effective any of these things are.

00:10:06.330 --> 00:10:09.370
<v Aaron van Wirdum>Yeah, you're basically making transactions to yourself a couple times.

00:10:09.690 --> 00:10:14.230
<v Sjors Provoost>Yeah, now it should be noted that from my reading of the indictment, they don't

00:10:14.230 --> 00:10:17.750
<v Sjors Provoost>even talk about whether or not these tools, these mixing tools were effective or

00:10:17.750 --> 00:10:21.670
<v Sjors Provoost>not. They just, you know, the fact that it's doing any mixing, that is the

00:10:21.670 --> 00:10:25.050
<v Sjors Provoost>problem. So that's something to keep in mind.

00:10:26.830 --> 00:10:31.390
<v Aaron van Wirdum>Yeah, I would say the Ricochet one, the fact that that one is even mentioned,

00:10:33.240 --> 00:10:37.760
<v Aaron van Wirdum>is blatantly absurd. Like, every wallet, with every wallet you can send coins to

00:10:37.760 --> 00:10:41.760
<v Aaron van Wirdum>yourself. This is just a button that just sort of automates that you do that a

00:10:41.760 --> 00:10:42.360
<v Aaron van Wirdum>couple of times.

00:10:42.360 --> 00:10:43.080
<v Sjors Provoost>Exactly.

00:10:43.080 --> 00:10:48.120
<v Aaron van Wirdum>That this is even… Like, the other, the Whirlpool, I can sort of at least

00:10:48.120 --> 00:10:51.760
<v Aaron van Wirdum>understand why it's seen as some… I mean, I don't agree with…

00:10:51.760 --> 00:10:55.580
<v Sjors Provoost>Well, the Whirlpool requires coordinating with other users, right? Whereas the

00:10:55.580 --> 00:11:00.340
<v Sjors Provoost>Ricochet thing does not. It's just your wallet sending a transaction to itself

00:11:00.340 --> 00:11:01.720
<v Sjors Provoost>essentially five times in a row.

00:11:01.720 --> 00:11:04.940
<v Aaron van Wirdum>Yeah, which again, literally every wallet can do.

00:11:04.940 --> 00:11:10.460
<v Sjors Provoost>But I would be very surprised if in the court case they're going to debate the

00:11:10.460 --> 00:11:16.200
<v Sjors Provoost>specific details of what is and what is not mixing. My guess is

00:11:16.200 --> 00:11:19.840
<v Sjors Provoost>they just go go with the marketing. They say, well, you guys called it a mixer,

00:11:19.840 --> 00:11:22.380
<v Sjors Provoost>and that's all we care about.

00:11:22.380 --> 00:11:25.180
<v Aaron van Wirdum>Right, anyways.

00:11:27.290 --> 00:11:32.410
<v Aaron van Wirdum>Yeah, seems like a new era in Bitcoin and Bitcoin development to me.

00:11:32.790 --> 00:11:37.390
<v Sjors Provoost>Yeah, and I think we could briefly do a recap of the differences, how these cases

00:11:37.390 --> 00:11:41.350
<v Sjors Provoost>relate to each other. So we brought up most of the things. So the interesting

00:11:41.350 --> 00:11:45.150
<v Sjors Provoost>thing about Samourai is that it's only happening in the US, whereas the Tornado

00:11:45.150 --> 00:11:50.070
<v Sjors Provoost>Cash trial is happening in the US and the Netherlands in parallel, which is interesting.

00:11:50.490 --> 00:11:53.630
<v Aaron van Wirdum>Yeah, you didn't mention that yet, but yeah, one of the other...

00:11:54.840 --> 00:11:58.820
<v Aaron van Wirdum>Tornado Cash co-founders was arrested in the US and will be on trial there.

00:11:59.180 --> 00:12:03.200
<v Sjors Provoost>Yeah, and this is interesting because the Dutch court system is not very

00:12:03.200 --> 00:12:08.100
<v Sjors Provoost>transparent. You can go to the court hearings, but you don't get to see any of

00:12:08.100 --> 00:12:11.640
<v Sjors Provoost>the dossier. Whereas in the US, it's much more transparent. So we'll probably

00:12:11.640 --> 00:12:15.700
<v Sjors Provoost>learn much more about the Dutch case through the US case.

00:12:18.290 --> 00:12:19.790
<v Sjors Provoost>Both of them are non-custodial.

00:12:21.700 --> 00:12:26.460
<v Sjors Provoost>Both of them use a... Well, no. So the Samourai uses a central coordinator. So

00:12:26.460 --> 00:12:29.820
<v Sjors Provoost>that might be a service. Whereas in Tornado Cash, it's a smart contract. So

00:12:29.820 --> 00:12:34.520
<v Sjors Provoost>that's not really a service. Although the prosecutor argued that it's a service anyway.

00:12:36.000 --> 00:12:38.540
<v Aaron van Wirdum>You mean the main smart contract?

00:12:39.330 --> 00:12:43.730
<v Sjors Provoost>Yeah, the main smart contract and everything around it. You could argue like it's

00:12:43.730 --> 00:12:47.210
<v Sjors Provoost>an autonomous system, so it's not really a service, but that's what they're

00:12:47.210 --> 00:12:51.530
<v Sjors Provoost>arguing, I think, in both the Netherlands and the U.S. against or for, depending

00:12:51.530 --> 00:12:57.130
<v Sjors Provoost>on which side you're at. I'd say Samourai used fees, fairly, pretty direct fee

00:12:57.130 --> 00:12:59.550
<v Sjors Provoost>system, whereas the...

00:13:00.940 --> 00:13:05.560
<v Sjors Provoost>Tornado Cash system did not charge fees directly. At least the fees don't go

00:13:05.560 --> 00:13:10.240
<v Sjors Provoost>directly to the developers or operators. They have a more convoluted tokenomic

00:13:10.240 --> 00:13:16.220
<v Sjors Provoost>system where at least the prosecutor argued that these tokenomics are, you

00:13:16.220 --> 00:13:19.020
<v Sjors Provoost>know, how it is how the business works.

00:13:19.020 --> 00:13:19.980
<v Aaron van Wirdum>I

00:13:21.420 --> 00:13:26.840
<v Aaron van Wirdum>think the short summary I would give is if the Tornado Cash developer is guilty

00:13:26.840 --> 00:13:32.010
<v Aaron van Wirdum>in the Netherlands, which he is, then the Samourai developers have to be as well.

00:13:32.150 --> 00:13:34.070
<v Aaron van Wirdum>So it's sort of even more straightforward.

00:13:34.350 --> 00:13:37.170
<v Sjors Provoost>Exactly. Samourai is a simpler case.

00:13:37.370 --> 00:13:37.630
<v Aaron van Wirdum>Right.

00:13:40.350 --> 00:13:44.950
<v Aaron van Wirdum>So, yeah, bad news. Let's move on to our actual topic for the podcast. What do you think?

00:13:45.290 --> 00:13:47.210
<v Sjors Provoost>Yeah, also some bad news in a way.

00:13:48.170 --> 00:13:50.450
<v Aaron van Wirdum>Yeah, but bad news that we're gonna fix, right?

00:13:50.450 --> 00:13:53.070
<v Sjors Provoost>Sure. Yeah, exactly, that we hopefully fix in time.

00:13:53.070 --> 00:13:58.890
<v Aaron van Wirdum>So we're gonna talk main topic of the of the podcast. Finally we're here. We're

00:13:58.890 --> 00:14:03.310
<v Aaron van Wirdum>here, ladies and gentlemen. We're gonna talk about the Great Consensus Cleanup,

00:14:03.310 --> 00:14:08.550
<v Aaron van Wirdum>or maybe more specifically the Great Consensus Cleanup Revival. That's right,

00:14:08.550 --> 00:14:13.110
<v Aaron van Wirdum>because the Great Consensus Cleanup was proposed by Matt Corallo a couple years

00:14:13.110 --> 00:14:19.080
<v Aaron van Wirdum>ago and was recently revived by Antoine Poinsot. Am

00:14:19.080 --> 00:14:19.680
<v Aaron van Wirdum>I saying that right?

00:14:19.680 --> 00:14:20.280
<v Sjors Provoost>Probably.

00:14:20.280 --> 00:14:24.540
<v Aaron van Wirdum>It was him, right? I got the person right, at least, whether I got the name

00:14:24.540 --> 00:14:30.300
<v Aaron van Wirdum>pronunciation right… Well, yeah, not sure about that one. Uh, and the

00:14:30.300 --> 00:14:36.020
<v Aaron van Wirdum>Great Consensus Cleanup Revival, maybe what's the difference

00:14:36.020 --> 00:14:38.320
<v Aaron van Wirdum>between the original and the revival? Is there a difference?

00:14:39.420 --> 00:14:44.840
<v Sjors Provoost>Yeah, there is. So the revival adds something, and I guess I'll let you know when

00:14:44.840 --> 00:14:45.900
<v Sjors Provoost>we get to that new bit.

00:14:46.220 --> 00:14:51.240
<v Aaron van Wirdum>Okay, and as far as I understand, the great consensus cleanup would be, well,

00:14:51.360 --> 00:14:56.840
<v Aaron van Wirdum>would basically be one soft fork that bundles several soft forks, and these soft

00:14:56.840 --> 00:15:00.860
<v Aaron van Wirdum>forks sort of fix existing bugs in the protocol.

00:15:01.160 --> 00:15:06.180
<v Sjors Provoost>Yeah, there could be individual soft forks, and in the worst case, maybe out of

00:15:06.180 --> 00:15:10.220
<v Sjors Provoost>the four components, people really like three of them and are kind of arguing

00:15:10.220 --> 00:15:14.380
<v Sjors Provoost>about the fourth one, then you can simply do three and not do the other one.

00:15:14.580 --> 00:15:19.500
<v Aaron van Wirdum>Okay, and if I understand correctly, basically everyone, and when I say everyone,

00:15:19.580 --> 00:15:24.400
<v Aaron van Wirdum>I mean everyone that has enough expertise to have an opinion in the first place,

00:15:24.740 --> 00:15:27.600
<v Aaron van Wirdum>agrees that at least the bugs are problems.

00:15:29.160 --> 00:15:34.700
<v Aaron van Wirdum>there's maybe at most like some conversation about the best way to solve these

00:15:34.700 --> 00:15:38.760
<v Aaron van Wirdum>problems, whether these are the best ways. But the problems are real. There's no

00:15:38.760 --> 00:15:42.300
<v Aaron van Wirdum>one that says, no, these are actually features, right? These are just real

00:15:42.300 --> 00:15:44.440
<v Aaron van Wirdum>problems, bugs that exist in the Bitcoin protocol.

00:15:44.560 --> 00:15:48.720
<v Sjors Provoost>I think when it comes to the time warp attack, there might have been someone who

00:15:48.720 --> 00:15:53.140
<v Sjors Provoost>could think of some interesting schemes that you can do using a time warp attack.

00:15:53.140 --> 00:15:56.720
<v Aaron van Wirdum>That's right. Yeah, you're thinking of Mark Friedenbach, who had some sort of

00:15:56.720 --> 00:16:01.360
<v Aaron van Wirdum>proposal years ago to sort of increase the block size. And yes, yeah, yeah,

00:16:01.360 --> 00:16:03.320
<v Aaron van Wirdum>you're right, but let's…

00:16:03.320 --> 00:16:04.360
<v Sjors Provoost>Every bug is a feature.

00:16:04.360 --> 00:16:08.400
<v Aaron van Wirdum>Yeah, let's table that for a second. Although, I mean, it is interesting that you

00:16:08.400 --> 00:16:08.900
<v Aaron van Wirdum>bring that up.

00:16:08.900 --> 00:16:13.540
<v Sjors Provoost>But, well, I mean, that won't work if somebody exploits the time warp maliciously

00:16:13.540 --> 00:16:17.140
<v Sjors Provoost>before the legitimate use case happens, I think.

00:16:20.180 --> 00:16:25.440
<v Aaron van Wirdum>Well, is the legitimate use case still possible after this bug would be fixed?

00:16:25.800 --> 00:16:26.720
<v Sjors Provoost>Actually, I'm not sure.

00:16:26.900 --> 00:16:27.640
<v Aaron van Wirdum>Probably not, right?

00:16:27.640 --> 00:16:31.900
<v Sjors Provoost>We'll show that. So there may be, you know, as always, there may be some ways

00:16:31.900 --> 00:16:35.120
<v Sjors Provoost>that you could use this to your advantage. I think it's better to fix them.

00:16:35.340 --> 00:16:40.000
<v Aaron van Wirdum>Yeah. Okay. And so there are basically four bugs, right? There are four bugs.

00:16:40.180 --> 00:16:43.600
<v Aaron van Wirdum>There are four things that this would solve.

00:16:43.800 --> 00:16:47.380
<v Sjors Provoost>That's right. Plus an open invitation to anyone who knows another bug.

00:16:49.490 --> 00:16:53.840
<v Aaron van Wirdum>Okay, so four. Let's start with the first one. So the first one, you already

00:16:53.840 --> 00:16:58.590
<v Aaron van Wirdum>mentioned it, the time warp attack, the time warp problem, what do we call this?

00:16:58.590 --> 00:17:00.030
<v Sjors Provoost>Yeah, the time warp attack.

00:17:00.030 --> 00:17:05.690
<v Aaron van Wirdum>Yeah, and so it's about the the time warp… The time warp attack is possible now

00:17:05.690 --> 00:17:09.510
<v Aaron van Wirdum>and we're talking about fixing that that is possible. Like, that shouldn't be

00:17:09.510 --> 00:17:10.590
<v Aaron van Wirdum>possible, essentially, right?

00:17:10.590 --> 00:17:14.010
<v Sjors Provoost>That's right. And we did an earlier episode about the time warp attack. It's

00:17:14.010 --> 00:17:17.030
<v Sjors Provoost>episode number five, so scroll all the way back.

00:17:17.030 --> 00:17:18.430
<v Aaron van Wirdum>That's a long time back.

00:17:18.430 --> 00:17:23.010
<v Sjors Provoost>Where we explain how it works, I think. I didn't listen back to it. Um, but

00:17:23.010 --> 00:17:28.150
<v Sjors Provoost>basically, I mean, the TL;DR is that you can mess with the timestamps in every

00:17:28.150 --> 00:17:32.530
<v Sjors Provoost>block. So miners can, you know, Bitcoin is not a clock contrary to popular

00:17:32.530 --> 00:17:38.430
<v Sjors Provoost>belief, but blocks do have a timestamp in it. And this timestamp cannot,

00:17:38.990 --> 00:17:42.430
<v Sjors Provoost>I mean, the miner can pick this timestamp however they want, but there are a few

00:17:42.430 --> 00:17:47.370
<v Sjors Provoost>restrictions on it based on earlier possible attacks. One of the restrictions is

00:17:47.370 --> 00:17:51.490
<v Sjors Provoost>that it cannot be more than two hours in the future as determined when you

00:17:51.490 --> 00:17:52.110
<v Sjors Provoost>receive the block.

00:17:53.390 --> 00:17:59.200
<v Sjors Provoost>The other rule is that every, I think it's the rolling average or the median, I

00:17:59.200 --> 00:18:03.940
<v Sjors Provoost>should say, of the last 11 blocks has to go up by one second every block.

00:18:06.140 --> 00:18:11.300
<v Sjors Provoost>And so basically, the block time has to go up a little bit and it can't be too

00:18:11.300 --> 00:18:13.720
<v Sjors Provoost>far in the future. Those are the only two restrictions, but it turns out you can

00:18:13.720 --> 00:18:16.220
<v Sjors Provoost>still mess with the system with those two rules.

00:18:17.460 --> 00:18:18.060
<v Aaron van Wirdum>How so?

00:18:19.600 --> 00:18:23.040
<v Sjors Provoost>Well, you can basically fool the system.

00:18:25.400 --> 00:18:30.080
<v Sjors Provoost>I think we need to explain another related bug here first, which is how

00:18:30.080 --> 00:18:35.920
<v Sjors Provoost>the difficulty adjustment works. So the goal of the system is to keep

00:18:35.920 --> 00:18:41.620
<v Sjors Provoost>one block every 10 minutes, and this is achieved by looking at the last block in

00:18:41.620 --> 00:18:46.020
<v Sjors Provoost>the difficulty adjustment period and comparing it to the first block in that

00:18:46.020 --> 00:18:51.630
<v Sjors Provoost>period, and then dividing it by 2016. And there are multiple problems with that,

00:18:51.670 --> 00:18:56.740
<v Sjors Provoost>but the biggest one is that you are not comparing the first block of each period

00:18:56.740 --> 00:19:00.560
<v Sjors Provoost>to the first block of each last period. You're comparing the first block of a

00:19:00.560 --> 00:19:05.020
<v Sjors Provoost>period to the last block of a period. And that allows you to kind of mess around

00:19:05.020 --> 00:19:05.500
<v Sjors Provoost>the edges.

00:19:08.850 --> 00:19:11.750
<v Aaron van Wirdum>Oh, yeah. Okay. So how do you mess around the edges?

00:19:12.510 --> 00:19:16.390
<v Sjors Provoost>Well, one thing you can do here is you can increase the timestamp of...

00:19:16.390 --> 00:19:22.030
<v Sjors Provoost>Basically, you increase the timestamp of every block as little as possible.

00:19:22.090 --> 00:19:28.050
<v Sjors Provoost>So the entire two-week period... will look like it's only a few minutes, basically.

00:19:28.390 --> 00:19:33.970
<v Aaron van Wirdum>Yeah, and to be clear, this would require a majority of miners to collaborate, right?

00:19:33.970 --> 00:19:39.130
<v Sjors Provoost>Yeah, the time warp attack is a 51% attack, basically, or requires a 51% attack.

00:19:39.410 --> 00:19:45.230
<v Aaron van Wirdum>So a majority of miners is faking the timestamps, and all nodes on the network

00:19:45.230 --> 00:19:49.790
<v Aaron van Wirdum>will accept this because it's not breaking the rules. The nodes are just looking,

00:19:49.950 --> 00:19:55.460
<v Aaron van Wirdum>is this block mined in the future? And is it mined at least one second

00:19:55.460 --> 00:19:58.340
<v Aaron van Wirdum>previously, later than like the 11 blocks before?

00:19:58.720 --> 00:19:58.780
<v Sjors Provoost>Exactly.

00:19:59.420 --> 00:20:03.860
<v Aaron van Wirdum>So then you can mine, you can fake the timestamps to make every blocks look like

00:20:03.860 --> 00:20:05.980
<v Aaron van Wirdum>it was all mined within the same minutes, basically.

00:20:06.140 --> 00:20:06.260
<v Sjors Provoost>Yeah.

00:20:06.440 --> 00:20:08.480
<v Aaron van Wirdum>Like a whole period mined within the same minute.

00:20:08.620 --> 00:20:12.060
<v Sjors Provoost>Why would you want to do that? Well, there's another part of this attack, which

00:20:12.060 --> 00:20:15.200
<v Sjors Provoost>is where you take the last block of the difficulty adjustment period, and there

00:20:15.200 --> 00:20:18.880
<v Sjors Provoost>you don't lie. You just put it two hours in the future or right now. It doesn't

00:20:18.880 --> 00:20:24.020
<v Sjors Provoost>really matter. If you do that in just one difficulty adjustment period, it really

00:20:24.020 --> 00:20:29.040
<v Sjors Provoost>has almost no effect, right? Because the first block in that period had a real

00:20:29.040 --> 00:20:33.520
<v Sjors Provoost>time because you weren't lying. The last block in the period has a real time

00:20:33.520 --> 00:20:37.060
<v Sjors Provoost>because you weren't lying. You were only lying for all the other blocks. So the

00:20:37.060 --> 00:20:40.780
<v Sjors Provoost>difficulty will just stay the same because it took you two weeks to make these

00:20:40.780 --> 00:20:46.780
<v Sjors Provoost>blocks. But the attack has already begun, even though it doesn't have any visible

00:20:46.780 --> 00:20:52.680
<v Sjors Provoost>effect yet. For the next two weeks, you do the same thing. So the first block,

00:20:52.940 --> 00:20:56.820
<v Sjors Provoost>you set a fake time as low as possible. So much older than the last block of the

00:20:56.820 --> 00:20:59.400
<v Sjors Provoost>previous period. You just keep that original clock going.

00:20:59.640 --> 00:21:03.100
<v Aaron van Wirdum>Right. So now you're back in the original minute, so to say.

00:21:03.950 --> 00:21:09.370
<v Sjors Provoost>Yes. And now the last block, you're speaking the truth again. The last block of

00:21:09.370 --> 00:21:14.360
<v Sjors Provoost>the period. And now if the blockchain is looking at what to do with the

00:21:14.360 --> 00:21:19.920
<v Sjors Provoost>difficulty, it's seeing the last block of the period, which is real. And it's

00:21:19.920 --> 00:21:23.020
<v Sjors Provoost>seeing the first block of that new period, which is now four weeks ago.

00:21:23.180 --> 00:21:23.420
<v Aaron van Wirdum>Right.

00:21:23.600 --> 00:21:25.940
<v Sjors Provoost>Because we've only increased that timer very slowly.

00:21:26.160 --> 00:21:26.260
<v Aaron van Wirdum>Yeah.

00:21:26.500 --> 00:21:29.820
<v Sjors Provoost>And so that means the difficulty can be cut in half now.

00:21:30.220 --> 00:21:30.360
<v Aaron van Wirdum>Yeah.

00:21:30.520 --> 00:21:32.200
<v Sjors Provoost>And then you repeat this little trick.

00:21:32.420 --> 00:21:36.040
<v Aaron van Wirdum>Yeah. The rest of the network, all nodes are looking at these two blocks and

00:21:36.040 --> 00:21:40.770
<v Aaron van Wirdum>they're thinking, wow, it took a whole month to mine 2016 blocks it's way too

00:21:40.770 --> 00:21:45.790
<v Aaron van Wirdum>long. We got to decrease the difficulty by half. So now difficulty is divided by

00:21:45.790 --> 00:21:49.690
<v Aaron van Wirdum>half. Even though that was not really necessary, it's just the timestamps were

00:21:49.690 --> 00:21:50.350
<v Aaron van Wirdum>all being faked.

00:21:50.590 --> 00:21:56.390
<v Sjors Provoost>Exactly. So now you can make two weeks worth of blocks in just

00:21:56.390 --> 00:21:57.150
<v Sjors Provoost>one week.

00:21:57.950 --> 00:22:02.090
<v Aaron van Wirdum>Assuming that all the hash power is still the same, now you can mine two weeks of

00:22:02.090 --> 00:22:02.910
<v Aaron van Wirdum>blocks in one week.

00:22:04.670 --> 00:22:07.010
<v Sjors Provoost>Because again, and then at the end of that one week...

00:22:07.010 --> 00:22:10.390
<v Aaron van Wirdum>But you're still faking the timestamps. So we're still sort of back mining in the

00:22:10.390 --> 00:22:10.970
<v Aaron van Wirdum>first minute.

00:22:11.330 --> 00:22:17.170
<v Sjors Provoost>Yeah, so at the end of that week, which for the blockchain is two weeks, you're

00:22:17.170 --> 00:22:20.650
<v Sjors Provoost>like, okay, this was five weeks. This took five weeks to produce this block. So

00:22:20.650 --> 00:22:25.630
<v Sjors Provoost>it could decrease the difficulty even more. And then it gets cut in half again.

00:22:25.790 --> 00:22:30.410
<v Sjors Provoost>So now you can mine in about two and a half days, the equivalent of two weeks.

00:22:31.260 --> 00:22:35.600
<v Sjors Provoost>And the blockchain is like, whoa, that took five weeks and two days. I've got to

00:22:35.600 --> 00:22:40.520
<v Sjors Provoost>reduce the difficulty again. And so the difficulty goes to one very, very quickly

00:22:40.520 --> 00:22:43.840
<v Sjors Provoost>in a matter of about 40 days, according to Antoine's calculation.

00:22:44.320 --> 00:22:49.620
<v Aaron van Wirdum>Right. So, yeah, miners, like you said, it's basically 51% attack where miners

00:22:49.620 --> 00:22:55.580
<v Aaron van Wirdum>can drive the difficulty down to one. And then they can mine all remaining

00:22:55.580 --> 00:22:57.420
<v Aaron van Wirdum>coins that are still to be mined.

00:22:57.540 --> 00:22:57.820
<v Sjors Provoost>Exactly.

00:22:58.210 --> 00:22:59.650
<v Aaron van Wirdum>Over the next century.

00:22:59.850 --> 00:23:04.330
<v Sjors Provoost>They mined the equivalent of until the year 2106. They've got every last sat.

00:23:04.510 --> 00:23:07.730
<v Sjors Provoost>We've got, you know, millions of blocks in a very short period of time.

00:23:08.430 --> 00:23:08.830
<v Aaron van Wirdum>Yeah.

00:23:10.010 --> 00:23:13.410
<v Sjors Provoost>And then they probably stopped the attack because there's no need to do it anymore.

00:23:13.810 --> 00:23:19.760
<v Aaron van Wirdum>Yeah. And then on top of that, that would mess up probably a bunch of

00:23:19.760 --> 00:23:22.960
<v Aaron van Wirdum>like smart contract things, time lock types of things.

00:23:22.960 --> 00:23:27.800
<v Sjors Provoost>No, well, time locks are, well, they might be affected, but... because time is

00:23:27.800 --> 00:23:32.860
<v Sjors Provoost>moving more slowly, your time locks would indeed not expire because… But that's

00:23:32.860 --> 00:23:36.060
<v Sjors Provoost>that's probably not a big deal, like, during this attack, because the attack

00:23:36.060 --> 00:23:38.940
<v Sjors Provoost>takes five weeks plus a little bit to suck all the coins out.

00:23:38.940 --> 00:23:43.160
<v Aaron van Wirdum>Well, it could definitely… The time locks that are locked on a certain block in

00:23:43.160 --> 00:23:43.600
<v Aaron van Wirdum>the future…

00:23:43.600 --> 00:23:47.240
<v Sjors Provoost>Yeah, so if you're looking at height locks, I guess you call them, height locks

00:23:47.240 --> 00:23:50.920
<v Sjors Provoost>are definitely affected, because if you have a contract that expires in block one

00:23:50.920 --> 00:23:55.240
<v Sjors Provoost>million, well, guess what, that is that happens immediately. Yeah, but a time

00:23:55.240 --> 00:23:59.060
<v Sjors Provoost>lock would be kind of during the attack, it would be effective because your time

00:23:59.060 --> 00:24:03.240
<v Sjors Provoost>lock is never happening because they keep the time behind. But once they stop the

00:24:03.240 --> 00:24:07.940
<v Sjors Provoost>attack, it'll be fine. So you might be unlucky if your lightning thing is in the

00:24:07.940 --> 00:24:12.700
<v Sjors Provoost>wrong place. Yeah, it could be bad. But the worst aspect of this attack, other

00:24:12.700 --> 00:24:17.480
<v Sjors Provoost>than the five-week disruption, is simply that they have now exhausted the full

00:24:17.480 --> 00:24:23.480
<v Sjors Provoost>subsidy. And so we were hoping to not have to deal with the

00:24:23.480 --> 00:24:28.970
<v Sjors Provoost>no-subsidy world, uh only 20, 30 years from now, but we have to deal with it in,

00:24:28.970 --> 00:24:34.290
<v Sjors Provoost>well, 40 days, if this is exploited, and it could happen at any moment.

00:24:34.290 --> 00:24:34.970
<v Aaron van Wirdum>Okay, so…

00:24:34.970 --> 00:24:38.470
<v Sjors Provoost>And a majority of miners, you know, might think, well, you know, why not? We're

00:24:38.470 --> 00:24:40.530
<v Sjors Provoost>the majority of miners. Well,

00:24:41.370 --> 00:24:44.530
<v Aaron van Wirdum>I mean, one reason why not is that it would probably undermine trust in the

00:24:44.530 --> 00:24:49.270
<v Aaron van Wirdum>protocol, but let's ignore that. Let's see if we can fix the protocol instead of,

00:24:49.270 --> 00:24:51.930
<v Aaron van Wirdum>uh, relying on that kind of trust. So what's the fix here?

00:24:52.420 --> 00:24:54.380
<v Sjors Provoost>The fix is actually fairly simple.

00:24:56.100 --> 00:25:01.580
<v Sjors Provoost>Well, the ideal fix would be that we just compare every block to the same block

00:25:01.580 --> 00:25:03.660
<v Sjors Provoost>in the last period, but that's a hard fork.

00:25:03.980 --> 00:25:04.340
<v Aaron van Wirdum>Okay.

00:25:04.500 --> 00:25:06.860
<v Sjors Provoost>So instead, at least I think it's a hard fork.

00:25:07.360 --> 00:25:12.440
<v Aaron van Wirdum>So by that you mean instead of comparing the first to the last block within the

00:25:12.440 --> 00:25:17.440
<v Aaron van Wirdum>same period? and checking if that's two weeks, we should really just check the

00:25:17.440 --> 00:25:22.060
<v Aaron van Wirdum>first block to the next first block. But that's not possible, right?

00:25:22.300 --> 00:25:25.220
<v Sjors Provoost>As far as I know, that's a hard fork, so I can't do it.

00:25:25.840 --> 00:25:30.020
<v Aaron van Wirdum>But also, how is that even possible? Because by then, the difficulty should have

00:25:30.020 --> 00:25:34.470
<v Aaron van Wirdum>already... adjusted, right? By the time the first block of the next period is made.

00:25:34.490 --> 00:25:37.590
<v Sjors Provoost>Well, obviously you'd have to change exactly how the difficulty adjustments

00:25:37.590 --> 00:25:41.770
<v Sjors Provoost>happen, but you should just do the difficulty adjustments correctly. Yeah. But

00:25:41.770 --> 00:25:46.070
<v Sjors Provoost>the simplest solution here is that every first block or block zero of every

00:25:46.070 --> 00:25:52.290
<v Sjors Provoost>period needs to be in the present or two hours ago, but no more than that.

00:25:52.470 --> 00:25:52.890
<v Aaron van Wirdum>Every what?

00:25:53.170 --> 00:25:59.020
<v Sjors Provoost>Every first block of every period, so block zero, block 216, et cetera, has to

00:25:59.020 --> 00:26:03.840
<v Sjors Provoost>be in the present, the timestamp. And it can be two hours ago for weird

00:26:03.840 --> 00:26:08.820
<v Sjors Provoost>mining-related reasons. And it can, of course, not be more than two hours in the

00:26:08.820 --> 00:26:12.820
<v Sjors Provoost>future. But basically, it has to be in a four-hour window between two hours ago

00:26:12.820 --> 00:26:13.680
<v Sjors Provoost>and two hours in the future.

00:26:14.610 --> 00:26:16.090
<v Aaron van Wirdum>Every first block has to be.

00:26:16.230 --> 00:26:16.550
<v Sjors Provoost>Yes.

00:26:17.110 --> 00:26:20.550
<v Aaron van Wirdum>Right. Okay, yeah, that sounds like a pretty simple fix.

00:26:20.890 --> 00:26:24.610
<v Sjors Provoost>Yeah, because remember the attack involved comparing the last block to the first

00:26:24.610 --> 00:26:28.130
<v Sjors Provoost>block and really messing with the first block. That's the part of the messing

00:26:28.130 --> 00:26:32.410
<v Sjors Provoost>that you weren't messing with the last block already, but you were messing with

00:26:32.410 --> 00:26:36.250
<v Sjors Provoost>the first block and this fix basically makes that impossible and therefore the

00:26:36.250 --> 00:26:38.970
<v Sjors Provoost>difficulty adjustment will be correct, problem solved.

00:26:39.630 --> 00:26:40.570
<v Aaron van Wirdum>Okay, makes sense.

00:26:40.850 --> 00:26:46.010
<v Sjors Provoost>Yeah, and as far as I know, that's still the proposed fix that hasn't changed.

00:26:47.660 --> 00:26:51.580
<v Aaron van Wirdum>Okay, that was a time warp attack fix. What's the next one?

00:26:52.500 --> 00:26:53.320
<v Sjors Provoost>Slow scripts.

00:26:55.040 --> 00:27:00.290
<v Sjors Provoost>So as you know, it takes a while to validate the whole blockchain. And some

00:27:00.290 --> 00:27:04.030
<v Sjors Provoost>blocks take a bit longer than others. That can be because there's tons and tons

00:27:04.030 --> 00:27:09.060
<v Sjors Provoost>of transactions in them. But there's certain, you know, at least we have a limit

00:27:09.060 --> 00:27:13.320
<v Sjors Provoost>on the block size. A block can be more than four megabyte. So there's some limit

00:27:13.320 --> 00:27:17.360
<v Sjors Provoost>to how much you can do in a block. But it turns out you can make some special

00:27:17.360 --> 00:27:21.360
<v Sjors Provoost>transactions that are really quite slow to verify. And that's usually a

00:27:21.360 --> 00:27:25.040
<v Sjors Provoost>combination of lots of signature checks. Because signature checks take a while.

00:27:25.040 --> 00:27:28.380
<v Sjors Provoost>You have to do the ECDSA thing. And hashing.

00:27:29.940 --> 00:27:35.790
<v Sjors Provoost>So we talked about this signature checking speed problem back in

00:27:35.790 --> 00:27:38.850
<v Sjors Provoost>episode, let me see, I

00:27:40.480 --> 00:27:46.070
<v Sjors Provoost>think episode 32 and episode 76. Um, yeah, yeah.

00:27:47.320 --> 00:27:51.560
<v Aaron van Wirdum>So from what I understand, the problem here essentially is like every transaction

00:27:53.650 --> 00:27:58.570
<v Aaron van Wirdum>includes scripts. And for many transactions, that's just a straightforward check

00:27:58.570 --> 00:28:02.890
<v Aaron van Wirdum>that the signature is valid type of thing. But you can make more complex

00:28:02.890 --> 00:28:07.590
<v Aaron van Wirdum>transactions that includes, like you say, hashing or more signature validation.

00:28:08.110 --> 00:28:13.850
<v Aaron van Wirdum>And if you would intentionally want to design a

00:28:13.850 --> 00:28:18.610
<v Aaron van Wirdum>transaction or maybe even a block full of transactions with complicated stuff,

00:28:18.770 --> 00:28:24.420
<v Aaron van Wirdum>then that could, in the worst case, lead to blocks that take minutes to

00:28:24.420 --> 00:28:25.180
<v Aaron van Wirdum>actually validate.

00:28:25.180 --> 00:28:29.200
<v Sjors Provoost>Yeah, and so, you know, people have been… Uh, Antoine, I believe, has been doing

00:28:29.200 --> 00:28:34.100
<v Sjors Provoost>some math on seeing what is the absolute worst you can do. And he came up with

00:28:34.100 --> 00:28:37.280
<v Sjors Provoost>something that took more than one hour to validate on a Raspberry Pi 4.

00:28:37.440 --> 00:28:37.760
<v Aaron van Wirdum>Right.

00:28:38.240 --> 00:28:43.500
<v Sjors Provoost>And that's not good. Now, you could say, well, it sucks to have a Raspberry, but

00:28:43.500 --> 00:28:45.240
<v Sjors Provoost>it'd be nice if it didn't.

00:28:45.660 --> 00:28:49.480
<v Aaron van Wirdum>And even on a fast laptop, it took several minutes, right?

00:28:49.480 --> 00:28:53.040
<v Sjors Provoost>Yeah, and several minutes would be bad, right? So if you are a miner and you

00:28:53.040 --> 00:28:57.300
<v Sjors Provoost>receive that block that takes you several minutes to validate, well, now your

00:28:57.300 --> 00:29:01.240
<v Sjors Provoost>competitor can do all sorts of shenanigans because you're kind of stuck

00:29:01.240 --> 00:29:01.800
<v Sjors Provoost>validating.

00:29:02.650 --> 00:29:07.810
<v Aaron van Wirdum>Yeah, or not shenanigans, just get a head start on finding a nice block, for example.

00:29:08.530 --> 00:29:11.670
<v Sjors Provoost>Right, that's one shenanigan, but I think there might be other things you can do.

00:29:11.910 --> 00:29:15.850
<v Aaron van Wirdum>Yeah, it would be a disruptive thing for the network if blocks take minutes or

00:29:15.850 --> 00:29:17.190
<v Aaron van Wirdum>even longer than that to validate.

00:29:17.410 --> 00:29:23.300
<v Sjors Provoost>And so the question is, how do we prevent those blocks from being created? Now,

00:29:23.700 --> 00:29:24.340
<v Sjors Provoost>for now...

00:29:24.340 --> 00:29:30.040
<v Aaron van Wirdum>Just to give you a comparison, how long does it take to validate an average block

00:29:30.040 --> 00:29:30.440
<v Aaron van Wirdum>right now?

00:29:30.830 --> 00:29:33.530
<v Sjors Provoost>I think on a good laptop, a fraction of a second.

00:29:33.890 --> 00:29:36.090
<v Aaron van Wirdum>Yeah. And on like a Raspberry Pi?

00:29:36.530 --> 00:29:37.770
<v Sjors Provoost>Probably one second.

00:29:37.990 --> 00:29:43.720
<v Aaron van Wirdum>Yeah. Okay. Just to sort of paint the context there. Okay. So the solution.

00:29:45.250 --> 00:29:49.430
<v Sjors Provoost>Well, the solution is in the original proposal by BlueMatt, there was a solution,

00:29:49.870 --> 00:29:55.850
<v Sjors Provoost>which was... Just changing a few rules, I think now there's discussion about a

00:29:55.850 --> 00:30:00.190
<v Sjors Provoost>slightly different solution. So that's actually still ongoing research, what is

00:30:00.190 --> 00:30:04.830
<v Sjors Provoost>the actual best solution. But the gist of it is that there are certain

00:30:04.830 --> 00:30:10.710
<v Sjors Provoost>extra rules in SegWit and in Taproot that make the script safer. This was why the

00:30:10.710 --> 00:30:14.090
<v Sjors Provoost>block size could be increased with SegWit, because any of these extra SegWit

00:30:14.090 --> 00:30:17.610
<v Sjors Provoost>transactions would not be as expensive and as slow. These worst case couldn't

00:30:17.610 --> 00:30:21.680
<v Sjors Provoost>happen. But it looks like some of these rules should also be applied to legacy

00:30:21.680 --> 00:30:26.880
<v Sjors Provoost>scripts, to legacy transactions. And then the problem is you can't just apply all

00:30:26.880 --> 00:30:30.460
<v Sjors Provoost>of SegWit's rules to legacy transactions. So you have to be very careful which

00:30:30.460 --> 00:30:31.700
<v Sjors Provoost>ones you'd want to apply.

00:30:33.540 --> 00:30:38.540
<v Sjors Provoost>Main problem there is, you know, somebody might have a transaction that they put

00:30:38.540 --> 00:30:39.200
<v Sjors Provoost>in a cold wallet.

00:30:40.780 --> 00:30:44.080
<v Sjors Provoost>Or like offline wallet, right? So we don't see it on the blockchain. And now they

00:30:44.080 --> 00:30:47.020
<v Sjors Provoost>want to broadcast it, but we changed the rules and now they can't spend it anymore.

00:30:49.410 --> 00:30:53.290
<v Sjors Provoost>Now, you know, the changes that people have in mind would only impact the most

00:30:53.290 --> 00:30:58.930
<v Sjors Provoost>bizarre, unrealistic transactions that you can possibly imagine. But still, that

00:30:58.930 --> 00:31:04.090
<v Sjors Provoost>could still be controversial. So the key is to find the absolute minimum extra

00:31:04.090 --> 00:31:09.920
<v Sjors Provoost>rules that you need in order to fix the problem and no more. Because the simplest

00:31:09.920 --> 00:31:13.100
<v Sjors Provoost>solution would just be to say, hey, you know what? You can only make Taproot

00:31:13.100 --> 00:31:18.920
<v Sjors Provoost>transactions. That would fix the problem. But it would make a lot of people

00:31:18.920 --> 00:31:19.380
<v Sjors Provoost>very angry.

00:31:20.590 --> 00:31:26.490
<v Aaron van Wirdum>Yeah, I thought the idea was also to, like, only apply these

00:31:26.490 --> 00:31:32.010
<v Aaron van Wirdum>new rules from a certain block height, so if you already had your coins in some…

00:31:32.660 --> 00:31:38.540
<v Sjors Provoost>So those are other things you could do to restrict the possible damage

00:31:38.540 --> 00:31:44.020
<v Sjors Provoost>that a rule could do. But the trade-off there is complexity. So a rule that says

00:31:44.020 --> 00:31:48.000
<v Sjors Provoost>only do this after this block or only when the coins you're spending is from this

00:31:48.000 --> 00:31:51.220
<v Sjors Provoost>block, that's extra complexity that you'd prefer not to have.

00:31:52.450 --> 00:31:57.050
<v Sjors Provoost>Plus, you know, if the attack, this is one of the problems, once you publish the

00:31:57.050 --> 00:32:02.100
<v Sjors Provoost>exact fix, somebody might come up with what it is fixing. and then do the attack

00:32:02.100 --> 00:32:07.060
<v Sjors Provoost>before the software is activated. That's probably inevitable anyway, just like

00:32:07.060 --> 00:32:09.100
<v Sjors Provoost>the time warp attack. Everybody knows what to do there.

00:32:09.360 --> 00:32:09.520
<v Aaron van Wirdum>Yeah.

00:32:10.760 --> 00:32:11.760
<v Sjors Provoost>So there's that.

00:32:13.230 --> 00:32:17.070
<v Aaron van Wirdum>Yeah. Well, you really want to avoid that people lose their coins, right? That's

00:32:17.070 --> 00:32:17.690
<v Aaron van Wirdum>kind of a...

00:32:17.690 --> 00:32:22.710
<v Sjors Provoost>Yeah. So realistically, even the original proposal by BlueMatt, I think it was

00:32:22.710 --> 00:32:26.470
<v Sjors Provoost>changed a bit by him because there were several things that he wanted to change

00:32:26.470 --> 00:32:32.240
<v Sjors Provoost>for this problem. And I think they ended up dropping one of these things.

00:32:32.240 --> 00:32:37.180
<v Sjors Provoost>So hopefully there's a way to make sure that you can, like, this that nothing

00:32:37.180 --> 00:32:42.880
<v Sjors Provoost>gets unspendable. It might just take more fees, for example. Right.

00:32:42.880 --> 00:32:48.320
<v Aaron van Wirdum>Okay, so that was slow scripts. Are we done with those scripts?

00:32:48.320 --> 00:32:49.760
<v Sjors Provoost>Yep, we are.

00:32:49.760 --> 00:32:55.120
<v Aaron van Wirdum>All right, and the next point is about banning 64 byte transactions. Is that right?

00:32:55.120 --> 00:33:01.010
<v Sjors Provoost>Yes. 64 bytes, bad. Why? Well, we've mentioned this a few times

00:33:01.010 --> 00:33:04.550
<v Sjors Provoost>in other episodes. I don't think we've done an actual episode about it. But in

00:33:04.550 --> 00:33:09.190
<v Sjors Provoost>our episode 81, we talked about a change to Bitcoin Core 25 that makes

00:33:09.190 --> 00:33:14.940
<v Sjors Provoost>transactions that are 65

00:33:14.940 --> 00:33:20.640
<v Sjors Provoost>bytes or greater. I think they make them illegal again or something weird about

00:33:20.640 --> 00:33:25.140
<v Sjors Provoost>that. I forgot what exactly we discussed. The point is 64 byte transactions are

00:33:25.140 --> 00:33:29.260
<v Sjors Provoost>bad. And the reason they're bad is because they look the same as two 32 byte

00:33:29.260 --> 00:33:31.120
<v Sjors Provoost>transactions next to each other in the block.

00:33:33.300 --> 00:33:35.380
<v Sjors Provoost>Because of the way the Merkle trees are made.

00:33:36.760 --> 00:33:41.060
<v Aaron van Wirdum>Sorry, we have to take a step back here, Sjors. What does it mean? Why is there

00:33:41.060 --> 00:33:45.380
<v Aaron van Wirdum>such a thing as a 64 byte transaction and also such a thing as a 32 byte

00:33:45.380 --> 00:33:48.520
<v Aaron van Wirdum>transaction? Why aren't all transactions the same number of bytes?

00:33:49.110 --> 00:33:52.590
<v Sjors Provoost>Because the size of a transaction depends on the number of inputs, the number of

00:33:52.590 --> 00:33:56.210
<v Sjors Provoost>outputs, what kind of script you have in those inputs and outputs and whether it

00:33:56.210 --> 00:33:57.470
<v Sjors Provoost>has a witness or not.

00:33:57.970 --> 00:33:59.410
<v Aaron van Wirdum>Okay. And then

00:34:01.170 --> 00:34:07.090
<v Aaron van Wirdum>64, but a 32 transaction would also look like

00:34:07.090 --> 00:34:09.190
<v Aaron van Wirdum>two 16-byte transactions, right?

00:34:09.450 --> 00:34:14.410
<v Sjors Provoost>Yeah, but I don't think you can make a 16-byte transaction because simply it

00:34:14.410 --> 00:34:14.870
<v Sjors Provoost>wouldn't fit.

00:34:15.410 --> 00:34:21.330
<v Aaron van Wirdum>Okay, and a 128-byte transaction would look like four 32 bytes. Why

00:34:21.330 --> 00:34:23.130
<v Aaron van Wirdum>is 64 singled out is my question.

00:34:23.610 --> 00:34:29.120
<v Sjors Provoost>Okay, so the Merkle tree that the Bitcoin transactions are stored in takes the

00:34:29.120 --> 00:34:34.490
<v Sjors Provoost>SHA-256 hash of every transaction and

00:34:35.170 --> 00:34:40.910
<v Sjors Provoost>then puts that next to the SHA-256 hash of the next transaction. So you take all

00:34:40.910 --> 00:34:44.890
<v Sjors Provoost>the transactions and you take their SHA-256 hashes and then in pairs you put

00:34:44.890 --> 00:34:48.110
<v Sjors Provoost>those hashes next to each other. And the size of a hash is 32 bytes.

00:34:49.710 --> 00:34:51.890
<v Aaron van Wirdum>Right. That's always 32 bytes.

00:34:52.290 --> 00:34:52.510
<v Sjors Provoost>Yes.

00:34:52.790 --> 00:34:52.970
<v Aaron van Wirdum>Yeah.

00:34:54.940 --> 00:34:58.640
<v Aaron van Wirdum>I vaguely remember this problem. We discussed it.

00:34:58.860 --> 00:35:04.340
<v Sjors Provoost>So two hashes next to each other is 64 bytes. And so then the question is, when

00:35:04.340 --> 00:35:07.620
<v Sjors Provoost>you are... So I guess it's not two 32-byte transactions because you can't have

00:35:07.620 --> 00:35:09.060
<v Sjors Provoost>32-byte transactions. Too small.

00:35:09.240 --> 00:35:09.500
<v Aaron van Wirdum>Right.

00:35:09.620 --> 00:35:12.860
<v Sjors Provoost>Because the minimum size of a transaction, keep in mind that a transaction has an

00:35:12.860 --> 00:35:18.470
<v Sjors Provoost>input, at least. And the input is already 32 bytes plus a little bit more.

00:35:18.730 --> 00:35:22.150
<v Sjors Provoost>Because the input of a transaction refers to the hash of a previous transaction.

00:35:22.530 --> 00:35:26.570
<v Sjors Provoost>We just set the hash to 32 bytes. So then it has to have a number and a few other

00:35:26.570 --> 00:35:31.750
<v Sjors Provoost>things. So yeah, a transaction cannot be 32 bytes. But it can be 64 bytes. It

00:35:31.750 --> 00:35:36.530
<v Sjors Provoost>would be a pretty nonsensical transaction, but it can be 32 bytes. And so...

00:35:36.250 --> 00:35:36.800
<v Aaron van Wirdum>64.

00:35:37.050 --> 00:35:37.810
<v Sjors Provoost>64, yeah.

00:35:38.170 --> 00:35:43.650
<v Aaron van Wirdum>But that would look like two hashes that are both 32 bytes. And why is that a

00:35:43.650 --> 00:35:46.820
<v Aaron van Wirdum>problem? Like, where are these hashes in the blockchain?

00:35:46.980 --> 00:35:52.660
<v Sjors Provoost>It's caused multiple problems in the past, exactly. So in each block is a Merkle

00:35:52.660 --> 00:35:57.980
<v Sjors Provoost>tree of all the transactions in that block. And all the leaves of the tree are 32

00:35:57.980 --> 00:36:01.880
<v Sjors Provoost>bytes, these transactions. And then you go one level up, and it's 32 bytes again,

00:36:02.020 --> 00:36:06.520
<v Sjors Provoost>it's 32 bytes again. And now what you can do is you can give somebody a block and

00:36:06.520 --> 00:36:10.470
<v Sjors Provoost>say, here's a block, and here's all the transactions in this block. And then you

00:36:10.470 --> 00:36:16.210
<v Sjors Provoost>verify it, and you see these 32 transactions. Sorry, you see these

00:36:16.210 --> 00:36:20.750
<v Sjors Provoost>two times 32s, and you combine them, and it looks all good. But somebody could

00:36:20.750 --> 00:36:26.690
<v Sjors Provoost>leave out the actual transactions and just pretend that it's only a

00:36:26.690 --> 00:36:30.250
<v Sjors Provoost>64-byte transaction instead of two separate ones. But then you validate the

00:36:30.250 --> 00:36:34.650
<v Sjors Provoost>64-byte transaction, and you say, hey, this is an invalid transaction, so the

00:36:34.650 --> 00:36:35.470
<v Sjors Provoost>whole block is invalid.

00:36:37.070 --> 00:36:40.930
<v Sjors Provoost>And now you think this block is invalid. And the next time you see this block,

00:36:41.130 --> 00:36:44.530
<v Sjors Provoost>because somebody gives you the same block hash, you're like, I don't, you know,

00:36:44.710 --> 00:36:48.110
<v Sjors Provoost>I'm not going to check this block. It's invalid. But actually it's not invalid.

00:36:48.710 --> 00:36:52.510
<v Sjors Provoost>Because somebody sent you, because now you got the real one where you actually

00:36:52.510 --> 00:36:54.110
<v Sjors Provoost>have the two separate transactions in it.

00:36:55.620 --> 00:36:56.300
<v Aaron van Wirdum>I'm lost.

00:36:57.840 --> 00:37:02.960
<v Aaron van Wirdum>Who's the target here? What's the problem? And what's the, like, who are we targeting?

00:37:02.960 --> 00:37:07.400
<v Sjors Provoost>Well, they're different targets. So this example, I think, could be used to make

00:37:07.400 --> 00:37:12.110
<v Sjors Provoost>a network split. where you would make a real block with two 32-byte transactions

00:37:12.110 --> 00:37:16.850
<v Sjors Provoost>in it, but that when you combine those two 32-byte transactions, it would also

00:37:16.850 --> 00:37:22.490
<v Sjors Provoost>make a real 64-byte transaction. So the hashes of those two

00:37:22.490 --> 00:37:25.750
<v Sjors Provoost>transactions, not 32-byte transactions, but the hashes of those two transactions,

00:37:26.160 --> 00:37:30.980
<v Sjors Provoost>if you add them together, look like a real transaction, but it's an invalid

00:37:30.980 --> 00:37:31.500
<v Sjors Provoost>transaction.

00:37:32.740 --> 00:37:38.490
<v Sjors Provoost>So now... you are, or the other way around, the 64 byte thing is valid, but

00:37:38.490 --> 00:37:43.710
<v Sjors Provoost>the two individual transactions are invalid. So if you give somebody a block,

00:37:44.030 --> 00:37:48.370
<v Sjors Provoost>it will have the same hash at the top because the Merkle tree is the same at the

00:37:48.370 --> 00:37:50.990
<v Sjors Provoost>top. And that's the only thing you're communicating when you're communicating a

00:37:50.990 --> 00:37:54.970
<v Sjors Provoost>block hash. So I'm giving you a block hash and I'm giving somebody else the same

00:37:54.970 --> 00:38:00.900
<v Sjors Provoost>block hash, but I'm going to give you the two transactions. And

00:38:00.900 --> 00:38:05.920
<v Sjors Provoost>I'm going to give this other person the one 64 byte transaction. And now one of

00:38:05.920 --> 00:38:08.500
<v Sjors Provoost>you is going to say this block is invalid and the other is going to say this

00:38:08.500 --> 00:38:11.020
<v Sjors Provoost>block is valid. Now you have a network split.

00:38:12.900 --> 00:38:18.280
<v Aaron van Wirdum>Yeah, okay. I kind of get that now, except what do you mean? Why would they check

00:38:18.280 --> 00:38:19.040
<v Aaron van Wirdum>for different things?

00:38:20.390 --> 00:38:25.270
<v Sjors Provoost>Because I've given you the block hash, the root of the Merkle tree. I've also

00:38:25.270 --> 00:38:28.970
<v Sjors Provoost>given you all the transactions individually. Okay, so you're actually putting

00:38:28.970 --> 00:38:34.050
<v Sjors Provoost>those back in a tree. But I'm giving you a different set of transactions than I'm

00:38:34.050 --> 00:38:37.490
<v Sjors Provoost>giving the other person. They get the same root of the tree, but one of them will

00:38:37.490 --> 00:38:40.150
<v Sjors Provoost>say, hey, this transaction is invalid because, I don't know, it's spending more

00:38:40.150 --> 00:38:42.630
<v Sjors Provoost>money than it's earning. Some other rule that's violated.

00:38:43.770 --> 00:38:48.170
<v Aaron van Wirdum>Right. And that's because it's not really a transaction. It's really two 32-byte

00:38:48.170 --> 00:38:48.990
<v Aaron van Wirdum>hashes.

00:38:49.620 --> 00:38:50.100
<v Sjors Provoost>Yeah.

00:38:50.480 --> 00:38:51.240
<v Aaron van Wirdum>Am I saying that right?

00:38:51.440 --> 00:38:52.300
<v Sjors Provoost>Of real transactions.

00:38:52.560 --> 00:38:55.420
<v Aaron van Wirdum>Of actual transactions. Yeah. So for one person...

00:38:55.420 --> 00:38:57.120
<v Sjors Provoost>One person sees a 64-byte transaction.

00:38:57.300 --> 00:39:00.520
<v Aaron van Wirdum>One person sees one invalid 64-byte transaction.

00:39:00.760 --> 00:39:01.320
<v Sjors Provoost>Or valid.

00:39:02.530 --> 00:39:06.710
<v Sjors Provoost>One person sees one 64-byte transaction. The other person sees two other

00:39:06.710 --> 00:39:08.390
<v Sjors Provoost>transactions. Doesn't matter what size they are.

00:39:08.650 --> 00:39:08.830
<v Aaron van Wirdum>Yeah.

00:39:09.070 --> 00:39:14.870
<v Sjors Provoost>And if these two transactions are invalid, but the 64-byte one is valid, then

00:39:14.870 --> 00:39:16.530
<v Sjors Provoost>you come to a different conclusion out of the block.

00:39:19.290 --> 00:39:24.190
<v Aaron van Wirdum>And this depends on which transactions you saw earlier, essentially, kind of.

00:39:25.320 --> 00:39:30.910
<v Sjors Provoost>Well, the rest of the block is the same, right? So it's just that one of these

00:39:30.910 --> 00:39:35.430
<v Sjors Provoost>transactions is actually invalid. So the 64-byte transaction might be invalid or

00:39:35.430 --> 00:39:40.390
<v Sjors Provoost>it might be valid. It has nothing to do with what you've seen before. You're

00:39:40.390 --> 00:39:44.570
<v Sjors Provoost>basically just giving two versions of the same block that [unclear] think is the

00:39:44.570 --> 00:39:48.410
<v Sjors Provoost>same block because it only remembers the hash and it's not. So that bug has been

00:39:48.410 --> 00:39:52.970
<v Sjors Provoost>fixed by simply not storing the block if it's invalid.

00:39:53.290 --> 00:39:58.390
<v Aaron van Wirdum>No, hang on. I have a question. I still have one question.

00:39:59.010 --> 00:40:01.430
<v Aaron van Wirdum>You and I are both running a node, okay?

00:40:02.830 --> 00:40:07.850
<v Aaron van Wirdum>Now... Some joker sends us a block that

00:40:07.850 --> 00:40:12.050
<v Aaron van Wirdum>has this one 64-byte transaction in it.

00:40:12.130 --> 00:40:12.430
<v Sjors Provoost>Yes.

00:40:12.710 --> 00:40:18.170
<v Aaron van Wirdum>Why would my node look at this like two 32-byte transactions while your node is

00:40:18.170 --> 00:40:21.150
<v Aaron van Wirdum>looking at it like a one 64-byte transaction?

00:40:21.310 --> 00:40:27.110
<v Sjors Provoost>Because as the joker is sending you the hash of the block

00:40:27.110 --> 00:40:32.310
<v Sjors Provoost>and is sending you all the individual transactions. So he's sending you... two

00:40:32.310 --> 00:40:36.150
<v Sjors Provoost>individual transactions at the end of this block. And it's sending me one

00:40:36.150 --> 00:40:40.210
<v Sjors Provoost>individual transaction of 64 bytes. So they're sending us different things.

00:40:40.250 --> 00:40:41.690
<v Aaron van Wirdum>Isn't that just in the block?

00:40:43.060 --> 00:40:46.720
<v Aaron van Wirdum>Isn't that just the block that he's sending? That's the block, right? The in the

00:40:46.720 --> 00:40:47.780
<v Aaron van Wirdum>block is the transaction.

00:40:47.880 --> 00:40:52.180
<v Sjors Provoost>A block, when you receive a block, what it really is, is a message, right? And

00:40:52.180 --> 00:40:56.480
<v Sjors Provoost>the message starts with the header and it's followed by the list of every single

00:40:56.480 --> 00:40:56.920
<v Sjors Provoost>transaction.

00:40:57.080 --> 00:40:57.200
<v Aaron van Wirdum>Yeah.

00:40:57.540 --> 00:41:01.280
<v Sjors Provoost>And so... that list of transactions, yeah, it's very… It's different. So if you

00:41:01.280 --> 00:41:04.520
<v Sjors Provoost>were to look at the bytes on on the… If you printed it out a piece of paper, you

00:41:04.520 --> 00:41:06.160
<v Sjors Provoost>would see that at the end of the piece of paper it's different.

00:41:06.420 --> 00:41:06.720
<v Aaron van Wirdum>Okay.

00:41:06.780 --> 00:41:07.600
<v Sjors Provoost>You and I got a different block.

00:41:07.800 --> 00:41:10.300
<v Aaron van Wirdum>We got a different block. It just has the same hash.

00:41:10.420 --> 00:41:10.620
<v Sjors Provoost>Yes.

00:41:10.800 --> 00:41:12.400
<v Aaron van Wirdum>It hashes to the same hash.

00:41:12.580 --> 00:41:14.240
<v Sjors Provoost>And because you say it's invalid.

00:41:14.400 --> 00:41:17.260
<v Aaron van Wirdum>Yeah. Because it is invalid. The one you sent me is invalid. It's yours.

00:41:17.460 --> 00:41:20.600
<v Sjors Provoost>Exactly. But now if somebody else sends you the correct one…

00:41:17.792 --> 00:41:18.640
<v Aaron van Wirdum>It's only sending you…

00:41:20.740 --> 00:41:23.580
<v Aaron van Wirdum>Yeah. Then I'll be like, no, I already saw this and it was invalid.

00:41:23.760 --> 00:41:27.320
<v Sjors Provoost>Yeah. And that problem, you know, keep in mind that this problem was discovered

00:41:27.320 --> 00:41:30.040
<v Sjors Provoost>in 2012 or something. So back then that attack was cheap.

00:41:30.260 --> 00:41:30.600
<v Aaron van Wirdum>Right.

00:41:30.720 --> 00:41:33.860
<v Sjors Provoost>Right now this attack would be expensive, but the attack was fixed because

00:41:33.860 --> 00:41:37.030
<v Sjors Provoost>basically when this happens to you, you say, hey, this block is invalid, you just

00:41:37.030 --> 00:41:40.490
<v Sjors Provoost>forget it. And so the next time somebody sends you the correct one, you're fine.

00:41:40.810 --> 00:41:44.450
<v Sjors Provoost>So that attack is fixed. But then there was other ways that you can fool light

00:41:44.450 --> 00:41:48.530
<v Sjors Provoost>clients like SPV wallets using the same trick because they are asking just for an

00:41:48.530 --> 00:41:52.390
<v Sjors Provoost>SPV proof. So they just want proof that a transaction was included and you could

00:41:52.390 --> 00:41:55.930
<v Sjors Provoost>now give them a transaction that they think is included because you gave the SPV

00:41:55.930 --> 00:42:00.390
<v Sjors Provoost>proof, but it wasn't included. Because the real block had two separate

00:42:00.390 --> 00:42:04.750
<v Sjors Provoost>transactions that happened to combine to this one fake transaction. And this

00:42:04.750 --> 00:42:09.070
<v Sjors Provoost>could be used to steal light wallets, but possibly also to rob sidechains if

00:42:09.070 --> 00:42:14.160
<v Sjors Provoost>those sidechains only use SPV proofs for peg-ins and peg-outs. And that problem,

00:42:14.180 --> 00:42:18.850
<v Sjors Provoost>I think, was solved by telling light clients to be careful. I don't think it was

00:42:18.850 --> 00:42:19.630
<v Sjors Provoost>actually solved.

00:42:19.870 --> 00:42:23.830
<v Aaron van Wirdum>Okay, back to the great consensus cleanup revival. What's the solution here?

00:42:23.990 --> 00:42:25.550
<v Sjors Provoost>Don't allow 64 byte transactions.

00:42:25.830 --> 00:42:28.150
<v Aaron van Wirdum>Well, what if my transaction is 64 bytes though?

00:42:28.290 --> 00:42:29.910
<v Sjors Provoost>Then you are out of luck.

00:42:31.560 --> 00:42:34.740
<v Sjors Provoost>So if you still have one of those in the safe, you better spend it.

00:42:34.840 --> 00:42:40.580
<v Aaron van Wirdum>I create a transaction that consists of 64 bytes because I want to

00:42:40.580 --> 00:42:46.380
<v Aaron van Wirdum>pay exactly... this many people, this many coins with this many UTXOs,

00:42:46.520 --> 00:42:49.740
<v Aaron van Wirdum>then the Bitcoin network say, no, your money is not valid.

00:42:49.900 --> 00:42:54.160
<v Sjors Provoost>Yeah, I think the actual examples would be burning coins. So you can make an

00:42:54.160 --> 00:42:58.800
<v Sjors Provoost>OP_RETURN transaction that burns your coins, doesn't send it anywhere. And that

00:42:58.800 --> 00:43:03.240
<v Sjors Provoost>can be shorter than 64 bytes, but it could also be 64 bytes. So if you want to

00:43:03.240 --> 00:43:08.650
<v Sjors Provoost>burn your money using an OP_RETURN that is exactly 64 bytes in total, then yeah,

00:43:08.910 --> 00:43:09.410
<v Sjors Provoost>you can't do that.

00:43:09.770 --> 00:43:13.430
<v Aaron van Wirdum>Are there no normal transactions that are exactly 64 bytes?

00:43:13.570 --> 00:43:17.230
<v Sjors Provoost>I believe not. So you can already not send those in the mempool today.

00:43:18.900 --> 00:43:20.520
<v Sjors Provoost>It won't be relayed.

00:43:20.720 --> 00:43:21.080
<v Aaron van Wirdum>Okay.

00:43:21.320 --> 00:43:24.920
<v Sjors Provoost>And so I think that was the change in version 25. So I think there was a rule

00:43:24.920 --> 00:43:30.800
<v Sjors Provoost>that says nothing under 64 bytes or sorry, nothing under 65 bytes. That

00:43:30.800 --> 00:43:33.960
<v Sjors Provoost>was the mempool rule. And then people were like, well, but it could be useful to

00:43:33.960 --> 00:43:38.780
<v Sjors Provoost>have a 63-byte or a 62-byte transaction to burn your coins. And so I think the

00:43:38.780 --> 00:43:43.300
<v Sjors Provoost>rule was changed to no 64 bytes. So the difference is make this

00:43:43.300 --> 00:43:46.000
<v Sjors Provoost>consensus rather than policy.

00:43:46.260 --> 00:43:51.560
<v Aaron van Wirdum>Okay. So most transactions are well over 64 bytes or at least more than 64 bytes.

00:43:51.760 --> 00:43:56.620
<v Aaron van Wirdum>That's normal for a transaction to be more than 64 bytes. If you see a 64-byte

00:43:56.620 --> 00:43:58.500
<v Aaron van Wirdum>transaction, it's kind of something special.

00:43:58.970 --> 00:44:00.310
<v Sjors Provoost>Yeah, then it's probably an attack.

00:44:00.310 --> 00:44:05.450
<v Aaron van Wirdum>Okay, right. And now the Great Consensus Cleanup says let's just get rid of that

00:44:05.450 --> 00:44:11.290
<v Aaron van Wirdum>all together. However, 63 or 62, that's still okay, if you really

00:44:11.290 --> 00:44:14.670
<v Aaron van Wirdum>do, like, if you're not attacking but you're burning coins, that that should

00:44:14.670 --> 00:44:20.550
<v Aaron van Wirdum>work. But yeah, so basically if people make 64 byte transactions in the future

00:44:20.550 --> 00:44:24.670
<v Aaron van Wirdum>and the soft fork happens, then their transaction wouldn't be confirmed.

00:44:24.670 --> 00:44:25.210
<v Sjors Provoost>Yep.

00:44:25.210 --> 00:44:29.450
<v Aaron van Wirdum>Then I have to make a new transaction that's either 63 or 65 or something else,

00:44:29.450 --> 00:44:30.910
<v Aaron van Wirdum>as long as it's not 64.

00:44:30.910 --> 00:44:36.130
<v Sjors Provoost>And you can probably malleate it. So we… I think we talked about transaction

00:44:36.130 --> 00:44:40.010
<v Sjors Provoost>malleation, where you can, like, mess with another transaction, so you might,

00:44:40.010 --> 00:44:43.610
<v Sjors Provoost>even if you lost the original coin that you used to make this thing, I think you

00:44:43.610 --> 00:44:47.870
<v Sjors Provoost>might be able to just make it one byte longer, but I'm not entirely sure about that.

00:44:47.870 --> 00:44:51.350
<v Aaron van Wirdum>Right. Okay, got it. Sounds like…

00:44:51.980 --> 00:44:57.240
<v Sjors Provoost>But this is another case of like, yes, you could just ban anything under 64 or

00:44:57.240 --> 00:45:02.020
<v Sjors Provoost>anything under 65, but you want to make the minimum change possible to reduce

00:45:02.020 --> 00:45:03.820
<v Sjors Provoost>controversy. That's not too complicated.

00:45:04.760 --> 00:45:08.590
<v Aaron van Wirdum>Okay. Last one. BIP 30, 34.

00:45:08.990 --> 00:45:13.170
<v Sjors Provoost>Yeah, we did a whole episode about this called episode 87. It was called the

00:45:13.170 --> 00:45:16.330
<v Sjors Provoost>block 1,983,702 problem.

00:45:17.960 --> 00:45:22.040
<v Aaron van Wirdum>Right. What was that problem again? It was about two transactions that look

00:45:22.040 --> 00:45:22.640
<v Aaron van Wirdum>similar, right?

00:45:23.260 --> 00:45:29.260
<v Sjors Provoost>Yeah, so the TL;DR of this one is that there was a BIP 30 that prevents duplicate

00:45:29.260 --> 00:45:33.100
<v Sjors Provoost>transactions. Because having duplicate transactions, transactions with the same

00:45:33.100 --> 00:45:37.420
<v Sjors Provoost>hash, it causes problems. You can override coinbases, do all sorts of weird

00:45:37.420 --> 00:45:41.220
<v Sjors Provoost>things. It happened a few times in the beginning of Bitcoin. It was fixed. The

00:45:41.220 --> 00:45:45.220
<v Sjors Provoost>problem of this fix is that it was a slow fix. So every time there's a new block

00:45:45.220 --> 00:45:48.060
<v Sjors Provoost>coming in, you have to check every transaction to make sure that it doesn't

00:45:48.060 --> 00:45:52.140
<v Sjors Provoost>already exist. And this check is expensive, requires a lot of disk reading.

00:45:55.280 --> 00:45:58.300
<v Sjors Provoost>Unfortunately, and so there was a way to speed it up. The way to speed it up was

00:45:58.300 --> 00:46:04.270
<v Sjors Provoost>to force the coinbase transaction to have the block height in it. So

00:46:04.270 --> 00:46:08.810
<v Sjors Provoost>that makes every coinbase transaction unique. And since every transaction

00:46:08.810 --> 00:46:11.990
<v Sjors Provoost>eventually descends from a coinbase transaction, every descendant is unique.

00:46:12.210 --> 00:46:15.210
<v Aaron van Wirdum>Yeah, that way you can't have duplicate transactions anymore.

00:46:15.450 --> 00:46:19.350
<v Sjors Provoost>Yeah, and so then people thought, okay, so we can turn off this expensive check.

00:46:20.130 --> 00:46:25.670
<v Sjors Provoost>But it turns out you can't because there are some very old transactions before

00:46:25.700 --> 00:46:31.340
<v Sjors Provoost>this BIP 34 rule was introduced that if you read them, you could interpret the

00:46:31.340 --> 00:46:36.270
<v Sjors Provoost>first bytes of those transactions as a version. Sorry, as a block height.

00:46:36.450 --> 00:46:41.610
<v Aaron van Wirdum>Yeah. So there's something in these old transactions, in these old UTXOs, I guess

00:46:41.610 --> 00:46:42.110
<v Aaron van Wirdum>we should say.

00:46:42.150 --> 00:46:45.190
<v Sjors Provoost>Yeah, that is effectively the same as putting a block height in there, but the

00:46:45.190 --> 00:46:45.590
<v Sjors Provoost>wrong one.

00:46:45.730 --> 00:46:45.950
<v Aaron van Wirdum>Yeah.

00:46:46.870 --> 00:46:50.910
<v Sjors Provoost>And so these ones, we're going to start encountering these, and we've already

00:46:50.910 --> 00:46:56.780
<v Sjors Provoost>encountered a few, but they didn't cause problems. So we got lucky. And so as of

00:46:56.780 --> 00:47:02.380
<v Sjors Provoost>the first one, we're going to encounter again is block 1,983,702. So there is an

00:47:02.380 --> 00:47:05.880
<v Sjors Provoost>old transaction out there that looks like it's at that height. So in theory,

00:47:05.880 --> 00:47:10.740
<v Sjors Provoost>somebody could then make a coinbase transaction that's a duplicate of that old

00:47:10.740 --> 00:47:16.610
<v Sjors Provoost>one. And we don't want that. So the BIP 30 check, the slow check, is re-enabled

00:47:16.610 --> 00:47:17.450
<v Sjors Provoost>from that height on.

00:47:18.980 --> 00:47:24.120
<v Sjors Provoost>That's annoying because that check, as we said, is slow. So the proposal here is

00:47:24.120 --> 00:47:29.440
<v Sjors Provoost>to do something else that makes sure that this duplication cannot happen. So not

00:47:29.440 --> 00:47:32.860
<v Sjors Provoost>just putting the height in the coinbase, but also putting something else in it.

00:47:33.600 --> 00:47:38.220
<v Sjors Provoost>What that something else is, we don't know. My favorite is to make SegWit

00:47:38.220 --> 00:47:43.120
<v Sjors Provoost>mandatory, as in SegWit commitment, because every SegWit block has

00:47:43.120 --> 00:47:49.080
<v Sjors Provoost>an OP_RETURN and followed by the hash of the witness data. And right

00:47:49.080 --> 00:47:53.500
<v Sjors Provoost>now, if there is no transactions in a block, including if there's no SegWit

00:47:53.500 --> 00:47:56.880
<v Sjors Provoost>transactions even in the coinbase, well, then there's no witness commitment. And

00:47:56.880 --> 00:48:01.740
<v Sjors Provoost>so that OP_RETURN is not present. But you could make it mandatory from off.

00:48:01.940 --> 00:48:06.660
<v Sjors Provoost>Basically, you could make it mandatory starting at block 1,983,000. And so people

00:48:06.660 --> 00:48:07.940
<v Sjors Provoost>will have 20 years to upgrade.

00:48:08.160 --> 00:48:08.500
<v Aaron van Wirdum>Yeah.

00:48:08.780 --> 00:48:12.220
<v Sjors Provoost>But if they don't, they could accidentally mine an invalid block at that height.

00:48:12.760 --> 00:48:13.000
<v Aaron van Wirdum>Right.

00:48:14.720 --> 00:48:15.940
<v Sjors Provoost>There's different ways to do it.

00:48:15.960 --> 00:48:21.360
<v Aaron van Wirdum>We discussed this at length in the other episode, of course, which was 87, for

00:48:21.360 --> 00:48:25.720
<v Aaron van Wirdum>anyone who wants to know more about this problem. And then also the potential

00:48:25.720 --> 00:48:26.700
<v Aaron van Wirdum>fix, 87.

00:48:27.080 --> 00:48:32.100
<v Sjors Provoost>So that's the whole great consensus cleanup. And so as you can hear, some changes

00:48:32.100 --> 00:48:35.780
<v Sjors Provoost>are very straightforward. There's not really any discussion. Some, there is

00:48:35.780 --> 00:48:36.220
<v Sjors Provoost>discussion.

00:48:38.920 --> 00:48:42.600
<v Sjors Provoost>And so we'll have to figure that out. And then at some point, somebody will have

00:48:42.600 --> 00:48:46.660
<v Sjors Provoost>to take the initiative to... actually propose this as a soft fork, do activation

00:48:46.660 --> 00:48:48.300
<v Sjors Provoost>parameters, hope there's no drama.

00:48:48.300 --> 00:48:54.250
<v Aaron van Wirdum>Well, that is kind of one of the, you know, side goals of

00:48:54.250 --> 00:49:00.240
<v Aaron van Wirdum>this proposal, I would say, is figuring out how we actually do soft

00:49:00.240 --> 00:49:02.280
<v Aaron van Wirdum>forks and how we actually do Bitcoin upgrades.

00:49:02.280 --> 00:49:06.660
<v Sjors Provoost>Exactly. This was proposed long before Taproot as a way to sort of get over the

00:49:06.660 --> 00:49:07.260
<v Sjors Provoost>SegWit trauma.

00:49:07.260 --> 00:49:12.980
<v Aaron van Wirdum>Yeah, like, we're still… it's still not clear how we're supposed to do these

00:49:12.980 --> 00:49:17.520
<v Aaron van Wirdum>kinds of things. So then the idea was let's do something that's very

00:49:17.520 --> 00:49:23.000
<v Aaron van Wirdum>uncontroversial that everyone should or does or will agree on. There's nothing,

00:49:23.000 --> 00:49:27.500
<v Aaron van Wirdum>like, it's just very obvious bugs that we're gonna fix, and then we can figure

00:49:27.500 --> 00:49:32.830
<v Aaron van Wirdum>out how we're actually supposed to do these soft forks. And then, you know, it's

00:49:32.830 --> 00:49:36.920
<v Aaron van Wirdum>sort of a good trial run for future soft forks, I guess.

00:49:37.120 --> 00:49:39.880
<v Sjors Provoost>Yeah. Now we've already done Taproot, but of course there was still discussion

00:49:39.880 --> 00:49:43.780
<v Sjors Provoost>about how that soft fork was activated. So I don't know if we really now have

00:49:43.780 --> 00:49:46.440
<v Sjors Provoost>broad consensus on how to do this.

00:49:46.520 --> 00:49:47.720
<v Aaron van Wirdum>We definitely don't, Sjors.

00:49:47.960 --> 00:49:51.800
<v Sjors Provoost>But this may be another case of nobody cares what the activation mechanism is

00:49:51.800 --> 00:49:52.500
<v Sjors Provoost>just activate it.

00:49:54.290 --> 00:49:58.710
<v Sjors Provoost>The main thing is, of course, this takes away the options of miners to do a time

00:49:58.710 --> 00:50:02.570
<v Sjors Provoost>warp attack, so if they actually like to keep that option, they might veto it,

00:50:02.650 --> 00:50:05.430
<v Sjors Provoost>and then you get into more difficult territory.

00:50:07.130 --> 00:50:08.670
<v Sjors Provoost>Um, well, but they may…

00:50:08.670 --> 00:50:12.010
<v Aaron van Wirdum>I don't know if we want to get… We don't want to get into the activation

00:50:12.010 --> 00:50:14.050
<v Aaron van Wirdum>discussion in this podcast episode.

00:50:14.050 --> 00:50:17.090
<v Sjors Provoost>We do not. I'm just saying, like, it might be straightforward, it might not be,

00:50:17.090 --> 00:50:18.990
<v Sjors Provoost>and we'll have to… We may have…

00:50:18.990 --> 00:50:20.490
<v Aaron van Wirdum>No, I'm telling you it will not be.

00:50:20.490 --> 00:50:21.110
<v Sjors Provoost>Okay.

00:50:21.110 --> 00:50:22.950
<v Aaron van Wirdum>For sure.

00:50:22.950 --> 00:50:27.760
<v Sjors Provoost>I'm more bullish. Okay. And of course, we keep in mind that you can deploy

00:50:27.760 --> 00:50:33.480
<v Sjors Provoost>multiple soft forks in parallel. So this doesn't have to be before or after your

00:50:33.480 --> 00:50:38.040
<v Sjors Provoost>favorite feature X. You can activate, I don't know, 10 soft forks at the same time.

00:50:38.800 --> 00:50:41.320
<v Aaron van Wirdum>Yeah, remember when people thought that would actually happen?

00:50:42.570 --> 00:50:44.130
<v Aaron van Wirdum>Good times. Good times.

00:50:44.170 --> 00:50:47.470
<v Sjors Provoost>Good times, indeed. I'm just saying, you know, don't worry about that aspect.

00:50:47.890 --> 00:50:51.090
<v Sjors Provoost>Okay, I think that's all we've got. Thank you for listening to Bitcoin,

00:50:51.470 --> 00:50:51.910
<v Aaron van Wirdum>Explained.

