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

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

00:00:22.900 --> 00:00:24.220
<v Sjors Provoost>Explained.

00:00:24.420 --> 00:00:24.800
<v Aaron van Wirdum>Hey Sjors.

00:00:25.380 --> 00:00:25.680
<v Sjors Provoost>Hello.

00:00:26.340 --> 00:00:29.320
<v Aaron van Wirdum>You just came back from Advancing Bitcoin, is that right?

00:00:29.560 --> 00:00:29.960
<v Sjors Provoost>That's right.

00:00:30.160 --> 00:00:31.060
<v Aaron van Wirdum>Technical conference.

00:00:31.400 --> 00:00:31.540
<v Sjors Provoost>Yep.

00:00:31.740 --> 00:00:32.080
<v Aaron van Wirdum>How was that?

00:00:32.340 --> 00:00:32.800
<v Sjors Provoost>It was fun.

00:00:33.500 --> 00:00:34.820
<v Aaron van Wirdum>Did you learn anything new?

00:00:35.650 --> 00:00:36.690
<v Sjors Provoost>Many little things.

00:00:37.310 --> 00:00:38.950
<v Aaron van Wirdum>Anything we can discuss on the podcast?

00:00:39.310 --> 00:00:41.330
<v Sjors Provoost>I don't think so. Maybe later, but not.

00:00:41.530 --> 00:00:46.670
<v Aaron van Wirdum>Well, I knew that because we got a topic for today. Today. We're going to discuss

00:00:46.670 --> 00:00:50.310
<v Aaron van Wirdum>P2SH, which somehow we never did before.

00:00:50.690 --> 00:00:53.990
<v Sjors Provoost>Well, we've mentioned it a few times, but we haven't done a full episode on it.

00:00:54.030 --> 00:00:58.610
<v Aaron van Wirdum>Yeah, we probably mentioned it many times, and it was actually a suggestion by

00:00:58.610 --> 00:01:03.890
<v Aaron van Wirdum>someone. I don't remember who it was. Sorry if you're listening, dear listener,

00:01:04.070 --> 00:01:08.490
<v Aaron van Wirdum>but it was someone on Twitter that suggested it, and then I went over the episode

00:01:08.490 --> 00:01:13.390
<v Aaron van Wirdum>overview list, and I realized that we've never actually done an episode on P2SH.

00:01:14.060 --> 00:01:18.840
<v Aaron van Wirdum>Pay-to-script-hash so let's do it today but first, Sjors, your

00:01:19.740 --> 00:01:25.000
<v Aaron van Wirdum>favorite part of the show, you wanted to give us you what's it called again a

00:01:25.000 --> 00:01:26.240
<v Aaron van Wirdum>booster… Explain what you're doing.

00:01:26.240 --> 00:01:29.750
<v Sjors Provoost>I'm just gonna read one boostagram. This is

00:01:29.750 --> 00:01:34.350
<v Aaron van Wirdum>Also, you sent me a couple of links on how people can stream the sats to me is that right?

00:01:34.350 --> 00:01:35.210
<v Sjors Provoost>That's right.

00:01:35.210 --> 00:01:40.130
<v Aaron van Wirdum>I'm not gonna do it Sjors, I decided… I decided, this is your special moment this

00:01:40.130 --> 00:01:41.970
<v Aaron van Wirdum>is your special moment in the show.

00:01:43.570 --> 00:01:47.130
<v Aaron van Wirdum>This is your love affair with the listeners.

00:01:47.430 --> 00:01:50.850
<v Sjors Provoost>No, you don't have to read any of the boost yourself. It's just that I now have

00:01:50.850 --> 00:01:55.230
<v Sjors Provoost>to look at how many sats we got and then send you half and deal with invoices,

00:01:55.230 --> 00:01:55.910
<v Sjors Provoost>which is annoying.

00:01:56.270 --> 00:01:58.370
<v Aaron van Wirdum>I don't want half. It's all yours.

00:01:58.830 --> 00:01:59.130
<v Sjors Provoost>All right.

00:01:59.390 --> 00:02:03.430
<v Aaron van Wirdum>Dear listener, if you want to make Sjors rich, if you want to make me regret this

00:02:03.430 --> 00:02:09.090
<v Aaron van Wirdum>decision, send all your sats to Sjors. Do you want your own intro

00:02:09.090 --> 00:02:10.710
<v Aaron van Wirdum>tune for this part of the show? Sjors?

00:02:11.400 --> 00:02:12.320
<v Sjors Provoost>No, that's all right.

00:02:12.320 --> 00:02:13.220
<v Aaron van Wirdum>I can make one for you.

00:02:13.220 --> 00:02:15.620
<v Sjors Provoost>All right, so we got a

00:02:15.620 --> 00:02:20.880
<v Aaron van Wirdum>Sjors stacks sats. Sjors stacks sats. Sjors stacks sats.

00:02:20.880 --> 00:02:26.680
<v Sjors Provoost>That is pretty good intro tune. Let's keep that one. it… for 20,000 sats from

00:02:26.680 --> 00:02:32.010
<v Sjors Provoost>AtLawBitcoin saying appreciate you. so it's a pretty nice one. I think you're

00:02:32.010 --> 00:02:32.870
<v Sjors Provoost>already regretting it.

00:02:32.870 --> 00:02:38.300
<v Aaron van Wirdum>20,000 oh my god. Okay, Sjors,

00:02:38.300 --> 00:02:44.290
<v Aaron van Wirdum>back to the show. Pay-to-script-hash so the

00:02:44.290 --> 00:02:49.650
<v Aaron van Wirdum>way we're going to structure this episode is because I think probably a lot of

00:02:49.650 --> 00:02:53.710
<v Aaron van Wirdum>our listeners know what pay-to-script-hash is although we might go into some

00:02:53.710 --> 00:02:57.490
<v Aaron van Wirdum>details that not everyone knows about but then also what we're going to do is

00:02:57.490 --> 00:03:00.950
<v Aaron van Wirdum>we're going to discuss a little bit about the history of pay-to-SH.

00:03:00.950 --> 00:03:02.130
<v Sjors Provoost>Exactly.

00:03:02.130 --> 00:03:07.890
<v Aaron van Wirdum>And that's actually largely based on an article that I wrote with Pete Rizzo

00:03:08.970 --> 00:03:13.850
<v Aaron van Wirdum>Three years ago now something like that because it was kind of the first big

00:03:13.850 --> 00:03:18.970
<v Aaron van Wirdum>Bitcoin controversy first big Bitcoin war

00:03:18.970 --> 00:03:23.550
<v Aaron van Wirdum>you know it wasn't as big as a scaling war obviously but it was kind of like a

00:03:23.550 --> 00:03:29.260
<v Aaron van Wirdum>prelude to that in a way it was sort of the precursor the prequel to to the big

00:03:29.260 --> 00:03:29.900
<v Aaron van Wirdum>scaling war.

00:03:29.900 --> 00:03:33.140
<v Sjors Provoost>Yeah, there were at least like 20 angry posts on Bitcointalk.

00:03:34.390 --> 00:03:40.230
<v Aaron van Wirdum>Yeah, and there was some bickering on IRC and there was the

00:03:40.230 --> 00:03:44.850
<v Aaron van Wirdum>[unclear]. Amir Taaki got involved with his own website. There was some debate

00:03:44.850 --> 00:03:45.590
<v Aaron van Wirdum>about it back then.

00:03:46.090 --> 00:03:52.070
<v Sjors Provoost>Speaking of IRC, yesterday I tried to find the IRC logs from 2011 and all

00:03:52.070 --> 00:03:56.670
<v Sjors Provoost>the websites that link to old IRC logs pointing to a website, Bitcoin something,

00:03:57.070 --> 00:04:00.870
<v Sjors Provoost>which doesn't exist anymore. So it's a bit annoying.

00:04:02.030 --> 00:04:05.530
<v Aaron van Wirdum>Wait, the logs from 2011 are gone? is that what you're saying?

00:04:05.530 --> 00:04:08.670
<v Sjors Provoost>I don't know if they're gone they're not on the sites where the other sites link

00:04:08.670 --> 00:04:12.250
<v Sjors Provoost>to so if somebody still has IRC logs I'd like to know where they are.

00:04:12.250 --> 00:04:17.110
<v Aaron van Wirdum>Oh, I mean I can look that up for you I'm sure I would have that somewhere unless

00:04:17.110 --> 00:04:22.870
<v Aaron van Wirdum>it got deleted. we'll find out. anyways, okay, so

00:04:23.060 --> 00:04:28.000
<v Aaron van Wirdum>let's just start at the beginning and I think we'll start with a more sort of

00:04:28.690 --> 00:04:34.070
<v Aaron van Wirdum>high-level description of pay-to-script-hash, P2SH. What

00:04:34.070 --> 00:04:35.850
<v Aaron van Wirdum>is P2SH?

00:04:36.050 --> 00:04:39.070
<v Sjors Provoost>Because what we'll get to is that there were actually three proposals, but

00:04:39.070 --> 00:04:43.010
<v Sjors Provoost>they're all really doing P2SH. It's just that one of them came to be known that.

00:04:43.520 --> 00:04:47.820
<v Sjors Provoost>with by that name but P2SH just means pay-to-script-hash and there are multiple

00:04:47.820 --> 00:04:51.000
<v Sjors Provoost>ways to pay to a script hash so what it does is…

00:04:51.000 --> 00:04:55.400
<v Aaron van Wirdum>Well, I guess my question is about what we call pay-to-script-hash today but I

00:04:55.400 --> 00:04:59.080
<v Aaron van Wirdum>think your point is that what you're going to describe kind of applies to all of them.

00:04:59.080 --> 00:05:03.620
<v Sjors Provoost>Yeah, exactly, so the idea is that so when you want to receive Bitcoin you need

