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

00:00:19.380 --> 00:00:22.860
<v Aaron van Wirdum>Live from Utrecht, this is Bitcoin Explained.

00:00:23.120 --> 00:00:23.380
<v Sjors Provoost>Hello.

00:00:24.000 --> 00:00:24.500
<v Aaron van Wirdum>Hey, Sjors.

00:00:24.880 --> 00:00:25.200
<v Sjors Provoost>What's up?

00:00:25.660 --> 00:00:28.470
<v Aaron van Wirdum>I'm good. And welcome back, Ruben.

00:00:28.970 --> 00:00:30.130
<v Ruben Somsen>Thank you. Good to be back.

00:00:30.450 --> 00:00:31.790
<v Aaron van Wirdum>Back-to-back episodes for you?

00:00:32.310 --> 00:00:36.330
<v Ruben Somsen>Yeah, sure. Almost. Or has there not been an episode in between? I don't even know.

00:00:36.590 --> 00:00:40.690
<v Aaron van Wirdum>We skipped last one. So yeah, no, it's truly back-to-back for you this time.

00:00:40.680 --> 00:00:41.060
<v Ruben Somsen>All right, cool.

00:00:41.650 --> 00:00:46.580
<v Aaron van Wirdum>Happy you are back because we're going to discuss a particularly... interesting

00:00:46.580 --> 00:00:51.820
<v Aaron van Wirdum>and at least in my opinion, pretty complex topic. We did have a, we had a call

00:00:51.820 --> 00:00:57.680
<v Aaron van Wirdum>the three of us before we started recording this, this afternoon, and uh, it was

00:00:57.680 --> 00:01:02.340
<v Aaron van Wirdum>basically a call between the two of you because I tapped out after like a minute

00:01:02.340 --> 00:01:08.090
<v Aaron van Wirdum>and especially when it became mathematical, when the mathematics came into

00:01:08.090 --> 00:01:13.210
<v Aaron van Wirdum>play, that's where it went a little bit over my head. So let's see how we can

00:01:13.210 --> 00:01:14.370
<v Aaron van Wirdum>manage this episode today.

00:01:14.590 --> 00:01:18.210
<v Sjors Provoost>Yeah, for me, it was also just confusing initially, especially reading some of

00:01:18.210 --> 00:01:22.870
<v Sjors Provoost>the documentation that explains some of the assumptions behind it and then just

00:01:22.870 --> 00:01:27.010
<v Sjors Provoost>skips all the details that I care about to actually understand it. It's not the

00:01:27.010 --> 00:01:31.330
<v Sjors Provoost>full math, but it's like, ah, tell me one more thing, tell me one more thing. But

00:01:31.330 --> 00:01:35.130
<v Sjors Provoost>then if you're listening to a high-level talk by somebody who's not trying to

00:01:35.130 --> 00:01:38.610
<v Sjors Provoost>make it technical, they're not filling out the details. And then if you want to

00:01:38.610 --> 00:01:40.750
<v Sjors Provoost>read... an actual spec gets too technical.

00:01:41.710 --> 00:01:47.670
<v Aaron van Wirdum>So the thing we are going to discuss is Discreet log contracts, also

00:01:47.670 --> 00:01:49.630
<v Aaron van Wirdum>known as DLCs.

00:01:49.910 --> 00:01:53.810
<v Sjors Provoost>Yeah, and it's spelled discreet E-E-T, which kind of means

00:01:53.810 --> 00:01:59.710
<v Sjors Provoost>careful in what you're saying, versus

00:01:59.710 --> 00:02:05.090
<v Sjors Provoost>discrete with E-T-E, which is single digits, like

00:02:05.090 --> 00:02:10.880
<v Sjors Provoost>a discrete number. But it's a pun. Yeah, you cannot say

00:02:10.880 --> 00:02:12.340
<v Sjors Provoost>in audio because it sounds the same.

00:02:12.340 --> 00:02:17.600
<v Ruben Somsen>I think the end result is that people are just confused, but it's a, it's funny

00:02:17.600 --> 00:02:18.580
<v Ruben Somsen>for those who are in the know.

00:02:18.580 --> 00:02:23.400
<v Aaron van Wirdum>Yeah, anyway, so let's start with a short summary of what Discreet long—log

00:02:23.400 --> 00:02:29.120
<v Aaron van Wirdum>contracts actually are. I would summarize it as there are, they are essentially

00:02:29.120 --> 00:02:34.280
<v Aaron van Wirdum>smart contracts for Bitcoin and a little bit more specifically they are bets,

00:02:34.280 --> 00:02:40.130
<v Aaron van Wirdum>essentially. Yeah. And the interesting thing about bets is that many types of

00:02:40.130 --> 00:02:44.810
<v Aaron van Wirdum>financial contracts are essentially bets, even if we don't

00:02:45.660 --> 00:02:49.740
<v Aaron van Wirdum>normally think of them as bets. You, you can sort of distill them as bets

00:02:49.740 --> 00:02:53.200
<v Sjors Provoost>like, right, they're not gambling necessarily. They could just be saying I think

00:02:53.200 --> 00:02:57.400
<v Sjors Provoost>the dollar is going to go up, uh, so I want a derivative project, uh, product

00:02:57.400 --> 00:03:01.040
<v Sjors Provoost>that follows the dollar price and you could call that betting, but it's, it's,

00:03:01.040 --> 00:03:03.680
<v Sjors Provoost>it's a sane thing to do even as, as a non-gambler

00:03:03.680 --> 00:03:08.660
<v Aaron van Wirdum>Yeah, yeah, exactly. Or like an insurance, if you, if you're insuring your house

00:03:08.660 --> 00:03:13.980
<v Aaron van Wirdum>in a way you're sort of betting that your house will burn down. And then if you

00:03:13.980 --> 00:03:18.100
<v Aaron van Wirdum>lose the bet and you didn't, your house is still there, you're kind of happy, but

00:03:18.100 --> 00:03:22.320
<v Aaron van Wirdum>it did cost a little bit of money. So that's sort of the down payment. Well, if

00:03:22.320 --> 00:03:26.400
<v Aaron van Wirdum>your house burns down, you win the bet and you get all this money. So a lot of

00:03:26.400 --> 00:03:31.700
<v Aaron van Wirdum>financial products are essentially bets. So that's why it's interesting to think

00:03:31.700 --> 00:03:37.400
<v Aaron van Wirdum>of how can we bring this sort of betting to Bitcoin. And then what we

00:03:37.400 --> 00:03:41.220
<v Aaron van Wirdum>really want or, you know, the essence of smart contracts, what smart contracts

00:03:41.220 --> 00:03:47.160
<v Aaron van Wirdum>are ideally at least, is that these bets are executed automatically, right?

00:03:48.120 --> 00:03:52.680
<v Sjors Provoost>Yes. And in the case of blockchain, not just automatically, but also in a way

00:03:52.680 --> 00:03:58.660
<v Sjors Provoost>that does not require any trust. Now, just a spoiler. There is this thing

00:03:58.660 --> 00:04:03.340
<v Sjors Provoost>called the Oracle problem. And we are not solving the Oracle problem. The Oracle

00:04:03.340 --> 00:04:07.500
<v Sjors Provoost>problem basically means that if you have anything that relies on information

00:04:07.500 --> 00:04:12.220
<v Sjors Provoost>outside the blockchain, well, anything except the knowledge of a private key or hash,

00:04:13.530 --> 00:04:16.550
<v Sjors Provoost>If you need any kind of information from outside the blockchain, like the weather

00:04:16.550 --> 00:04:20.790
<v Sjors Provoost>or the dollar price, there has to be an oracle that knows this thing. And the

00:04:20.790 --> 00:04:24.070
<v Sjors Provoost>blockchain has no idea if the oracle is lying or not. And we're not going to

00:04:24.070 --> 00:04:27.870
<v Sjors Provoost>solve that. So everything we're doing here still assumes that the oracle is

00:04:27.870 --> 00:04:31.810
<v Sjors Provoost>honest. And then there are some tricks that you can use to make it slightly more

00:04:31.810 --> 00:04:34.060
<v Sjors Provoost>honest. But it's not a perfect solution.

00:04:34.300 --> 00:04:37.960
<v Aaron van Wirdum>Well, that is kind of what we're doing, right? We're sort of trying to minimize

00:04:37.960 --> 00:04:40.900
<v Aaron van Wirdum>the trust in the Oracle or at least a little bit.

00:04:41.400 --> 00:04:46.110
<v Sjors Provoost>Well, we're also trying to reduce the workload for the Oracle, and increase the

00:04:46.110 --> 00:04:47.770
<v Sjors Provoost>plausible deniability for the oracle.

00:04:47.970 --> 00:04:51.590
<v Ruben Somsen>Yeah, that's I think an important point where the oracle doesn't have to be

00:04:51.590 --> 00:04:56.410
<v Ruben Somsen>directly involved with your bets. It can just post the outcome and then you take

00:04:56.410 --> 00:04:59.970
<v Ruben Somsen>the outcome and you resolve your bets with that outcome without the oracle

00:04:59.970 --> 00:05:02.230
<v Ruben Somsen>specifically having to know that you were even betting.

00:05:02.710 --> 00:05:06.610
<v Sjors Provoost>Right, and that also makes the oracle hopefully more neutral. So again, you

00:05:06.610 --> 00:05:07.490
<v Sjors Provoost>cannot guarantee that.

00:05:07.670 --> 00:05:07.750
<v Ruben Somsen>Yeah.

00:05:08.270 --> 00:05:12.810
<v Aaron van Wirdum>Okay, so... Before we get into it, let's pick a very nice and easy sort of bet

00:05:12.810 --> 00:05:14.610
<v Aaron van Wirdum>that everyone will understand is a bet.

00:05:14.770 --> 00:05:15.990
<v Sjors Provoost>If it's going to rain tomorrow.

00:05:16.890 --> 00:05:17.910
<v Aaron van Wirdum>I don't like that one.

00:05:18.810 --> 00:05:20.750
<v Sjors Provoost>Especially because the answer tends to be yes here.

00:05:22.570 --> 00:05:27.430
<v Aaron van Wirdum>Let's go for the World Cup final. We'll have the World Cup later this year. Let's

00:05:27.430 --> 00:05:31.370
<v Aaron van Wirdum>assume the World Cup final is the Netherlands versus Germany, and now we're gonna

00:05:31.370 --> 00:05:33.950
<v Aaron van Wirdum>bet on the winner of the World Cup final. Yeah, all right.

00:05:33.950 --> 00:05:36.570
<v Sjors Provoost>Yeah, all right. Trivial, but yeah.

00:05:36.570 --> 00:05:39.110
<v Aaron van Wirdum>That will be the bet throughout this episode.

00:05:39.110 --> 00:05:40.930
<v Ruben Somsen>Obviously, the Netherlands is gonna win, but okay.

00:05:40.930 --> 00:05:46.390
<v Aaron van Wirdum>The Netherlands versus Germany. All right, in the World Cup final. So the very—

00:05:46.390 --> 00:05:51.730
<v Aaron van Wirdum>let's start at the beginning. We want to solve this problem, um, Ruben and Sjors,

00:05:51.850 --> 00:05:55.190
<v Aaron van Wirdum>you want to bet against each other. Ruben, you're betting on the Netherlands

00:05:55.190 --> 00:05:59.790
<v Aaron van Wirdum>apparently. Sjors, you're betting on Germany. Now we need to make this trustless

00:05:59.790 --> 00:06:05.230
<v Aaron van Wirdum>somehow. I think the most basic solution is to create a multisig.

00:06:05.530 --> 00:06:10.110
<v Aaron van Wirdum>Well, you could create a multisig between the two of you, two of two, but then

00:06:10.110 --> 00:06:13.610
<v Aaron van Wirdum>you have the obvious problem that the loser might not cooperate, right?

00:06:13.810 --> 00:06:13.950
<v Ruben Somsen>Yeah.

00:06:14.510 --> 00:06:18.900
<v Aaron van Wirdum>So if we take the next step... we'll take it one step further. We'll introduce

00:06:18.900 --> 00:06:23.500
<v Aaron van Wirdum>the oracle that's gonna be me. Both of you trust me. So now we create a two out

00:06:23.500 --> 00:06:29.480
<v Aaron van Wirdum>of three multisig and now the final has been played. The Netherlands

