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

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

00:00:10.190 --> 00:00:10.390
<v Sjors Provoost>Hello.

00:00:11.380 --> 00:00:16.540
<v Aaron van Wirdum>Sjors, we're recording this on Wednesday evening, Dutch time. Bitcoin just broke

00:00:16.720 --> 00:00:19.180
<v Aaron van Wirdum>20k dollars. Are you ecstatic?

00:00:19.540 --> 00:00:19.900
<v Sjors Provoost>No, no.

00:00:20.360 --> 00:00:23.300
<v Aaron van Wirdum>Okay. This episode, we're going to discuss open source?

00:00:23.820 --> 00:00:24.300
<v Sjors Provoost>Yes.

00:00:24.480 --> 00:00:28.140
<v Aaron van Wirdum>I'm just going to skip over the whole price thing. We're going to discuss open

00:00:28.140 --> 00:00:32.800
<v Aaron van Wirdum>source and why it's useful. Or free software and why it's useful. Are you on the

00:00:32.800 --> 00:00:34.800
<v Aaron van Wirdum>free software train or on the open source train?

00:00:35.360 --> 00:00:38.600
<v Sjors Provoost>I'm on every train. I like trains, but tell me.

00:00:38.740 --> 00:00:42.200
<v Aaron van Wirdum>I can tell you the difference because a lot of people don't know this. There

00:00:42.200 --> 00:00:46.640
<v Aaron van Wirdum>isn't a lot of difference except for like a philosophical difference. So the idea

00:00:46.640 --> 00:00:51.920
<v Aaron van Wirdum>is that Richard Stallman, he founded the free software movement. And the idea

00:00:51.920 --> 00:00:57.280
<v Aaron van Wirdum>there was if software is closed source, then there is sort of a power

00:00:57.280 --> 00:01:02.970
<v Aaron van Wirdum>relationship between developers and users. Because users don't

00:01:02.970 --> 00:01:08.540
<v Aaron van Wirdum>know what software they are running. And we'll get to this in a bit I guess, well

00:01:08.540 --> 00:01:12.660
<v Aaron van Wirdum>I can explain this very briefly right now the reason is… because you know this

00:01:12.660 --> 00:01:16.820
<v Aaron van Wirdum>but I'm explaining it to our listeners, yeah, the reason is that the actual

00:01:16.820 --> 00:01:21.140
<v Aaron van Wirdum>software you're running on your computer are binaries they're ones and zeros

00:01:21.140 --> 00:01:27.140
<v Aaron van Wirdum>that's the stuff computers can read while humans when they write software they

00:01:27.140 --> 00:01:32.810
<v Aaron van Wirdum>write computer code and the two aren't the same thing. So when you're running

00:01:32.810 --> 00:01:38.450
<v Aaron van Wirdum>closed software, you're just running the binaries and you're not exactly sure

00:01:38.450 --> 00:01:43.610
<v Aaron van Wirdum>what your computer is actually doing. So what your computer could be doing, for

00:01:43.610 --> 00:01:48.350
<v Aaron van Wirdum>example, is spy on you. If the developer put some malware into the closed

00:01:48.350 --> 00:01:54.270
<v Aaron van Wirdum>software, then your computer could spy on you or could do all sorts of stuff that

00:01:54.270 --> 00:01:58.790
<v Aaron van Wirdum>you don't actually want the software to do. So you have to trust the developer.

00:01:59.210 --> 00:02:02.770
<v Aaron van Wirdum>In that sense, you have to trust the developer that he didn't include malware

00:02:02.770 --> 00:02:08.250
<v Aaron van Wirdum>into your binaries, into your software. So Richard Stallman, he didn't like this

00:02:08.250 --> 00:02:12.230
<v Aaron van Wirdum>idea. That wasn't his vision for the future. So he started a free software

00:02:12.230 --> 00:02:18.190
<v Aaron van Wirdum>movement where the source code had to be available so people could actually check

00:02:18.190 --> 00:02:21.770
<v Aaron van Wirdum>what they were running on their computer. So in that sense, there wasn't a power

00:02:21.770 --> 00:02:26.610
<v Aaron van Wirdum>relationship anymore. They didn't need to trust their developer. So free in that

00:02:26.610 --> 00:02:31.280
<v Aaron van Wirdum>context means freedom. It doesn't mean free as in free beer.

00:02:31.540 --> 00:02:36.620
<v Sjors Provoost>Yeah, so in Dutch we have the word vrij, which means freedom, and gratis, which

00:02:36.620 --> 00:02:40.820
<v Sjors Provoost>means free beer. So we can intuitively understand this.

00:02:40.960 --> 00:02:43.440
<v Aaron van Wirdum>Yeah, we actually have two different words for that. Yeah, exactly.

00:02:44.280 --> 00:02:46.700
<v Sjors Provoost>And I'm sure German has 27 words for it.

00:02:47.250 --> 00:02:47.770
<v Aaron van Wirdum>Probably.

00:02:49.290 --> 00:02:54.610
<v Aaron van Wirdum>Where was I? So yeah, that was Stallman's vision. Then I think in the early

00:02:54.610 --> 00:02:59.270
<v Aaron van Wirdum>90s, there was a different, I can't remember the guy who wrote it, but there was

00:02:59.270 --> 00:03:04.090
<v Aaron van Wirdum>this paper about the cathedral and the bazaar, the bazaar and the cathedral,

00:03:04.270 --> 00:03:09.090
<v Aaron van Wirdum>something like that. It was like a Linux contributor. And he explained the

00:03:09.090 --> 00:03:13.790
<v Aaron van Wirdum>benefits of free software, as it was just called until then, from a kind of

00:03:13.790 --> 00:03:19.360
<v Aaron van Wirdum>different perspective, where he explained how… free software could

00:03:19.360 --> 00:03:24.080
<v Aaron van Wirdum>actually provide high quality code because there's a lot of people checking the

00:03:24.080 --> 00:03:29.380
<v Aaron van Wirdum>code. Enough eyeballs make all bugs shallow. That's the saying. So he came up

00:03:29.380 --> 00:03:33.740
<v Aaron van Wirdum>with a more sort of pragmatic reason why free software was a good idea. This

00:03:33.740 --> 00:03:39.600
<v Aaron van Wirdum>convinced the Netscape people to turn Netscape, the internet browser, into

00:03:39.600 --> 00:03:44.000
<v Aaron van Wirdum>an open source project. I'm calling it open source now. And that was Firefox. And

00:03:44.000 --> 00:03:48.420
<v Aaron van Wirdum>I'm calling it open source now because this group of people, they sort of

00:03:48.420 --> 00:03:53.900
<v Aaron van Wirdum>rebranded free software to open source to sort of more accentuate

00:03:53.900 --> 00:03:57.500
<v Aaron van Wirdum>these different benefits. So they weren't necessarily

00:03:58.900 --> 00:04:03.440
<v Aaron van Wirdum>proposing or they weren't in favor of open sourcing software for this

00:04:03.440 --> 00:04:09.400
<v Aaron van Wirdum>philosophical freedom reasons that Stallman was advertising, that he was

00:04:09.400 --> 00:04:13.340
<v Aaron van Wirdum>promoting, but more this pragmatic attitude. So that's that's where sort of the

00:04:13.340 --> 00:04:16.960
<v Aaron van Wirdum>difference between free software and open source stems from.

00:04:16.960 --> 00:04:20.180
<v Sjors Provoost>Was there also a difference between freeware because of course that was a term

00:04:20.180 --> 00:04:22.860
<v Sjors Provoost>that was going around too but freeware could still be closed source?

00:04:22.860 --> 00:04:28.450
<v Aaron van Wirdum>I don't know. I do know that basically every free software project is also an

00:04:28.450 --> 00:04:33.050
<v Aaron van Wirdum>open source project. There are very subtle differences for some of the licenses,

00:04:33.070 --> 00:04:37.590
<v Aaron van Wirdum>but it's basically the same thing, just sort of explained with different

00:04:37.590 --> 00:04:38.430
<v Aaron van Wirdum>philosophies.

00:04:38.770 --> 00:04:41.730
<v Sjors Provoost>All right. Well, in our case, we're going to be quite pragmatic. So the

00:04:41.730 --> 00:04:43.110
<v Sjors Provoost>terminology is less important.

00:04:43.350 --> 00:04:45.450
<v Aaron van Wirdum>You want to just go with open source?

00:04:46.130 --> 00:04:46.610
<v Sjors Provoost>Yes.

00:04:46.930 --> 00:04:50.750
<v Aaron van Wirdum>Okay. So we're just going to discuss open source. Okay. So Bitcoin is an open

00:04:50.750 --> 00:04:51.290
<v Aaron van Wirdum>source project?

00:04:51.740 --> 00:04:52.260
<v Sjors Provoost>Yes.