00:05:03.620 --> 00:05:09.240
<v Sjors Provoost>to tell the sender, where to send it to, and what you're really telling them is

00:05:09.240 --> 00:05:12.740
<v Sjors Provoost>what script to send it to. And usually that script is just like, okay, whoever

00:05:12.740 --> 00:05:16.400
<v Sjors Provoost>has the private key belonging to the public key can spend it, but the script can

00:05:16.400 --> 00:05:21.230
<v Sjors Provoost>be more complicated. And this is a problem because the more complicated your

00:05:21.230 --> 00:05:25.270
<v Sjors Provoost>script is, the longer it is. And so that means that the sender has to pay you

00:05:25.270 --> 00:05:28.790
<v Sjors Provoost>fees and that the addresses can look very small or the addresses can look very

00:05:28.790 --> 00:05:32.950
<v Sjors Provoost>long if you have a long script. So in order to avoid that, the idea was to send

00:05:32.950 --> 00:05:37.650
<v Sjors Provoost>your coins to the hash of a script because a hash is always the same length.

00:05:38.650 --> 00:05:42.990
<v Sjors Provoost>And so therefore, the idea of paying the script hash is that the recipient gives

00:05:42.990 --> 00:05:47.650
<v Sjors Provoost>you not the script itself, but the hash of the script. And then you... turn that

00:05:47.650 --> 00:05:51.650
<v Sjors Provoost>into a special your wallet will then do its magic and make sure that the coins

00:05:51.650 --> 00:05:55.290
<v Sjors Provoost>are sent to the right place that can only and then when recipient wants to spend

00:05:55.290 --> 00:05:59.530
<v Sjors Provoost>it they have to reveal the original script and the precise details vary per

00:05:59.530 --> 00:06:04.010
<v Sjors Provoost>proposal but that's a general idea right? you reveal the script the blockchain

00:06:04.010 --> 00:06:06.710
<v Sjors Provoost>checks that it matches the hash of the script that you previously said it would

00:06:06.710 --> 00:06:11.070
<v Sjors Provoost>be, and then you have to satisfy whatever that script says right?

00:06:11.070 --> 00:06:16.260
<v Aaron van Wirdum>So back in the early days of Bitcoin if you wanted to receive

00:06:17.140 --> 00:06:21.160
<v Aaron van Wirdum>money if you wanted to lock how do I say… what's the best way to put this?

00:06:21.160 --> 00:06:22.380
<v Sjors Provoost>Encumber money.

00:06:22.380 --> 00:06:27.760
<v Aaron van Wirdum>Let's say you you want to say I want to receive money from you sure but I want to

00:06:27.760 --> 00:06:31.680
<v Aaron van Wirdum>receive it in such a way that the money is locked into a multisig let's say just

00:06:31.680 --> 00:06:32.360
<v Aaron van Wirdum>a multisig.

00:06:32.360 --> 00:06:32.960
<v Sjors Provoost>Yeah,

00:06:32.960 --> 00:06:37.160
<v Aaron van Wirdum>then what I would do in the early days well actually it wouldn't even work in the

00:06:37.160 --> 00:06:41.650
<v Aaron van Wirdum>early days right because of… it would… No, policy rules… what's it called?

00:06:41.650 --> 00:06:44.990
<v Sjors Provoost>Well, it would be difficult to get the transaction mined. Exactly. You'd have to

00:06:44.990 --> 00:06:47.110
<v Sjors Provoost>work with a miner because of the standardness rules.

00:06:47.110 --> 00:06:50.770
<v Aaron van Wirdum>Standardness, that's what I was looking for. but let's ignore that for a second

00:06:50.770 --> 00:06:55.890
<v Aaron van Wirdum>so if I wanted to receive coins in such a way that it's in a multisig I got

00:06:55.890 --> 00:07:00.150
<v Aaron van Wirdum>several keys dispersed in several locations that's how I want to receive the

00:07:00.150 --> 00:07:05.190
<v Aaron van Wirdum>coins then I would actually send the script to you and you would send it to that

00:07:05.190 --> 00:07:06.310
<v Aaron van Wirdum>script right?

00:07:06.310 --> 00:07:09.770
<v Sjors Provoost>Yeah, you would… Yeah, exactly. You would have to tell me, okay, this is my

00:07:09.770 --> 00:07:12.890
<v Sjors Provoost>multisig script. Please send it here. And that was annoying because there was

00:07:12.890 --> 00:07:18.670
<v Sjors Provoost>also no address format for it. And so it's a very difficult UI or user

00:07:18.670 --> 00:07:19.190
<v Sjors Provoost>experience.

00:07:19.430 --> 00:07:24.170
<v Aaron van Wirdum>Right. So then you're going to have to pay the fees for the fact that the

00:07:24.170 --> 00:07:29.220
<v Aaron van Wirdum>transaction is not bigger because it contains a whole script. And also it's

00:07:29.220 --> 00:07:34.880
<v Aaron van Wirdum>immediately visible on the blockchain that it is sent to a

00:07:34.880 --> 00:07:37.800
<v Aaron van Wirdum>multisig, which is maybe not great for privacy.

00:07:38.200 --> 00:07:41.900
<v Sjors Provoost>Yeah, so the privacy, the nice thing about paying to script hash is that the

00:07:41.900 --> 00:07:46.760
<v Sjors Provoost>privacy is slightly better. At least you have privacy for longer because

00:07:46.760 --> 00:07:50.600
<v Sjors Provoost>eventually if you spend it, the script will show up. But until you spend it, the

00:07:50.600 --> 00:07:51.500
<v Sjors Provoost>script will not show up.

00:07:53.890 --> 00:07:57.810
<v Aaron van Wirdum>Yeah, and and you're the one paying the fee rather like I'm the one who wants a

00:07:57.810 --> 00:08:03.070
<v Aaron van Wirdum>complicated multisig address but then you have to pay the fee for including it in

00:08:03.070 --> 00:08:04.350
<v Aaron van Wirdum>that address right?

00:08:04.350 --> 00:08:09.590
<v Sjors Provoost>Yeah, in so for P2SH yes I the sender— would have to pay a higher fee in order to

00:08:09.590 --> 00:08:13.110
<v Sjors Provoost>send to somebody with a complicated setup which kind of doesn't make sense and

00:08:13.110 --> 00:08:17.480
<v Sjors Provoost>now they'll… it's more fair in the sense that if you have a complicated setup

00:08:17.480 --> 00:08:21.620
<v Sjors Provoost>anybody can send to you it doesn't cost them anything extra but once you want to

00:08:21.620 --> 00:08:24.400
<v Sjors Provoost>spend from your complicated setup then you have to pay the extra fees

00:08:24.400 --> 00:08:30.360
<v Aaron van Wirdum>Right? Yeah, no, I was just summing up how it would work before pay to a script

00:08:30.360 --> 00:08:35.000
<v Aaron van Wirdum>hash was there so I sent you the whole script so that's big so you have to pay a

00:08:35.000 --> 00:08:39.360
<v Aaron van Wirdum>big fee even though I'm the one who wants to use a complicated script and then

00:08:39.360 --> 00:08:45.250
<v Aaron van Wirdum>also it's slightly worse for privacy so that's why developers early on

00:08:45.250 --> 00:08:51.110
<v Aaron van Wirdum>in like 2011 came up with this idea let's instead send it to a hash and I

00:08:51.110 --> 00:08:54.250
<v Aaron van Wirdum>give you just the hash I don't give you the script I give you the hash and when I

00:08:54.250 --> 00:09:00.250
<v Aaron van Wirdum>want to spend it I reveal the whole scripts and then anyone can check that the

00:09:00.250 --> 00:09:04.710
<v Aaron van Wirdum>script matches the hash and that's what I spend it from… that's how I it's only

00:09:04.710 --> 00:09:09.790
<v Aaron van Wirdum>then that I… include all the multiple signatures in the multisig case, right?

00:09:10.090 --> 00:09:10.290
<v Sjors Provoost>Yeah.

00:09:10.650 --> 00:09:12.770
<v Aaron van Wirdum>So that's the basics of P2SH.

00:09:13.270 --> 00:09:17.370
<v Sjors Provoost>Yes, in general. And so the hash of a script happens to be the same size of the

00:09:17.370 --> 00:09:22.530
<v Sjors Provoost>hash of a public key, which means that it will just look like an address. You

00:09:22.530 --> 00:09:25.730
<v Sjors Provoost>just start with a three instead of a one. So that's nice too.

00:09:26.590 --> 00:09:28.670
<v Aaron van Wirdum>Right. Why is it three, not a two?

00:09:29.390 --> 00:09:32.950
<v Sjors Provoost>Because it's a version number. So the first number in the address, in the legacy

00:09:32.950 --> 00:09:37.990
<v Sjors Provoost>addresses, we've done an episode about addresses. The first letter represents a

00:09:37.990 --> 00:09:43.290
<v Sjors Provoost>version number of the address scheme. So if it starts with a 1, which is not

00:09:43.290 --> 00:09:48.050
<v Sjors Provoost>actually a 1 because it's base 58, but we're not going to bother you with that,

00:09:48.230 --> 00:09:51.950
<v Sjors Provoost>that means that it has to be interpreted in a certain way, and if the address

00:09:51.950 --> 00:09:54.110
<v Sjors Provoost>starts with a 3, it has to be interpreted in another way.

00:09:55.120 --> 00:09:56.200
<v Aaron van Wirdum>But why is it not a 2?

00:09:57.340 --> 00:10:03.300
<v Sjors Provoost>Because the numbers 1 and 3 do not actually represent the numbers 1 and 3 because

00:10:03.300 --> 00:10:04.120
<v Sjors Provoost>it's base 58.

00:10:06.190 --> 00:10:09.210
<v Sjors Provoost>We did a whole episode about that, Aaron. You should just listen back to the

00:10:09.210 --> 00:10:10.390
<v Sjors Provoost>original episode about addresses.