00:06:29.480 --> 00:06:35.460
<v Aaron van Wirdum>has won at this point. Either Sjors can cooperate with Ruben to get all the money

00:06:35.460 --> 00:06:41.160
<v Aaron van Wirdum>in the multisig to Ruben, or if Sjors doesn't cooperate, then Ruben can contact

00:06:41.160 --> 00:06:42.400
<v Aaron van Wirdum>me. I'll step in.

00:06:43.900 --> 00:06:47.700
<v Aaron van Wirdum>I'll acknowledge that the Netherlands won the final. So I'll provide my signature

00:06:47.700 --> 00:06:52.620
<v Aaron van Wirdum>and I'll help Ruben get the money. Now, because I can do this, and because both

00:06:52.620 --> 00:06:55.940
<v Aaron van Wirdum>of you know I can do this, and Sjors in particular, you know for a fact that I

00:06:55.940 --> 00:06:59.640
<v Aaron van Wirdum>can do this. So at this point, there's really no reason for you to obstruct. You

00:06:59.640 --> 00:07:01.020
<v Aaron van Wirdum>might as well just cooperate, right?

00:07:01.300 --> 00:07:07.080
<v Sjors Provoost>Yeah, exactly. And so this could just be a trusted friend or this could be the

00:07:07.080 --> 00:07:12.180
<v Sjors Provoost>actual organization that runs the soccer match that has no reason to lie about

00:07:12.180 --> 00:07:16.140
<v Sjors Provoost>the result and is subject to some scrutiny. But the problem is then, of course,

00:07:16.500 --> 00:07:22.400
<v Sjors Provoost>if you want to do a contract with this World Cup organizer, you know... You

00:07:22.400 --> 00:07:26.060
<v Sjors Provoost>need to involve them. They actually need to sign something specifically for you.

00:07:26.220 --> 00:07:29.300
<v Sjors Provoost>And they may not want to do that because, hey, then they're cooperating with

00:07:29.300 --> 00:07:34.670
<v Sjors Provoost>sports betting. Or they don't feel like doing that. I don't know.

00:07:35.620 --> 00:07:41.040
<v Aaron van Wirdum>Yeah, what you're saying is that there are a number of problems with this

00:07:41.040 --> 00:07:46.100
<v Aaron van Wirdum>solution. One of them is it requires me to actually be actively involved in your

00:07:46.100 --> 00:07:50.660
<v Aaron van Wirdum>bet, even before the bet is made. I need to provide my public key and I sort of

00:07:50.660 --> 00:07:53.960
<v Aaron van Wirdum>need to know what you guys are doing and I need to agree with that. And then

00:07:53.960 --> 00:07:56.760
<v Aaron van Wirdum>after the bet, you might need my help and I might do stuff.

00:07:59.320 --> 00:08:04.380
<v Aaron van Wirdum>If it's just two of you, that's maybe acceptable, but now tens of thousands of

00:08:04.380 --> 00:08:08.580
<v Aaron van Wirdum>people want to make the same bet, and I would have to provide my public key to

00:08:08.580 --> 00:08:12.040
<v Aaron van Wirdum>tens of thousands of people, and now it starts to become a lot of work, right?

00:08:12.240 --> 00:08:16.340
<v Sjors Provoost>And they don't even know what you exactly are betting, right? So they would have

00:08:16.340 --> 00:08:20.370
<v Sjors Provoost>to read the terms and conditions of each of your bets to even know which side to

00:08:20.370 --> 00:08:24.710
<v Sjors Provoost>have to sign. Because you can't tell by the public key which side I, Ruben, bet

00:08:24.710 --> 00:08:26.870
<v Sjors Provoost>it on. So yeah, it's pretty tedious.

00:08:27.230 --> 00:08:30.430
<v Aaron van Wirdum>Yeah, and then there's the problem that I need to know what you guys are doing,

00:08:30.450 --> 00:08:34.550
<v Aaron van Wirdum>which is sort of bad for your privacy. I need to know which coins are yours and

00:08:34.550 --> 00:08:37.750
<v Aaron van Wirdum>what they're used for. Are there more problems?

00:08:38.970 --> 00:08:41.070
<v Ruben Somsen>Well, I think you summed it up pretty well.

00:08:41.700 --> 00:08:44.780
<v Sjors Provoost>That said, I think it's possible. It's not impossible.

00:08:45.300 --> 00:08:50.520
<v Aaron van Wirdum>Yeah. Obviously, I could try to cheat by, for example,

00:08:51.380 --> 00:08:56.560
<v Aaron van Wirdum>Sjors could try to bribe me. He could contact me, say, hey, Aaron, let's share

00:08:56.560 --> 00:09:00.160
<v Aaron van Wirdum>the prize and forget about Ruben. Let's share the prize between us. And, you

00:09:00.160 --> 00:09:04.100
<v Aaron van Wirdum>know, I could be corrupted in this way. It's not a problem. Lots of problems with

00:09:04.100 --> 00:09:05.900
<v Aaron van Wirdum>this solution, even though it technically works.

00:09:06.490 --> 00:09:06.890
<v Sjors Provoost>Yes.

00:09:07.070 --> 00:09:11.750
<v Ruben Somsen>I will say there's an upside to it as well, which is that if the bet somehow is

00:09:11.750 --> 00:09:16.210
<v Ruben Somsen>unclear or I don't know, there's a meteor crashes on earth and the finals are

00:09:16.210 --> 00:09:21.330
<v Ruben Somsen>canceled. And now we're like, oh, what are we going to do with our bets? Then you

00:09:21.330 --> 00:09:26.510
<v Ruben Somsen>being a human, you can maybe, you know, sort of have, you can make a decision on

00:09:26.510 --> 00:09:31.710
<v Ruben Somsen>our behalf. That's maybe one small advantage, but I don't think it's a great one.

00:09:32.080 --> 00:09:34.200
<v Sjors Provoost>Okay, method two. Method one.

00:09:34.360 --> 00:09:38.340
<v Aaron van Wirdum>Yeah, so let's try to improve on this solution. Sjors, you wanted to improve on

00:09:38.340 --> 00:09:38.780
<v Aaron van Wirdum>the solution.

00:09:39.920 --> 00:09:45.380
<v Sjors Provoost>Yes. So today I learned about a concept, which I had not followed, and it's

00:09:45.380 --> 00:09:46.460
<v Sjors Provoost>called Reality Keys.

00:09:46.580 --> 00:09:46.760
<v Ruben Somsen>Yeah.

00:09:47.140 --> 00:09:51.600
<v Sjors Provoost>And this is actually a pretty simple idea. It takes it one step further.

00:09:52.390 --> 00:09:54.270
<v Aaron van Wirdum>This is an existing thing.

00:09:54.490 --> 00:09:55.630
<v Ruben Somsen>It was an existing thing.

00:09:55.630 --> 00:09:56.650
<v Aaron van Wirdum>This was an existing thing.

00:09:56.650 --> 00:10:02.350
<v Ruben Somsen>It existed between 2014 and 2018, and it just disappeared. And I don't think a

00:10:02.350 --> 00:10:06.170
<v Ruben Somsen>lot of Bitcoiners remember, but it was actually kind of a really awesome little

00:10:06.170 --> 00:10:06.650
<v Ruben Somsen>platform.

00:10:08.170 --> 00:10:13.890
<v Sjors Provoost>But the general idea still exists. Of course, you can do this. So what the World

00:10:13.890 --> 00:10:16.850
<v Sjors Provoost>Cup leaders in this case probably, they would be the Oracle, what they would do

00:10:16.850 --> 00:10:22.500
<v Sjors Provoost>is they would say, here is two public keys. Public key A, or public key

00:10:22.500 --> 00:10:28.100
<v Sjors Provoost>N, I guess, and public key D, as in the Netherlands public key and the Germany

00:10:28.100 --> 00:10:33.900
<v Sjors Provoost>public key. And depending on who wins, we will publish one of those keys. We will

00:10:33.900 --> 00:10:36.100
<v Sjors Provoost>publish the private key of one of those two keys.

00:10:36.420 --> 00:10:41.500
<v Aaron van Wirdum>Right. So either winner, both winners, have a public key attributed to them,

00:10:41.640 --> 00:10:45.720
<v Aaron van Wirdum>essentially, by Reality Keys, by whoever is running this.

00:10:47.400 --> 00:10:52.260
<v Aaron van Wirdum>And... based on the winner, depending on who wins, they will publish one of the

00:10:52.260 --> 00:10:53.400
<v Aaron van Wirdum>corresponding private keys.

00:10:53.580 --> 00:10:57.500
<v Sjors Provoost>Yeah, and they promised to only publish one. So in that case, Ruben and I set up

00:10:57.500 --> 00:11:02.800
<v Sjors Provoost>our little multisig with, again, two out of three, I think, the threshold,

00:11:03.140 --> 00:11:05.820
<v Sjors Provoost>one key of you, one key of me, and then...

00:11:07.760 --> 00:11:12.400
<v Sjors Provoost>The Germany key, I guess, would send it to me and the Netherlands key would send

00:11:12.400 --> 00:11:14.160
<v Sjors Provoost>it to you. It's a little bit more complicated.

00:11:14.660 --> 00:11:18.700
<v Aaron van Wirdum>Well, essentially, I guess you would set up two out of three multisigs, right?

00:11:18.840 --> 00:11:23.600
<v Ruben Somsen>You can do, well, you can make it a two of two where one is my key plus the

00:11:23.600 --> 00:11:27.120
<v Ruben Somsen>Netherlands key and the other key is Sjors plus the Germany key.

00:11:27.220 --> 00:11:28.280
<v Aaron van Wirdum>That also makes sense, yeah.

00:11:28.480 --> 00:11:33.240
<v Ruben Somsen>But the thing is that Reality Keys doesn't care. They're just going to issue the

00:11:33.240 --> 00:11:37.910
<v Ruben Somsen>key, and we get to deal with that key whatever we want. So we can set it up in

00:11:37.910 --> 00:11:40.710
<v Ruben Somsen>any way that we like, but that would be a plausible way for it.

00:11:40.730 --> 00:11:44.770
<v Sjors Provoost>Yeah, I guess we put the money into the multisig and then we take it out. We have

00:11:44.770 --> 00:11:49.250
<v Sjors Provoost>two different pre-signed transactions, right? One that takes it out or something like that.

00:11:49.270 --> 00:11:54.850
<v Ruben Somsen>Yeah, you probably want two out of three where the third key is you and me

00:11:54.850 --> 00:11:58.950
<v Ruben Somsen>together. So, well, no, that might also not make sense. Yeah, I'm not sure. But

00:11:58.950 --> 00:12:03.670
<v Ruben Somsen>anyway, you need to have a fallback for if Reality Keys doesn't issue any key

00:12:03.670 --> 00:12:07.490
<v Ruben Somsen>whatsoever. So you need to take that into account as well, which we didn't thus far.

00:12:07.570 --> 00:12:12.310
<v Sjors Provoost>And there's another problem that they might actually reveal both keys, which is a

00:12:12.310 --> 00:12:16.970
<v Sjors Provoost>problem. And that's not a problem in the first situation because they're just

00:12:16.970 --> 00:12:21.010
<v Sjors Provoost>putting the signature. I guess they could also just sign two transactions. Then

00:12:21.010 --> 00:12:23.340
<v Sjors Provoost>you have to fight over it, with, you know, replaced by fee.

00:12:23.560 --> 00:12:27.740
<v Ruben Somsen>Well, yeah, you could have two bets with the interactive Oracle and it could

00:12:27.740 --> 00:12:30.860
<v Ruben Somsen>resolve those two bets in a different way, right? Even though there's one

00:12:30.860 --> 00:12:31.480
<v Ruben Somsen>outcome.

00:12:32.260 --> 00:12:35.640
<v Aaron van Wirdum>I think we're botching this. I think the simple solution would be to have three

00:12:35.640 --> 00:12:40.480
<v Aaron van Wirdum>out of four, right? And then you both sign. Am I saying this right? What's the

00:12:40.480 --> 00:12:41.240
<v Aaron van Wirdum>solution there, Ruben?

00:12:42.260 --> 00:12:45.820
<v Sjors Provoost>There has to be a different result depending on which public key gets published.