00:04:52.460 --> 00:04:55.760
<v Aaron van Wirdum>Why is that very important in the context of Bitcoin, Sjors?

00:04:56.160 --> 00:05:01.620
<v Sjors Provoost>Well, imagine you're trying to use Bitcoin and you install a computer program and

00:05:01.620 --> 00:05:06.120
<v Sjors Provoost>it gives you an address. And then it turns out there's some code in there that

00:05:06.120 --> 00:05:09.100
<v Sjors Provoost>just steals your Bitcoin. That would be bad.

00:05:09.560 --> 00:05:10.360
<v Aaron van Wirdum>Yeah, that would be bad.

00:05:10.540 --> 00:05:16.120
<v Sjors Provoost>So at minimum, you want to know what code you're actually about to send your

00:05:16.120 --> 00:05:17.540
<v Sjors Provoost>pension to.

00:05:17.900 --> 00:05:23.230
<v Aaron van Wirdum>Yep. Well, this is actually… this is exactly… I just gave you the spying example

00:05:23.230 --> 00:05:26.570
<v Aaron van Wirdum>of Stallman, but this would obviously be another great example where, you know,

00:05:26.570 --> 00:05:31.590
<v Aaron van Wirdum>you don't want… you don't want to trust the developers to steal… to not steal

00:05:31.590 --> 00:05:32.270
<v Aaron van Wirdum>your coins.

00:05:32.690 --> 00:05:37.510
<v Sjors Provoost>It's a very extreme example. It makes it very clear why you really need the

00:05:37.510 --> 00:05:40.630
<v Sjors Provoost>maximum transparency of what the hell is running on your machine.

00:05:40.830 --> 00:05:41.270
<v Aaron van Wirdum>Exactly.

00:05:42.160 --> 00:05:44.120
<v Sjors Provoost>And we're going to go down that rabbit hole a little bit.

00:05:44.300 --> 00:05:45.940
<v Aaron van Wirdum>Yeah, because it's not that easy.

00:05:46.220 --> 00:05:46.980
<v Sjors Provoost>No, it's not.

00:05:47.140 --> 00:05:51.500
<v Aaron van Wirdum>It would be nice if it was that easy, but it's actually a lot harder than it

00:05:51.500 --> 00:05:56.120
<v Aaron van Wirdum>sounds to make sure that the code on your computer is actually doing what you

00:05:56.120 --> 00:05:56.820
<v Aaron van Wirdum>want it to do.

00:05:57.020 --> 00:06:01.780
<v Sjors Provoost>Yeah, because one thing is you want whatever Bitcoin code is running to be open

00:06:01.780 --> 00:06:05.580
<v Sjors Provoost>source so that you can see what it is. But most computer programs, as we talked

00:06:05.580 --> 00:06:09.560
<v Sjors Provoost>about in the first episode, use libraries or dependencies. Use some other piece

00:06:09.560 --> 00:06:13.330
<v Sjors Provoost>of software. That in turn uses some other piece of software that in turn uses

00:06:13.330 --> 00:06:14.330
<v Sjors Provoost>some other piece of software…

00:06:14.330 --> 00:06:20.090
<v Aaron van Wirdum>I want to… I want to take this one step at a time. First step. So the the code of

00:06:20.090 --> 00:06:24.290
<v Aaron van Wirdum>Bitcoin it's open source, it's on the… it's hosted on the… it's GitHub

00:06:24.290 --> 00:06:24.950
<v Aaron van Wirdum>repository.

00:06:24.950 --> 00:06:28.810
<v Sjors Provoost>Yeah it's a Git repository which is also hosted on GitHub.

00:06:28.810 --> 00:06:34.590
<v Aaron van Wirdum>Right. Okay sorry thanks for that correction. So it's on GitHub so anyone with

00:06:34.590 --> 00:06:39.840
<v Aaron van Wirdum>the skills can look at this source code and you know check that it does what it's

00:06:39.840 --> 00:06:40.500
<v Aaron van Wirdum>supposed to do, so…

00:06:40.500 --> 00:06:45.400
<v Sjors Provoost>In addition, everybody who has that skill can compile it themselves rather than

00:06:45.400 --> 00:06:46.140
<v Sjors Provoost>downloading it.

00:06:46.140 --> 00:06:51.400
<v Aaron van Wirdum>Right. First question is yours, because I actually cannot read this at all. How

00:06:51.400 --> 00:06:53.480
<v Aaron van Wirdum>many people do you think can actually read this?

00:06:53.480 --> 00:06:58.940
<v Sjors Provoost>Well that depends on what you mean by actually read? I mean, how many people are

00:06:58.940 --> 00:07:03.620
<v Sjors Provoost>computer literate in general? Probably many, many tens of millions in the world.

00:07:04.140 --> 00:07:09.560
<v Sjors Provoost>How many can roughly read what a C program is doing? I guess, again, several

00:07:09.560 --> 00:07:13.300
<v Sjors Provoost>million, tens of millions probably. But the number of people who can actually

00:07:13.300 --> 00:07:18.340
<v Sjors Provoost>understand what the Bitcoin software is doing is probably a lot smaller. And the

00:07:18.340 --> 00:07:21.900
<v Sjors Provoost>number of people who actually do, in addition to being able to, is in the dozens.

00:07:22.320 --> 00:07:28.080
<v Sjors Provoost>And even then, it's hyper-specialized. So somebody might know everything

00:07:28.080 --> 00:07:33.120
<v Sjors Provoost>about peer-to-peer networking code and have never looked at some other part of the code.

00:07:33.280 --> 00:07:38.720
<v Aaron van Wirdum>So this sounds like a small number. Why is it so small and can it be bigger? How

00:07:38.720 --> 00:07:41.260
<v Aaron van Wirdum>could we make this bigger in the future?

00:07:42.140 --> 00:07:47.880
<v Sjors Provoost>Well, one thing is you can make source code more clean, more readable. So then

00:07:47.880 --> 00:07:50.600
<v Sjors Provoost>there are just more people who can read it because it's just better.

00:07:50.820 --> 00:07:53.140
<v Aaron van Wirdum>So why isn't that the case right now, for example?

00:07:53.940 --> 00:07:59.320
<v Sjors Provoost>Well, it's better than it was. But when Satoshi wrote it, everything was one file

00:07:59.320 --> 00:08:05.060
<v Sjors Provoost>with God knows how many lines of code in it. And that's very, very, very hard to

00:08:05.060 --> 00:08:05.540
<v Sjors Provoost>reason about.

00:08:06.970 --> 00:08:10.830
<v Aaron van Wirdum>For the non-programmers, that means, reason about means…

00:08:11.850 --> 00:08:16.710
<v Sjors Provoost>You're looking at the code and you see, okay, there's a function called make a

00:08:16.710 --> 00:08:20.230
<v Sjors Provoost>private key. Okay, what does that function do? Oh, calling this other function.

00:08:20.370 --> 00:08:24.050
<v Sjors Provoost>Where's that other function? Oh, it's 20,000 lines up in the same file. Let me

00:08:24.050 --> 00:08:28.330
<v Sjors Provoost>scroll 20,000 lines up, have a look at that code, and it's calling something

00:08:28.330 --> 00:08:32.690
<v Sjors Provoost>else. Oh, but it's not calling something, it's referring to a variable. Oh, but

00:08:32.690 --> 00:08:37.000
<v Sjors Provoost>this variable… can be accessed in like 15 different places at the same time

00:08:37.000 --> 00:08:38.440
<v Sjors Provoost>somewhere in this file.

00:08:39.220 --> 00:08:42.040
<v Aaron van Wirdum>Reason about means understand what the hell is going on.

00:08:42.240 --> 00:08:42.420
<v Sjors Provoost>Yes.

00:08:42.740 --> 00:08:47.560
<v Aaron van Wirdum>Right. Okay, so there's not that many, but hopefully it's improving or it's

00:08:47.560 --> 00:08:51.320
<v Aaron van Wirdum>getting easier, but that's a work in progress and it's still pretty hard.

00:08:51.320 --> 00:08:54.080
<v Sjors Provoost>Yeah, we're getting a little bit of help from all these altcoins, which are

00:08:54.080 --> 00:08:58.260
<v Sjors Provoost>cloning the Bitcoin code. Not all altcoins are, but many are. And they're cloning

00:08:58.260 --> 00:09:01.760
<v Sjors Provoost>it and they're working on it and they might occasionally find bugs too. Or at

00:09:01.760 --> 00:09:02.560
<v Sjors Provoost>least they're looking at it.

00:09:02.780 --> 00:09:08.580
<v Aaron van Wirdum>Right. Okay, so let's say I trust that this process where you know,

00:09:08.740 --> 00:09:11.920
<v Aaron van Wirdum>a bunch of people can look at it and I kind of trust that they're not all