00:10:10.670 --> 00:10:13.990
<v Aaron van Wirdum>I definitely forgot about it. I thought the reason was because 2 was already used

00:10:13.990 --> 00:10:14.650
<v Aaron van Wirdum>by testnet.

00:10:15.970 --> 00:10:16.450
<v Sjors Provoost>Yes.

00:10:16.750 --> 00:10:20.880
<v Aaron van Wirdum>So 1 mainnet, 2 testnet, 3, you know, next 1.

00:10:21.120 --> 00:10:22.240
<v Sjors Provoost>That could also be true.

00:10:23.270 --> 00:10:23.750
<v Aaron van Wirdum>Okay.

00:10:24.750 --> 00:10:29.670
<v Sjors Provoost>It doesn't really matter. It's just that once you're sending to it, the wallet

00:10:29.670 --> 00:10:33.790
<v Sjors Provoost>that's sending has to put something on the blockchain. And the only thing that's

00:10:33.790 --> 00:10:37.510
<v Sjors Provoost>in the address is the hash of something, either the hash of a public key or the

00:10:37.510 --> 00:10:41.750
<v Sjors Provoost>hash of a script. And that's not enough to put on the blockchain. You actually

00:10:41.750 --> 00:10:44.910
<v Sjors Provoost>have to put more information on the blockchain as a sender. And the version

00:10:44.910 --> 00:10:49.310
<v Sjors Provoost>number tells you your wallet exactly what to put on the blockchain. So the

00:10:49.310 --> 00:10:51.770
<v Sjors Provoost>standard script templates that go around the hash.

00:10:53.130 --> 00:10:58.750
<v Aaron van Wirdum>Moving on. So this was the basics of pay-to-script-hash and

00:10:58.750 --> 00:11:04.420
<v Aaron van Wirdum>why it was implemented. But now we'll

00:11:04.420 --> 00:11:08.420
<v Aaron van Wirdum>sort of take a trip down memory lane and go

00:11:08.640 --> 00:11:13.920
<v Aaron van Wirdum>back to some historical context.

00:11:14.480 --> 00:11:20.170
<v Aaron van Wirdum>So first of the first proposal that would do something

00:11:20.170 --> 00:11:26.140
<v Aaron van Wirdum>like this. So this pay-to-script-hash idea was around. And then the first idea

00:11:26.140 --> 00:11:31.660
<v Aaron van Wirdum>that was actually proposed and implemented and almost deployed was called

00:11:31.660 --> 00:11:37.440
<v Aaron van Wirdum>OP_EVAL. So OP_EVAL, I think the right way

00:11:37.440 --> 00:11:42.560
<v Aaron van Wirdum>to looking at it was a way of doing pay-to-script-hash, right?

00:11:43.080 --> 00:11:48.660
<v Sjors Provoost>Yes. And arguably the most obvious way to do it Though, of course, that depends

00:11:48.660 --> 00:11:53.040
<v Sjors Provoost>on what you were thinking of at the time when you were designing it. But

00:11:53.040 --> 00:11:57.820
<v Sjors Provoost>basically, the idea of OP_EVAL is that, again, as a sender, you just get a hash

00:11:57.820 --> 00:12:01.080
<v Sjors Provoost>and you put that on the blockchain. Now, the recipient wants to spend it. They

00:12:01.080 --> 00:12:06.850
<v Sjors Provoost>reveal the original script. And then the way that that original

00:12:06.850 --> 00:12:12.830
<v Sjors Provoost>script is run is by this opcode called OP_EVAL. So that means the sender has to

00:12:12.830 --> 00:12:16.550
<v Sjors Provoost>put the word OP_EVAL somewhere in the thing on the blockchain. And then the

00:12:16.550 --> 00:12:20.150
<v Sjors Provoost>recipient will actually put the script and then the script gets executed.

00:12:21.880 --> 00:12:22.040
<v Sjors Provoost>Yeah.

00:12:22.280 --> 00:12:26.940
<v Aaron van Wirdum>So to be perfectly clear, in case anyone is confused at this point, OP_EVAL is

00:12:26.940 --> 00:12:29.960
<v Aaron van Wirdum>not actually in Bitcoin. This was an early proposal that was rejected.

00:12:30.320 --> 00:12:30.760
<v Sjors Provoost>Yes.

00:12:31.150 --> 00:12:36.870
<v Aaron van Wirdum>Okay, so who's putting OP_EVAL? Maybe you just said this, but who's putting

00:12:36.870 --> 00:12:38.790
<v Aaron van Wirdum>OP_EVAL where exactly?

00:12:39.090 --> 00:12:42.450
<v Sjors Provoost>The sender has to do it. So this is one of the things you implicitly communicate

00:12:42.450 --> 00:12:45.230
<v Sjors Provoost>when you have a version number in your address. Now, in this case, this standard

00:12:45.230 --> 00:12:49.090
<v Sjors Provoost>was never materialized, but maybe the address would have started with a 7 or

00:12:49.090 --> 00:12:54.650
<v Sjors Provoost>something. And then as a sender, you get a hash of a script and you put on the

00:12:54.650 --> 00:12:59.390
<v Sjors Provoost>blockchain something like OP_DUP, the hash of the script OP_EVAL. A little bit

00:12:59.390 --> 00:13:00.490
<v Sjors Provoost>longer, but something like that.

00:13:01.240 --> 00:13:05.520
<v Aaron van Wirdum>Wait, so I'm the one who wants to receive money from you in a multisig address.

00:13:05.720 --> 00:13:07.160
<v Aaron van Wirdum>Let's just stick to that example.

00:13:08.280 --> 00:13:12.160
<v Aaron van Wirdum>So in the case of OP_EVAL, what exactly do I send you? Do I send you…

00:13:11.840 --> 00:13:14.380
<v Sjors Provoost>The hash of the script. So the hash of your multisig script.

00:13:14.580 --> 00:13:16.700
<v Aaron van Wirdum>Okay, and does this script include OP_EVAL?

00:13:16.840 --> 00:13:17.000
<v Sjors Provoost>No.

00:13:17.380 --> 00:13:21.120
<v Aaron van Wirdum>Okay, so I just sent you the script of the multisig. I sent it to you. What do you do?

00:13:21.200 --> 00:13:23.000
<v Sjors Provoost>You sent me the hash of the script of the multisig.

00:13:23.850 --> 00:13:26.970
<v Aaron van Wirdum>I guess I can do either, right? But sure, I'll send you the hash.

00:13:27.210 --> 00:13:30.170
<v Sjors Provoost>Yeah, that's the whole point basically to make it simple. So you're sending me

00:13:30.170 --> 00:13:33.890
<v Sjors Provoost>the hash. Then what I do is I create a script, a scriptPubKey on the blockchain.

00:13:34.070 --> 00:13:38.700
<v Sjors Provoost>That's where the coins are going. And I think it says the first instruction is

00:13:38.700 --> 00:13:43.560
<v Sjors Provoost>like duplicate whatever's on the stack and then put the hash there. And then it

00:13:43.560 --> 00:13:48.710
<v Sjors Provoost>says compare the thing that's on the stack with the hash. And then if that's

00:13:48.710 --> 00:13:53.830
<v Sjors Provoost>true, then you call OP_EVAL. And this is a very similar pattern to how you spend

00:13:53.830 --> 00:13:59.790
<v Sjors Provoost>from a public key. Because of the public key, you're also basically, the

00:13:59.790 --> 00:14:02.770
<v Sjors Provoost>sender is putting the hash of the public key on the blockchain. And then the

00:14:02.770 --> 00:14:06.450
<v Sjors Provoost>receiver, when they want to spend it, they have to reveal the actual public key.

00:14:08.550 --> 00:14:12.410
<v Aaron van Wirdum>Oh, sorry. Do you put OP_EVAL in the input or in the output?

00:14:12.650 --> 00:14:13.270
<v Sjors Provoost>In the output.

00:14:13.550 --> 00:14:18.430
<v Aaron van Wirdum>Okay. So I sent you the hash and then you put that hash in the output and you put

00:14:18.430 --> 00:14:19.710
<v Aaron van Wirdum>OP_EVAL next to it.

00:14:19.890 --> 00:14:20.070
<v Sjors Provoost>Yep.

00:14:20.850 --> 00:14:26.530
<v Aaron van Wirdum>Okay, and then when I want to spend the coins then I include the script.

00:14:26.530 --> 00:14:31.150
<v Sjors Provoost>Yeah, the only basically what you will do when you're spending it you include the

00:14:31.150 --> 00:14:34.710
<v Sjors Provoost>script and you include whatever is necessary to satisfy the script right?

00:14:34.710 --> 00:14:36.670
<v Aaron van Wirdum>And do I put OP_EVAL anywhere?

00:14:36.670 --> 00:14:37.430
<v Sjors Provoost>No, no.

00:14:37.430 --> 00:14:43.190
<v Aaron van Wirdum>Okay, so then other nodes on the network… They're gonna look at...

00:14:43.190 --> 00:14:46.910
<v Sjors Provoost>They start basically because you always start with the signature side. So what

00:14:46.910 --> 00:14:50.170
<v Sjors Provoost>they'll do is they'll say, okay, I'm putting some signatures on the stack. I'm

00:14:50.170 --> 00:14:55.770
<v Sjors Provoost>putting the actual script on the stack. And then I'm gonna run the scriptPubKey,

00:14:56.110 --> 00:15:00.750
<v Sjors Provoost>which will say, okay, you need to duplicate. So you need to duplicate the hash of

00:15:00.750 --> 00:15:04.850
<v Sjors Provoost>the script. No, I don't know what you need. Anyway, it basically says, okay, now

00:15:04.850 --> 00:15:08.010
<v Sjors Provoost>you should check that the hash of the script actually matches the script that was

00:15:08.010 --> 00:15:11.410
<v Sjors Provoost>put in the stack. And that's because then you call, then you encounter this eval