00:12:46.100 --> 00:12:46.460
<v Aaron van Wirdum>Yeah.

00:12:46.640 --> 00:12:51.350
<v Sjors Provoost>If it's just three out of four, the script doesn't care which three. So it would

00:12:51.350 --> 00:12:55.790
<v Sjors Provoost>just send the money to one person regardless of who wins. So you need to think

00:12:55.790 --> 00:12:56.510
<v Sjors Provoost>about this a little bit.

00:12:56.750 --> 00:12:57.770
<v Ruben Somsen>Two out of four, I think.

00:12:58.620 --> 00:12:58.860
<v Sjors Provoost>Anyway.

00:13:00.280 --> 00:13:01.560
<v Aaron van Wirdum>Two out of four, that makes sense.

00:13:01.560 --> 00:13:03.460
<v Ruben Somsen>I think that works. I think I sold it.

00:13:03.780 --> 00:13:04.480
<v Aaron van Wirdum>That's the one.

00:13:04.760 --> 00:13:04.960
<v Ruben Somsen>Okay.

00:13:05.420 --> 00:13:10.360
<v Aaron van Wirdum>All right, we figure it out. Two out of four. However, we're still not... So

00:13:10.360 --> 00:13:12.300
<v Aaron van Wirdum>yeah, to clarify two out of four because...

00:13:12.300 --> 00:13:15.940
<v Ruben Somsen>Then Oracle can steal though. There's still a problem. Oh yeah.

00:13:16.400 --> 00:13:20.580
<v Aaron van Wirdum>It sounded very simple on paper until we started to actually figure this out live

00:13:20.580 --> 00:13:21.240
<v Aaron van Wirdum>on the podcast.

00:13:22.200 --> 00:13:25.900
<v Ruben Somsen>Yeah, the platform is down. You can't really test it anymore. But what was

00:13:25.900 --> 00:13:29.200
<v Ruben Somsen>interesting about the platform is that it actually worked with APIs. So it was

00:13:29.200 --> 00:13:33.280
<v Ruben Somsen>just connected to a bunch of APIs. And you could then just tell it to pay

00:13:33.280 --> 00:13:37.900
<v Ruben Somsen>attention to that API and publish a key depending on an event from that API. So

00:13:37.900 --> 00:13:42.840
<v Ruben Somsen>it was semi-automated in that regard. So it was kind of a nifty little platform

00:13:42.840 --> 00:13:47.740
<v Ruben Somsen>that I think is very similar. But one sort of downside, I think, to that platform

00:13:47.740 --> 00:13:52.320
<v Ruben Somsen>that we're going to address as well is that it was mostly centered around binary

00:13:52.320 --> 00:13:53.260
<v Ruben Somsen>bets, right?

00:13:54.640 --> 00:13:58.600
<v Ruben Somsen>Either one party or the other party is going to win or the price of Bitcoin is

00:13:58.600 --> 00:14:04.100
<v Ruben Somsen>going to be X at this date, things like that. But so not very, you wouldn't have

00:14:04.100 --> 00:14:08.620
<v Ruben Somsen>these kind of bets with a granular outcome where depending on the price, I get

00:14:08.620 --> 00:14:11.400
<v Ruben Somsen>this amount of Bitcoin and Sjors gets some other amount of Bitcoin.

00:14:11.780 --> 00:14:15.800
<v Sjors Provoost>Right. And especially when you're talking about, say, the US dollar price, if

00:14:15.800 --> 00:14:19.140
<v Sjors Provoost>that's what you're betting on, then it could be have all sorts of numbers

00:14:19.140 --> 00:14:20.500
<v Sjors Provoost>involved. Okay.

00:14:21.120 --> 00:14:25.120
<v Aaron van Wirdum>So anyways, Reality Keys. I don't understand how it would actually work, but

00:14:25.120 --> 00:14:26.960
<v Aaron van Wirdum>there's probably some way to make it work.

00:14:27.260 --> 00:14:27.840
<v Ruben Somsen>I'm sure there's a way.

00:14:28.080 --> 00:14:31.980
<v Aaron van Wirdum>Where the Oracle just publishes a private key depending on the winner. But we

00:14:31.980 --> 00:14:36.500
<v Aaron van Wirdum>just discussed that as a sort of stepping stone for the actual subject of this

00:14:36.500 --> 00:14:40.520
<v Aaron van Wirdum>specific podcast, which is DLCs. And that's sort of what we're getting at now,

00:14:40.680 --> 00:14:44.240
<v Aaron van Wirdum>right? So who wants to give DLCs a first go?

00:14:47.000 --> 00:14:51.840
<v Ruben Somsen>I'll start and then maybe Sjors can continue from where I begin.

00:14:52.100 --> 00:14:52.420
<v Aaron van Wirdum>Right.

00:14:53.320 --> 00:14:59.280
<v Ruben Somsen>So I think the DLC paper came from Tadge Dryja, who currently works on

00:14:59.280 --> 00:15:02.640
<v Ruben Somsen>Utreexo, so a very interesting project as well, which I think we discussed.

00:15:03.000 --> 00:15:03.340
<v Sjors Provoost>We have.

00:15:03.480 --> 00:15:03.640
<v Ruben Somsen>Yeah.

00:15:04.160 --> 00:15:07.180
<v Aaron van Wirdum>Also one of the co-authors of the Lightning White Paper.

00:15:07.320 --> 00:15:09.600
<v Ruben Somsen>Yeah, and Lightning Network Paper as well. Yeah, good points.

00:15:11.140 --> 00:15:17.000
<v Ruben Somsen>So the idea there is to basically have the bets

00:15:17.000 --> 00:15:22.200
<v Ruben Somsen>be a channel where you lock up your funds together with a counterparty. And then

00:15:22.200 --> 00:15:26.580
<v Ruben Somsen>from that state where you have a channel. So it's very similar to a Lightning

00:15:26.580 --> 00:15:30.180
<v Ruben Somsen>channel, right? There's two of two, and you would have to have some kind of

00:15:30.180 --> 00:15:34.560
<v Ruben Somsen>transaction where you can exit out of it in case you disagree or something.

00:15:34.900 --> 00:15:39.380
<v Aaron van Wirdum>So hang on. In this specific case, essentially Ruben and Sjors, the two of you

00:15:39.380 --> 00:15:44.500
<v Aaron van Wirdum>would open a payment channel, which looks a little bit like a Lightning channel.

00:15:44.680 --> 00:15:44.900
<v Ruben Somsen>Yeah.

00:15:45.180 --> 00:15:46.020
<v Aaron van Wirdum>Right? Okay, go on.

00:15:46.120 --> 00:15:47.280
<v Ruben Somsen>The initial setup is the two of two.

00:15:47.280 --> 00:15:50.420
<v Aaron van Wirdum>Which essentially means you're both depositing funds in this channel, right?

00:15:50.560 --> 00:15:54.860
<v Ruben Somsen>Yes. But the way that you can get the funds out is sort of the key difference.

00:15:55.180 --> 00:16:00.880
<v Ruben Somsen>Where now in order to get your funds out, you have a bunch of transactions that

00:16:00.880 --> 00:16:06.280
<v Ruben Somsen>are basically bet outcomes. And so in our example, a World Cup, Netherlands

00:16:06.280 --> 00:16:11.590
<v Ruben Somsen>versus Germany, we would have two transactions basically. One transaction

00:16:12.170 --> 00:16:17.530
<v Ruben Somsen>would be a transaction where Sjors wins. So he can publish his version of the

00:16:17.530 --> 00:16:23.070
<v Ruben Somsen>transaction and then he can spend that money with both his key

00:16:23.070 --> 00:16:29.030
<v Ruben Somsen>plus the key of the oracle where the oracle says that Germany won.

00:16:29.870 --> 00:16:35.510
<v Ruben Somsen>But then there's also a time lock because if Sjors publishes his transaction,

00:16:35.770 --> 00:16:40.870
<v Ruben Somsen>but that transaction is actually not the one that the Oracle published,

00:16:41.150 --> 00:16:45.610
<v Ruben Somsen>well, then basically what happens is that he can't spend it because he doesn't

00:16:45.610 --> 00:16:49.170
<v Ruben Somsen>have both keys. He only has one of the keys. And then the time lock expires. And

00:16:49.170 --> 00:16:52.230
<v Ruben Somsen>the time lock says that after the time lock expires, I get to take the money.

00:16:52.650 --> 00:16:58.150
<v Aaron van Wirdum>Okay, so hang on. In a Lightning channel, if I'm remembering correctly, which I

00:16:58.150 --> 00:17:03.570
<v Aaron van Wirdum>think I am, both of you would essentially, you've exchanged signed

00:17:03.570 --> 00:17:08.790
<v Aaron van Wirdum>transactions, right? You both have a different version of the redemption

00:17:08.790 --> 00:17:10.250
<v Aaron van Wirdum>transaction. Am I saying that right?

00:17:10.470 --> 00:17:11.110
<v Ruben Somsen>Yeah, yeah.

00:17:11.250 --> 00:17:17.230
<v Aaron van Wirdum>And so in this case, both of these transactions depend on the outcome of the

00:17:17.230 --> 00:17:22.720
<v Aaron van Wirdum>match, essentially. So you would have the transaction that should be broadcast if

00:17:22.720 --> 00:17:27.000
<v Aaron van Wirdum>the Netherlands wins, Ruben. And then Sjors has a slightly different version of

00:17:27.000 --> 00:17:32.820
<v Aaron van Wirdum>an almost identical transaction that he should broadcast if Germany wins. Right?

00:17:33.120 --> 00:17:33.240
<v Ruben Somsen>Yeah.

00:17:33.660 --> 00:17:39.550
<v Sjors Provoost>And in both cases, if we happen to broadcast the wrong one... which, you know, we

00:17:39.550 --> 00:17:42.290
<v Sjors Provoost>don't have to do, but then the other side can just take the...

00:17:42.290 --> 00:17:45.570
<v Aaron van Wirdum>Yes, this is what Ruben was just explaining. So the Netherlands won in our

00:17:45.570 --> 00:17:51.370
<v Aaron van Wirdum>example and Sjors bet on Germany. So Sjors has the transaction that he should

00:17:51.370 --> 00:17:56.870
<v Aaron van Wirdum>broadcast only if Germany wins, but he broadcasts it anyways. The reason he can't

00:17:56.870 --> 00:18:02.250
<v Aaron van Wirdum>actually claim the funds is because he needs something from the Oracle in

00:18:02.250 --> 00:18:05.910
<v Aaron van Wirdum>combination with his own signature in order to actually claim the funds, right?

00:18:06.310 --> 00:18:06.430
<v Ruben Somsen>Yes.

00:18:06.370 --> 00:18:11.990
<v Aaron van Wirdum>So he— because he can't do that now a time lock is ticking, yeah, it's going to

00:18:11.990 --> 00:18:16.110
<v Aaron van Wirdum>clock out at which point the money is sent to you Ruben.

00:18:16.110 --> 00:18:16.410
<v Ruben Somsen>Yes.

00:18:16.350 --> 00:18:21.910
<v Aaron van Wirdum>So that's sort of a strong disincentive for Sjors to try to claim the money even

00:18:21.910 --> 00:18:22.690
<v Aaron van Wirdum>though he didn't win.

00:18:22.850 --> 00:18:23.230
<v Ruben Somsen>Yes.

00:18:23.430 --> 00:18:24.510
<v Aaron van Wirdum>Okay, so this...

00:18:24.430 --> 00:18:28.350
<v Sjors Provoost>It's useful to know here that a transaction has inputs and outputs and so the

00:18:28.350 --> 00:18:32.850
<v Sjors Provoost>transaction that both of the transactions that go out of this pot that we put the

00:18:32.850 --> 00:18:38.330
<v Sjors Provoost>money in or this channel both of them have the same inputs so both of us can just

00:18:38.330 --> 00:18:42.160
<v Sjors Provoost>throw it on the chain because they you know. But the outputs are different. And

00:18:42.160 --> 00:18:45.640
<v Sjors Provoost>so we need another transaction to actually take the money to really own it. And

00:18:45.640 --> 00:18:47.560
<v Sjors Provoost>that's where the Oracle signature comes in.