00:09:11.920 --> 00:09:17.080
<v Aaron van Wirdum>cheating and this process is sort of working. At that point, I can

00:09:17.080 --> 00:09:23.360
<v Aaron van Wirdum>download the binaries from BitcoinCore.org and I should be totally fine, right?

00:09:23.660 --> 00:09:23.940
<v Sjors Provoost>No.

00:09:24.200 --> 00:09:26.140
<v Aaron van Wirdum>Oh, what's the next problem?

00:09:26.900 --> 00:09:32.080
<v Sjors Provoost>Well, I mean, there's a lot of problems. First of all, who says BitcoinCore.org

00:09:32.080 --> 00:09:34.500
<v Sjors Provoost>is run by the same people you just mentioned?

00:09:36.250 --> 00:09:41.150
<v Sjors Provoost>It might not be. Well, okay, maybe you can still prove that. But then maybe the

00:09:41.150 --> 00:09:45.230
<v Sjors Provoost>site is hacked or the site isn't hacked, but the DNS is hacked. There's lots of

00:09:45.230 --> 00:09:47.930
<v Sjors Provoost>reasons why the thing you download is not the thing you think you're downloading.

00:09:48.150 --> 00:09:53.310
<v Sjors Provoost>It's called malware. So one thing that open source projects almost always do

00:09:53.310 --> 00:09:59.070
<v Sjors Provoost>is publish a checksum, which is basically saying when you download this thing

00:09:59.070 --> 00:10:03.050
<v Sjors Provoost>and you run this little script on it, it should have the following checksum.

00:10:03.430 --> 00:10:07.370
<v Sjors Provoost>That's one thing you can do. But then can you trust the checksum that you

00:10:07.370 --> 00:10:10.930
<v Sjors Provoost>downloaded? I don't know, because whoever hacked the site might have also hacked

00:10:10.930 --> 00:10:16.810
<v Sjors Provoost>the checksum. So then what you do is you sign the checksum. So, for example,

00:10:16.870 --> 00:10:22.030
<v Sjors Provoost>a well-known person, in this case, Wladimir van der Laan, he signs the checksum

00:10:22.030 --> 00:10:27.070
<v Sjors Provoost>with a signature, with a key, with a PGP key that's publicly known. It's been the

00:10:27.070 --> 00:10:32.300
<v Sjors Provoost>same for like 10 years. So then at least, you know, you kind of have something to check.

00:10:32.480 --> 00:10:37.560
<v Aaron van Wirdum>Okay, so how does Wladimir know that the binaries he got

00:10:37.560 --> 00:10:41.220
<v Aaron van Wirdum>actually reflect the open source code from the Git?

00:10:41.440 --> 00:10:45.780
<v Sjors Provoost>Well, he knows because he did it. So he took the source code, he ran a command,

00:10:45.840 --> 00:10:46.860
<v Sjors Provoost>and he got the binary.

00:10:47.300 --> 00:10:51.820
<v Aaron van Wirdum>Yeah, and by he ran a command, you mean he put it through some other piece of

00:10:51.820 --> 00:10:56.320
<v Aaron van Wirdum>software that… produces binaries from the open source software.

00:10:56.520 --> 00:10:58.360
<v Sjors Provoost>Yeah, a compiler and a bunch of other tools.

00:10:58.520 --> 00:10:58.640
<v Aaron van Wirdum>Yeah.

00:10:59.500 --> 00:11:02.280
<v Sjors Provoost>So that's great. But then the question is, how do you know?

00:11:02.440 --> 00:11:02.660
<v Aaron van Wirdum>Right.

00:11:03.300 --> 00:11:08.820
<v Sjors Provoost>And here it gets a little bit more complicated. Ideally, what you do is you run

00:11:08.820 --> 00:11:13.800
<v Sjors Provoost>the same command and you also compile it, and then hopefully you get the same result.

00:11:14.060 --> 00:11:14.460
<v Aaron van Wirdum>Right.

00:11:14.940 --> 00:11:19.180
<v Sjors Provoost>And sometimes that works with some projects, but as projects get really

00:11:19.180 --> 00:11:24.620
<v Sjors Provoost>complicated, it often doesn't work because it can depend on some very specific

00:11:24.620 --> 00:11:29.160
<v Sjors Provoost>details on your computer system what the exact binary file is going to be. So for

00:11:29.160 --> 00:11:33.420
<v Sjors Provoost>example, the software uses libraries. And those libraries are living on your

00:11:33.420 --> 00:11:36.840
<v Sjors Provoost>system. So we talked about that in one of the first episodes about libraries in

00:11:36.840 --> 00:11:40.320
<v Sjors Provoost>general. These libraries might live in your system and these libraries get

00:11:40.320 --> 00:11:44.500
<v Sjors Provoost>updated all the time. And maybe you updated two months ago and Wladimir is like

00:11:44.500 --> 00:11:50.320
<v Sjors Provoost>very accurate and he updated yesterday. And so the final product contains a

00:11:50.320 --> 00:11:53.820
<v Sjors Provoost>different version of a library. And if you only change one letter in a computer

00:11:53.820 --> 00:11:57.850
<v Sjors Provoost>program, then boom, your checksum doesn't work anymore. So that's one of the

00:11:57.850 --> 00:11:58.590
<v Sjors Provoost>things that can go wrong.

00:11:58.690 --> 00:12:03.490
<v Aaron van Wirdum>Hang on. One step at a time. Why do I even need to care that my checksum matches

00:12:03.490 --> 00:12:06.610
<v Aaron van Wirdum>whatever Wladimir signed if I compiled it myself?

00:12:06.970 --> 00:12:09.870
<v Sjors Provoost>If all you want is to compile it yourself, you don't care.

00:12:10.250 --> 00:12:10.370
<v Aaron van Wirdum>Right.

00:12:10.570 --> 00:12:16.370
<v Sjors Provoost>But basically what this whole mechanism relies on is that some people check. And

00:12:16.370 --> 00:12:20.900
<v Sjors Provoost>that if some people find a problem, they're going to sound the alarm bell. And so

00:12:20.900 --> 00:12:25.840
<v Sjors Provoost>your security model kind of depends on hoping that somebody will do this checking

00:12:25.840 --> 00:12:27.700
<v Sjors Provoost>for you because you didn't compile it yourself.

00:12:28.080 --> 00:12:33.760
<v Aaron van Wirdum>Right. Everyone who compiles the software should compile into the same checksum

00:12:33.760 --> 00:12:37.000
<v Aaron van Wirdum>because that's how you know everyone's running the same software and no one's

00:12:37.000 --> 00:12:38.300
<v Aaron van Wirdum>being [unclear]…

00:12:40.070 --> 00:12:42.430
<v Sjors Provoost>Malicious software, for example. Yeah, so you, as somebody who wants to make sure

00:12:42.430 --> 00:12:45.350
<v Sjors Provoost>there are no shenanigans going on, you go to BitcoinCore.org, you download the

00:12:45.350 --> 00:12:49.050
<v Sjors Provoost>binary, you just put it in a nice place, and then you compile it yourself and you

00:12:49.050 --> 00:12:53.110
<v Sjors Provoost>see, hey, is this the same? If not, you go on Twitter and on the news media and

00:12:53.110 --> 00:12:54.750
<v Sjors Provoost>you say, hey, there's malware on this website.

00:12:55.010 --> 00:12:55.210
<v Aaron van Wirdum>Right.

00:12:55.610 --> 00:12:59.670
<v Sjors Provoost>However, that is not trivial because of, for example, these libraries that might

00:12:59.670 --> 00:13:02.830
<v Sjors Provoost>be slightly different. So you get a different checksum, even though there are no

00:13:02.830 --> 00:13:05.150
<v Sjors Provoost>shenanigans going on. It's just your computer is different.

00:13:05.560 --> 00:13:11.470
<v Aaron van Wirdum>Right, so if I compile the Bitcoin Core software on my… and you

00:13:11.470 --> 00:13:16.350
<v Aaron van Wirdum>compile it on your MacBook, they could still compile into different binaries?

00:13:16.510 --> 00:13:19.390
<v Sjors Provoost>Yes, because there might be some subtle differences. And it's not just libraries.

00:13:19.390 --> 00:13:25.250
<v Sjors Provoost>It can even be the time of your computer. So because as you're copying stuff,

00:13:25.570 --> 00:13:30.370
<v Sjors Provoost>there's some random output that contains a timestamp, maybe a log. And if the log

00:13:30.370 --> 00:13:33.490
<v Sjors Provoost>is included in the final product, then there's a different timestamp in your

00:13:33.490 --> 00:13:36.450
<v Sjors Provoost>version than in my version because we didn't compile it exactly at the same time.

00:13:38.270 --> 00:13:39.530
<v Sjors Provoost>So that's a problem.