00:15:11.410 --> 00:15:15.410
<v Sjors Provoost>instruction and that's when you execute the whole script and when you need the signatures.

00:15:17.910 --> 00:15:21.470
<v Aaron van Wirdum>Just to make sure that I'm understanding this. So when other, when nodes

00:15:21.470 --> 00:15:27.430
<v Aaron van Wirdum>verifying new transactions, they, what does OP_EVAL mean to them

00:15:27.430 --> 00:15:29.550
<v Aaron van Wirdum>exactly? It means that they need to compare…

00:15:29.790 --> 00:15:31.550
<v Sjors Provoost>It means execute the script that's on the stack.

00:15:34.060 --> 00:15:35.400
<v Aaron van Wirdum>Shouldn't they always do that?

00:15:37.050 --> 00:15:41.150
<v Sjors Provoost>No, normally you are executing a script and the script can put things on the

00:15:41.150 --> 00:15:46.410
<v Sjors Provoost>stack, like numbers, et cetera. The stacks are like plates basically. So you can

00:15:46.410 --> 00:15:49.130
<v Sjors Provoost>put numbers on the plate and you can say, okay, is this number on the first

00:15:49.130 --> 00:15:53.330
<v Sjors Provoost>plate? Is that the same as the number on the next plate? But you do not execute

00:15:53.330 --> 00:15:58.420
<v Sjors Provoost>code that is on the stack. So things that are on the stack are numbers or text or

00:15:58.420 --> 00:16:01.980
<v Sjors Provoost>keys or whatever it is or dates, but they are not code.

00:16:02.760 --> 00:16:03.160
<v Aaron van Wirdum>Okay.

00:16:03.560 --> 00:16:06.880
<v Sjors Provoost>And what this eval thing does is, no, no, no, pretend that what is on the stack

00:16:06.880 --> 00:16:10.920
<v Sjors Provoost>is not a number or a text, pretend that it's code, and then just run it like that.

00:16:11.320 --> 00:16:14.800
<v Aaron van Wirdum>Okay. Well, you say pretend, but it's actually code then, right?

00:16:14.960 --> 00:16:18.600
<v Sjors Provoost>Well, so this is where the downside of this proposal comes in.

00:16:18.720 --> 00:16:18.920
<v Aaron van Wirdum>Okay.

00:16:19.020 --> 00:16:23.180
<v Sjors Provoost>But maybe some people have worked with JavaScript in the past. And in JavaScript,

00:16:23.560 --> 00:16:27.130
<v Sjors Provoost>you can, you know, there's also a command called eval. And it's extremely

00:16:27.130 --> 00:16:30.990
<v Sjors Provoost>dangerous. So generally when you're building a JavaScript web application, you

00:16:30.990 --> 00:16:34.530
<v Sjors Provoost>really should not use eval. And the reason for that tends to be that you cannot

00:16:34.530 --> 00:16:38.310
<v Sjors Provoost>predict what that thing is going to do if you're just trying to analyze your

00:16:38.310 --> 00:16:44.310
<v Sjors Provoost>JavaScript code. So your JavaScript code might see something like eval and then a

00:16:44.310 --> 00:16:47.130
<v Sjors Provoost>piece of text. So if you're just analyzing the code, you might think, oh, it's

00:16:47.130 --> 00:16:50.850
<v Sjors Provoost>just text. What could go wrong? But now it turns out this text is actually

00:16:50.850 --> 00:16:55.500
<v Sjors Provoost>treated as code. You can no longer just treat text as if it texts. And the same

00:16:55.500 --> 00:16:58.380
<v Sjors Provoost>thing goes with Bitcoin. That's sort of where the downside of this eval proposal

00:16:58.380 --> 00:17:02.730
<v Sjors Provoost>comes in. Normally, when you see a piece of Bitcoin script, you can look at what

00:17:02.730 --> 00:17:06.430
<v Sjors Provoost>it's going to do because you can see all the opcodes in it. And you can see,

00:17:06.530 --> 00:17:10.170
<v Sjors Provoost>okay, it's pushing some number, whatever. It's pushing some text, doesn't matter.

00:17:10.710 --> 00:17:14.110
<v Sjors Provoost>And you can reason about it. And then after you've done some sanity checks,

00:17:14.310 --> 00:17:18.890
<v Sjors Provoost>that's when you actually run the script. But with eval, you cannot do that

00:17:18.890 --> 00:17:24.240
<v Sjors Provoost>anymore because… anywhere in this script could be a piece of text that initially

00:17:24.240 --> 00:17:29.000
<v Sjors Provoost>you think is just text, so you've ignored it, but now it's suddenly code, so you

00:17:29.000 --> 00:17:32.960
<v Sjors Provoost>should not have ignored it. But conversely, if you're just looking at the text

00:17:32.960 --> 00:17:36.260
<v Sjors Provoost>and you're treating it as code, well, maybe it really is just text and you should

00:17:36.260 --> 00:17:36.860
<v Sjors Provoost>have ignored it.

00:17:37.600 --> 00:17:38.020
<v Aaron van Wirdum>Okay.

00:17:38.120 --> 00:17:38.940
<v Sjors Provoost>So it just creates...

00:17:38.940 --> 00:17:41.920
<v Aaron van Wirdum>So it makes it hard to do a sanity check.

00:17:42.500 --> 00:17:45.140
<v Sjors Provoost>Yeah, a sanity check without running the code.

00:17:45.280 --> 00:17:49.720
<v Aaron van Wirdum>What is insane in this context? What is it you're afraid of?

00:17:50.030 --> 00:17:54.010
<v Sjors Provoost>Well, there's many things you'd be afraid of because my understanding is that

00:17:54.010 --> 00:17:58.350
<v Sjors Provoost>this would actually make Bitcoin Turing complete. And Turing completeness is bad,

00:17:58.510 --> 00:18:02.510
<v Sjors Provoost>basically, because it means you can execute any arbitrary program, which could

00:18:02.510 --> 00:18:06.710
<v Sjors Provoost>include loops, infinite loops, for example. So one of the things you might be

00:18:06.710 --> 00:18:07.590
<v Sjors Provoost>afraid of is an infinite loop.

00:18:07.730 --> 00:18:09.430
<v Aaron van Wirdum>That's the core risk, right?

00:18:09.690 --> 00:18:13.370
<v Sjors Provoost>That's one of the risks when you have, basically, when you can run any program

00:18:13.370 --> 00:18:17.090
<v Sjors Provoost>you want. Well, one of those programs could be an infinite loop where you're

00:18:17.090 --> 00:18:20.470
<v Sjors Provoost>trying to validate the block and you will never finish validating it because you

00:18:20.470 --> 00:18:22.190
<v Sjors Provoost>keep going in circles because you have a loop.

00:18:22.650 --> 00:18:28.470
<v Aaron van Wirdum>Can you give an example of an infinite loop just for people like

00:18:28.470 --> 00:18:31.910
<v Aaron van Wirdum>me that this is not obvious to me what that means?

00:18:32.670 --> 00:18:35.830
<v Sjors Provoost>Well, how you would do it, like normally in a programming language,

00:18:35.990 --> 00:18:37.970
<v Aaron van Wirdum>You can just say do while.

00:18:38.480 --> 00:18:43.120
<v Sjors Provoost>Which basically, you just basically say, okay, go in a loop until some condition

00:18:43.120 --> 00:18:46.240
<v Sjors Provoost>is met. Usually that's how a programming language works. And then inside that

00:18:46.240 --> 00:18:51.580
<v Sjors Provoost>loop, you might print something on the screen. And if the condition that to leave

00:18:51.580 --> 00:18:54.680
<v Sjors Provoost>the loop never happens, then you never leave the loop. So you keep printing

00:18:54.680 --> 00:18:57.960
<v Sjors Provoost>something on the screen line by line by line and you never stop.

00:18:59.090 --> 00:18:59.970
<v Aaron van Wirdum>What is a loop?

00:19:02.430 --> 00:19:06.510
<v Sjors Provoost>Basically, I guess a circle of code. So you run an instruction and then you go to

00:19:06.510 --> 00:19:08.310
<v Sjors Provoost>the top of the loop and you run the instruction again.

00:19:10.020 --> 00:19:13.800
<v Sjors Provoost>So it's a piece of code that you keep running again and again until you, for some

00:19:13.800 --> 00:19:14.700
<v Sjors Provoost>reason, stop running it.

00:19:15.390 --> 00:19:18.190
<v Aaron van Wirdum>Okay, so I'm going to just try an example.

00:19:18.630 --> 00:19:23.670
<v Sjors Provoost>So typically you might loop from 1 to 10, and you print the number. So you can

00:19:23.670 --> 00:19:29.610
<v Sjors Provoost>say for i is 0, and then you say print i, and then at the end of the

00:19:29.610 --> 00:19:35.030
<v Sjors Provoost>loop you do i++, which increases i, and then you check if i is more than 10, you

00:19:35.030 --> 00:19:35.770
<v Sjors Provoost>exit the loop.

00:19:39.480 --> 00:19:40.360
<v Sjors Provoost>That's one example.

00:19:40.580 --> 00:19:46.580
<v Aaron van Wirdum>If I tell my code, I write code that says hash this piece of data

00:19:46.580 --> 00:19:51.780
<v Aaron van Wirdum>with the nonce until it spells Sjors is the king. And then I will keep hashing

00:19:51.780 --> 00:19:54.240
<v Aaron van Wirdum>that until it says that. Is that like an infinite loop?

00:19:54.420 --> 00:19:57.000
<v Sjors Provoost>Well, that's probably an infinite loop, yeah, because that's never going to happen.

00:19:57.200 --> 00:19:59.400
<v Aaron van Wirdum>Yeah, I mean, it might happen at some point, right?