00:18:47.860 --> 00:18:51.800
<v Aaron van Wirdum>Right. So let me ask about it. So the Netherlands won. Ruben, you bet on the Netherlands.

00:18:52.040 --> 00:18:52.140
<v Ruben Somsen>Yeah.

00:18:52.300 --> 00:18:55.600
<v Aaron van Wirdum>So we just gave the example where Sjors is trying to cheat. Let's forget about

00:18:55.600 --> 00:18:58.840
<v Aaron van Wirdum>that. Now you're just broadcasting the legitimate transaction.

00:18:59.100 --> 00:18:59.260
<v Ruben Somsen>Yeah.

00:18:59.620 --> 00:19:05.420
<v Aaron van Wirdum>Which requires now a signature from you. As well as what's the other

00:19:05.420 --> 00:19:06.080
<v Aaron van Wirdum>thing exactly?

00:19:06.420 --> 00:19:10.480
<v Ruben Somsen>Yeah. So really what it is, and we have to go into more detail here, but

00:19:10.480 --> 00:19:15.700
<v Ruben Somsen>essentially it is two keys. One is mine and the other key comes from the Oracle.

00:19:16.940 --> 00:19:20.500
<v Aaron van Wirdum>Wait, wait, wait. You're saying key. Do you mean key or do you mean signature?

00:19:20.720 --> 00:19:26.140
<v Ruben Somsen>I mean an actual key. Yeah. So when I send my transaction to the Bitcoin

00:19:26.140 --> 00:19:30.860
<v Ruben Somsen>blockchain, there's going to be an output and the output is encumbered by a key.

00:19:31.260 --> 00:19:35.740
<v Ruben Somsen>And that key is the combination of my key and a key that is provided by the Oracle.

00:19:37.070 --> 00:19:42.210
<v Ruben Somsen>And I basically take both keys. When the Oracle reveals his private key,

00:19:42.410 --> 00:19:47.570
<v Ruben Somsen>I get that private key. I combine it with my private key. And that combined

00:19:47.570 --> 00:19:51.750
<v Ruben Somsen>number is what I use to sign the transaction and then actually take the money.

00:19:52.010 --> 00:19:55.270
<v Ruben Somsen>And I have to do that because if I don't do that, then the time lock expires and

00:19:55.270 --> 00:19:56.070
<v Ruben Somsen>Sjors gets to take it.

00:19:56.040 --> 00:19:59.220
<v Sjors Provoost>Yeah, to go back to that encumbering it's, it's encumbered, of course, by the

00:19:59.220 --> 00:20:03.860
<v Sjors Provoost>public key. Well, it's encumbered by… So it's basically saying anybody with this

00:20:03.860 --> 00:20:08.180
<v Sjors Provoost>public key can spend it and this public key happens to be your public key plus a

00:20:08.180 --> 00:20:11.360
<v Sjors Provoost>public key that we have pre-computed that belongs to the Oracle.

00:20:11.780 --> 00:20:12.140
<v Ruben Somsen>Yeah.

00:20:13.820 --> 00:20:17.800
<v Sjors Provoost>And this is sort of where the magic comes in because it's not the same as the

00:20:17.800 --> 00:20:22.260
<v Sjors Provoost>previous mechanism. The Oracle is not actually publishing a private key like a

00:20:22.260 --> 00:20:23.280
<v Sjors Provoost>private key that holds funds.

00:20:25.030 --> 00:20:30.050
<v Sjors Provoost>But we're actually getting it from the signature. And this is kind of where

00:20:30.050 --> 00:20:35.690
<v Sjors Provoost>things get a little funky, because a signature is really two numbers.

00:20:36.210 --> 00:20:41.970
<v Sjors Provoost>It is essentially a public key, or it's not a public key, but it's a point, a

00:20:41.970 --> 00:20:47.760
<v Sjors Provoost>point on the elliptic curve, and it is a number. And in general,

00:20:48.080 --> 00:20:52.200
<v Sjors Provoost>when you have a number, you can treat that as a private key. And when you have a

00:20:52.200 --> 00:20:55.680
<v Sjors Provoost>point, you can treat that as a public key. And the reason is that you can very

00:20:55.680 --> 00:21:00.270
<v Sjors Provoost>easily go from a number to a point. but you cannot go from a point to the

00:21:00.270 --> 00:21:05.210
<v Sjors Provoost>corresponding number. So that's why the private key is the number and the point

00:21:05.210 --> 00:21:06.770
<v Sjors Provoost>is the public key.

00:21:08.400 --> 00:21:11.600
<v Sjors Provoost>But in the case of the signature, we don't interpret it that way. So we're seeing

00:21:11.600 --> 00:21:16.580
<v Sjors Provoost>a point and we're seeing a number, but we can if we want to, and that's actually

00:21:16.580 --> 00:21:21.460
<v Sjors Provoost>what we're doing here. So we're interpreting the second part of the signature,

00:21:21.740 --> 00:21:26.630
<v Sjors Provoost>which is a number. We're interpreting that as a private key. And that is the

00:21:26.630 --> 00:21:31.590
<v Sjors Provoost>private key that we're missing. And now the nice thing is that the Oracle can

00:21:31.590 --> 00:21:37.010
<v Sjors Provoost>sign anything, really. They can publish any signature they want. And depending on

00:21:37.010 --> 00:21:41.900
<v Sjors Provoost>exactly what message they sign, we're going to get a different private key in

00:21:41.960 --> 00:21:42.460
<v Sjors Provoost>that signature.

00:21:43.760 --> 00:21:49.330
<v Sjors Provoost>And so if they publish Germany, then I get a private key.

00:21:49.570 --> 00:21:53.270
<v Sjors Provoost>Then that private key that the Oracle just published is useful for me. It allows

00:21:53.270 --> 00:21:58.190
<v Sjors Provoost>me to redeem the coins. If the oracle wrote Germany in the message, then Ruben

00:21:58.190 --> 00:22:02.510
<v Sjors Provoost>gets the private key that is useful for him and of no use to me.

00:22:03.710 --> 00:22:09.690
<v Sjors Provoost>And to make it even nicer is if they publish both, well, now we can actually

00:22:09.690 --> 00:22:15.570
<v Sjors Provoost>punish the oracle because the oracle also has its own private key.

00:22:15.730 --> 00:22:20.240
<v Sjors Provoost>And by this, I mean the real private key that he would use to protect his own

00:22:20.240 --> 00:22:24.170
<v Sjors Provoost>funds. And that now becomes known. Because there's a rule that if you publish,

00:22:24.350 --> 00:22:29.230
<v Sjors Provoost>basically, if you make two, if you sign two different messages this way, you're

00:22:29.230 --> 00:22:30.650
<v Sjors Provoost>giving away your private key.

00:22:31.010 --> 00:22:35.330
<v Ruben Somsen>Yeah, that's exactly right. So maybe to sort of give a...

00:22:35.330 --> 00:22:37.130
<v Sjors Provoost>But that's maybe a little bit tangential.

00:22:37.450 --> 00:22:43.430
<v Ruben Somsen>Yeah, to give sort of a high-level summary here is that basically we just

00:22:43.430 --> 00:22:48.330
<v Ruben Somsen>get the Oracle to pre-commit to what it's going to sign. So it's going to say

00:22:48.330 --> 00:22:53.770
<v Ruben Somsen>like, look, I'm going to sign either Germany or the Netherlands. And we

00:22:53.770 --> 00:22:59.490
<v Ruben Somsen>calculate ahead of time what that signature is going to look like. And we use

00:22:59.490 --> 00:23:03.430
<v Ruben Somsen>that in our scripts, in our transactions.

00:23:03.670 --> 00:23:06.450
<v Aaron van Wirdum>Well, you can know what the signature will look like exactly, right?

00:23:06.550 --> 00:23:08.930
<v Sjors Provoost>No, we know one part of that signature, what it's going to look like.

00:23:09.070 --> 00:23:14.650
<v Ruben Somsen>Yeah, we know sort of, we know the, as Sjors stated, you can treat the signature

00:23:14.650 --> 00:23:18.710
<v Ruben Somsen>as a key. And so we know the public key, but we don't know the private key,

00:23:18.890 --> 00:23:24.450
<v Ruben Somsen>basically, of the signature. So we treat the signature as a key. And we only know

00:23:24.450 --> 00:23:28.390
<v Ruben Somsen>the public key. We don't know the private key until the Oracle actually signs.

00:23:32.970 --> 00:23:37.410
<v Aaron van Wirdum>All right, well, I didn't get all of that. Maybe some of our listeners did. I do

00:23:37.410 --> 00:23:43.370
<v Aaron van Wirdum>want to, at the risk of confusing our listeners even more, I actually want to

00:23:43.370 --> 00:23:48.130
<v Aaron van Wirdum>take one step back. So we were discussing this Reality Keys idea where the Oracle

00:23:48.130 --> 00:23:53.510
<v Aaron van Wirdum>would just publish a private key. Why can't we just use that in this setup? So

00:23:53.510 --> 00:23:57.930
<v Aaron van Wirdum>the Netherlands won, Ruben, you're now publishing your transaction that allowed

00:23:57.930 --> 00:24:03.550
<v Aaron van Wirdum>you to withdraw the funds, which... requires your signature. And why don't we

00:24:03.550 --> 00:24:09.150
<v Aaron van Wirdum>just say it also requires a signature from a private key, which is for the

00:24:09.150 --> 00:24:09.810
<v Aaron van Wirdum>[unclear] specifically.

00:24:10.090 --> 00:24:10.390
<v Ruben Somsen>Yeah.

00:24:10.610 --> 00:24:14.650
<v Aaron van Wirdum>Like we were speaking out loud where we were at that step of the podcast and we

00:24:14.650 --> 00:24:17.790
<v Aaron van Wirdum>were budging it, but this actually seems to make sense to me. Like this would

00:24:17.790 --> 00:24:18.750
<v Aaron van Wirdum>actually work, right? Yeah.

00:24:18.990 --> 00:24:23.050
<v Ruben Somsen>So I think the first thing to point out is that, yes, that works. So if you're

00:24:23.050 --> 00:24:26.030
<v Ruben Somsen>confused about everything that we said, you can just think of it in that way.

00:24:26.230 --> 00:24:26.450
<v Aaron van Wirdum>Right.

00:24:26.610 --> 00:24:31.270
<v Ruben Somsen>So that's, I think, like the first point. Second point is there are two subtle

00:24:31.270 --> 00:24:36.230
<v Ruben Somsen>differences. And the first difference is what Sjors explained earlier, where if

00:24:36.230 --> 00:24:42.510
<v Ruben Somsen>the Oracle signs two things, we can punish the Oracle by extracting their private key.

00:24:42.710 --> 00:24:45.450
<v Aaron van Wirdum>Right, yeah. So if...

00:24:45.840 --> 00:24:47.880
<v Sjors Provoost>So the Oracle would say in this case...

00:24:47.880 --> 00:24:52.160
<v Aaron van Wirdum>If the Oracle would publish both results for whatever reason, then there's this

00:24:52.160 --> 00:24:56.880
<v Aaron van Wirdum>mathematical trick where you can combine the signatures and from there derive the

00:24:56.880 --> 00:25:02.240
<v Aaron van Wirdum>actual private key from the actual Oracle. Assuming that the Oracle put up some

00:25:02.240 --> 00:25:08.040
<v Aaron van Wirdum>funds there to prove that it won't cheat, that's how you're sure that the Oracle

00:25:08.040 --> 00:25:10.880
<v Aaron van Wirdum>will only publish one result, right? That's the point here.

00:25:11.120 --> 00:25:11.280
<v Ruben Somsen>Yeah.

00:25:11.680 --> 00:25:15.000
<v Aaron van Wirdum>Right. And then there was another solid point I think you were going to mention, Ruben.

00:25:15.120 --> 00:25:19.100
<v Ruben Somsen>Yeah. And the second point is sort of a smaller one that probably not everybody

00:25:19.100 --> 00:25:24.960
<v Ruben Somsen>appreciates, but it's just less data, basically. So the Oracle can basically

00:25:24.960 --> 00:25:30.560
<v Ruben Somsen>commit to what it's going to reveal in less data than you would

00:25:30.560 --> 00:25:35.760
<v Ruben Somsen>need if you would create a public key for every bet event.