00:13:39.710 --> 00:13:43.870
<v Aaron van Wirdum>Right, so somehow we need to make sure that the same source code compiles into

00:13:43.870 --> 00:13:45.350
<v Aaron van Wirdum>the exact same binaries.

00:13:45.570 --> 00:13:49.410
<v Sjors Provoost>Yeah, at least if your goal is to verify that nothing went wrong, right? Because

00:13:49.410 --> 00:13:53.050
<v Sjors Provoost>normally if you're just using it yourself, you don't care about that. So this

00:13:53.050 --> 00:13:57.570
<v Sjors Provoost>phenomena is called deterministic builds. So deterministic really just implies

00:13:57.570 --> 00:14:01.350
<v Sjors Provoost>given a source, you're going to get the same binary, and if you change one letter

00:14:01.350 --> 00:14:04.390
<v Sjors Provoost>in the source, you're going to get a different binary, but everybody will get the

00:14:04.390 --> 00:14:06.750
<v Sjors Provoost>same, basically, if they make the same change.

00:14:06.890 --> 00:14:07.750
<v Aaron van Wirdum>So how is this done?

00:14:08.520 --> 00:14:13.840
<v Sjors Provoost>So this is difficult. And the current way that Bitcoin Core is doing this is

00:14:13.840 --> 00:14:19.100
<v Sjors Provoost>called Gitian. And just to sum that up, it's basically, you take an Ubuntu

00:14:19.100 --> 00:14:24.500
<v Sjors Provoost>machine, could be a virtual machine, or could be a real machine. And you just

00:14:24.500 --> 00:14:28.460
<v Sjors Provoost>take a very specific Ubuntu version, I think, that you download. And many people

00:14:28.460 --> 00:14:32.800
<v Sjors Provoost>in the world have seen that version, so you kind of trust it. And then inside

00:14:32.800 --> 00:14:37.880
<v Sjors Provoost>that machine, you build another virtual machine. And inside… that virtual

00:14:37.880 --> 00:14:40.880
<v Sjors Provoost>machine, there are all sorts of little changes made to make sure that that

00:14:40.880 --> 00:14:45.500
<v Sjors Provoost>machine is identical for everyone who builds this thing. So I think it uses a

00:14:45.500 --> 00:14:49.020
<v Sjors Provoost>fake time and all the files are in the same place and all the libraries are the

00:14:49.020 --> 00:14:54.860
<v Sjors Provoost>exact same versions, etc. And then you build Bitcoin Core. And then you look at

00:14:54.860 --> 00:14:56.580
<v Sjors Provoost>the checksums inside that virtual machine.

00:14:57.810 --> 00:15:03.490
<v Aaron van Wirdum>Right. Yeah. So it's kind of like running a computer within your actual computer.

00:15:03.710 --> 00:15:04.670
<v Sjors Provoost>Within a computer.

00:15:04.950 --> 00:15:08.690
<v Aaron van Wirdum>And everyone's sort of running the same computer within the computer, in their

00:15:08.690 --> 00:15:13.410
<v Aaron van Wirdum>actual computer. And therefore the software they're compiling into binaries in

00:15:13.410 --> 00:15:17.310
<v Aaron van Wirdum>that computer, and the computer is resulting in the exact same binaries.

00:15:17.530 --> 00:15:17.930
<v Sjors Provoost>That's right.

00:15:18.130 --> 00:15:23.620
<v Aaron van Wirdum>This is turned into a checksum. And if the checksums match, then the

00:15:23.620 --> 00:15:29.600
<v Aaron van Wirdum>developers sign because they can all verify that, yep, it all worked out

00:15:29.600 --> 00:15:33.860
<v Aaron van Wirdum>and this is the correct checksum and you can trust this because we're not all

00:15:33.860 --> 00:15:36.680
<v Aaron van Wirdum>going to cheat on you. Unless they are, but at least…

00:15:36.680 --> 00:15:37.340
<v Sjors Provoost>But then you can catch them.

00:15:37.580 --> 00:15:37.740
<v Aaron van Wirdum>Yeah.

00:15:38.040 --> 00:15:40.920
<v Sjors Provoost>Anybody has the opportunity to see that there's a shenanigan going on.

00:15:41.020 --> 00:15:43.940
<v Aaron van Wirdum>Anyone can follow this process and catch that something…

00:15:44.120 --> 00:15:47.790
<v Sjors Provoost>Yeah, in theory. In practice, it's a pain. It's a huge pain to get the system

00:15:47.790 --> 00:15:51.330
<v Sjors Provoost>working. There's not many open source projects that use this. As far as I know,

00:15:51.410 --> 00:15:54.490
<v Sjors Provoost>Bitcoin Core and Tor do. Maybe a few others, but not a lot.

00:15:54.830 --> 00:15:56.490
<v Aaron van Wirdum>Maybe some other cryptocurrencies.

00:15:56.870 --> 00:16:00.250
<v Sjors Provoost>Some, but a lot of them, even if they've cloned Bitcoin Core, they stopped doing

00:16:00.250 --> 00:16:01.790
<v Sjors Provoost>this process because it's too much work.

00:16:02.090 --> 00:16:02.210
<v Aaron van Wirdum>Right.

00:16:03.010 --> 00:16:04.150
<v Sjors Provoost>But, okay.

00:16:04.930 --> 00:16:05.930
<v Aaron van Wirdum>So far, so good.

00:16:06.110 --> 00:16:10.190
<v Sjors Provoost>So it's great, but there is another problem because the rabbit hole is deeper.

00:16:11.320 --> 00:16:14.360
<v Sjors Provoost>And there's actually two different problems, but they're kind of the same. So

00:16:14.360 --> 00:16:17.720
<v Sjors Provoost>let's start with the first thing. Let's say you have read every single line of

00:16:17.720 --> 00:16:22.120
<v Sjors Provoost>code in Bitcoin Core. And you can say, okay, I've read every single line in

00:16:22.120 --> 00:16:24.920
<v Sjors Provoost>there. I understand every single line of it. It's just like, you know, when you

00:16:24.920 --> 00:16:28.580
<v Sjors Provoost>read the Facebook terms and conditions. But then it turns out the Facebook terms

00:16:28.580 --> 00:16:32.660
<v Sjors Provoost>and conditions point to some other document. Like, for example, I don't know, the

00:16:32.660 --> 00:16:34.720
<v Sjors Provoost>United States law. All of it.

00:16:36.590 --> 00:16:41.750
<v Sjors Provoost>So, you know, with phrases like as defined in law. Now you have a problem because

00:16:41.750 --> 00:16:45.830
<v Sjors Provoost>Bitcoin Core uses all sorts of other things. And so you have to inspect those

00:16:45.830 --> 00:16:46.370
<v Sjors Provoost>things too.

00:16:46.850 --> 00:16:49.010
<v Aaron van Wirdum>Yeah, dependencies, these are called.

00:16:49.210 --> 00:16:54.510
<v Sjors Provoost>Because the dependencies could also be stealing your coins. So they should be

00:16:54.510 --> 00:16:55.150
<v Sjors Provoost>open source too.

00:16:56.480 --> 00:16:59.440
<v Aaron van Wirdum>Bitcoin Core doesn't use that many dependencies anymore, right?

00:16:59.720 --> 00:17:03.460
<v Sjors Provoost>Exactly. So one of the constraints when working on Bitcoin Core is to try and

00:17:03.460 --> 00:17:07.860
<v Sjors Provoost>keep the number of dependencies as small as possible and also not update them all

00:17:07.860 --> 00:17:11.100
<v Sjors Provoost>the time. Because of course, the people who maintain those dependencies know that

00:17:11.100 --> 00:17:15.300
<v Sjors Provoost>Bitcoin Core is using it, right? So you need to be somewhat on your toes to make

00:17:15.300 --> 00:17:17.740
<v Sjors Provoost>sure that those projects are being scrutinized too.

00:17:17.920 --> 00:17:23.720
<v Aaron van Wirdum>So let's say some dependency is corrupted. What could that mean for Bitcoin?

00:17:24.300 --> 00:17:26.220
<v Aaron van Wirdum>Could they… Go on.

00:17:26.740 --> 00:17:29.460
<v Sjors Provoost>Yeah, if some dependency is corrupted, it could steal your coins.

00:17:29.700 --> 00:17:30.740
<v Aaron van Wirdum>Right. That bad.

00:17:31.280 --> 00:17:32.580
<v Sjors Provoost>Yeah, that's your worst case.

00:17:32.760 --> 00:17:32.960
<v Aaron van Wirdum>Okay.

00:17:33.240 --> 00:17:38.810
<v Sjors Provoost>And this actually happened, at least in another project, called Copay, which is

00:17:38.810 --> 00:17:43.550
<v Sjors Provoost>a… I think it's a library for wallets in general, used by BitPay, but by other