00:19:59.640 --> 00:20:04.680
<v Sjors Provoost>But it's practically an infinite loop. Yeah, exactly. It's just as bad because it

00:20:04.680 --> 00:20:05.960
<v Sjors Provoost>will grind your computer to a halt.

00:20:06.100 --> 00:20:11.520
<v Aaron van Wirdum>Okay, so and then the problem is... To verify if a transaction is valid, you

00:20:11.520 --> 00:20:15.180
<v Aaron van Wirdum>first have to basically keep checking all kinds of different things.

00:20:15.640 --> 00:20:18.340
<v Sjors Provoost>Yeah, and so an infinite loop in Bitcoin would probably be...

00:20:18.340 --> 00:20:23.900
<v Aaron van Wirdum>New blocks come in and just grinds your... Your node basically can't keep up with

00:20:23.900 --> 00:20:27.060
<v Aaron van Wirdum>the blockchain because it's still verifying an infinite loop from a transaction

00:20:27.060 --> 00:20:28.060
<v Aaron van Wirdum>from four years ago.

00:20:28.260 --> 00:20:31.600
<v Sjors Provoost>Yeah, and I guess an example of this infinite loop could be that the thing you're

00:20:31.600 --> 00:20:37.520
<v Sjors Provoost>calling eval on says OP_DUP, which means duplicate. And then it says

00:20:37.520 --> 00:20:42.840
<v Sjors Provoost>OP_EVAL again. And so what you would do is you see eval,

00:20:43.080 --> 00:20:49.020
<v Sjors Provoost>you duplicate the actual thing that you want to evaluate, and then you

00:20:49.020 --> 00:20:53.580
<v Sjors Provoost>call eval on it again. And then... you know you're calling eval on something

00:20:53.580 --> 00:20:57.760
<v Sjors Provoost>that's that same string again which says okay duplicate myself and so you keep

00:20:57.760 --> 00:21:01.660
<v Sjors Provoost>duplicating the thing that you're trying to evaluate and so that will be an

00:21:01.660 --> 00:21:04.420
<v Sjors Provoost>infinite loop. Now there were in this proposal some protections against that.

00:21:04.420 --> 00:21:09.800
<v Aaron van Wirdum>Well, just to be clear was this the example that you just gave was that sort of

00:21:09.800 --> 00:21:12.020
<v Aaron van Wirdum>the specific concern with OP_EVAL?

00:21:12.020 --> 00:21:15.140
<v Sjors Provoost>Well, that was one example of how it could be to an infinite loop.

00:21:15.140 --> 00:21:15.780
<v Aaron van Wirdum>Okay.

00:21:15.780 --> 00:21:19.320
<v Sjors Provoost>Yeah, but there was a protection against that in the implementation of it it

00:21:19.320 --> 00:21:24.640
<v Sjors Provoost>would basically only allow two loops or like to recurse that's the term basically

00:21:24.640 --> 00:21:30.060
<v Sjors Provoost>recursion. so how often can you go back inside yourself inside the loop? and

00:21:30.060 --> 00:21:33.120
<v Sjors Provoost>there was a limit of two, but I think then there was a mistake in the

00:21:33.120 --> 00:21:38.460
<v Sjors Provoost>implementation that that protection didn't work and so people got a little scared.

00:21:40.480 --> 00:21:46.440
<v Aaron van Wirdum>Okay, well this got real technical real fast but let's so…

00:21:47.420 --> 00:21:50.560
<v Aaron van Wirdum>Do you think we've now explained the problem with OP_EVAL?

00:21:51.100 --> 00:21:56.300
<v Sjors Provoost>Yeah, so basically in theory you could have fixed all these specific issues, but

00:21:56.300 --> 00:22:00.120
<v Sjors Provoost>the general risk remains when you have something like eval in any programming

00:22:00.120 --> 00:22:04.800
<v Sjors Provoost>language is just kind of dangerous. So you don't want to, you preferably don't

00:22:04.800 --> 00:22:07.740
<v Sjors Provoost>want to do it. It makes it more difficult to reason about the code, very easy to

00:22:07.740 --> 00:22:10.760
<v Sjors Provoost>make a mistake, and one mistake and you have an infinite loop.

00:22:11.320 --> 00:22:16.860
<v Aaron van Wirdum>Okay, so is it fair if I summarize the problem with OP_EVAL? In that it

00:22:16.860 --> 00:22:21.940
<v Aaron van Wirdum>opens the door to potentially infinite loops, which would kind of break Bitcoin.

00:22:22.610 --> 00:22:23.790
<v Sjors Provoost>Yeah, I guess so.

00:22:23.970 --> 00:22:24.170
<v Aaron van Wirdum>Okay.

00:22:24.550 --> 00:22:28.550
<v Sjors Provoost>And keep in mind that Ethereum does allow something like Eval. And the reason

00:22:28.550 --> 00:22:32.870
<v Sjors Provoost>they get away with it is because they have gas. And so you use up your gas and

00:22:32.870 --> 00:22:35.730
<v Sjors Provoost>the loop won't be infinite because you run out of gas at some point.

00:22:36.230 --> 00:22:42.150
<v Aaron van Wirdum>I see. Okay. So that was the problem with

00:22:42.150 --> 00:22:48.100
<v Aaron van Wirdum>OP_EVAL. And then... This was discovered very last minute by

00:22:48.100 --> 00:22:53.480
<v Aaron van Wirdum>Russell O'Connor back in 2011. It was ready to be deployed. And then Russell

00:22:53.480 --> 00:22:57.300
<v Aaron van Wirdum>O'Connor said, guys, what are you doing? You got to stop this right now.

00:22:57.680 --> 00:23:00.520
<v Sjors Provoost>Yeah, he literally said, you guys need to stop what you're doing and really

00:23:00.520 --> 00:23:01.300
<v Sjors Provoost>understand Bitcoin.

00:23:02.000 --> 00:23:07.850
<v Aaron van Wirdum>Right, yeah. And then... The core developers at the time,

00:23:08.110 --> 00:23:13.070
<v Aaron van Wirdum>which were led by Gavin Andresen, but also a lot of the kind of currently known

00:23:13.070 --> 00:23:17.370
<v Aaron van Wirdum>developers were already involved, right? Greg Maxwell Pieter Wuille, Luke Dashjr,

00:23:17.530 --> 00:23:18.390
<v Aaron van Wirdum>Amir Taaki also.

00:23:18.850 --> 00:23:18.970
<v Sjors Provoost>Yep.

00:23:19.270 --> 00:23:24.350
<v Aaron van Wirdum>Anyway, so they figured out we've got to figure out something else.

00:23:24.690 --> 00:23:29.370
<v Sjors Provoost>Well, they didn't even agree on that, I think, initially, because there were two

00:23:29.370 --> 00:23:34.270
<v Sjors Provoost>possibilities. Either you do something completely different or you just... play

00:23:34.270 --> 00:23:38.210
<v Sjors Provoost>whack-a-mole basically so you you stick with the OP_EVAL you fix the specific bug

00:23:38.210 --> 00:23:42.730
<v Sjors Provoost>you find but you know there might be another bug but you just hope that there isn't

00:23:42.730 --> 00:23:48.600
<v Aaron van Wirdum>Right, and but then Gavin Gavin Andresen

00:23:48.600 --> 00:23:54.410
<v Aaron van Wirdum>he proposed pay to what we would call pay-to-script-hash today so

00:23:54.410 --> 00:23:58.090
<v Aaron van Wirdum>really OP_EVAL is kind of a form of pay-to-script-hash so how we're just gonna

00:23:58.090 --> 00:24:03.610
<v Aaron van Wirdum>name this one pay-to-script-hash because that's what we're calling it today, I guess.

00:24:03.790 --> 00:24:07.290
<v Sjors Provoost>Exactly. So he could have basically stuck to the OP_EVAL proposal. I think he

00:24:07.290 --> 00:24:11.170
<v Sjors Provoost>tried initially. But then I guess somehow we got the idea of doing it in a

00:24:11.170 --> 00:24:12.210
<v Sjors Provoost>different way that was safer.

00:24:13.240 --> 00:24:15.700
<v Aaron van Wirdum>So what is this different way and why is it safer?

00:24:16.120 --> 00:24:20.780
<v Sjors Provoost>So this different way is that we have a type of script. So when on the blockchain

00:24:20.780 --> 00:24:24.880
<v Sjors Provoost>you see a script that has a very specific form. So I don't know, it starts with

00:24:24.880 --> 00:24:30.750
<v Sjors Provoost>OP_EQUAL, then it has a hash, and then it starts with something like that. If the

00:24:30.750 --> 00:24:35.550
<v Sjors Provoost>script interpreter sees that particular form, it will understand that what it

00:24:35.550 --> 00:24:41.250
<v Sjors Provoost>tries to do is be a P2SH transaction. Because from the old node point of view, it

00:24:41.250 --> 00:24:45.150
<v Sjors Provoost>would just see the hash of a script. And all it would do is check whether it

00:24:45.150 --> 00:24:48.410
<v Sjors Provoost>matches the script that you're putting on the stack. But it wouldn't do anything.

00:24:48.950 --> 00:24:54.630
<v Sjors Provoost>So from an old node point of view, such a template just looks like doing nothing,

00:24:54.770 --> 00:24:58.200
<v Sjors Provoost>giving the money away. But from the new node's point of view, they'll recognize

00:24:58.200 --> 00:25:03.680
<v Sjors Provoost>this. They will take the script, the actual script, and run it.

00:25:04.460 --> 00:25:10.160
<v Aaron van Wirdum>Yeah, so you're getting into a topic that we haven't mentioned so far, which is

00:25:10.160 --> 00:25:14.940
<v Aaron van Wirdum>that pay-to-script-hash as well as OP_EVAL can be implemented as a soft fork.

00:25:15.360 --> 00:25:19.160
<v Aaron van Wirdum>This was kind of a discovery by the Bitcoin developers at the time that this was