00:25:35.980 --> 00:25:38.960
<v Sjors Provoost>Well, and this becomes especially important if you're doing something like

00:25:38.960 --> 00:25:42.380
<v Sjors Provoost>predicting the price of the US dollar in Bitcoin. Because you might want to

00:25:42.380 --> 00:25:46.200
<v Sjors Provoost>publish a six-digit number. And that means, you know, hundreds of thousands of

00:25:46.200 --> 00:25:49.940
<v Sjors Provoost>public keys that you would have to publish for each possible value. And you'd

00:25:49.940 --> 00:25:52.560
<v Sjors Provoost>have to pre-sign transactions for each of these possible values.

00:25:52.840 --> 00:25:58.000
<v Ruben Somsen>Yeah. Well, not necessarily because you can do it in binary, which makes it a lot less.

00:25:58.160 --> 00:25:58.900
<v Sjors Provoost>I guess we'll get to that.

00:25:58.980 --> 00:26:00.420
<v Ruben Somsen>We'll get to that later. Yes.

00:26:00.940 --> 00:26:06.180
<v Sjors Provoost>Okay. So maybe... Fun to just dive into a little bit more detail for those who do

00:26:06.180 --> 00:26:08.180
<v Sjors Provoost>understand the math better than we.

00:26:10.540 --> 00:26:15.020
<v Sjors Provoost>Do we? Yeah, so there's a couple of things that the Oracle publishes or that are

00:26:15.020 --> 00:26:20.120
<v Sjors Provoost>known here. If you look at what a signature is, it's like an equation,

00:26:20.140 --> 00:26:24.120
<v Sjors Provoost>essentially. If I can read it out loud, you have on the left side of the

00:26:24.120 --> 00:26:29.700
<v Sjors Provoost>equation, you have S times G, where S is the

00:26:29.700 --> 00:26:33.500
<v Sjors Provoost>signature. G is the, what's it called?

00:26:33.800 --> 00:26:34.200
<v Ruben Somsen>Generator.

00:26:34.500 --> 00:26:39.200
<v Sjors Provoost>Is a generator. Now, the generator is a publicly known universal number that all

00:26:39.200 --> 00:26:41.920
<v Sjors Provoost>of Bitcoin uses. So that's a number that everybody knows. So we only have one

00:26:41.920 --> 00:26:43.280
<v Sjors Provoost>unknown thing on the left side.

00:26:43.420 --> 00:26:43.560
<v Ruben Somsen>Yeah.

00:26:43.920 --> 00:26:49.900
<v Sjors Provoost>And then on the right side, we have capital R. And R is actually... something

00:26:49.900 --> 00:26:53.540
<v Sjors Provoost>that the oracle is going to reveal before the bet. So they're going to say, this

00:26:53.540 --> 00:26:57.660
<v Sjors Provoost>is my R. So again, we have something that we already know. Then we have...

00:26:57.660 --> 00:26:59.880
<v Ruben Somsen>The capital R meaning it's a curve point.

00:27:00.100 --> 00:27:05.780
<v Sjors Provoost>Yes. And then the next part of the equation is plus the hash of R concatenated by

00:27:05.780 --> 00:27:10.180
<v Sjors Provoost>the message. So the message is something we already said. We don't know what the

00:27:10.180 --> 00:27:14.820
<v Sjors Provoost>message will be, but we can enumerate all the possible messages. We can enumerate

00:27:14.820 --> 00:27:20.190
<v Sjors Provoost>M is Germany or M is Netherlands. And we're hashing that with R and we know R.

00:27:20.630 --> 00:27:26.270
<v Sjors Provoost>So that's all known. And then there's times P, capital P. And P is the public key

00:27:26.270 --> 00:27:32.020
<v Sjors Provoost>of the Oracle, which they've also published. So the Oracle will say, hey, I'm a

00:27:32.020 --> 00:27:36.680
<v Sjors Provoost>Bitcoin related Oracle. So you have to assume G is the generator as we know it in

00:27:36.680 --> 00:27:41.240
<v Sjors Provoost>Bitcoin. Here's my public key. And by the way, this public key belongs to a

00:27:41.240 --> 00:27:44.720
<v Sjors Provoost>Bitcoin address and there's a million dollars on it. So I'm not going to do

00:27:44.720 --> 00:27:45.320
<v Sjors Provoost>anything bad.

00:27:47.760 --> 00:27:53.690
<v Sjors Provoost>And here's an R that I'm going to use for this specific bet. So you have to have

00:27:53.690 --> 00:27:56.530
<v Sjors Provoost>a new R for every bet. But in this case, if it's Netherlands, Germany, here's the

00:27:56.530 --> 00:28:01.800
<v Sjors Provoost>R for that. And so that equation that I just read out loud really only has one

00:28:01.800 --> 00:28:06.280
<v Sjors Provoost>real unknown, and that's lowercase s. And if you have an equation with only one

00:28:06.280 --> 00:28:09.500
<v Sjors Provoost>unknown, well, then you're quite happy. Right?

00:28:09.760 --> 00:28:09.980
<v Ruben Somsen>Yeah.

00:28:10.420 --> 00:28:14.980
<v Sjors Provoost>Except in this case, you cannot actually derive the private key because as we

00:28:14.980 --> 00:28:19.400
<v Sjors Provoost>said, you cannot go from a public key to a private key. So anyway, that's just to

00:28:19.400 --> 00:28:22.340
<v Sjors Provoost>say that if you really looked at it and you had a little bit more time and you

00:28:22.340 --> 00:28:24.900
<v Sjors Provoost>could see it in front of you, you could just see it's an equation with some

00:28:24.900 --> 00:28:26.700
<v Sjors Provoost>unknowns and it's not that hard.

00:28:26.900 --> 00:28:27.020
<v Ruben Somsen>Yeah.

00:28:27.300 --> 00:28:32.970
<v Sjors Provoost>And so then when the oracle actually signs a message,

00:28:33.330 --> 00:28:37.110
<v Sjors Provoost>they let you know which M they picked. That's not going to be too much of a

00:28:37.110 --> 00:28:41.680
<v Sjors Provoost>surprise. It's going to be the Netherlands. And then it's going to actually put

00:28:41.680 --> 00:28:45.080
<v Sjors Provoost>down the signature, and that reveals this lowercase s. That was the only missing

00:28:45.080 --> 00:28:46.020
<v Sjors Provoost>part from our equation.

00:28:47.830 --> 00:28:50.730
<v Sjors Provoost>And we use that to do our own signature.

00:28:50.990 --> 00:28:51.110
<v Ruben Somsen>Yeah.

00:28:52.140 --> 00:28:57.250
<v Aaron van Wirdum>Okay, so let's bring this back to the real world a little bit. We started with

00:28:57.250 --> 00:29:01.590
<v Aaron van Wirdum>the example where Sjors and Ruben, the two of you, are betting on the winner of

00:29:01.590 --> 00:29:06.530
<v Aaron van Wirdum>the World Cup and I was part of a multisig who would help in case one of you

00:29:06.530 --> 00:29:12.350
<v Aaron van Wirdum>tried to obstruct. And then we mentioned some of the problems with that. Now we

00:29:12.350 --> 00:29:17.570
<v Aaron van Wirdum>have this new solution which we just described, which I sort of get and the two

00:29:17.570 --> 00:29:23.280
<v Aaron van Wirdum>of you seem to get it pretty well. So the benefits here are that

00:29:23.280 --> 00:29:28.700
<v Aaron van Wirdum>the FIFA who's organizing the World Cup, they can always just publish a signed

00:29:28.700 --> 00:29:30.500
<v Aaron van Wirdum>message of the winner.

00:29:30.920 --> 00:29:30.970
<v Ruben Somsen>Yeah.

00:29:31.220 --> 00:29:36.180
<v Aaron van Wirdum>And this can be used by anyone, right? So the FIFA does not need to be part of

00:29:36.180 --> 00:29:41.200
<v Aaron van Wirdum>any multisig. They do not need to have any active involvement. They do not even

00:29:41.200 --> 00:29:43.820
<v Aaron van Wirdum>need to know that a bet took place at all.

00:29:44.060 --> 00:29:44.160
<v Ruben Somsen>Yeah.

00:29:44.360 --> 00:29:48.460
<v Aaron van Wirdum>All they need to know is that they need to sign a message and this will allow

00:29:48.460 --> 00:29:51.220
<v Aaron van Wirdum>anyone to create bets on their own accord, right?

00:29:51.400 --> 00:29:51.900
<v Ruben Somsen>That is correct.

00:29:52.320 --> 00:29:53.080
<v Aaron van Wirdum>Is that...

00:29:53.080 --> 00:29:56.820
<v Sjors Provoost>And optionally, they can publish, they can post a collateral that if they

00:29:56.820 --> 00:30:00.670
<v Sjors Provoost>cheat... then they lose a collateral. But that's not essential for the algorithm.

00:30:01.010 --> 00:30:01.070
<v Ruben Somsen>Yeah.

00:30:01.590 --> 00:30:07.030
<v Aaron van Wirdum>Right. And then I think another benefit here is that if the FIFA would try to

00:30:07.030 --> 00:30:12.390
<v Aaron van Wirdum>cheat for whatever reason, if they would announce the wrong winner, then that's

00:30:12.390 --> 00:30:17.910
<v Aaron van Wirdum>also very obvious and publicly known to anyone. So now everyone knows we

00:30:17.910 --> 00:30:21.450
<v Aaron van Wirdum>shouldn't rely on them to settle our bets for the next World Cup.

00:30:21.670 --> 00:30:24.590
<v Sjors Provoost>Yeah, which might be more difficult to prove in the earlier scenarios, right,

00:30:24.630 --> 00:30:29.010
<v Sjors Provoost>where they... where they just manually sign one of our sides. We don't really,

00:30:29.010 --> 00:30:31.090
<v Sjors Provoost>you know, you don't really know what was going on there.

00:30:31.090 --> 00:30:34.970
<v Ruben Somsen>I think it's still solvable because you can get them to commit to what they're

00:30:34.970 --> 00:30:37.990
<v Ruben Somsen>going to do and then you can reveal that they said they were going to do x if

00:30:37.990 --> 00:30:42.050
<v Ruben Somsen>this happened and they didn't. So, okay, it's probably solvable either way, but

00:30:42.050 --> 00:30:44.350
<v Ruben Somsen>uh, it's a little nicer here, it's more formalized.

00:30:44.350 --> 00:30:50.310
<v Aaron van Wirdum>Okay, okay, so this message that FIFA is broadcasting this can be used as we

00:30:50.310 --> 00:30:55.570
<v Aaron van Wirdum>explained in combination with your own bets, depending on who won, you publish

00:30:56.060 --> 00:31:00.080
<v Aaron van Wirdum>the original transaction that you have. Then you use this signature from

00:31:00.080 --> 00:31:03.760
<v Aaron van Wirdum>the FIFA, combine it with your own signature. Does this require Schnorr, by the

00:31:03.760 --> 00:31:05.220
<v Aaron van Wirdum>way? Does this require Schnorr signatures?

00:31:05.220 --> 00:31:06.340
<v Sjors Provoost>It's easier.

00:31:06.340 --> 00:31:12.240
<v Ruben Somsen>It— so the, the oracle signs with Schnorr signatures because,

00:31:12.240 --> 00:31:16.640
<v Ruben Somsen>uh, that's the, because Schnorr signatures are linear and that's how you can do

00:31:16.640 --> 00:31:20.860
<v Ruben Somsen>the thing that Sjors just explained. Well, that's how you can, that's how you can

00:31:20.860 --> 00:31:25.080
<v Ruben Somsen>calculate ahead of time what the expected signature is going to be, the public

00:31:25.080 --> 00:31:26.260
<v Ruben Somsen>key of the expected signature.

00:31:26.380 --> 00:31:26.560
<v Aaron van Wirdum>Right.

00:31:26.740 --> 00:31:32.220
<v Ruben Somsen>And you need Schnorr for that. You can't do that with the ECDSA, I believe. But

00:31:32.220 --> 00:31:36.400
<v Ruben Somsen>on the side of the betters, you can use ECDSA.

00:31:36.600 --> 00:31:39.540
<v Sjors Provoost>But we're not going to because we're cool people and we use Schnorr.

00:31:39.680 --> 00:31:40.180
<v Ruben Somsen>That's right.