00:17:43.550 --> 00:17:44.150
<v Sjors Provoost>companies too.

00:17:44.410 --> 00:17:44.670
<v Aaron van Wirdum>Right.

00:17:45.050 --> 00:17:48.850
<v Sjors Provoost>And it's written in a different programming language, but the general idea is the

00:17:48.850 --> 00:17:52.330
<v Sjors Provoost>same. You know, they have a piece of software that's open source. Everybody can

00:17:52.330 --> 00:17:56.890
<v Sjors Provoost>review it, but it uses dependencies. And those dependencies use dependencies and

00:17:56.890 --> 00:18:00.350
<v Sjors Provoost>those and those and those and those. And in this case, they were using npm, the

00:18:00.350 --> 00:18:05.620
<v Sjors Provoost>node package manager. And Node.js and that package manager is basically a very

00:18:05.620 --> 00:18:10.060
<v Sjors Provoost>large open source community. And they've very much focused on making very modular

00:18:10.060 --> 00:18:15.480
<v Sjors Provoost>packages. So I think there's an individual package for just addition or

00:18:15.480 --> 00:18:21.300
<v Sjors Provoost>multiplication or fairly trivial packages. And every single package links

00:18:21.300 --> 00:18:25.380
<v Sjors Provoost>to a place on GitHub. So it's all open source. And every package could have its

00:18:25.380 --> 00:18:29.560
<v Sjors Provoost>own maintainer who can release updates whenever they want. And so now you have a

00:18:29.560 --> 00:18:33.760
<v Sjors Provoost>problem because you might be pulling in 10,000 dependencies without even

00:18:33.760 --> 00:18:37.700
<v Sjors Provoost>realizing it because you only pull in maybe five dependencies, but those each

00:18:37.700 --> 00:18:42.300
<v Sjors Provoost>pull in 50 dependencies and those each pull in another 50 dependencies.

00:18:42.420 --> 00:18:48.110
<v Aaron van Wirdum>And if any of these is corrupted, it could… At least theoretically, include

00:18:48.110 --> 00:18:49.490
<v Aaron van Wirdum>coin-stealing malware.

00:18:50.050 --> 00:18:54.190
<v Sjors Provoost>Yeah, and so it depends. I mean, there are some ways in theory that you can try

00:18:54.190 --> 00:18:58.550
<v Sjors Provoost>to avoid that by encapsulating, by saying, okay, this piece of code, I'm going to

00:18:58.550 --> 00:19:01.510
<v Sjors Provoost>run that code. I don't trust it, but I'm going to put it in some place where it

00:19:01.510 --> 00:19:06.130
<v Sjors Provoost>cannot do anything other than that I want it to do. But with JavaScript, which is

00:19:06.130 --> 00:19:10.450
<v Sjors Provoost>what they're using, at least at the time, this is two years ago, that was very

00:19:10.450 --> 00:19:16.290
<v Sjors Provoost>difficult to do. So any JavaScript… that is run can do anything in the

00:19:16.290 --> 00:19:21.110
<v Sjors Provoost>entire browser. So in this case with the Copay wallet there would be private keys

00:19:21.110 --> 00:19:25.890
<v Sjors Provoost>somewhere inside the browser and a piece of malware could just say

00:19:25.890 --> 00:19:29.590
<v Sjors Provoost>window.blahblahblah.stealcoins basically.

00:19:30.610 --> 00:19:32.350
<v Aaron van Wirdum>And did this actually happen?

00:19:32.280 --> 00:19:36.530
<v Sjors Provoost>Or, well, somebody wrote that malware. I don't think it was exploited in the

00:19:36.530 --> 00:19:39.500
<v Sjors Provoost>wild. I think it was detected… on… someone… someone…

00:19:39.010 --> 00:19:44.390
<v Aaron van Wirdum>Because I vaguely remember this, but someone actually got this kind of malware

00:19:44.390 --> 00:19:49.530
<v Aaron van Wirdum>into the Copay wallet, basically, into the Copay library. This was actually done.

00:19:49.550 --> 00:19:52.670
<v Sjors Provoost>In a dependency of a dependency of a dependency. So what they did is they found

00:19:52.670 --> 00:19:57.570
<v Sjors Provoost>some random faraway dependency down, deep down in the tree right, that's actually

00:19:57.570 --> 00:19:59.350
<v Sjors Provoost>used by millions of projects.

00:20:01.060 --> 00:20:05.440
<v Sjors Provoost>And that dependency was no longer maintained. So somebody wrote it, everybody

00:20:05.440 --> 00:20:11.200
<v Sjors Provoost>uses it, and then the guy or girl no longer maintains it. And so the attacker

00:20:11.200 --> 00:20:15.000
<v Sjors Provoost>sent an email to that previous maintainer saying, hey, I really love your

00:20:15.000 --> 00:20:19.780
<v Sjors Provoost>project, I care about this, maybe I can take over from you. And so he got the

00:20:19.780 --> 00:20:24.840
<v Sjors Provoost>keys to the kingdom, and he was able to publish updates. And so then he published

00:20:24.840 --> 00:20:29.080
<v Sjors Provoost>an update that contained some malware. Some coin stealing code that was

00:20:29.080 --> 00:20:33.780
<v Sjors Provoost>specifically designed to attack Copay wallets or the general library.

00:20:35.200 --> 00:20:39.580
<v Sjors Provoost>And what it did was, well, first of all, he hid it. So, you know, it's open

00:20:39.580 --> 00:20:43.880
<v Sjors Provoost>source, but if you release an update, you can do different versions. So you can

00:20:43.880 --> 00:20:46.600
<v Sjors Provoost>do a minor update saying, oh, this is just a small change and you can do major

00:20:46.600 --> 00:20:52.590
<v Sjors Provoost>updates. And most software will constrain these updates. So it will

00:20:52.590 --> 00:20:56.150
<v Sjors Provoost>automatically update for you, but only for minor updates. It won't automatically

00:20:56.150 --> 00:21:01.990
<v Sjors Provoost>upgrade a major upgrade. So what the attacker did is he made a minor update, and

00:21:01.990 --> 00:21:06.990
<v Sjors Provoost>then immediately afterwards made a major update, which undid the attack. So if

00:21:06.990 --> 00:21:10.670
<v Sjors Provoost>you looked at the most recent version of the code, there would not be any attack

00:21:10.670 --> 00:21:13.790
<v Sjors Provoost>code in there. So anybody inspecting the open source would say, okay, this is

00:21:13.790 --> 00:21:19.130
<v Sjors Provoost>fine. But if you looked at the specific minor version that was being used, then

00:21:19.130 --> 00:21:24.230
<v Sjors Provoost>it was there. So you don't only have to review the most recent source codes, you

00:21:24.230 --> 00:21:29.070
<v Sjors Provoost>have to review the source code specific version that you're using for all of your

00:21:29.070 --> 00:21:30.830
<v Sjors Provoost>dependencies. It's completely impossible.

00:21:31.130 --> 00:21:36.510
<v Aaron van Wirdum>Right. So Copay was open source, but because of these dependencies and the

00:21:36.510 --> 00:21:40.610
<v Aaron van Wirdum>dependencies on the dependencies, it's still not going to solve your problems.

00:21:40.870 --> 00:21:45.470
<v Sjors Provoost>No, and it was very, very subtle, right? I guess it was found by somebody very,

00:21:45.470 --> 00:21:48.990
<v Sjors Provoost>very carefully looking for this sort of stuff because it's very hard to stumble

00:21:48.990 --> 00:21:54.830
<v Sjors Provoost>into it. And it was even made that it wouldn't reveal itself early because what

00:21:54.830 --> 00:21:59.070
<v Sjors Provoost>you kind of want to do as an attacker is you want to look for a very big bounty

00:21:59.070 --> 00:22:03.130
<v Sjors Provoost>and then take that. Because as soon as you start stealing coins, if you only

00:22:03.130 --> 00:22:07.030
<v Sjors Provoost>steal one Satoshi and the person losing that one Satoshi notices it, they're

00:22:07.030 --> 00:22:09.250
<v Sjors Provoost>going to sound the alarm bell and then people are going to start looking where

00:22:09.250 --> 00:22:13.410
<v Sjors Provoost>the malware is, knowing that it exists and they're going to find it. So it was

00:22:13.410 --> 00:22:16.510
<v Sjors Provoost>basically it had a condition in there that says it has to be at least a couple of

00:22:16.510 --> 00:22:20.830
<v Sjors Provoost>Bitcoin in there. And only then am I going to attack. And I guess that never

00:22:20.830 --> 00:22:24.550
<v Sjors Provoost>happened, fortunately, because they [unclear] it on time. But this is a risk.

00:22:24.750 --> 00:22:28.150
<v Aaron van Wirdum>So what's the solution? Just not depend on dependencies?