00:25:19.160 --> 00:25:19.760
<v Aaron van Wirdum>even possible.

00:25:20.360 --> 00:25:24.020
<v Sjors Provoost>Yeah, that's fun to read on the forums and probably also in IRC. You can find a

00:25:24.020 --> 00:25:29.850
<v Sjors Provoost>log that... Yeah, they discovered that there are ways to do

00:25:29.850 --> 00:25:34.690
<v Sjors Provoost>soft forks this way by either in the OP_EVAL proposal by saying we take an

00:25:34.690 --> 00:25:36.070
<v Sjors Provoost>existing opcode that does nothing.

00:25:36.330 --> 00:25:37.130
<v Aaron van Wirdum>Yeah, the OP_NOPs.

00:25:37.370 --> 00:25:42.130
<v Sjors Provoost>The OP_NOP. And then because it does nothing, old nodes will think, okay, this

00:25:42.130 --> 00:25:47.230
<v Sjors Provoost>transaction is valid because nothing changes. And new nodes will actually do what

00:25:47.230 --> 00:25:52.540
<v Sjors Provoost>the new opcode says. And that mechanism was new for the developers, but very

00:25:52.540 --> 00:25:56.940
<v Sjors Provoost>likely Satoshi knew that this would be possible because otherwise why did he put

00:25:56.940 --> 00:25:57.720
<v Sjors Provoost>the OP_NOPs in there?

00:25:57.980 --> 00:26:00.260
<v Aaron van Wirdum>Right. Yeah. So let's get into that.

00:26:00.300 --> 00:26:01.380
<v Sjors Provoost>It was rediscovered, essentially.

00:26:02.080 --> 00:26:06.640
<v Aaron van Wirdum>Right. So let's get into that a little bit. So the OP_NOPs, these are op codes

00:26:06.640 --> 00:26:12.490
<v Aaron van Wirdum>put in there by Satoshi, which... old nodes or non-upgraded nodes or whatever you

00:26:12.490 --> 00:26:16.550
<v Aaron van Wirdum>want to call it, if they see OP_NOP, they will just consider the transaction valid?

00:26:16.870 --> 00:26:21.070
<v Sjors Provoost>Well, they don't consider the transaction valid necessarily, but it doesn't

00:26:21.070 --> 00:26:25.000
<v Sjors Provoost>change anything about the validity. So if whatever happened before OP_NOP... was

00:26:25.000 --> 00:26:27.320
<v Sjors Provoost>valid then after OP_NOP it's still valid.

00:26:27.600 --> 00:26:33.340
<v Aaron van Wirdum>Right but then these OP_NOP codes can be reinterpreted by

00:26:33.340 --> 00:26:38.700
<v Aaron van Wirdum>newer nodes after a soft fork and then they start to mean something else. So in

00:26:38.700 --> 00:26:42.900
<v Aaron van Wirdum>this specific example they would have started to mean OP_EVAL after that.

00:26:43.160 --> 00:26:48.140
<v Sjors Provoost>Yes, and although the OP_EVAL concept was abandoned the idea of doing a soft fork

00:26:48.140 --> 00:26:52.080
<v Sjors Provoost>this way by having a script that means nothing to all nodes or like it just means

00:26:52.080 --> 00:26:56.540
<v Sjors Provoost>take the money for all nodes it it has a more strict interpretation for the new

00:26:56.540 --> 00:26:58.120
<v Sjors Provoost>nodes right?

00:26:58.120 --> 00:27:03.860
<v Aaron van Wirdum>The thing though is that with OP_EVAL there was an actual explicit

00:27:03.860 --> 00:27:09.530
<v Aaron van Wirdum>reinterpretation of an OP_NOP. And then with pay-to-script-hash, that was not the

00:27:09.530 --> 00:27:15.130
<v Aaron van Wirdum>case. So it's used the same logic for a soft fork. It just didn't

00:27:15.130 --> 00:27:17.530
<v Aaron van Wirdum>reinterpret an actual OP_NOP.

00:27:17.930 --> 00:27:22.130
<v Sjors Provoost>Exactly. What it interpreted was a template. So if a transaction looks like a

00:27:22.130 --> 00:27:26.470
<v Sjors Provoost>duck… For example, you know, your old rules would be, oh, we just take a photo

00:27:26.470 --> 00:27:31.170
<v Sjors Provoost>and we say what animal it is. We see a photo and we say it's a cat or it's a dog.

00:27:31.410 --> 00:27:35.230
<v Sjors Provoost>And the new rule would be, well, but if it's a cat, we're actually going to look

00:27:35.230 --> 00:27:40.030
<v Sjors Provoost>at the skin color of the cat and do some other game. And this costs some friction

00:27:40.030 --> 00:27:44.990
<v Sjors Provoost>because, you know, it depends on your taste, I guess, whether or not you think

00:27:44.990 --> 00:27:47.810
<v Sjors Provoost>this particular way of doing it is good or bad.

00:27:48.470 --> 00:27:53.090
<v Aaron van Wirdum>Yeah, it was described at the time, even by people that supported it, like Amir

00:27:53.090 --> 00:27:56.930
<v Aaron van Wirdum>Taaki. He said, I don't know the exact quote, I don't know if we have it here,

00:27:57.010 --> 00:27:58.190
<v Aaron van Wirdum>but he definitely called it a hack.

00:27:58.830 --> 00:28:02.730
<v Sjors Provoost>Well, and you could ask, was this the will of Satoshi, you know, that kind of

00:28:02.730 --> 00:28:06.470
<v Sjors Provoost>interpretation, because the OP_NOP system was, well, at least you could think

00:28:06.470 --> 00:28:10.970
<v Sjors Provoost>that the OP_NOP system was intended to be used in the way that eval was using it,

00:28:11.230 --> 00:28:16.700
<v Sjors Provoost>whereas this idea of using a template was not basically in there. So

00:28:16.700 --> 00:28:22.520
<v Sjors Provoost>mostly I think Luke Dashjr was very not happy with this way of doing it. And so

00:28:22.520 --> 00:28:26.140
<v Sjors Provoost>for, I think for, you know, you could say aesthetic reasons, but you know, he

00:28:26.140 --> 00:28:29.780
<v Sjors Provoost>might look at that differently. So he came up with a different proposal that was

00:28:29.780 --> 00:28:34.560
<v Sjors Provoost>somewhere in between. It didn't use an OP_NOP, I think. In fact, I think it

00:28:34.560 --> 00:28:40.460
<v Sjors Provoost>repurposed OP_CODESEPARATOR or something like that. In any case, he basically

00:28:40.460 --> 00:28:44.930
<v Sjors Provoost>came up with an alternative design that didn't use this templating mechanism. And

00:28:44.930 --> 00:28:46.170
<v Sjors Provoost>then there was a lot of drama.

00:28:47.480 --> 00:28:52.120
<v Sjors Provoost>And the downside of the drama was that not much attention was really paid to the

00:28:52.120 --> 00:28:56.380
<v Sjors Provoost>real proposal that Luke was doing. And there was much more bickering back and

00:28:56.380 --> 00:29:02.270
<v Sjors Provoost>forth, at least on the forums. And so, yeah, I haven't studied that

00:29:02.270 --> 00:29:05.650
<v Sjors Provoost>proposal in a lot of detail either. I mean, I wasn't around it. I can say some

00:29:05.650 --> 00:29:08.130
<v Sjors Provoost>things about it, but it might not be the most fair description.

00:29:08.410 --> 00:29:12.930
<v Aaron van Wirdum>Yeah, so let's get to that in a second, just to clarify. So first, there was

00:29:12.930 --> 00:29:17.650
<v Aaron van Wirdum>OP_EVAL that turned out to have these problems with recursion

00:29:17.880 --> 00:29:23.740
<v Aaron van Wirdum>then the alternative that was proposed by Gavin Andresen was we'll just

00:29:23.740 --> 00:29:26.920
<v Aaron van Wirdum>call it pay-to-script-hash even though all of them are really pay-to-script-hash

00:29:26.920 --> 00:29:31.000
<v Aaron van Wirdum>but this one is like explicitly called pay-to-script-hash and then like Luke

00:29:31.000 --> 00:29:36.760
<v Aaron van Wirdum>Dashjr came around he said I don't like this at all let's

00:29:36.760 --> 00:29:42.210
<v Aaron van Wirdum>do and this is what we call in our article at least CheckHashVerify So

00:29:42.210 --> 00:29:46.770
<v Aaron van Wirdum>CHV is what we call it. I don't know if he called it that at a time, probably, though.

00:29:47.050 --> 00:29:50.990
<v Sjors Provoost>Right, but you see it's really the same thing, right? You're checking a hash,

00:29:51.270 --> 00:29:56.430
<v Sjors Provoost>namely the hash of a script, and you're verifying that it's actually a valid script.

00:29:56.690 --> 00:30:01.230
<v Aaron van Wirdum>You just blew my mind, Sjors. You're right. You're right. It's the same thing.

00:30:01.810 --> 00:30:06.490
<v Sjors Provoost>Yeah. So it's a way of you can pay to a script hash, or there's probably other

00:30:06.490 --> 00:30:07.210
<v Sjors Provoost>things you could have done.

00:30:07.730 --> 00:30:12.770
<v Aaron van Wirdum>CheckHashVerify so okay, so and you wanted to explain how that works kind of you

00:30:12.770 --> 00:30:18.030
<v Aaron van Wirdum>have somebody so again this one wasn't implemented so if you are the listener

00:30:18.030 --> 00:30:21.450
<v Aaron van Wirdum>don't really understand how this works it doesn't even matter because it's not in

00:30:21.450 --> 00:30:25.850
<v Aaron van Wirdum>Bitcoin but if you're interested and curious anyways Sjors is going to explain it to you now

00:30:25.850 --> 00:30:29.870
<v Sjors Provoost>Well, not entirely. so it's I think it's BIP 12, right? That was the number given to it?