00:31:40.500 --> 00:31:42.300
<v Sjors Provoost>Anyway, but there's more.

00:31:42.860 --> 00:31:47.300
<v Aaron van Wirdum>Okay, yeah. I was almost done with sort of reiterating the point of how it

00:31:47.300 --> 00:31:51.640
<v Aaron van Wirdum>actually works. So the FIFA broadcasts a message saying the Netherlands won in

00:31:51.640 --> 00:31:56.200
<v Aaron van Wirdum>this case. Then Ruben can take that message. He broadcasts the transaction that

00:31:56.200 --> 00:32:00.640
<v Aaron van Wirdum>he had. Sjors cannot because then he might lose his money. So Ruben is

00:32:00.640 --> 00:32:05.700
<v Aaron van Wirdum>broadcasting that message, that transaction, and then he uses this signed message

00:32:05.700 --> 00:32:11.300
<v Aaron van Wirdum>from FIFA, combines it with his own signature, and now... Yeah, with some key.

00:32:11.040 --> 00:32:14.980
<v Aaron van Wirdum>And now you're withdrawing the funds for yourself and you won the bet. That's

00:32:14.980 --> 00:32:18.140
<v Aaron van Wirdum>right. And the FIFA doesn't even need to know that there was a bet at all.

00:32:18.280 --> 00:32:18.460
<v Ruben Somsen>Yep.

00:32:18.640 --> 00:32:18.820
<v Aaron van Wirdum>Right?

00:32:20.050 --> 00:32:25.780
<v Aaron van Wirdum>Great. So that gets us one step ahead. And then I think there's another

00:32:25.910 --> 00:32:30.070
<v Aaron van Wirdum>incremental improvement, which we're also going to discuss. Is that right?

00:32:30.290 --> 00:32:34.110
<v Sjors Provoost>Yeah. And that basically gets rid of a bunch of transactions and makes it look

00:32:34.110 --> 00:32:34.930
<v Sjors Provoost>even more...

00:32:36.620 --> 00:32:37.180
<v Sjors Provoost>inconspicuous.

00:32:37.180 --> 00:32:42.400
<v Aaron van Wirdum>So hang on, what I just explained, what we just discussed are Discreet log

00:32:42.400 --> 00:32:43.320
<v Aaron van Wirdum>contracts, right?

00:32:43.320 --> 00:32:49.180
<v Ruben Somsen>From the, from the paper by Tadge Dryja. So this is the original design and not

00:32:49.180 --> 00:32:50.580
<v Ruben Somsen>the design that it's currently in use.

00:32:50.580 --> 00:32:55.220
<v Aaron van Wirdum>Okay, so now there has been an improvement on the original design. Yeah. Is it

00:32:55.220 --> 00:32:56.820
<v Aaron van Wirdum>still called Discreet log contract?

00:32:56.820 --> 00:32:57.420
<v Ruben Somsen>Yes.

00:32:57.420 --> 00:32:59.360
<v Aaron van Wirdum>All right, just an improved version of it.

00:32:59.360 --> 00:33:04.790
<v Ruben Somsen>It is, it is just I would say it's a slight tweak that was kind of obvious,

00:33:05.150 --> 00:33:07.230
<v Ruben Somsen>but makes things a lot easier.

00:33:07.570 --> 00:33:07.910
<v Aaron van Wirdum>All right.

00:33:09.130 --> 00:33:10.930
<v Aaron van Wirdum>Who wants to...

00:33:10.930 --> 00:33:13.550
<v Sjors Provoost>I think I'm going to go give this one to Ruben.

00:33:13.730 --> 00:33:13.850
<v Ruben Somsen>Okay.

00:33:14.050 --> 00:33:15.650
<v Sjors Provoost>Because he wrote a mailing list post about it.

00:33:15.890 --> 00:33:20.750
<v Ruben Somsen>That is true, yeah. So to my knowledge, I'm the first person who actually wrote

00:33:20.750 --> 00:33:26.270
<v Ruben Somsen>it up. I don't think it was super novel because it's literally just... I just

00:33:26.270 --> 00:33:31.790
<v Ruben Somsen>realized, oh, you can combine adaptor signatures with the DLC

00:33:34.470 --> 00:33:36.630
<v Ruben Somsen>protocol that Tadge Dryja came up with.

00:33:36.790 --> 00:33:41.230
<v Aaron van Wirdum>Wait, you're being modest probably, but are you saying, did you invent this? Was

00:33:41.230 --> 00:33:42.250
<v Aaron van Wirdum>it your original idea?

00:33:42.450 --> 00:33:47.410
<v Ruben Somsen>I don't think, because it's literally just, yes, I'm probably the first person

00:33:47.410 --> 00:33:53.410
<v Ruben Somsen>who mentioned it, but it wasn't an invention, I would say, because it's

00:33:53.410 --> 00:33:58.930
<v Ruben Somsen>literally just you're taking adaptor signatures, which was invented, I guess, by

00:33:58.930 --> 00:34:03.800
<v Ruben Somsen>Andrew Poelstra, and applying it to the DLC protocol. And there's nothing, like

00:34:03.800 --> 00:34:09.120
<v Ruben Somsen>it's a very straightforward one-to-one conversion. So I guess I'm the first

00:34:09.120 --> 00:34:14.240
<v Ruben Somsen>person who maybe saw the connection, maybe. I'm sure other people must have seen

00:34:14.240 --> 00:34:17.740
<v Ruben Somsen>it too, but just didn't mention it. I'm at least maybe the first person to

00:34:17.740 --> 00:34:19.540
<v Ruben Somsen>actually mention it. Let's put it like that.

00:34:19.720 --> 00:34:22.780
<v Aaron van Wirdum>Okay, so let's start at the beginning. Adaptor signatures, what are they?

00:34:23.520 --> 00:34:28.870
<v Ruben Somsen>So adaptor signatures at a high level, the way I would explain them is that it's

00:34:28.870 --> 00:34:33.930
<v Ruben Somsen>a way to do a signature that is incomplete. So you create a signature, but it's

00:34:33.930 --> 00:34:39.550
<v Ruben Somsen>not actually valid. It's missing something. And what it's missing, you

00:34:39.550 --> 00:34:44.130
<v Ruben Somsen>can know the public key of what is missing. So there's a number that is missing.

00:34:44.630 --> 00:34:50.310
<v Ruben Somsen>That number is basically a private key, but you only know the public key of what

00:34:50.310 --> 00:34:54.970
<v Ruben Somsen>is missing. So if someone reveals the private key, then you can complete the

00:34:54.970 --> 00:34:57.430
<v Ruben Somsen>signature. And now the signature becomes valid.

00:34:58.160 --> 00:35:03.940
<v Aaron van Wirdum>Right, I see. I think when I was trying to summarize DLCs earlier, this was

00:35:03.940 --> 00:35:07.340
<v Aaron van Wirdum>kind of what I had in mind. Okay, but this is actually what that is.

00:35:07.440 --> 00:35:07.700
<v Ruben Somsen>Yes.

00:35:07.820 --> 00:35:08.320
<v Aaron van Wirdum>All right, got it.

00:35:08.460 --> 00:35:13.140
<v Ruben Somsen>And it makes a whole lot of sense because it makes things a lot easier. So what

00:35:13.140 --> 00:35:17.220
<v Ruben Somsen>we had earlier was this mechanism where you publish a transaction. If you publish

00:35:17.220 --> 00:35:21.720
<v Ruben Somsen>the wrong transaction, you get punished. And now we can basically get rid of that

00:35:21.720 --> 00:35:25.300
<v Ruben Somsen>with adaptor signatures because what we can do is we can again start from our two

00:35:25.300 --> 00:35:29.920
<v Ruben Somsen>of two multisig that me and Sjors have. And then we can create a bunch of

00:35:29.920 --> 00:35:34.660
<v Ruben Somsen>transactions, in this case, two transactions, right? Sjors wins or I win. We put

00:35:34.660 --> 00:35:38.900
<v Ruben Somsen>our signature on that transaction, but we do it in such a way that it's

00:35:38.900 --> 00:35:44.440
<v Ruben Somsen>incomplete. We do it with an adaptor signature. And the signature where Sjors

00:35:44.440 --> 00:35:48.780
<v Ruben Somsen>wins can be completed if the Oracle signs Germany wins.

00:35:48.980 --> 00:35:49.160
<v Aaron van Wirdum>Right.

00:35:49.440 --> 00:35:54.700
<v Ruben Somsen>And my transaction... that signature can be completed if the oracle signs the

00:35:54.700 --> 00:36:00.160
<v Ruben Somsen>Netherlands wins. And now we, we completely circumvent that issue of having to go

00:36:00.160 --> 00:36:04.760
<v Ruben Somsen>back and having to punish, uh, if Sjors publish the wrong transaction, having to

00:36:04.760 --> 00:36:07.600
<v Ruben Somsen>publish him, because he can't publish his transaction because the oracle never

00:36:07.600 --> 00:36:09.840
<v Ruben Somsen>revealed, uh, that secret.

00:36:09.840 --> 00:36:14.520
<v Aaron van Wirdum>Right, so, so in the previous example I explained that's like in a payment

00:36:14.520 --> 00:36:18.400
<v Aaron van Wirdum>channel both of you essentially have a mirror version of the transaction. Yeah,

00:36:18.400 --> 00:36:22.200
<v Aaron van Wirdum>you both have sort of your own version of the transaction. And then you publish

00:36:22.200 --> 00:36:25.360
<v Aaron van Wirdum>that. And then from that transaction, you can withdraw the funds. And in this

00:36:25.360 --> 00:36:29.300
<v Aaron van Wirdum>case, you still kind of have these mirror versions of the transactions. However,

00:36:29.420 --> 00:36:33.600
<v Aaron van Wirdum>you can't even publish it in the first place if you don't have the adaptor

00:36:33.600 --> 00:36:34.620
<v Aaron van Wirdum>signature. Is that right?

00:36:34.800 --> 00:36:38.260
<v Sjors Provoost>And that's also because the inputs are different in this case. So in the previous

00:36:38.260 --> 00:36:42.360
<v Sjors Provoost>thing that we described are basically the money that takes it out of the

00:36:42.360 --> 00:36:47.490
<v Sjors Provoost>multisig, the transaction that takes it out of the multisig is the same. The

00:36:47.490 --> 00:36:50.630
<v Sjors Provoost>input side of the transaction is the same. It has the same signatures,

00:36:50.850 --> 00:36:54.330
<v Sjors Provoost>essentially, because it's just taking out of a regular multisig. And what adaptor

00:36:54.330 --> 00:36:59.830
<v Sjors Provoost>signatures do is they kind of create broken signatures to get it out of the

00:36:59.830 --> 00:37:03.730
<v Sjors Provoost>multisig. So you're not actually getting it out of the multisig, but once you've

00:37:03.730 --> 00:37:07.340
<v Sjors Provoost>got it out of the multisig, you can just send it straight to your own wallet. The

00:37:07.340 --> 00:37:12.020
<v Sjors Provoost>only thing is you can't get it out of the multisig, because you need this thing

00:37:12.020 --> 00:37:16.540
<v Sjors Provoost>from the Oracle. And we both do this. We both have this broken transaction that

00:37:16.540 --> 00:37:20.960
<v Sjors Provoost>cannot spend any coins. And then we just hope that we get the private key.

00:37:21.300 --> 00:37:21.400
<v Ruben Somsen>Yeah.

00:37:21.640 --> 00:37:24.600
<v Sjors Provoost>So there's nothing we need to keep secret for each other. Well, except, you know,

00:37:24.660 --> 00:37:26.320
<v Sjors Provoost>our own private keys, but yes.

00:37:26.860 --> 00:37:30.700
<v Aaron van Wirdum>Right. Yeah. So this does sound like a streamlined version of the previous

00:37:30.700 --> 00:37:35.720
<v Aaron van Wirdum>example. So in this case, to clarify this, if I'm getting it right, is the

00:37:35.720 --> 00:37:41.230
<v Aaron van Wirdum>Netherlands won, the FIFA broadcasts a message that says the Netherlands won

00:37:41.230 --> 00:37:46.230
<v Aaron van Wirdum>and this time you actually use that message itself, Ruben, to combine that with

00:37:46.870 --> 00:37:47.850
<v Aaron van Wirdum>your own signature.