00:22:28.650 --> 00:22:32.130
<v Sjors Provoost>Pretty much. I mean, I think there are now, you know, over the last couple of

00:22:32.130 --> 00:22:36.650
<v Sjors Provoost>years, there's some companies that will sort of screen as a service that might

00:22:36.650 --> 00:22:39.930
<v Sjors Provoost>actually go through all these dependencies. But what you really want to do is you

00:22:39.930 --> 00:22:43.910
<v Sjors Provoost>want to have very few dependencies. And especially you want to stay away from

00:22:43.910 --> 00:22:47.850
<v Sjors Provoost>things that have nested dependencies. So in the case of Bitcoin Core, it's not

00:22:47.850 --> 00:22:52.570
<v Sjors Provoost>too bad. It has, I think, about 10 dependencies that do not have a bunch of

00:22:52.570 --> 00:22:53.390
<v Sjors Provoost>nested dependencies.

00:22:54.150 --> 00:22:54.550
<v Aaron van Wirdum>Right.

00:22:54.550 --> 00:22:59.130
<v Sjors Provoost>It's not a big tree. It's relatively shallow. So you'd have to go after those

00:22:59.130 --> 00:23:02.800
<v Sjors Provoost>dependencies directly to attack. So that's good news.

00:23:03.440 --> 00:23:09.230
<v Aaron van Wirdum>Okay, sure. I think that part is clear. Now, I have another question for you. I

00:23:09.230 --> 00:23:13.450
<v Aaron van Wirdum>think you have a vague idea where I'm going because we already discussed exactly

00:23:13.450 --> 00:23:17.690
<v Aaron van Wirdum>where we're going. We just discussed how you have deterministic builds and how

00:23:17.690 --> 00:23:23.330
<v Aaron van Wirdum>different developers are all using this Gitian building thing to get the exact

00:23:23.330 --> 00:23:29.260
<v Aaron van Wirdum>same binaries and sign all of that. Now, here's my next question. What if the

00:23:29.260 --> 00:23:34.120
<v Aaron van Wirdum>Gitian building process itself is corrupted somehow? Is that possible?

00:23:34.790 --> 00:23:40.650
<v Sjors Provoost>Yeah, or specifically Gitian uses Ubuntu. And what if somebody says, hey, this

00:23:40.650 --> 00:23:43.850
<v Sjors Provoost>Bitcoin project is pretty cool. This Ubuntu project is pretty cool. Let me

00:23:43.850 --> 00:23:49.450
<v Sjors Provoost>contribute some source to Ubuntu. And now when everybody runs their Gitian

00:23:49.450 --> 00:23:55.240
<v Sjors Provoost>builder, which includes Ubuntu, there is a compiler on Ubuntu. And maybe that

00:23:55.240 --> 00:23:59.920
<v Sjors Provoost>compiler is modified to, if it compiles Bitcoin Core, it actually adds some code

00:23:59.920 --> 00:24:00.720
<v Sjors Provoost>to steal coins.

00:24:02.250 --> 00:24:02.610
<v Aaron van Wirdum>Right.

00:24:02.730 --> 00:24:05.390
<v Sjors Provoost>It would be very, very scary. Because you still have deterministic builds,

00:24:05.450 --> 00:24:07.990
<v Sjors Provoost>because everybody would be using the same malware to build it.

00:24:08.470 --> 00:24:12.450
<v Aaron van Wirdum>Yeah, I guess that's a dependency in itself then, right? That's like a dependency

00:24:12.450 --> 00:24:14.810
<v Aaron van Wirdum>for Ubuntu, or am I saying that right?

00:24:14.850 --> 00:24:18.130
<v Sjors Provoost>I guess there's two kinds of dependencies. One is the dependency you're actively

00:24:18.130 --> 00:24:21.330
<v Sjors Provoost>running, you know, that's inside the binary that you're shipping to your

00:24:21.330 --> 00:24:24.850
<v Sjors Provoost>customers. But the other dependency, and that's a real can of worms, are all the

00:24:24.850 --> 00:24:26.830
<v Sjors Provoost>tools that you're using to produce the binary.

00:24:26.990 --> 00:24:27.330
<v Aaron van Wirdum>Right.

00:24:27.590 --> 00:24:29.390
<v Sjors Provoost>And even to download the binary, but yeah.

00:24:29.730 --> 00:24:35.570
<v Aaron van Wirdum>Yeah, so if the tools you use to build Bitcoin Core… is corrupted then you still

00:24:35.570 --> 00:24:39.030
<v Aaron van Wirdum>have a problem because all of the developers are getting the self the same

00:24:39.030 --> 00:24:43.170
<v Aaron van Wirdum>binaries from their Gitian process but if that's corrupted anyways I think our

00:24:43.170 --> 00:24:44.010
<v Aaron van Wirdum>listeners get it.

00:24:44.010 --> 00:24:47.110
<v Sjors Provoost>So what's… what you're hoping is that the people who are maintaining all these

00:24:47.110 --> 00:24:50.650
<v Sjors Provoost>compilers and all the other things know what they're doing and would never let

00:24:50.650 --> 00:24:54.210
<v Sjors Provoost>any such a backdoor through. But, you know, that would be boring. So how do we

00:24:54.210 --> 00:24:54.890
<v Sjors Provoost>get more paranoid?

00:24:54.890 --> 00:24:57.970
<v Aaron van Wirdum>How do we get more paranoid? How do we solve this problem?

00:24:57.970 --> 00:25:03.630
<v Sjors Provoost>Well, the key there is to make everything open source, and

00:25:03.630 --> 00:25:08.670
<v Sjors Provoost>everything a deterministic build. So not just Bitcoin is a deterministic build,

00:25:08.830 --> 00:25:12.770
<v Sjors Provoost>but every dependency of Bitcoin is a deterministic build. And every tool that is

00:25:12.770 --> 00:25:17.410
<v Sjors Provoost>used to build Bitcoin is a deterministic build, including the compiler. And this

00:25:17.410 --> 00:25:23.020
<v Sjors Provoost>is where we introduce Guix. This is a project Carl Dong has been working on and

00:25:23.020 --> 00:25:25.820
<v Sjors Provoost>has given several talks on that we'll probably link to in the show notes.

00:25:26.060 --> 00:25:29.020
<v Aaron van Wirdum>Yeah, Carl Dong from, he's with Chaincode Labs, right?

00:25:29.220 --> 00:25:29.340
<v Sjors Provoost>Yeah.

00:25:29.860 --> 00:25:35.360
<v Aaron van Wirdum>Yeah, so the trick then, it's a difficult trick… Well, it sounds very difficult

00:25:35.360 --> 00:25:41.160
<v Aaron van Wirdum>to me because you need a compiler, that itself needs to

00:25:41.160 --> 00:25:44.620
<v Aaron van Wirdum>be compiled as well because the compiler is also software.

00:25:44.900 --> 00:25:46.740
<v Sjors Provoost>So this is turtles all the way down.

00:25:46.860 --> 00:25:47.140
<v Aaron van Wirdum>Exactly.

00:25:47.560 --> 00:25:52.720
<v Sjors Provoost>So the ambition of Guix is roughly as follows: You start with about, I think it's

00:25:52.720 --> 00:25:58.440
<v Sjors Provoost>150 bytes of actual machine code. So that is binary code that you must

00:25:58.440 --> 00:26:02.600
<v Sjors Provoost>trust, but it's only 150 bytes and the whole world can study it and put it on a

00:26:02.600 --> 00:26:08.240
<v Sjors Provoost>temple wall or something like that. But from that 150 bytes, all you need to do

00:26:08.240 --> 00:26:11.820
<v Sjors Provoost>now is read source and compile source. So how do you do that? Because there's no

00:26:11.820 --> 00:26:17.640
<v Sjors Provoost>compiler yet, right? So this 150 bytes is able to bootstrap. It is able to

00:26:17.640 --> 00:26:21.920
<v Sjors Provoost>read something. That's all it can do, basically, and produce a little bit more

00:26:21.920 --> 00:26:27.700
<v Sjors Provoost>code. So it reads something and then it builds up a

00:26:27.700 --> 00:26:32.570
<v Sjors Provoost>very simple compiler. And once it has the very simple compiler, that very simple

00:26:32.570 --> 00:26:35.870
<v Sjors Provoost>compiler reads another piece of source, which then builds a slightly more

00:26:35.870 --> 00:26:39.790
<v Sjors Provoost>complicated compiler. And then that slightly more complicated compiler builds

00:26:39.790 --> 00:26:43.970
<v Sjors Provoost>another compiler. And this goes on for quite a while, I think, until eventually

00:26:43.970 --> 00:26:48.230
<v Sjors Provoost>you have the modern C compiler that we all know and love, which is itself, of