00:30:29.870 --> 00:30:33.510
<v Aaron van Wirdum>[unclear], right, oh, the debate was between BIP 16, which was

00:30:33.510 --> 00:30:34.770
<v Aaron van Wirdum>pay-to-script-hash, and 17.

00:30:35.590 --> 00:30:39.270
<v Sjors Provoost>So I don't completely understand how it works. All I know is that it did not use

00:30:39.270 --> 00:30:40.190
<v Sjors Provoost>the templating technique.

00:30:40.330 --> 00:30:41.990
<v Aaron van Wirdum>I think OP_EVAL may have been 12.

00:30:42.150 --> 00:30:47.730
<v Sjors Provoost>And it didn't exactly, it didn't use eval, but it did something similar to

00:30:47.730 --> 00:30:53.470
<v Sjors Provoost>eval. I believe it was still treating text as code, but I might be wrong about

00:30:53.470 --> 00:30:58.490
<v Sjors Provoost>that part. In any case, one of the things that it contained was the legendary

00:30:58.490 --> 00:31:02.490
<v Sjors Provoost>OP_CODESEPARATOR. And maybe one day we'll do an episode about OP_CO…

00:31:02.830 --> 00:31:08.050
<v Sjors Provoost>OP_CODESEPARATOR. I don't understand it. I think it generally gives people two

00:31:08.050 --> 00:31:12.130
<v Sjors Provoost>kinds of responses either they don't know it and so they have no response or they

00:31:12.130 --> 00:31:13.130
<v Sjors Provoost>know it and they fear it.

00:31:13.130 --> 00:31:15.810
<v Aaron van Wirdum>This is something that is in Bitcoin or is not?

00:31:15.810 --> 00:31:19.170
<v Sjors Provoost>Yes, it is in Bitcoin it's been there from the beginning it led to the arguably

00:31:19.170 --> 00:31:22.630
<v Sjors Provoost>biggest bug ever which is that in the beginning you could take everybody's

00:31:22.630 --> 00:31:26.070
<v Sjors Provoost>Bitcoin right, and that had to do with the OP_CODESEPARATOR

00:31:26.070 --> 00:31:27.270
<v Aaron van Wirdum>So it's non-standard?

00:31:27.270 --> 00:31:31.430
<v Sjors Provoost>I'm not sure I think it has become non-standard or at least it's become

00:31:31.430 --> 00:31:36.400
<v Sjors Provoost>non-standard in certain circumstances. What you do see is a trend that newer

00:31:36.400 --> 00:31:41.700
<v Sjors Provoost>soft forks like SegWit and Taproot will make more and more restrictions on that

00:31:41.700 --> 00:31:45.880
<v Sjors Provoost>particular opcode. And there was a proposal by Matt Corallo, the Great Consensus

00:31:45.880 --> 00:31:51.640
<v Sjors Provoost>Cleanup in 2015, that would also make it invalid outside

00:31:51.640 --> 00:31:55.940
<v Sjors Provoost>of SegWit or P2SH. Though that was controversial because there might be some

00:31:55.940 --> 00:31:59.260
<v Sjors Provoost>really obscure transaction out there that uses it.

00:32:00.830 --> 00:32:04.710
<v Sjors Provoost>So anyway, that is really almost FUD. I guess I'm saying, oh my God, this

00:32:04.710 --> 00:32:08.370
<v Sjors Provoost>proposal had this evil opcode inside of it, but it did. But at the time, of

00:32:08.370 --> 00:32:13.550
<v Sjors Provoost>course, it wasn't probably considered that evil. So really the question was, you

00:32:13.550 --> 00:32:17.770
<v Sjors Provoost>have three proposals. Which one are you going to pick? If you ignore all the

00:32:17.770 --> 00:32:21.070
<v Sjors Provoost>drama, it's like you have three options. What do you want to do? You also kind of

00:32:21.070 --> 00:32:24.190
<v Sjors Provoost>want to do it quickly because that was sort of Gavin Andresen's point. People are

00:32:24.190 --> 00:32:27.630
<v Sjors Provoost>losing Bitcoin left and right. We should have more advanced scripts

00:32:27.630 --> 00:32:28.290
<v Sjors Provoost>functionality.

00:32:30.120 --> 00:32:32.280
<v Sjors Provoost>I don't know how much of that actually got used in the end.

00:32:32.620 --> 00:32:36.440
<v Aaron van Wirdum>Well, let me... Well, I mean, pay-to-script-hash is used all the time, right?

00:32:37.980 --> 00:32:42.280
<v Sjors Provoost>Well, if you ignore wrapped SegWit, it's only used for very standard multisig

00:32:42.280 --> 00:32:46.990
<v Sjors Provoost>transactions. Probably two or three that you could have done with raw script.

00:32:47.030 --> 00:32:47.730
<v Aaron van Wirdum>That still counts.

00:32:48.230 --> 00:32:49.790
<v Sjors Provoost>Yeah, but you could already do those.

00:32:49.830 --> 00:32:50.450
<v Aaron van Wirdum>That was the whole point.

00:32:50.630 --> 00:32:54.350
<v Sjors Provoost>You could already do those with bare multisig. If you just make them standard and

00:32:54.350 --> 00:32:55.330
<v Sjors Provoost>invent an address format.

00:32:56.720 --> 00:33:00.320
<v Sjors Provoost>Was it worth the risk? I mean, that's the question, right? Is it worth making a

00:33:00.320 --> 00:33:04.040
<v Sjors Provoost>change to Bitcoin that could break it and almost would have broken it in the case

00:33:04.040 --> 00:33:04.540
<v Sjors Provoost>of OP_EVAL?

00:33:04.940 --> 00:33:08.950
<v Aaron van Wirdum>Well, I want to first ask, so I want to

00:33:10.040 --> 00:33:15.640
<v Aaron van Wirdum>take one step back because I feel we moved on before I was ready to move on.

00:33:15.840 --> 00:33:16.140
<v Sjors Provoost>All right.

00:33:16.560 --> 00:33:22.400
<v Aaron van Wirdum>Okay, so how does CheckHashVerify, Luke Dashjr's alternative proposal,

00:33:22.400 --> 00:33:26.530
<v Aaron van Wirdum>if you know this, how did it... prevent the loop-de-loops?

00:33:26.670 --> 00:33:28.230
<v Sjors Provoost>I'm not sure if it did. I think it did.

00:33:28.570 --> 00:33:31.210
<v Aaron van Wirdum>I mean, it must have, right? Because that was the whole point.

00:33:31.330 --> 00:33:37.250
<v Sjors Provoost>Yeah, I think you somehow split the script and the hash of the script in a way

00:33:37.250 --> 00:33:41.950
<v Sjors Provoost>that it's interpreted, but you're not using eval, so you can't duplicate it. So

00:33:41.950 --> 00:33:46.110
<v Sjors Provoost>eval would allow you to sort of recursively duplicate stuff. But I think here you

00:33:46.110 --> 00:33:49.930
<v Sjors Provoost>would just have the hash and then you would have the script itself. And so I

00:33:49.930 --> 00:33:52.670
<v Sjors Provoost>don't think you'd have any recursion or loops.

00:33:53.940 --> 00:33:54.600
<v Aaron van Wirdum>So, yeah.

00:33:55.080 --> 00:33:57.900
<v Sjors Provoost>As you can see, I did not study that proposal in enough detail.

00:33:58.380 --> 00:34:04.220
<v Aaron van Wirdum>That's fair. Yeah. So I think the real situation, I think

00:34:04.220 --> 00:34:07.360
<v Aaron van Wirdum>OP_EVAL was kind of done, right? So then the debate was really about

00:34:07.360 --> 00:34:09.460
<v Aaron van Wirdum>pay-to-script-hash and CheckHashVerify.

00:34:09.800 --> 00:34:13.020
<v Sjors Provoost>Yeah. And then, of course, the pay-to-script-hash was implemented by Gavin

00:34:13.020 --> 00:34:18.140
<v Sjors Provoost>Andresen, who also implemented OP_EVAL and who was the lead maintainer. And so

00:34:18.140 --> 00:34:22.400
<v Sjors Provoost>that probably got the most attention, the most review. So that also tends to...

00:34:22.220 --> 00:34:26.120
<v Sjors Provoost>give it a little bit of favor almost by default if the other proposal was equal.

00:34:26.120 --> 00:34:32.030
<v Aaron van Wirdum>Yeah, and also very important to… there was ultimately

00:34:32.030 --> 00:34:37.710
<v Aaron van Wirdum>kind of really a vote between the two and that was a hash power vote. Like the

00:34:37.710 --> 00:34:41.870
<v Aaron van Wirdum>miners could pretty explicitly just vote for one or the other.

00:34:42.330 --> 00:34:46.170
<v Sjors Provoost>Yeah, I think both of them kind of went on a campaign. Well, I think Luke Dashjr

00:34:46.170 --> 00:34:49.190
<v Sjors Provoost>used his own pool to campaign for it, and they may have also convinced some other

00:34:49.190 --> 00:34:54.370
<v Sjors Provoost>ones. So there was something similar to BIP 9, though much more primitive. The

00:34:54.370 --> 00:34:57.110
<v Sjors Provoost>idea that miners would put something in the block to say that they liked the

00:34:57.110 --> 00:34:58.550
<v Sjors Provoost>proposal or not. So that happened.

00:34:58.940 --> 00:35:03.680
<v Aaron van Wirdum>Yeah, well, it was kind of a precursor to BIP 9, I would say, where BIP 9 was

00:35:03.680 --> 00:35:08.180
<v Aaron van Wirdum>more about readiness signaling. Like that idea kind of evolved over the years.

00:35:08.460 --> 00:35:12.720
<v Aaron van Wirdum>Well, for the very first time that hash power signaling was used, it was arguably