00:37:48.430 --> 00:37:52.410
<v Ruben Somsen>Yeah, and Sjors's signature specifically, right? Because that's the one I need to

00:37:52.410 --> 00:37:55.990
<v Ruben Somsen>complete. I can complete my own signature. That's not hard because I have my own

00:37:55.990 --> 00:38:00.030
<v Ruben Somsen>key. But Sjors also had to put a signature on that transaction and that's the one

00:38:00.030 --> 00:38:00.630
<v Ruben Somsen>I want to complete.

00:38:00.850 --> 00:38:05.210
<v Aaron van Wirdum>Right. Yeah. When I said your signature, I kind of meant the transaction that

00:38:05.210 --> 00:38:06.750
<v Aaron van Wirdum>you're holding. Is that right? Yeah.

00:38:06.890 --> 00:38:07.050
<v Ruben Somsen>Yes.

00:38:07.210 --> 00:38:12.360
<v Aaron van Wirdum>But it is technically Sjors's signature. Right. Got it. All right. Is there

00:38:12.360 --> 00:38:16.960
<v Aaron van Wirdum>anything else? Do you want to get into the P's and the G's and the math like you

00:38:16.960 --> 00:38:17.380
<v Aaron van Wirdum>did before?

00:38:17.580 --> 00:38:20.940
<v Sjors Provoost>No, we try to. And I think conceptually, you know, it's again, you just have an

00:38:20.940 --> 00:38:23.500
<v Sjors Provoost>equation with something on the left and something on the right. And you can see

00:38:23.500 --> 00:38:27.020
<v Sjors Provoost>what the Oracle knows and what you know. And that's all straightforward. The only

00:38:27.020 --> 00:38:30.400
<v Sjors Provoost>thing I got confused of is because, you know, we're doing this fancy

00:38:30.400 --> 00:38:34.540
<v Sjors Provoost>Lightning-like thing. The multisig, the transaction that goes out of the multisig

00:38:34.540 --> 00:38:40.460
<v Sjors Provoost>is a joint, sort of a joint signature with something like MuSig2 as a protocol.

00:38:40.820 --> 00:38:41.340
<v Ruben Somsen>Ideally.

00:38:41.600 --> 00:38:45.520
<v Sjors Provoost>And I was wondering whether you can actually combine that with this, with this

00:38:45.520 --> 00:38:45.960
<v Sjors Provoost>moon math.

00:38:46.200 --> 00:38:46.480
<v Ruben Somsen>Yeah.

00:38:46.600 --> 00:38:48.500
<v Sjors Provoost>And I'm pretty sure the answer is yes.

00:38:48.800 --> 00:38:49.100
<v Ruben Somsen>Yeah.

00:38:49.160 --> 00:38:52.680
<v Sjors Provoost>And then you think the answer is super straightforward. Yes. And I looked at

00:38:52.680 --> 00:38:56.380
<v Sjors Provoost>some, some comments by Nick. What's his last name?

00:38:58.560 --> 00:38:59.800
<v Ruben Somsen>Jonas. Jonas Nick.

00:38:59.920 --> 00:39:03.960
<v Sjors Provoost>Jonas Nick from Blockstream. And he said complicated things about security

00:39:03.960 --> 00:39:05.500
<v Sjors Provoost>proofs, but he also said it was possible.

00:39:06.120 --> 00:39:06.600
<v Ruben Somsen>Yeah.

00:39:07.100 --> 00:39:12.560
<v Sjors Provoost>So maybe that, you know, you want to talk to your local cryptographer before

00:39:12.560 --> 00:39:13.420
<v Sjors Provoost>implementing something.

00:39:13.600 --> 00:39:15.820
<v Ruben Somsen>That is always wise, for sure.

00:39:16.000 --> 00:39:18.800
<v Sjors Provoost>That is always wise. Okay, but that's pretty much...

00:39:18.800 --> 00:39:20.100
<v Aaron van Wirdum>Yeah, I do have one more question.

00:39:20.220 --> 00:39:21.320
<v Sjors Provoost>Oh, no, we have a bonus section.

00:39:21.500 --> 00:39:21.600
<v Ruben Somsen>Yeah.

00:39:21.840 --> 00:39:26.320
<v Aaron van Wirdum>Well, you touched on this throughout the episode at some point, but I do want to

00:39:26.320 --> 00:39:29.760
<v Aaron van Wirdum>get back to this point towards the end, which is now.

00:39:29.960 --> 00:39:30.080
<v Ruben Somsen>Yeah.

00:39:30.960 --> 00:39:35.080
<v Aaron van Wirdum>So in the example so far, we've used this very simple bet of the Netherlands

00:39:35.080 --> 00:39:40.900
<v Aaron van Wirdum>versus Germany. But now we want to bet on something like the price of Bitcoin

00:39:40.900 --> 00:39:44.890
<v Aaron van Wirdum>in the future. So now there's not two outcomes, but there's... I don't know.

00:39:46.230 --> 00:39:47.210
<v Aaron van Wirdum>Unlimited? Endless?

00:39:47.470 --> 00:39:48.510
<v Sjors Provoost>No, not endless, but N.

00:39:49.090 --> 00:39:54.950
<v Aaron van Wirdum>N. Oh, yeah, sure. So how would this translate to these solutions? How are we going to...

00:39:54.950 --> 00:40:00.890
<v Sjors Provoost>Well, naively, if you say you want to do the dollar price, and let's say it's a

00:40:00.890 --> 00:40:05.430
<v Sjors Provoost>five-digit binary number, just to make it simple and to sort of anticipate where

00:40:05.430 --> 00:40:10.850
<v Sjors Provoost>we're going. So that's not a huge precision, but that's fine. For every

00:40:10.850 --> 00:40:16.750
<v Sjors Provoost>combination, so for 2 to the power of 5, that's the number of combinations,

00:40:16.750 --> 00:40:21.710
<v Sjors Provoost>we would write a contract that redeems the correct amount for me and the correct

00:40:21.710 --> 00:40:26.930
<v Sjors Provoost>amount for Ruben. So this is no longer completely binary, but if the dollar price

00:40:26.930 --> 00:40:32.630
<v Sjors Provoost>is 00001, then you get a little bit of satoshi. If the dollar price is 1000,

00:40:33.490 --> 00:40:37.210
<v Sjors Provoost>you get more satoshi. That's the idea. So we could just sign all these

00:40:37.210 --> 00:40:41.790
<v Sjors Provoost>transactions. But if you want to have a bit more precision, we have to pre-sign a

00:40:41.790 --> 00:40:45.530
<v Sjors Provoost>lot of transactions. But for the Oracle's point of view, it's very simple. The

00:40:45.530 --> 00:40:49.410
<v Sjors Provoost>Oracle just produces, publishes a binary number and signs that.

00:40:50.480 --> 00:40:51.000
<v Aaron van Wirdum>All right.

00:40:51.340 --> 00:40:52.440
<v Sjors Provoost>That's one way to do it.

00:40:52.520 --> 00:40:55.800
<v Aaron van Wirdum>The Oracle, in this case, would only have to sign one message. For the Oracle

00:40:55.800 --> 00:40:59.980
<v Aaron van Wirdum>nothing changes. It's very simple. However, the two of you would need to do a lot

00:40:59.980 --> 00:41:02.060
<v Aaron van Wirdum>more preparation for all the different amounts.

00:41:02.260 --> 00:41:05.820
<v Sjors Provoost>And this works with both the proposals we just talked about, right? With the

00:41:05.820 --> 00:41:08.960
<v Sjors Provoost>adaptor signatures, but also without the adaptor signatures.

00:41:10.170 --> 00:41:11.250
<v Sjors Provoost>But we can do better.

00:41:12.910 --> 00:41:18.810
<v Ruben Somsen>Yeah, so hopefully I'm not lost here. But OK, so what you

00:41:18.810 --> 00:41:24.770
<v Ruben Somsen>described thus far is you just get the Oracle to sign a specific number, and that

00:41:24.770 --> 00:41:26.030
<v Ruben Somsen>number is in binary in this case.

00:41:26.250 --> 00:41:29.770
<v Sjors Provoost>Yeah, I already made it in binary, so it's easier to introduce your optimization.

00:41:34.400 --> 00:41:39.800
<v Ruben Somsen>In this case, you could have every possible number. So five bits would be 32

00:41:39.800 --> 00:41:44.760
<v Ruben Somsen>possible outcomes. So you could have 32 transactions that with each and every

00:41:44.760 --> 00:41:48.620
<v Ruben Somsen>outcome, Sjors and I get a different amount of Bitcoin depending on the bet

00:41:48.620 --> 00:41:50.760
<v Ruben Somsen>outcome. That's what you described thus far basically, right?

00:41:50.940 --> 00:41:51.080
<v Sjors Provoost>Yeah.

00:41:51.320 --> 00:41:57.220
<v Ruben Somsen>Okay. Yeah. So the thing that the Oracle can do is literally sign every bit.

00:41:57.360 --> 00:42:02.070
<v Ruben Somsen>So there are five bits in this example. And the bit can be either one or it can

00:42:02.070 --> 00:42:07.290
<v Ruben Somsen>be zero. So there are 10 possible outcomes that the Oracle can basically sign.

00:42:08.310 --> 00:42:13.750
<v Ruben Somsen>And out of those 10 outcomes, it is only allowed to sign five of them because we

00:42:13.750 --> 00:42:17.630
<v Ruben Somsen>use the same trick where if it signs something twice, you can punish the Oracle.

00:42:17.790 --> 00:42:23.550
<v Ruben Somsen>So for every bit, it can sign either zero or a one, but never both. Because if it

00:42:23.550 --> 00:42:27.790
<v Ruben Somsen>signs both, then we can punish the Oracle because we get their key. And so

00:42:27.790 --> 00:42:32.470
<v Ruben Somsen>basically we get the Oracle to publish these five numbers, which is the binary

00:42:32.470 --> 00:42:37.310
<v Ruben Somsen>outcome of the dollar amount that we want. And with that,

00:42:38.400 --> 00:42:42.240
<v Ruben Somsen>Sjors and I can now create our transactions that we want to create to resolve our

00:42:42.240 --> 00:42:46.440
<v Ruben Somsen>bets. But we can now, because we have the binary number, we can actually do some

00:42:46.440 --> 00:42:52.190
<v Ruben Somsen>cool stuff with it. What we can do is, so hopefully this is

00:42:52.190 --> 00:42:57.900
<v Ruben Somsen>followable. I'm not sure if this is going to be easy, but basically, we have five

00:42:57.900 --> 00:43:03.180
<v Ruben Somsen>bits and let's say my bet number was, like the bet is that if it's seven or

00:43:03.180 --> 00:43:06.140
<v Ruben Somsen>higher, I win, for instance.

00:43:06.500 --> 00:43:10.620
<v Sjors Provoost>Yeah, that's what I was wrong in my example because I made it like a dollar

00:43:10.620 --> 00:43:13.640
<v Sjors Provoost>derivative. But in this case, it's more like if it's more than, if the dollar

00:43:13.640 --> 00:43:18.390
<v Sjors Provoost>price is more than one satoshi, you win, or if it's less than one satoshi, I win.

00:43:18.490 --> 00:43:20.290
<v Sjors Provoost>But we want the dollar price with high precision.

00:43:20.530 --> 00:43:26.170
<v Ruben Somsen>Yeah, but you could still have a bet where it's like between three and seven, we

00:43:26.170 --> 00:43:29.370
<v Ruben Somsen>get paid out different amounts. And seven or more, I get paid out everything.

00:43:29.690 --> 00:43:31.150
<v Ruben Somsen>Three or less, you get paid out everything.

00:43:31.450 --> 00:43:36.890
<v Sjors Provoost>Yeah, the key here is that the Oracle does not want to make a custom bet for

00:43:36.890 --> 00:43:40.890
<v Sjors Provoost>everybody. It just wants to publish the actual dollar price. It doesn't care what

00:43:40.890 --> 00:43:43.630
<v Sjors Provoost>ranges you have in mind. So, yeah.

00:43:44.060 --> 00:43:48.300
<v Ruben Somsen>So the nice thing is that you can sort of have these, you can have multiple