00:26:48.230 --> 00:26:52.010
<v Sjors Provoost>course, open source, right? All compilers have this fundamental problem that who

00:26:52.010 --> 00:26:53.270
<v Sjors Provoost>compiles the compiler?

00:26:53.900 --> 00:26:57.120
<v Aaron van Wirdum>It sounds pretty fascinating. So it's… like… as… it's… yeah

00:26:57.120 --> 00:27:01.120
<v Sjors Provoost>It is turtles all the way down, but there's actually a bottom. It's not turtles

00:27:01.120 --> 00:27:01.520
<v Sjors Provoost>all the way down…

00:27:01.400 --> 00:27:05.160
<v Aaron van Wirdum>It's a seed that builds a compiler that builds compilers.

00:27:05.520 --> 00:27:09.900
<v Sjors Provoost>Yeah, so all the compilers and subcompilers are all open source. It's just that

00:27:09.900 --> 00:27:13.740
<v Sjors Provoost>seed, that is not source. That has to be a binary because you have to start with

00:27:13.740 --> 00:27:14.400
<v Sjors Provoost>the binary somewhere.

00:27:14.600 --> 00:27:14.940
<v Aaron van Wirdum>Yeah.

00:27:15.180 --> 00:27:16.340
<v Sjors Provoost>But you can literally just type it.

00:27:16.520 --> 00:27:20.940
<v Aaron van Wirdum>And this is a work in progress. This isn't used or finished yet, right?

00:27:21.140 --> 00:27:25.720
<v Sjors Provoost>I think it's a work in progress, but it is also working. I believe we can now use

00:27:25.720 --> 00:27:30.380
<v Sjors Provoost>this for Bitcoin Core. Because I recently did it as well. I tried to just hit the

00:27:30.380 --> 00:27:35.060
<v Sjors Provoost>commands blindly. And it was producing actual Bitcoin Core binaries that could be

00:27:35.060 --> 00:27:39.850
<v Sjors Provoost>run. And that are… Not turtles all the way down. I think it starts… doesn't start

00:27:39.850 --> 00:27:44.110
<v Sjors Provoost>at the very bottom. So I still had problems going from the bootstrap. But that's

00:27:44.110 --> 00:27:44.610
<v Sjors Provoost>where it's going.

00:27:44.930 --> 00:27:49.950
<v Aaron van Wirdum>So do one of these compilers build like the Gitian thing? Is it the same thing?

00:27:49.950 --> 00:27:50.570
<v Aaron van Wirdum>Or is it…

00:27:50.710 --> 00:27:53.290
<v Sjors Provoost>It's not building Gitian itself. It's building… but it's a similar principle. So

00:27:53.290 --> 00:27:57.230
<v Sjors Provoost>the idea is it can build. I think the idea eventually is that it can build a

00:27:57.230 --> 00:28:00.780
<v Sjors Provoost>whole operating system. So then your virtual machine or your physical machine

00:28:00.780 --> 00:28:05.260
<v Sjors Provoost>would be running a operating system that you've built from scratch. But in this

00:28:05.260 --> 00:28:09.280
<v Sjors Provoost>case, I think it just builds the compiler tools. And once those compiler tools

00:28:09.280 --> 00:28:12.980
<v Sjors Provoost>are there, it can just start building Bitcoin Core as it would otherwise do.

00:28:13.420 --> 00:28:17.940
<v Sjors Provoost>Similar to Gitian, as in it has to make sure that there are no timestamps in

00:28:17.940 --> 00:28:21.420
<v Sjors Provoost>there and it doesn't use anything else from your computer. So it solves two

00:28:21.420 --> 00:28:25.480
<v Sjors Provoost>things. It has no untrusted dependencies. It's not using random libraries. It's

00:28:25.480 --> 00:28:30.940
<v Sjors Provoost>also always using the same versions of libraries which means that everybody can

00:28:30.940 --> 00:28:32.020
<v Sjors Provoost>produce the same result.

00:28:32.240 --> 00:28:37.760
<v Aaron van Wirdum>Interesting. Okay. So the… these 115 bytes… were they

00:28:37.760 --> 00:28:39.460
<v Aaron van Wirdum>115? I don't know.

00:28:39.460 --> 00:28:41.460
<v Sjors Provoost>Just a small [unclear], but pretty small.

00:28:41.460 --> 00:28:47.290
<v Aaron van Wirdum>What? So do we still need to trust these or I I don't know how

00:28:47.290 --> 00:28:48.890
<v Aaron van Wirdum>big the leap of trust is there?

00:28:49.280 --> 00:28:53.040
<v Sjors Provoost>Well, you can read them. There's machine code. As far as I know, it's machine

00:28:53.040 --> 00:28:58.320
<v Sjors Provoost>code that can parse a hexadecimal piece of text. And then I guess it parses the

00:28:58.320 --> 00:29:04.200
<v Sjors Provoost>hexadecimal piece of text. And that piece of text is another piece of

00:29:04.200 --> 00:29:09.660
<v Sjors Provoost>machine code, I guess, which is then run. So you… it's… it's still open

00:29:09.660 --> 00:29:14.680
<v Sjors Provoost>source in the sense that the binary is the source, but machine code can be read,

00:29:14.800 --> 00:29:16.520
<v Sjors Provoost>right? It's very, very tedious to read it.

00:29:16.900 --> 00:29:21.020
<v Aaron van Wirdum>Wait, these 115 bytes, they're source code or they're binaries?

00:29:21.220 --> 00:29:24.520
<v Sjors Provoost>They're binaries, but you can read a binary. It's not fundamentally impossible to

00:29:24.520 --> 00:29:27.600
<v Sjors Provoost>read a binary. It's just very difficult to read a binary if it's big.

00:29:27.760 --> 00:29:28.120
<v Aaron van Wirdum>I see.

00:29:28.320 --> 00:29:32.060
<v Sjors Provoost>But if the binary is tiny, then it's just a set of machine instructions because

00:29:32.060 --> 00:29:37.030
<v Sjors Provoost>what happens when you run a program is the CPU just looks at the first… two bytes

00:29:37.030 --> 00:29:39.890
<v Sjors Provoost>or whatever and it says, what's what's the instruction? And then the instruction

00:29:39.890 --> 00:29:43.590
<v Sjors Provoost>says, okay, create a variable. And the next instruction says, set this variable

00:29:43.590 --> 00:29:47.750
<v Sjors Provoost>to two. And then the next instruction says, add five to the variable. And that

00:29:47.750 --> 00:29:53.080
<v Sjors Provoost>the fourth instruction says restart the computer or something like that. So if

00:29:53.080 --> 00:29:56.820
<v Sjors Provoost>it's just 150 bytes, you can look at every single byte and see what the computer

00:29:56.820 --> 00:29:59.300
<v Sjors Provoost>instruction is in there and you can still reason about it.

00:29:59.540 --> 00:29:59.820
<v Aaron van Wirdum>I see.

00:30:00.060 --> 00:30:04.480
<v Sjors Provoost>And I believe the only thing it does is it just has a small program that's able

00:30:04.480 --> 00:30:07.900
<v Sjors Provoost>to open a file and read that file and then execute that file.

00:30:09.390 --> 00:30:09.830
<v Aaron van Wirdum>Interesting.

00:30:10.090 --> 00:30:12.670
<v Sjors Provoost>And then slowly you try to get to a point where it's human readable.

00:30:13.240 --> 00:30:13.660
<v Aaron van Wirdum>Right.

00:30:13.840 --> 00:30:17.340
<v Sjors Provoost>So the very low-level compilers, the very simple compilers might have code that's

00:30:17.340 --> 00:30:21.400
<v Sjors Provoost>not very easy to read, but still very short. And then very quickly you get very

00:30:21.400 --> 00:30:25.260
<v Sjors Provoost>nice, elegant programming languages that you can read. But something like Rust,

00:30:25.540 --> 00:30:29.300
<v Sjors Provoost>in order to build Rust, you need to build compilers that can compile Rust. In

00:30:29.300 --> 00:30:33.580
<v Sjors Provoost>order to build a Rust compiler, you probably need a C compiler. So, yeah.

00:30:34.020 --> 00:30:36.500
<v Aaron van Wirdum>This sounds super fascinating to me, the fact that this is possible.

00:30:36.700 --> 00:30:41.780
<v Sjors Provoost>Yeah, and then at least you have this ginormous spiderweb of code. Like all of it

00:30:41.780 --> 00:30:45.960
<v Sjors Provoost>is code and you know that it produces a binary. And then you just need lots and

00:30:45.960 --> 00:30:49.540
<v Sjors Provoost>lots of people to review every single piece of code in there and be very

00:30:49.540 --> 00:30:54.220
<v Sjors Provoost>conservative about updating any of it. Because if you update any of it, well, it