00:35:12.720 --> 00:35:17.760
<v Aaron van Wirdum>actually like a vote. Like that's really what happened the first time, I would

00:35:17.760 --> 00:35:23.200
<v Aaron van Wirdum>say. So that's how pay-to-script-hash got, at least is what I remember.

00:35:23.220 --> 00:35:27.980
<v Sjors Provoost>That was one element in it. But I mean, there was debate about whether that was a

00:35:27.980 --> 00:35:32.140
<v Sjors Provoost>fair way to do it at all, because the lead maintainer, of course, had access to

00:35:32.140 --> 00:35:35.620
<v Sjors Provoost>many more miners. So from a social point of view, he would be able to get more

00:35:35.620 --> 00:35:38.780
<v Sjors Provoost>votes that way because miners would not look at the actual code. But there was

00:35:38.780 --> 00:35:42.660
<v Sjors Provoost>another thing that happened, which I think was more fair, at least relatively. I

00:35:42.660 --> 00:35:47.440
<v Sjors Provoost>think after some of the initial heated debate died down, some of the core devs at

00:35:47.440 --> 00:35:51.400
<v Sjors Provoost>the time, so Greg Maxwell and Pieter Wuille and a few others, were asked to like

00:35:51.400 --> 00:35:55.800
<v Sjors Provoost>take a few days, look at all three proposals and... Then they made a little chart

00:35:55.800 --> 00:35:57.320
<v Sjors Provoost>or a little diagram.

00:35:57.560 --> 00:35:58.080
<v Aaron van Wirdum>Oh, that's right.

00:35:58.240 --> 00:36:02.600
<v Sjors Provoost>Yeah, saying like, okay, this one I'm absolutely against or this one I have a

00:36:02.600 --> 00:36:07.540
<v Sjors Provoost>preference for or this one is fine. And if you look at that little table, the

00:36:07.540 --> 00:36:12.520
<v Sjors Provoost>P2SH also won in the sense that nobody was completely opposed to it, not even

00:36:12.520 --> 00:36:18.280
<v Sjors Provoost>Luke, although he really didn't prefer it. And it had the preference of some of

00:36:18.280 --> 00:36:19.440
<v Sjors Provoost>the experienced developers.

00:36:20.300 --> 00:36:25.940
<v Aaron van Wirdum>Yeah, I'll include the article Rizzo and I wrote in the show notes where this

00:36:25.940 --> 00:36:27.280
<v Aaron van Wirdum>whole debate is sort of outlined.

00:36:27.500 --> 00:36:30.500
<v Sjors Provoost>Yeah, so I think it was a little bit more to it than just a brute vote,

00:36:30.920 --> 00:36:36.520
<v Sjors Provoost>basically. There was more review on it. But nowadays, I think if you had a

00:36:36.520 --> 00:36:40.980
<v Sjors Provoost>situation like this, it would not be resolved in a matter of days and weeks. And

00:36:40.980 --> 00:36:44.100
<v Sjors Provoost>back then it was resolved in a matter of days or weeks, which is way too quick

00:36:44.100 --> 00:36:45.460
<v Sjors Provoost>for something like this.

00:36:46.120 --> 00:36:51.610
<v Aaron van Wirdum>Right, yeah. And I think, well, actually, I'm sure. Fairly sure that, for

00:36:51.610 --> 00:36:54.050
<v Aaron van Wirdum>example, Greg Maxwell, who at the time…

00:36:55.440 --> 00:37:00.060
<v Aaron van Wirdum>preferred BIP 16 has come around and said that BIP 17 would have actually been better.

00:37:00.060 --> 00:37:02.620
<v Sjors Provoost>Okay, I didn't know that so that that could be the case.

00:37:02.620 --> 00:37:07.980
<v Aaron van Wirdum>Yeah, in in Greg Maxwell style, he just you know mentioned this off the cuff in

00:37:07.980 --> 00:37:12.640
<v Aaron van Wirdum>some Reddit comment somewhere, so it's hard to find but I'm pretty sure that I'm

00:37:12.640 --> 00:37:16.920
<v Aaron van Wirdum>like sure that he did it I just don't really remember the reason or the

00:37:16.920 --> 00:37:17.420
<v Aaron van Wirdum>motivation.

00:37:17.420 --> 00:37:23.270
<v Sjors Provoost>Right, I I read a post by him during these days where he was articulating very

00:37:23.270 --> 00:37:28.170
<v Sjors Provoost>well why he supported the P2SH variant that we have now but obviously you know as

00:37:28.170 --> 00:37:30.370
<v Sjors Provoost>time goes by he could have changed his mind on it.

00:37:30.370 --> 00:37:36.270
<v Aaron van Wirdum>Yeah, okay, so we've discussed what pay-to-script-hash is both in

00:37:36.270 --> 00:37:40.950
<v Aaron van Wirdum>a sort of general sense as well as in a more specific sense of the proposal that

00:37:40.950 --> 00:37:43.150
<v Aaron van Wirdum>we actually call pay-to-script-hash and that we use today.

00:37:43.150 --> 00:37:48.080
<v Sjors Provoost>And to make a very quick jump to the future we still use this pattern Basically

00:37:48.080 --> 00:37:53.700
<v Sjors Provoost>in the way we, in SegWit and in Taproot, the idea of there is a hash and the

00:37:53.700 --> 00:37:57.920
<v Sjors Provoost>blockchain magically knows that this hash should be revealed as a script and then

00:37:57.920 --> 00:38:01.140
<v Sjors Provoost>the script should be executed. So this whole idea of pattern matching is still there.

00:38:02.610 --> 00:38:06.790
<v Sjors Provoost>And so apparently it's good enough to keep repeating it. Though there is also the

00:38:06.790 --> 00:38:09.290
<v Sjors Provoost>argument of not writing new code if you don't have to.

00:38:11.340 --> 00:38:16.840
<v Aaron van Wirdum>Yeah, well, I was going to say, so we've discussed P2SH more generally, more

00:38:16.840 --> 00:38:22.820
<v Aaron van Wirdum>specifically, and then also some of the proposals that were rejected OP_EVAL and

00:38:22.820 --> 00:38:27.990
<v Aaron van Wirdum>CHV. Gave an idea about the historical context. Is that the episode, Sjors?

00:38:28.250 --> 00:38:32.270
<v Sjors Provoost>I guess there's two little things that might be fun to mention briefly. One is

00:38:32.270 --> 00:38:35.690
<v Sjors Provoost>that there was some screw up with the deployment. At least that's what I read in

00:38:35.690 --> 00:38:40.490
<v Sjors Provoost>the overview of soft forks in general. Apparently, because of this mechanism,

00:38:40.750 --> 00:38:44.730
<v Sjors Provoost>which was kind of a vote, but also kind of an automatic activation, depending on

00:38:44.730 --> 00:38:49.890
<v Sjors Provoost>how you run your software, a subgroup of miners... activated the software too

00:38:49.890 --> 00:38:55.530
<v Sjors Provoost>early, and so they started rejecting blocks basically they they I think they I

00:38:56.170 --> 00:39:00.190
<v Sjors Provoost>don't know if they activated OP_EVAL accidentally, or they activated P2SH but

00:39:00.190 --> 00:39:03.050
<v Sjors Provoost>anyway they did it too early and they weren't in in the majority, so they

00:39:03.050 --> 00:39:07.110
<v Sjors Provoost>couldn't enforce the software, so it's like an accidental UASF except they

00:39:07.110 --> 00:39:10.310
<v Sjors Provoost>weren't like super passionate about it so they just went on I mean at the time

00:39:10.310 --> 00:39:14.190
<v Sjors Provoost>Bitcoin was worth nothing so they didn't worth… they didn't lose like a giant

00:39:14.190 --> 00:39:19.360
<v Sjors Provoost>fortune. And the other thing that is probably fun to mention

00:39:19.360 --> 00:39:24.170
<v Sjors Provoost>is I think the software was backported to even older versions of Bitcoin Core,

00:39:24.330 --> 00:39:30.160
<v Sjors Provoost>like version 0.3 and 0.5. And apparently something went wrong

00:39:30.160 --> 00:39:36.140
<v Sjors Provoost>doing that. So those versions of Bitcoin Core would actually also fork themselves

00:39:36.140 --> 00:39:40.940
<v Sjors Provoost>off the network. So they had to be sort of undone again. So I guess the question

00:39:40.940 --> 00:39:44.920
<v Sjors Provoost>to Jameson Lopp is, was that a hard fork? But I don't know.

00:39:44.920 --> 00:39:50.520
<v Aaron van Wirdum>Yeah, there's so this was the pay-to-script-hash was the first soft fork

00:39:50.520 --> 00:39:55.880
<v Aaron van Wirdum>after Satoshi left so it was also the first protocol upgrade after Satoshi left

00:39:55.880 --> 00:39:59.700
<v Aaron van Wirdum>so it was the first time that developers started to figure out how to actually

00:39:59.700 --> 00:40:05.040
<v Aaron van Wirdum>upgrade Bitcoin and who should do what what… so that's a

00:40:05.040 --> 00:40:09.730
<v Aaron van Wirdum>you know that's kind of the start of that whole debate and it's very interesting

00:40:09.730 --> 00:40:15.100
<v Aaron van Wirdum>in that sense but I would also say that's like a whole other episode or…

00:40:15.100 --> 00:40:15.900
<v Sjors Provoost>Yes.

00:40:15.900 --> 00:40:21.900
<v Aaron van Wirdum>So as far as pay-to-script-hash itself comes, I think we've kind of covered it at

00:40:21.900 --> 00:40:22.400
<v Aaron van Wirdum>this point right?

00:40:22.400 --> 00:40:26.400
<v Sjors Provoost>I think so. So okay, in that case, thank you for listening to Bitcoin,

00:40:26.400 --> 00:40:27.300
<v Aaron van Wirdum>Explained.