00:43:48.300 --> 00:43:52.860
<v Ruben Somsen>outcomes. You can combine them in a single bet by just adding the points

00:43:52.860 --> 00:43:58.770
<v Ruben Somsen>together. So in this case, what we could do is if we want

00:43:58.770 --> 00:44:04.230
<v Ruben Somsen>the outcome seven specifically, that means that the first three bits, the lowest

00:44:04.230 --> 00:44:10.010
<v Ruben Somsen>three bits have to be one. And so we can make an outcome where we just combine

00:44:10.010 --> 00:44:14.630
<v Ruben Somsen>the key for first bit is one, second bit is one, third bit is one. We combine

00:44:14.630 --> 00:44:20.570
<v Ruben Somsen>those three. And that, if the Oracle reveals all three, then that specific bet

00:44:20.570 --> 00:44:21.550
<v Ruben Somsen>outcome becomes valid.

00:44:21.650 --> 00:44:22.870
<v Sjors Provoost>And that means seven or higher.

00:44:23.650 --> 00:44:28.370
<v Ruben Somsen>So in this case, what I described thus far is just seven. If we want seven or

00:44:28.370 --> 00:44:33.430
<v Ruben Somsen>higher, then we need another transaction where we say, or

00:44:34.080 --> 00:44:38.760
<v Ruben Somsen>instead of the first three bits, it's also okay if the Oracle signed the fourth

00:44:38.760 --> 00:44:42.240
<v Ruben Somsen>bit, or it's also okay if the Oracle signed the fifth bit.

00:44:42.380 --> 00:44:45.240
<v Sjors Provoost>Yeah, so maybe we can make the example a little bit simpler if we wanted to say

00:44:45.240 --> 00:44:46.220
<v Sjors Provoost>one or higher.

00:44:47.700 --> 00:44:52.560
<v Ruben Somsen>Yeah, that works. Well, then if it's one or higher...

00:44:52.560 --> 00:44:58.470
<v Sjors Provoost>Then you can basically say if the first bit is signed, then you win. Basically,

00:44:58.670 --> 00:44:59.890
<v Sjors Provoost>regardless of what the other bits are.

00:45:00.450 --> 00:45:05.330
<v Ruben Somsen>Well, no, not regardless of what the other bits are, because if the second bit is

00:45:05.330 --> 00:45:09.640
<v Ruben Somsen>signed, if the answer is two, then the first bit is zero. So that's not

00:45:09.640 --> 00:45:10.280
<v Ruben Somsen>sufficient.

00:45:10.540 --> 00:45:11.460
<v Sjors Provoost>Ah, crap. Yeah.

00:45:12.200 --> 00:45:14.480
<v Ruben Somsen>So that's the problem. So it is quite complicated.

00:45:14.580 --> 00:45:18.400
<v Sjors Provoost>Anyway, you can basically say, like, if these and these bits are signed, that

00:45:18.400 --> 00:45:19.760
<v Sjors Provoost>means this and this number range.

00:45:19.920 --> 00:45:20.140
<v Ruben Somsen>Yeah.

00:45:20.360 --> 00:45:25.100
<v Sjors Provoost>You can make bets like that, and each digit represents a public key, essentially.

00:45:25.260 --> 00:45:29.700
<v Sjors Provoost>So before, the Oracle had only one public key. Now the Oracle might have, I don't

00:45:29.700 --> 00:45:32.160
<v Sjors Provoost>know, how many bits you want. Maybe they have 32 public keys.

00:45:32.320 --> 00:45:32.520
<v Ruben Somsen>Yeah.

00:45:32.680 --> 00:45:36.930
<v Sjors Provoost>And so you can actually make a smart contract, quote, unquote, that... that says

00:45:36.930 --> 00:45:41.280
<v Sjors Provoost>something about which public keys have to be present. And this is very cool.

00:45:41.600 --> 00:45:46.120
<v Ruben Somsen>Yeah. And so this is why this is a bonus segment, basically, because it is

00:45:46.120 --> 00:45:50.560
<v Ruben Somsen>complicated. And I'm sure we're losing a lot of the audience. But for those who

00:45:50.560 --> 00:45:55.380
<v Ruben Somsen>are still with us, basically, really at a high level, what we've been describing

00:45:55.380 --> 00:46:00.760
<v Ruben Somsen>here is that you can have these and and or statements with the oracles. So you

00:46:00.760 --> 00:46:05.300
<v Ruben Somsen>can even combine multiple oracle outcomes. And you can say this and this and this

00:46:05.300 --> 00:46:07.220
<v Ruben Somsen>outcome and this and this and this outcome,

00:46:08.710 --> 00:46:12.570
<v Ruben Somsen>or this and this and this and this. And you can basically make a whole bunch of

00:46:12.570 --> 00:46:18.290
<v Ruben Somsen>bets based on whatever you want. So it just allows for a lot of custom

00:46:18.290 --> 00:46:22.850
<v Ruben Somsen>contracts, whereas the Oracle itself doesn't have to do a lot of complex things.

00:46:22.910 --> 00:46:24.990
<v Ruben Somsen>It just has to sign the outcome in binary.

00:46:25.880 --> 00:46:30.230
<v Sjors Provoost>Exactly. And I guess we're not even going to explain anything about it because I

00:46:30.230 --> 00:46:33.170
<v Sjors Provoost>haven't even read it. But the bonus, bonus, bonus, bonus section would be that

00:46:33.170 --> 00:46:38.990
<v Sjors Provoost>with OP_CTV, this template thing where you can pre-commit to a whole series of

00:46:38.990 --> 00:46:41.970
<v Sjors Provoost>child transactions, you can do even fancier things.

00:46:42.230 --> 00:46:45.010
<v Ruben Somsen>Yeah. So I can maybe very briefly try to summarize it.

00:46:46.330 --> 00:46:49.810
<v Ruben Somsen>Basically what we've done so far is we've been pre-signing all these

00:46:49.810 --> 00:46:53.490
<v Ruben Somsen>transactions. And if you have a lot of bet outcomes, that's a lot of signatures,

00:46:54.310 --> 00:46:58.930
<v Ruben Somsen>and you can sort of get rid of those signatures by using OP_CTV, because OP_CTV

00:46:58.930 --> 00:47:04.510
<v Ruben Somsen>you can have, in tapscripts, you can have a bunch of OP_CTV branches. And then

00:47:04.510 --> 00:47:08.990
<v Ruben Somsen>every branch commits to a different oracle outcome, and then together with the

00:47:08.990 --> 00:47:12.950
<v Ruben Somsen>signature of the oracle for that specific outcome you can publish that specific

00:47:12.950 --> 00:47:17.690
<v Ruben Somsen>OP_CTV branch. And what that means is that you only have to sign one specific

00:47:17.690 --> 00:47:23.420
<v Ruben Somsen>tapscript with one signature from both of us, and that commits to every possible

00:47:23.420 --> 00:47:29.020
<v Ruben Somsen>bet outcome. And so what that means is that it is just much faster to generate

00:47:29.020 --> 00:47:32.060
<v Ruben Somsen>our bets. Other than that, it doesn't really change anything.

00:47:33.010 --> 00:47:36.130
<v Sjors Provoost>Okay, I don't understand that, but maybe if I listen back to the episode, I will.

00:47:36.290 --> 00:47:37.050
<v Ruben Somsen>I'm sure someone will.

00:47:37.270 --> 00:47:37.930
<v Sjors Provoost>Okay, out there.

00:47:38.130 --> 00:47:44.030
<v Aaron van Wirdum>Back to Earth one last time. What's the status of all of these DLCs? Is anyone

00:47:44.030 --> 00:47:47.170
<v Aaron van Wirdum>working on this? Is there any progress?

00:47:48.270 --> 00:47:53.710
<v Ruben Somsen>So I know there's a work group that has a mailing list that you can follow. I

00:47:53.710 --> 00:47:59.610
<v Ruben Somsen>think it's DLC-dev, but you'd have to Google for that. I

00:47:59.610 --> 00:48:03.450
<v Ruben Somsen>know Chris Stewart is working on it. Lloyd Fournier is working on it.

00:48:05.140 --> 00:48:06.020
<v Ruben Somsen>Lloyd Fournier.

00:48:06.240 --> 00:48:06.520
<v Aaron van Wirdum>Okay.

00:48:06.940 --> 00:48:12.900
<v Ruben Somsen>He actually, he came up with a way to do adaptor signatures for ECDSA. So

00:48:12.900 --> 00:48:16.620
<v Ruben Somsen>that's sort of the kind of the way in which it's being used today. Even though we

00:48:16.620 --> 00:48:21.160
<v Ruben Somsen>have Schnorr, I don't think the DLC project has switched from ECDSA to Schnorr

00:48:21.160 --> 00:48:27.030
<v Ruben Somsen>yet. So I would check out their projects. I think it's DLCS, I

00:48:27.030 --> 00:48:32.670
<v Ruben Somsen>think is Chris Stewart's project. And I know Lloyd Fournier has gun.fun,

00:48:32.870 --> 00:48:38.110
<v Ruben Somsen>which is a very funny name. But he has a little DLC project where he can

00:48:38.110 --> 00:48:43.930
<v Ruben Somsen>basically create a bet and you can publish it on Twitter. And he sort of came

00:48:43.930 --> 00:48:49.410
<v Ruben Somsen>up with a way to sort of encode it in Twitter. So it's quite a bit of data,

00:48:49.790 --> 00:48:53.610
<v Ruben Somsen>but it fits into a tweet because it uses all these weird characters. It's a fun

00:48:53.610 --> 00:48:56.610
<v Ruben Somsen>little project. So if you want to mess around with it, I definitely recommend

00:48:56.610 --> 00:48:57.370
<v Ruben Somsen>that one.

00:48:58.160 --> 00:49:02.900
<v Aaron van Wirdum>Yeah, I think Nicolas Dorier is also working on something. I think it's called

00:49:02.900 --> 00:49:03.840
<v Aaron van Wirdum>NDLC.

00:49:04.240 --> 00:49:06.980
<v Ruben Somsen>Oh, okay. I'm not familiar with that, but that's cool.

00:49:07.550 --> 00:49:12.550
<v Aaron van Wirdum>Yeah, they did it. He used that, and Chris Stewart used his own implementation, I

00:49:12.550 --> 00:49:16.730
<v Aaron van Wirdum>guess. They've done this one bet on the presidency, on the presidential elections

00:49:16.730 --> 00:49:21.810
<v Aaron van Wirdum>last year, a year ago. That's the only example that I know of that it was

00:49:21.810 --> 00:49:24.830
<v Aaron van Wirdum>actually used in some way or another.

00:49:25.050 --> 00:49:29.290
<v Ruben Somsen>Yeah. I used both projects on test nets, but not main nets.

00:49:29.530 --> 00:49:32.430
<v Aaron van Wirdum>Right. Well, I think that covers it.

00:49:32.670 --> 00:49:33.510
<v Sjors Provoost>I think so too.

00:49:34.590 --> 00:49:38.170
<v Aaron van Wirdum>Ruben, thanks a lot for coming again. I don't think we could have done this

00:49:38.170 --> 00:49:38.750
<v Aaron van Wirdum>without you.

00:49:38.670 --> 00:49:39.530
<v Ruben Somsen>It was a…

00:49:39.530 --> 00:49:40.570
<v Sjors Provoost>Sure, we could not have.

00:49:40.810 --> 00:49:45.530
<v Ruben Somsen>It was a tough one, yeah, for sure. It's hard to explain it as well. But I think

00:49:45.530 --> 00:49:48.370
<v Ruben Somsen>we did a decent job, even though I'm sure not everything was clear.

00:49:49.290 --> 00:49:50.790
<v Sjors Provoost>At least I understand it better.

00:49:51.170 --> 00:49:51.310
<v Ruben Somsen>Great.

00:49:51.970 --> 00:49:52.810
<v Aaron van Wirdum>So do I, Sjors.

00:49:53.210 --> 00:49:53.810
<v Sjors Provoost>So that's good.

00:49:54.690 --> 00:49:56.030
<v Aaron van Wirdum>We won something today.

00:49:56.650 --> 00:50:01.430
<v Sjors Provoost>All righty. In that case, thank you for listening to Bitcoin Explained.

00:50:01.610 --> 00:50:02.270
<v Aaron van Wirdum>There you go.