00:30:54.220 --> 00:30:54.980
<v Sjors Provoost>could be malware again.

00:30:55.400 --> 00:30:55.580
<v Aaron van Wirdum>Right.

00:30:56.520 --> 00:30:59.920
<v Sjors Provoost>So, you know, and most people are used to automatically updating the computer.

00:31:00.440 --> 00:31:04.840
<v Aaron van Wirdum>Okay. Well, so this is how we're going to make Bitcoin truly trustless, essentially?

00:31:05.570 --> 00:31:09.910
<v Sjors Provoost>Well, I mean, turtles really all the way down because, you're still running it on

00:31:09.910 --> 00:31:10.730
<v Sjors Provoost>a piece of hardware.

00:31:11.570 --> 00:31:13.810
<v Aaron van Wirdum>Yeah, of course. That's a whole other nightmare.

00:31:14.070 --> 00:31:17.930
<v Sjors Provoost>So trusted hardware, open source hardware is another movement that are trying to

00:31:17.930 --> 00:31:21.950
<v Sjors Provoost>get rid of all these weird chips on your computer that are doing arbitrary

00:31:21.950 --> 00:31:23.510
<v Sjors Provoost>things. You have no idea what it is doing.

00:31:23.750 --> 00:31:28.130
<v Aaron van Wirdum>Yeah. Do we want to give a shout out to walletscrutiny.com?

00:31:28.910 --> 00:31:34.490
<v Sjors Provoost>Yeah, so walletscrutiny.com is a website that looks at various wallets, whether

00:31:34.490 --> 00:31:35.950
<v Sjors Provoost>they are open source at all.

00:31:36.490 --> 00:31:38.130
<v Aaron van Wirdum>And a lot of them aren't.

00:31:38.330 --> 00:31:38.630
<v Sjors Provoost>Yep.

00:31:38.950 --> 00:31:44.270
<v Aaron van Wirdum>That's pretty scary. There's like dozens of wallets that aren't even open source.

00:31:44.570 --> 00:31:48.710
<v Sjors Provoost>Yeah, so the only way to verify those wallets would be to inspect the binaries,

00:31:48.990 --> 00:31:53.350
<v Sjors Provoost>which are the tools to make that also slightly less painful than it sounds. So if

00:31:53.350 --> 00:31:57.010
<v Sjors Provoost>there's some very obvious code in those wallets that says steal coins, somebody

00:31:57.010 --> 00:32:00.780
<v Sjors Provoost>will probably still find it. But it's not good. Yeah, and then you have wallets

00:32:00.780 --> 00:32:05.460
<v Sjors Provoost>that have source published. But if you have that source and you want to make sure

00:32:05.460 --> 00:32:10.780
<v Sjors Provoost>that the binary they give you in the Play Store is the same… Yeah, it's not that

00:32:10.780 --> 00:32:16.320
<v Sjors Provoost>easy. Sometimes they don't offer any functionality for it. Sometimes they do, but

00:32:16.320 --> 00:32:19.700
<v Sjors Provoost>it doesn't work because it hasn't been maintained because not a lot of people check this.

00:32:19.760 --> 00:32:24.540
<v Aaron van Wirdum>How would you make that? How would you check that? What's the process there? How

00:32:24.540 --> 00:32:25.660
<v Aaron van Wirdum>do you make sure that…

00:32:25.900 --> 00:32:29.720
<v Sjors Provoost>So Wallet Scrutiny actually, for some wallets, for example, AB Core, which is

00:32:29.720 --> 00:32:33.160
<v Sjors Provoost>kind of a full node on Android. It's a bit of a toy project, but it's very cool.

00:32:34.260 --> 00:32:39.300
<v Sjors Provoost>On the site, they just have 20 lines of code that you run in a terminal. Let's

00:32:39.300 --> 00:32:44.680
<v Sjors Provoost>just get this thing from GitHub, get this Android libraries, build this project,

00:32:44.760 --> 00:32:48.720
<v Sjors Provoost>and then compare the checksums. They show if you execute these commands, you get

00:32:48.720 --> 00:32:49.640
<v Sjors Provoost>the exact result.

00:32:49.880 --> 00:32:54.240
<v Aaron van Wirdum>So the app you're downloading on your Android phone, you can check the checksum for it?

00:32:54.400 --> 00:32:54.700
<v Sjors Provoost>Yeah.

00:32:54.860 --> 00:32:55.120
<v Aaron van Wirdum>Okay.

00:32:55.360 --> 00:32:59.320
<v Sjors Provoost>I think so. But I don't think they've done it for iOS yet, and I don't even know

00:32:59.320 --> 00:33:00.480
<v Sjors Provoost>if you can do it with iOS.

00:33:00.680 --> 00:33:01.060
<v Aaron van Wirdum>Right.

00:33:02.370 --> 00:33:06.130
<v Sjors Provoost>And for computers, for normal computer programs, you might need something like

00:33:06.130 --> 00:33:09.090
<v Sjors Provoost>Gitian, which is very tedious. And I don't think a lot of people are going to do

00:33:09.090 --> 00:33:14.010
<v Sjors Provoost>it. Web applications are, again, a different possibility. I once worked on that.

00:33:14.270 --> 00:33:18.530
<v Sjors Provoost>And I think I once got a web application to be a deterministic build. And you

00:33:18.530 --> 00:33:23.270
<v Sjors Provoost>could actually run a command and it would do it. But if you don't maintain that,

00:33:23.410 --> 00:33:24.170
<v Sjors Provoost>it's going to break.

00:33:25.390 --> 00:33:29.070
<v Sjors Provoost>Because all the Node.js tooling and all that stuff is not designed to make

00:33:29.070 --> 00:33:30.490
<v Sjors Provoost>reproducible builds too easy.

00:33:31.710 --> 00:33:37.130
<v Aaron van Wirdum>Yeah, so, okay. So, walletscrutiny.com, it's a project by Leo Wandersleb,

00:33:37.290 --> 00:33:43.060
<v Aaron van Wirdum>and it categorizes wallets into custodial, not even open source,

00:33:43.280 --> 00:33:46.400
<v Aaron van Wirdum>so, not custodial, but also not open source,

00:33:48.160 --> 00:33:52.080
<v Aaron van Wirdum>which is probably even worse than custodial. I don't know. What you think?

00:33:52.220 --> 00:33:53.640
<v Sjors Provoost>Depends if you know who it is.

00:33:53.960 --> 00:33:54.480
<v Aaron van Wirdum>Yeah, I guess.

00:33:54.480 --> 00:33:57.900
<v Sjors Provoost>I mean, if some random person, the only way you can find out who they are is to

00:33:57.900 --> 00:34:01.720
<v Sjors Provoost>ask Apple, and then Apple says, oh, sorry, that was some random BVI thing. We

00:34:01.720 --> 00:34:02.200
<v Sjors Provoost>have no idea.

00:34:02.640 --> 00:34:07.100
<v Aaron van Wirdum>Yeah. Anyway, so custodial, non-custodial, and also not open source. And then

00:34:07.100 --> 00:34:12.790
<v Aaron van Wirdum>there's not custodial, but at least open source. And then there's… the category

00:34:12.790 --> 00:34:18.330
<v Aaron van Wirdum>non-custodial, open source, and deterministically buildable,

00:34:18.610 --> 00:34:23.130
<v Aaron van Wirdum>which are only a few wallets. That's sort of the category you want to be in, but

00:34:23.130 --> 00:34:23.950
<v Aaron van Wirdum>that's only a handful.

00:34:23.950 --> 00:34:27.170
<v Sjors Provoost>And I think the site only covers Android wallets.

00:34:27.470 --> 00:34:32.290
<v Aaron van Wirdum>Right. Okay. Sure. So does that cover our episode? Is that it?

00:34:32.780 --> 00:34:36.840
<v Sjors Provoost>I think so. I think we've opened quite a few cans of worms and you folks can

00:34:36.840 --> 00:34:38.840
<v Sjors Provoost>think about that during the Christmas holidays.

00:34:39.080 --> 00:34:43.860
<v Aaron van Wirdum>Yeah, we're taking a break. There will not be any episode over, well, until the new year.

00:34:44.260 --> 00:34:45.120
<v Sjors Provoost>Yeah, probably.

00:34:45.900 --> 00:34:47.080
<v Aaron van Wirdum>Sure, see you in the new year.

00:34:47.320 --> 00:34:47.620
<v Sjors Provoost>Yes.

00:34:47.620 --> 00:34:48.680
<v Aaron van Wirdum>Have a good Christmas.

00:34:49.100 --> 00:34:51.920
<v Sjors Provoost>Thank you. Thank you for listening to the Van Wirdum Sjorsnado.

00:34:52.300 --> 00:34:53.000
<v Aaron van Wirdum>There you go.

