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

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

00:00:08.540 --> 00:00:08.860
<v Sjors Provoost>Hello.

00:00:09.380 --> 00:00:14.220
<v Aaron van Wirdum>[imitates tornado warning] That's my impression of a tornado warning.

00:00:14.720 --> 00:00:15.200
<v Sjors Provoost>Oh, okay.

00:00:15.740 --> 00:00:17.180
<v Aaron van Wirdum>That's probably how they sound, right?

00:00:17.360 --> 00:00:18.340
<v Sjors Provoost>I don't know, I've never heard one.

00:00:18.500 --> 00:00:21.520
<v Aaron van Wirdum>Me neither. Sjors, we're going to make a podcast.

00:00:21.940 --> 00:00:22.300
<v Sjors Provoost>Yes.

00:00:22.760 --> 00:00:26.540
<v Aaron van Wirdum>I suggest, since this is our first episode, we first introduce ourselves.

00:00:27.120 --> 00:00:27.480
<v Sjors Provoost>Sure.

00:00:27.680 --> 00:00:28.420
<v Aaron van Wirdum>Who are you, Sjors?

00:00:28.580 --> 00:00:32.600
<v Sjors Provoost>I'm Sjors. I work on Bitcoin Core and other hobbies.

00:00:34.120 --> 00:00:36.440
<v Sjors Provoost>I live in Utrecht, as do you.

00:00:37.620 --> 00:00:43.020
<v Aaron van Wirdum>Yep, I'm Aaron van Wirdum. I'm the technical editor at Bitcoin Magazine. And what

00:00:43.020 --> 00:00:48.820
<v Aaron van Wirdum>we're going to do basically is discuss technical news, technical stuff, Bitcoin

00:00:48.820 --> 00:00:50.120
<v Aaron van Wirdum>-related technical stuff.

00:00:50.360 --> 00:00:50.740
<v Sjors Provoost>Yes.

00:00:51.140 --> 00:00:51.480
<v Aaron van Wirdum>Correct?

00:00:52.040 --> 00:00:52.560
<v Sjors Provoost>Sounds right.

00:00:53.230 --> 00:00:55.550
<v Aaron van Wirdum>I think we can just start then.

00:00:55.950 --> 00:00:56.530
<v Sjors Provoost>All right.

00:00:57.030 --> 00:01:02.640
<v Aaron van Wirdum>So we got two topics this episode. See how that goes. First topic is the...

00:01:03.270 --> 00:01:07.250
<v Aaron van Wirdum>Well, there wasn't apparently an official name for it or if there was we couldn't

00:01:07.250 --> 00:01:08.830
<v Aaron van Wirdum>find it but the Fee Burning Bug?

00:01:09.070 --> 00:01:10.330
<v Sjors Provoost>Yeah, we call it the Fee Burning Bug.

00:01:10.350 --> 00:01:11.410
<v Aaron van Wirdum>That's how we're calling it, right?

00:01:12.700 --> 00:01:17.680
<v Aaron van Wirdum>So that was a big issue with hardware wallets in particular.

00:01:18.430 --> 00:01:21.310
<v Aaron van Wirdum>It is a bit windy here which is fitting for our name.

00:01:21.690 --> 00:01:24.650
<v Sjors Provoost>Exactly. I'm trying to keep the wind from the microphone.

00:01:25.040 --> 00:01:30.220
<v Aaron van Wirdum>So there was a big issue which related to hardware wallets specifically, I think,

00:01:30.760 --> 00:01:36.100
<v Aaron van Wirdum>a new bug, or at least sort of new, and the problem was that

00:01:36.710 --> 00:01:42.590
<v Aaron van Wirdum>an unknowing victim could overpay in fees and therefore lose money, right?

00:01:42.890 --> 00:01:44.430
<v Sjors Provoost>That's the synopsis of it.

00:01:44.590 --> 00:01:49.320
<v Aaron van Wirdum>Okay, so let's start from the beginning. What is this bug? How does it happen?

00:01:49.760 --> 00:01:53.060
<v Sjors Provoost>Well, we can go back a little bit further in history to talk about a similar bug,

00:01:53.260 --> 00:01:58.960
<v Sjors Provoost>which people thought was completely fixed, but it wasn't. So if you have a

00:01:58.960 --> 00:02:03.440
<v Sjors Provoost>Bitcoin transaction, it has... a bunch of inputs that you're spending from, and

00:02:03.440 --> 00:02:05.860
<v Sjors Provoost>it has a bunch of outputs that you're spending to.

00:02:06.460 --> 00:02:10.080
<v Aaron van Wirdum>Yeah, so the inputs are basically the addresses, your addresses that you're

00:02:10.080 --> 00:02:13.600
<v Aaron van Wirdum>sending the coins from, and the outputs refer to the addresses that you're going to, right?

00:02:13.600 --> 00:02:17.260
<v Sjors Provoost>Yeah, assuming Luke Dashjr isn't listening to that first part, what you said, but

00:02:17.260 --> 00:02:17.920
<v Sjors Provoost>basically.

00:02:18.960 --> 00:02:19.380
<v Aaron van Wirdum>Right.

00:02:20.960 --> 00:02:23.500
<v Aaron van Wirdum>I'm simplifying a bit. That's sort of my job, right?

00:02:23.560 --> 00:02:27.120
<v Sjors Provoost>But one thing that, you know, if you use a wallet, you'll see in a transaction is

00:02:27.120 --> 00:02:30.880
<v Sjors Provoost>a fee. But actually, if you look at the transaction on the blockchain, there's no

00:02:30.880 --> 00:02:35.540
<v Sjors Provoost>such thing as a fee in the transaction. It's just a difference between the inputs

00:02:35.540 --> 00:02:36.080
<v Sjors Provoost>and the outputs.

00:02:36.440 --> 00:02:39.940
<v Aaron van Wirdum>Yeah, so there's more coins going into the transaction than coming out of the

00:02:39.940 --> 00:02:44.580
<v Aaron van Wirdum>transaction, essentially. And that difference is something the miner can claim as a fee.

00:02:44.720 --> 00:02:48.930
<v Sjors Provoost>And the other thing is that a transaction output will say the amount. So the

00:02:48.930 --> 00:02:53.530
<v Sjors Provoost>transaction output might say, here's one BTC, but an input does not. An input

00:02:53.530 --> 00:02:57.650
<v Sjors Provoost>just says, take this previous transaction and spend it. And it's up to you,

00:02:57.750 --> 00:03:01.730
<v Sjors Provoost>again, to figure out how much that was, because it would be a waste of space to

00:03:01.730 --> 00:03:03.570
<v Sjors Provoost>put the amount in the blockchain twice.

00:03:05.430 --> 00:03:06.190
<v Sjors Provoost>Here's the problem.

00:03:06.370 --> 00:03:09.410
<v Aaron van Wirdum>The amount was already in the blockchain from the previous transaction. You're

00:03:09.410 --> 00:03:12.890
<v Aaron van Wirdum>just spending the coins from that transaction, and the only thing you really need

00:03:12.890 --> 00:03:16.470
<v Aaron van Wirdum>to know is the new amount, because then the difference, you know, you can just

00:03:16.470 --> 00:03:18.890
<v Aaron van Wirdum>look at a previous transaction, usually at least.

00:03:19.150 --> 00:03:23.270
<v Sjors Provoost>Yeah, and so when you make a new transaction, when you have a wallet, say the

00:03:23.270 --> 00:03:28.810
<v Sjors Provoost>Bitcoin Core wallet, you enter a destination and an amount, and then what it's

00:03:28.810 --> 00:03:32.790
<v Sjors Provoost>going to do is it's going to look for coins, those are inputs basically, that add

00:03:32.790 --> 00:03:37.140
<v Sjors Provoost>up to at least the amount you need to spend, and then it adds a change to go back

00:03:37.140 --> 00:03:40.920
<v Sjors Provoost>to you. And that's fine because you're doing all the work and your wallet can

00:03:40.920 --> 00:03:45.580
<v Sjors Provoost>check it. But now let's say you want to be safe and you want to put your private

00:03:45.580 --> 00:03:50.240
<v Sjors Provoost>keys not on your computer, but you want to put them on a hardware wallet.

00:03:52.590 --> 00:03:56.930
<v Sjors Provoost>So then what happens is your computer produces a transaction without a signature,

00:03:57.150 --> 00:04:01.520
<v Sjors Provoost>gives it to the hardware wallet and says, go and sign this thing, please. Now,

00:04:01.600 --> 00:04:06.340
<v Sjors Provoost>the hardware wallet will look at it and say, okay, these are the outputs. I can

00:04:06.340 --> 00:04:09.580
<v Sjors Provoost>read that. But what about those inputs? I know nothing about them.

00:04:10.360 --> 00:04:13.700
<v Aaron van Wirdum>The hardware wallet has no idea about the inputs because the hardware wallet has

00:04:13.700 --> 00:04:15.260
<v Aaron van Wirdum>no idea about the blockchain overall.

00:04:15.640 --> 00:04:17.260
<v Sjors Provoost>Exactly, unless you tell it about it.

00:04:17.700 --> 00:04:17.840
<v Aaron van Wirdum>Right.

00:04:18.120 --> 00:04:24.040
<v Sjors Provoost>So let's say you just lie to the hardware wallet and say, look, you're spending

00:04:24.040 --> 00:04:26.760
<v Sjors Provoost>these two inputs. They're just half a Bitcoin.

00:04:28.140 --> 00:04:30.920
<v Sjors Provoost>And, you know, there's almost no fee on this thing.

00:04:32.310 --> 00:04:36.070
<v Sjors Provoost>Now, the hardware wallet, there's no way to check that. It used to have no way to

00:04:36.070 --> 00:04:40.470
<v Sjors Provoost>check that. And so it would just sign the transaction. And then, oops, turns out

00:04:40.470 --> 00:04:45.970
<v Sjors Provoost>you spent one Bitcoin in fees. That's quite annoying. And maybe some malware on

00:04:45.970 --> 00:04:47.210
<v Sjors Provoost>your computer was doing that to you.

00:04:48.830 --> 00:04:52.730
<v Sjors Provoost>So the solution to that is that you give the hardware wallet everything it needs

00:04:52.730 --> 00:04:55.240
<v Sjors Provoost>to check. And so you give it...

00:04:55.240 --> 00:04:59.360
<v Aaron van Wirdum>The reason, to hold on one second, the reason you would overpay in fees in that

00:04:59.360 --> 00:05:04.360
<v Aaron van Wirdum>scenario is because there would actually be more coins in your inputs than you're

00:05:04.360 --> 00:05:05.400
<v Aaron van Wirdum>telling your hardware wallet.

00:05:05.540 --> 00:05:09.000
<v Sjors Provoost>Exactly. So you might think you're spending half a Bitcoin, but actually the

00:05:09.000 --> 00:05:10.900
<v Sjors Provoost>coins that you're spending are worth one Bitcoin.

00:05:11.080 --> 00:05:13.600
<v Aaron van Wirdum>Right. And the hardware wallet just didn't know that because you lied to the

00:05:13.600 --> 00:05:14.020
<v Aaron van Wirdum>hardware wallet.

00:05:14.120 --> 00:05:16.880
<v Sjors Provoost>The hardware wallet can't tell the difference, so we'll just sign whatever.

00:05:17.240 --> 00:05:18.100
<v Aaron van Wirdum>So that's a problem.

00:05:18.420 --> 00:05:18.680
<v Sjors Provoost>Yes.

00:05:18.840 --> 00:05:19.340
<v Aaron van Wirdum>You don't want that.

00:05:19.340 --> 00:05:24.700
<v Sjors Provoost>But the signature describes... So you're signing a message, essentially, and the

00:05:24.700 --> 00:05:29.120
<v Sjors Provoost>message is the transaction. And the transaction, or part of the transaction, and

00:05:29.120 --> 00:05:32.520
<v Sjors Provoost>the transaction contains the inputs that you're spending, namely the transaction

00:05:32.520 --> 00:05:38.050
<v Sjors Provoost>hash and the position in that previous transaction. And so now

00:05:38.050 --> 00:05:42.690
<v Sjors Provoost>you could give the hardware wallet the actual transaction that you're spending from.

00:05:43.110 --> 00:05:44.450
<v Aaron van Wirdum>The previous transaction.

00:05:44.590 --> 00:05:48.030
<v Sjors Provoost>Yes, exactly. And that previous transaction, you can look at it and you can check

00:05:48.030 --> 00:05:52.870
<v Sjors Provoost>the hash. and you can check that the hash matches what's in the input, and you

00:05:52.870 --> 00:05:56.450
<v Sjors Provoost>can see what the output amounts are. So now you know that you're probably

00:05:56.450 --> 00:06:00.750
<v Sjors Provoost>spending an actual transaction that wasn't messed with, and you can check the

00:06:00.750 --> 00:06:04.530
<v Sjors Provoost>amount yourself. So that's basically how it worked. So you would just give the

00:06:04.530 --> 00:06:09.510
<v Sjors Provoost>hardware wallet all the inputs, and that's fine if it's small, but maybe you're

00:06:09.510 --> 00:06:15.110
<v Sjors Provoost>spending from a giant exchange payout. multiple kilobyte transaction and

00:06:15.110 --> 00:06:17.790
<v Sjors Provoost>you maybe you don't have a USB connection

00:06:17.790 --> 00:06:23.510
<v Aaron van Wirdum>but you are sending it through a QR code so space could be an issue. A hardware

00:06:23.510 --> 00:06:28.210
<v Aaron van Wirdum>wallet is basically a very weak computer and then you have to load all that

00:06:28.210 --> 00:06:31.670
<v Aaron van Wirdum>information into the very weak computer and it's a hassle and it can take a lot

00:06:31.670 --> 00:06:35.890
<v Aaron van Wirdum>of time if it's a big transaction or a lot of them so that's not ideal for

00:06:35.890 --> 00:06:36.570
<v Aaron van Wirdum>hardware wallets.

00:06:36.670 --> 00:06:40.840
<v Sjors Provoost>Yeah some of them are really really slow. They're using chips that were designed

00:06:40.840 --> 00:06:43.360
<v Sjors Provoost>in the dark ages, basically.

00:06:43.660 --> 00:06:45.240
<v Aaron van Wirdum>It's not really made for this type of stuff.

00:06:45.440 --> 00:06:47.960
<v Sjors Provoost>No, absolutely not. Anyhow,

00:06:49.600 --> 00:06:55.380
<v Sjors Provoost>so in came SegWit, and the idea was to say, okay, let's have the signature of the

00:06:55.380 --> 00:07:00.720
<v Sjors Provoost>transaction not just cover what coin you're spending, so not just the transaction

00:07:00.720 --> 00:07:06.670
<v Sjors Provoost>hash and the input number, but also the amount that you're spending. And then the

00:07:06.670 --> 00:07:12.510
<v Sjors Provoost>idea is that if you sign something, you actually add the amount before you sign

00:07:12.510 --> 00:07:18.410
<v Sjors Provoost>it. And then if somebody lied about the amount, well, then your transaction is

00:07:18.410 --> 00:07:19.750
<v Sjors Provoost>just going to be invalid on the blockchain.

00:07:20.130 --> 00:07:20.290
<v Aaron van Wirdum>Right.

00:07:20.290 --> 00:07:23.730
<v Sjors Provoost>So the hardware wallet will just sign it because it just sees an amount and it

00:07:23.730 --> 00:07:26.730
<v Sjors Provoost>says, okay, whatever. I haven't checked that amount because I haven't looked at

00:07:26.730 --> 00:07:30.530
<v Sjors Provoost>the previous transaction. But I'm going to sign it anyway because if the amount

00:07:30.530 --> 00:07:32.890
<v Sjors Provoost>is wrong, it's going to be invalid. So I don't really care.

00:07:33.310 --> 00:07:33.550
<v Aaron van Wirdum>Right.

00:07:34.160 --> 00:07:39.980
<v Sjors Provoost>And that's where the attack comes in that was discussed. And

00:07:39.980 --> 00:07:43.800
<v Sjors Provoost>it wasn't unknown. It just was considered a little bit contrived.

00:07:45.840 --> 00:07:51.820
<v Sjors Provoost>But here's what happened. Let's say you give... Well, a transaction has two

00:07:51.820 --> 00:07:57.700
<v Sjors Provoost>inputs. And one of them is half a Bitcoin and the other is half a Bitcoin.

00:07:58.320 --> 00:08:02.970
<v Sjors Provoost>But you're actually going to lie. your computer is going to lie to your hardware

00:08:02.970 --> 00:08:05.930
<v Sjors Provoost>wallet, and it's going to say, well, the first one is half a Bitcoin, and the

00:08:05.930 --> 00:08:08.670
<v Sjors Provoost>second one is just 0.01 Bitcoin, don't worry about it.

00:08:10.150 --> 00:08:13.290
<v Aaron van Wirdum>Yeah, so to be clear, the reason your computer would be lying to your hardware

00:08:13.290 --> 00:08:15.210
<v Aaron van Wirdum>wallet is because your computer was compromised.

00:08:15.390 --> 00:08:15.650
<v Sjors Provoost>Yes.

00:08:15.890 --> 00:08:19.590
<v Aaron van Wirdum>So, right, the idea behind hardware wallets sort of is that even if your computer

00:08:19.590 --> 00:08:23.310
<v Aaron van Wirdum>is compromised, you should be fine, but in this case...

00:08:23.310 --> 00:08:25.290
<v Sjors Provoost>Well, that's one way to look at hardware wallets, yeah.

00:08:25.930 --> 00:08:30.360
<v Aaron van Wirdum>There's some... There are still some attack factors of which is one and there are others.

00:08:30.720 --> 00:08:34.120
<v Sjors Provoost>If your computer is compromised, you have a very serious problem. But let's say

00:08:34.120 --> 00:08:38.140
<v Sjors Provoost>somehow the problem is limited to just this little thing that's going to happen now.

00:08:38.440 --> 00:08:41.520
<v Aaron van Wirdum>Right, so then your computer is lying to your hardware wallet. So what's the lie?

00:08:41.940 --> 00:08:45.380
<v Sjors Provoost>The lie is, here's a transaction with two inputs, and I'm going to tell you the

00:08:45.380 --> 00:08:49.300
<v Sjors Provoost>truth about the first input, and I'm going to lie about the second one. And then

00:08:49.300 --> 00:08:53.060
<v Sjors Provoost>you're going to sign it, and you're going to sign both inputs, and you're going

00:08:53.060 --> 00:08:56.640
<v Sjors Provoost>to trust the amounts that you get from the computer. And now, if you were to

00:08:56.640 --> 00:09:00.260
<v Sjors Provoost>broadcast that transaction, it would be invalid. Because the blockchain would

00:09:00.260 --> 00:09:02.980
<v Sjors Provoost>look at the first input and it would say, yeah, that's valid. And it would look

00:09:02.980 --> 00:09:08.640
<v Sjors Provoost>at the second input and say, no, no, no, that's not 0.01 Bitcoin, that's 0.5

00:09:08.640 --> 00:09:13.120
<v Sjors Provoost>Bitcoin. So I'm not going to do anything with the transaction. But here's the

00:09:13.120 --> 00:09:18.000
<v Sjors Provoost>problem. What if you send the hardware wallet another transaction, which is the

00:09:18.000 --> 00:09:22.060
<v Sjors Provoost>opposite, where the first input is a lie. And the second input is actually true.

00:09:22.520 --> 00:09:26.400
<v Sjors Provoost>And now the hardware wallet will diligently sign that one. And now you can

00:09:26.400 --> 00:09:30.320
<v Sjors Provoost>actually combine the first and the second transaction, because you can just

00:09:30.320 --> 00:09:33.460
<v Sjors Provoost>combine, take the input from one, put it on to the other.

00:09:33.800 --> 00:09:38.380
<v Aaron van Wirdum>Yeah, so there's two transactions with two inputs. Both are really yours.

00:09:38.820 --> 00:09:44.800
<v Aaron van Wirdum>However, your computer is lying to your hardware wallet twice, telling you only

00:09:44.800 --> 00:09:45.740
<v Aaron van Wirdum>one of them is yours.

00:09:45.920 --> 00:09:46.220
<v Sjors Provoost>Exactly.

00:09:46.700 --> 00:09:48.300
<v Aaron van Wirdum>The opposite one in both cases.

00:09:48.680 --> 00:09:48.820
<v Sjors Provoost>Yeah.

00:09:49.810 --> 00:09:54.370
<v Aaron van Wirdum>Both times the outcome is an invalid transaction, because the

00:09:54.370 --> 00:09:58.570
<v Aaron van Wirdum>input you're being lied about doesn't match what's happening on the blockchain.

00:09:59.130 --> 00:10:03.990
<v Aaron van Wirdum>However, with the two invalid transactions, you can both times take the valid

00:10:03.990 --> 00:10:08.490
<v Aaron van Wirdum>one, an attacker can both times take the valid half, combine these, and then all

00:10:08.490 --> 00:10:09.910
<v Aaron van Wirdum>of a sudden have a valid transaction.

00:10:10.290 --> 00:10:14.490
<v Sjors Provoost>Yes. So that's how you're circumventing the amount restriction. Yeah, and now the

00:10:14.490 --> 00:10:18.930
<v Sjors Provoost>question is, how would this lying take place? Well, it would just tell you...

00:10:19.590 --> 00:10:24.230
<v Sjors Provoost>After you sign the first one, it would say, hey, there's a problem, please try

00:10:24.230 --> 00:10:30.160
<v Sjors Provoost>again. And it would show the other one. And so that's a very mean trick. So

00:10:30.160 --> 00:10:34.520
<v Sjors Provoost>then the question is, how do you solve that problem? Well, you go back to

00:10:34.520 --> 00:10:39.820
<v Sjors Provoost>basically what we had before. You just give it the inputs. Because now the

00:10:39.820 --> 00:10:44.560
<v Sjors Provoost>hardware wallet sees the actual input transactions and can calculate the hash and

00:10:44.560 --> 00:10:45.500
<v Sjors Provoost>say, hey, the amounts are...

00:10:45.500 --> 00:10:49.700
<v Aaron van Wirdum>Just to be clear about the problem before we move on to the new solution. The

00:10:49.700 --> 00:10:55.410
<v Aaron van Wirdum>problem here is that in theory at least because we used a very simplified example

00:10:55.410 --> 00:11:00.610
<v Aaron van Wirdum>here with two transactions and half both times but essentially if you really

00:11:00.610 --> 00:11:05.880
<v Aaron van Wirdum>pull this attack to the limits you can drain someone's hardware wallet completely

00:11:05.880 --> 00:11:08.040
<v Aaron van Wirdum>just with one transaction right?

00:11:08.140 --> 00:11:09.240
<v Sjors Provoost>Yeah, I guess you could do it three times.

00:11:08.660 --> 00:11:13.380
<v Aaron van Wirdum>and just just all inputs are just become a huge fee, and it's all paid as a huge

00:11:13.380 --> 00:11:18.700
<v Aaron van Wirdum>fee, and yeah you know it kind of disappears into the blockchain to the miners

00:11:18.700 --> 00:11:19.220
<v Aaron van Wirdum>somewhere.

00:11:19.220 --> 00:11:19.640
<v Sjors Provoost>Yeah.

00:11:20.730 --> 00:11:25.690
<v Aaron van Wirdum>So the only way to benefit from this attack is if you are a miner, correct? Like

00:11:25.690 --> 00:11:28.630
<v Aaron van Wirdum>you need to be a miner because that's the only way you can get the fee.

00:11:29.030 --> 00:11:33.470
<v Sjors Provoost>Maybe, or maybe you can blackmail somebody in saying like, okay, now I have this

00:11:33.470 --> 00:11:33.970
<v Sjors Provoost>transaction.

00:11:34.430 --> 00:11:34.750
<v Aaron van Wirdum>Right.

00:11:35.050 --> 00:11:36.930
<v Sjors Provoost>But I won't send it to the blockchain just yet.

00:11:37.150 --> 00:11:41.210
<v Aaron van Wirdum>You better pay me X amount or I'll broadcast this to the network and you'll lose your money.

00:11:41.210 --> 00:11:42.590
<v Sjors Provoost>Yeah, exactly. Something like that.

00:11:44.100 --> 00:11:48.860
<v Sjors Provoost>So you never know. In general, there's something called defense in depth. So just

00:11:48.860 --> 00:11:52.960
<v Sjors Provoost>because you cannot think of a way that this could go wrong, you still want to deal with it.

00:11:53.940 --> 00:11:55.920
<v Aaron van Wirdum>Yeah, it's a weakness you want to take care of.

00:11:56.140 --> 00:11:56.300
<v Sjors Provoost>Yeah.

00:11:57.250 --> 00:11:58.630
<v Aaron van Wirdum>Okay, so the solution.

00:11:59.010 --> 00:12:04.050
<v Sjors Provoost>Well, the solution is we're back to the old story where you have to give all the

00:12:04.050 --> 00:12:07.390
<v Sjors Provoost>inputs. all the input transactions so you can perform

00:12:07.390 --> 00:12:10.390
<v Aaron van Wirdum>you have to you have to provide the previous transactions like before

00:12:10.390 --> 00:12:14.570
<v Sjors Provoost>yeah so now there is a difference between this in the past in the past before

00:12:14.570 --> 00:12:20.490
<v Sjors Provoost>SegWit you could fool a wallet with just a single attempt there was no need to to

00:12:20.490 --> 00:12:23.650
<v Sjors Provoost>ask would you like to try again because you could just lie about the entire

00:12:23.650 --> 00:12:27.590
<v Sjors Provoost>transaction and right now you have to do this weird trick where you tell the user

00:12:27.590 --> 00:12:32.710
<v Sjors Provoost>oh something went wrong please sign again right and and so you know

00:12:33.200 --> 00:12:37.800
<v Sjors Provoost>things weren't as bad as they were before but with this you know the way most

00:12:37.800 --> 00:12:41.340
<v Sjors Provoost>hardware wallets have fixed this or at least some have fixed this we're kind of

00:12:41.340 --> 00:12:43.500
<v Sjors Provoost>back in the old situation where you just need to give it the inputs

00:12:43.500 --> 00:12:47.840
<v Aaron van Wirdum>yeah so we solved the problem but then it turned out it wasn't really solved it

00:12:47.840 --> 00:12:53.060
<v Aaron van Wirdum>was just made a little bit harder to abuse and then to solve it again we're sort

00:12:53.060 --> 00:12:54.520
<v Aaron van Wirdum>of back to the original situation

00:12:54.520 --> 00:12:54.940
<v Sjors Provoost>yes

00:12:54.940 --> 00:12:59.930
<v Aaron van Wirdum>all right so now there was some I don't know if controversy is the right word,

00:13:00.010 --> 00:13:01.210
<v Aaron van Wirdum>but there was some...

00:13:01.210 --> 00:13:04.650
<v Sjors Provoost>We can first talk about the even better solution.

00:13:05.310 --> 00:13:06.170
<v Aaron van Wirdum>Okay, go on.

00:13:06.890 --> 00:13:10.930
<v Sjors Provoost>So there is a new proposal called Taproot, which I'm sure we'll talk about in

00:13:10.930 --> 00:13:15.750
<v Sjors Provoost>another episode. And part of what Taproot will do is, for every input, you have

00:13:15.750 --> 00:13:21.410
<v Sjors Provoost>to sign the amount, not just of that input, but also of all the other inputs. And

00:13:21.410 --> 00:13:25.490
<v Sjors Provoost>so, yeah, you can't lie about one input but not lie about the other input.

00:13:25.710 --> 00:13:26.210
<v Aaron van Wirdum>I see.

00:13:26.390 --> 00:13:28.870
<v Sjors Provoost>And I think it's not just the amount. It's a whole bunch of things you're signing

00:13:28.870 --> 00:13:32.250
<v Sjors Provoost>for about that previous transaction. So you really don't have to provide it anymore.

00:13:32.690 --> 00:13:36.590
<v Aaron van Wirdum>So with that approach, you'd sign way more information about this transaction in general.

00:13:37.010 --> 00:13:39.870
<v Sjors Provoost>I mean, in general, with transaction signing, it's kind of a weird concept

00:13:39.870 --> 00:13:43.890
<v Sjors Provoost>because the signature is in the transaction. So how does that work? You can't

00:13:43.890 --> 00:13:47.070
<v Sjors Provoost>sign before you have the signature. So what you do before you sign the

00:13:47.070 --> 00:13:51.750
<v Sjors Provoost>transaction is where the signature goes, you put a dotted line, so to speak, and

00:13:51.750 --> 00:13:57.670
<v Sjors Provoost>you sign everything or you sign some parts of it. And you can change

00:13:57.670 --> 00:14:01.600
<v Sjors Provoost>that scheme a little bit, add a little bit more to it or move things from it. So

00:14:01.600 --> 00:14:03.140
<v Sjors Provoost>that's what Taproot plans to do.

00:14:03.340 --> 00:14:08.780
<v Aaron van Wirdum>But right now, I guess we're sort of drifting in a different topic now, but

00:14:08.780 --> 00:14:14.470
<v Aaron van Wirdum>that's fine by me. So right now you indicate which part of the transaction you're

00:14:14.470 --> 00:14:16.290
<v Aaron van Wirdum>going to sign, right? With the SIGHASH flag?

00:14:16.590 --> 00:14:16.730
<v Sjors Provoost>Yes.

00:14:16.890 --> 00:14:20.350
<v Aaron van Wirdum>So would Taproot actually make that less flexible then?

00:14:20.830 --> 00:14:25.930
<v Sjors Provoost>No, I think it just changes the meaning. So SIGHASH_ALL is what most transactions

00:14:25.930 --> 00:14:30.650
<v Sjors Provoost>use, which is pretty much signing everything about the transaction. And I think,

00:14:30.830 --> 00:14:36.450
<v Sjors Provoost>so what SegWit added is you're not just signing the content of your own

00:14:36.450 --> 00:14:39.910
<v Sjors Provoost>transaction, you're also signing something about the inputs, namely the amount.

00:14:40.380 --> 00:14:44.340
<v Sjors Provoost>And so what Taproot changes would be to sign not just the amount of the previous

00:14:44.340 --> 00:14:48.100
<v Sjors Provoost>transaction, but a bunch of other things. Probably the script as well. I haven't read it.

00:14:48.360 --> 00:14:53.240
<v Aaron van Wirdum>And was this done to solve this specific problem, or are there other problems it solves?

00:14:53.460 --> 00:14:58.100
<v Sjors Provoost>Maybe. So that comes into why did this thing become an issue again, because this

00:14:58.100 --> 00:15:03.400
<v Sjors Provoost>was known since 2017. And so I'm not sure. This problem was brought up again on

00:15:03.400 --> 00:15:07.900
<v Sjors Provoost>the mailing list. And this Taproot solution was brought up on the mailing list.

00:15:09.010 --> 00:15:14.810
<v Sjors Provoost>My theory is that bringing up the solution for Taproot

00:15:14.810 --> 00:15:18.770
<v Sjors Provoost>reminded people of the original problem, made other people look at that original

00:15:18.770 --> 00:15:23.670
<v Sjors Provoost>problem and not agree that it's innocent. They would feel more strongly about it.

00:15:23.910 --> 00:15:29.350
<v Aaron van Wirdum>Yeah, because this issue isn't new in itself. Like you said, it was around for

00:15:29.350 --> 00:15:32.630
<v Aaron van Wirdum>years. And you think it was just rediscovered?

00:15:33.230 --> 00:15:38.660
<v Sjors Provoost>Yeah, it was either rediscovered or it was... like somebody proposes this

00:15:38.660 --> 00:15:42.500
<v Sjors Provoost>solution, and you think, hey, what are you actually solving? Oh, I didn't know

00:15:42.500 --> 00:15:47.300
<v Sjors Provoost>about that problem. So something like that might have happened. But I'm sure you

00:15:47.300 --> 00:15:52.400
<v Sjors Provoost>can look it up in the archives. Now, it should be noted that if you can trick a

00:15:52.400 --> 00:15:57.680
<v Sjors Provoost>user to sign twice, you can also just make them send different funds.

00:15:58.460 --> 00:16:00.400
<v Sjors Provoost>So even with this fix...

00:16:01.640 --> 00:16:07.560
<v Sjors Provoost>If I can trick the hardware wallet into signing again, I can just make them

00:16:07.560 --> 00:16:11.220
<v Sjors Provoost>sign as many transactions as I want. But I can't lie about the amounts of each of

00:16:11.220 --> 00:16:11.840
<v Sjors Provoost>those transactions.

00:16:13.140 --> 00:16:16.340
<v Sjors Provoost>But you can still drain somebody's wallet. It's like, try again. Why don't you

00:16:16.340 --> 00:16:21.080
<v Sjors Provoost>try again? And then you cannot rack up the fees. You would just have them pay you

00:16:21.080 --> 00:16:25.560
<v Sjors Provoost>twice or pay somebody else twice. So perhaps that's less useful as an attack.

00:16:28.890 --> 00:16:34.070
<v Sjors Provoost>If you can't lie about anything... then you're sending money to an exchange, and

00:16:34.070 --> 00:16:37.510
<v Sjors Provoost>now you're sending it to the exchange twice. Well, if it's not the exchange

00:16:37.510 --> 00:16:42.210
<v Sjors Provoost>that's trying to scam you, but some random malware, the malware doesn't really

00:16:42.210 --> 00:16:45.010
<v Sjors Provoost>have any benefit from you sending to the exchange twice.

00:16:45.650 --> 00:16:46.170
<v Aaron van Wirdum>Right.

00:16:46.430 --> 00:16:48.350
<v Sjors Provoost>So it's perhaps a less useful attack.

00:16:49.220 --> 00:16:52.020
<v Aaron van Wirdum>Right. But it would be sending different coins still.

00:16:52.100 --> 00:16:57.630
<v Sjors Provoost>Yes. You would just have a brand new transaction. New inputs. different change

00:16:57.630 --> 00:17:00.610
<v Sjors Provoost>address maybe even. But your hardware wallet only says, would you like to send

00:17:00.610 --> 00:17:05.490
<v Sjors Provoost>this much to this address? And if it says that twice, you might just click OK

00:17:05.490 --> 00:17:06.990
<v Sjors Provoost>twice. You don't even think about it.

00:17:07.150 --> 00:17:12.740
<v Aaron van Wirdum>Yeah, yeah. Right, I see. So there was some incompatibility with

00:17:12.740 --> 00:17:15.020
<v Aaron van Wirdum>some wallets after this upgrade, right?

00:17:15.180 --> 00:17:20.580
<v Sjors Provoost>Especially BTCPay Server. They have a way to receive money on hardware wallets.

00:17:20.760 --> 00:17:24.660
<v Sjors Provoost>That's not affected. But they also have a way to then send money from your

00:17:24.660 --> 00:17:29.240
<v Sjors Provoost>hardware wallet using BTCPay Server. And the problem is, if you need to provide

00:17:29.240 --> 00:17:32.840
<v Sjors Provoost>the actual input transactions, you need to still have those input transactions.

00:17:33.120 --> 00:17:38.540
<v Sjors Provoost>And BTCPay Server doesn't have them. So it would have to... Basically, those

00:17:38.540 --> 00:17:42.400
<v Sjors Provoost>transactions are sitting somewhere in the blockchain, and BTCPay Server at the

00:17:42.400 --> 00:17:46.100
<v Sjors Provoost>moment doesn't have a way to just go in and get an arbitrary transaction from the blockchain.

00:17:46.300 --> 00:17:46.540
<v Aaron van Wirdum>Right.

00:17:46.720 --> 00:17:49.940
<v Sjors Provoost>But not all wallets have that problem. For example, the Bitcoin Core wallet, I

00:17:49.940 --> 00:17:54.320
<v Sjors Provoost>believe it keeps the transactions that it cares about inside the wallet itself.

00:17:54.320 --> 00:17:55.220
<v Aaron van Wirdum>Even if it's pruned.

00:17:55.300 --> 00:17:55.960
<v Sjors Provoost>Even if it's pruned.

00:17:56.060 --> 00:17:56.260
<v Aaron van Wirdum>Right.

00:17:56.380 --> 00:18:02.360
<v Sjors Provoost>Exactly. And web-based wallets, they will just ask the server to please give that

00:18:02.360 --> 00:18:03.840
<v Sjors Provoost>transaction, so that's not a problem either.

00:18:04.240 --> 00:18:08.380
<v Aaron van Wirdum>So it's mainly a problem for pruned types of wallets, because they need previous

00:18:08.380 --> 00:18:10.320
<v Aaron van Wirdum>transactions, which they don't have in order.

00:18:10.320 --> 00:18:15.860
<v Sjors Provoost>Yeah, I would say it's a problem for not wallets, basically, so they aren't used

00:18:15.860 --> 00:18:21.280
<v Sjors Provoost>to holding on to information. They just try to serve the wallet, sign things on

00:18:21.280 --> 00:18:25.360
<v Sjors Provoost>the fly. They're key managers, but they don't hold on to transactions, maybe.

00:18:26.100 --> 00:18:29.680
<v Sjors Provoost>It's not fundamentally unsolvable, but I can imagine it's painful.

00:18:29.960 --> 00:18:31.180
<v Aaron van Wirdum>It's unsolved, at least.

00:18:31.460 --> 00:18:33.530
<v Sjors Provoost>Yeah, I mean... At least for BTCPay Server.

00:18:33.550 --> 00:18:34.950
<v Aaron van Wirdum>There's no solution ready yet.

00:18:35.650 --> 00:18:36.870
<v Sjors Provoost>At least not for BTCPay Server.

00:18:37.590 --> 00:18:37.730
<v Aaron van Wirdum>Right.

00:18:38.010 --> 00:18:42.530
<v Sjors Provoost>But in principle it could be fixable because if BTCPay Server uses Bitcoin Core

00:18:42.530 --> 00:18:47.310
<v Sjors Provoost>indirectly and Bitcoin Core has a transaction index turned on, it'll just work.

00:18:47.770 --> 00:18:51.770
<v Sjors Provoost>Or if you store the block height, that also helps.

00:18:52.350 --> 00:18:54.370
<v Aaron van Wirdum>So do you think the fix was worth it?

00:18:57.140 --> 00:18:58.320
<v Aaron van Wirdum>What's your opinion, Sjors?

00:18:58.480 --> 00:19:04.060
<v Sjors Provoost>The problem is slightly overrated, but it's other people's money too. And so...

00:19:04.220 --> 00:19:07.840
<v Sjors Provoost>The problem, of course, is if you're using a hardware wallet and you don't like

00:19:07.840 --> 00:19:12.480
<v Sjors Provoost>this choice, but you've upgraded the hardware wallet, you're kind of screwed. But

00:19:12.480 --> 00:19:15.240
<v Sjors Provoost>not really, because at least with Trezor, you can downgrade it.

00:19:16.480 --> 00:19:19.960
<v Sjors Provoost>If you don't like the solution, of course, you don't get any of the other fixes.

00:19:20.460 --> 00:19:24.440
<v Sjors Provoost>In fact, it's open source, so you can even just take their latest firmware

00:19:24.440 --> 00:19:27.860
<v Sjors Provoost>release and undo that one change. And maybe they could add a setting where you

00:19:27.860 --> 00:19:28.940
<v Sjors Provoost>can turn it off if you want to.

00:19:29.480 --> 00:19:31.780
<v Aaron van Wirdum>Or you can just not upgrade, of course.

00:19:32.250 --> 00:19:37.470
<v Sjors Provoost>But if you were using Trezor with Bitcoin Core and HWI, that's all still

00:19:37.470 --> 00:19:41.790
<v Sjors Provoost>experimental. But that would break until the new version of Bitcoin Core, which

00:19:41.790 --> 00:19:45.850
<v Sjors Provoost>compensates for this change. So it's not the end of the world.

00:19:45.950 --> 00:19:48.950
<v Aaron van Wirdum>The upcoming version for Bitcoin Core will have a fix for this included.

00:19:49.070 --> 00:19:54.370
<v Sjors Provoost>Yes. At least if it gets merged, but I think so. So that's either 0.21, which

00:19:54.370 --> 00:19:59.470
<v Sjors Provoost>comes out November-ish, or 0.20.1, which just comes out randomly.

00:20:00.310 --> 00:20:00.510
<v Aaron van Wirdum>Yeah.

00:20:02.330 --> 00:20:03.970
<v Aaron van Wirdum>All right, anything else on this topic?

00:20:04.230 --> 00:20:09.330
<v Sjors Provoost>There's one other way that you could deal with this problem as a hardware wallet,

00:20:09.470 --> 00:20:14.250
<v Sjors Provoost>which is to remember the inputs you've already signed and warn the user, hey,

00:20:14.410 --> 00:20:20.010
<v Sjors Provoost>wait a minute, I've seen this input before, but that requires a fair memory on

00:20:20.010 --> 00:20:20.450
<v Sjors Provoost>the device.

00:20:21.820 --> 00:20:25.660
<v Sjors Provoost>But maybe if you only remember the last 10 inputs that you signed, maybe it's not

00:20:25.660 --> 00:20:28.560
<v Sjors Provoost>too bad. It depends on how much memory the device has. Some have very little.

00:20:29.090 --> 00:20:32.530
<v Aaron van Wirdum>Yeah, you mean the hardware wallets, right? So hardware would have to remember

00:20:32.530 --> 00:20:33.650
<v Aaron van Wirdum>transactions then.

00:20:33.730 --> 00:20:36.550
<v Sjors Provoost>Would have to remember some of the recent inputs they've signed and say, hey, you

00:20:36.550 --> 00:20:40.130
<v Sjors Provoost>signed this before, are you sure you want this?

00:20:40.390 --> 00:20:40.690
<v Aaron van Wirdum>Right.

00:20:40.990 --> 00:20:42.590
<v Sjors Provoost>And by the way, the amount changed.

00:20:43.770 --> 00:20:46.250
<v Aaron van Wirdum>Yeah, so that would require more memory.

00:20:46.290 --> 00:20:50.390
<v Sjors Provoost>Perhaps, or at least it requires another software change. There might be ways to

00:20:50.390 --> 00:20:52.990
<v Sjors Provoost>fool the hardware wallet with that kind of thing, so it's more complexity.

00:20:54.720 --> 00:20:56.980
<v Aaron van Wirdum>All right, Sjors, you want to move on to the next topic?

00:20:57.380 --> 00:20:59.660
<v Sjors Provoost>Yes, let's talk about our favorite topic.

00:21:00.640 --> 00:21:06.480
<v Aaron van Wirdum>RBF. Replace by fee. RBF. There was a news blitz in the

00:21:06.480 --> 00:21:11.980
<v Aaron van Wirdum>crypto media this week about RBF and how there was a

00:21:11.980 --> 00:21:15.600
<v Aaron van Wirdum>vulnerability, major weakness. Bitcoin was hacked.

00:21:15.960 --> 00:21:19.320
<v Sjors Provoost>Yes, Bitcoin was hacked. That's what we all read. Completely destroyed. Miner

00:21:19.320 --> 00:21:22.010
<v Sjors Provoost>death spiral to come. End of the world.

00:21:23.070 --> 00:21:27.950
<v Aaron van Wirdum>There were news stories about RBF. So let's get into what was this news story

00:21:27.950 --> 00:21:30.370
<v Aaron van Wirdum>about. Or maybe we should start with RBF.

00:21:30.470 --> 00:21:31.550
<v Sjors Provoost>Let's start with RBF.

00:21:31.630 --> 00:21:33.070
<v Aaron van Wirdum>What is RBF? What is replace by fee?

00:21:33.170 --> 00:21:39.110
<v Sjors Provoost>Okay. So basically, when you create a transaction, you don't put it in

00:21:39.110 --> 00:21:42.950
<v Sjors Provoost>the blockchain. That's not how that goes. You actually send it to other Bitcoin

00:21:42.950 --> 00:21:46.590
<v Sjors Provoost>nodes. And they send it to other Bitcoin nodes. And everybody sends it to each

00:21:46.590 --> 00:21:51.820
<v Sjors Provoost>other in a happy circle. And eventually a miner... puts your transaction in a block.

00:21:52.140 --> 00:21:52.460
<v Aaron van Wirdum>Hopefully.

00:21:53.300 --> 00:21:58.760
<v Sjors Provoost>Yeah, or not. And then it's confirmed. Now, the reason why they might want to do

00:21:58.760 --> 00:22:03.270
<v Sjors Provoost>that is not just because they're nice. it's because they want to make money.

00:22:03.370 --> 00:22:04.710
<v Aaron van Wirdum>Most of them are nice, though, aren't they?

00:22:04.930 --> 00:22:08.110
<v Sjors Provoost>Yeah, I would say so, because in the beginning, transactions paid very little

00:22:08.110 --> 00:22:10.610
<v Sjors Provoost>fees, pretty much not worth the electricity.

00:22:10.670 --> 00:22:12.850
<v Aaron van Wirdum>True, for the first couple of years, yes.

00:22:13.630 --> 00:22:17.870
<v Sjors Provoost>So yes, miners also have some incentive to keep the network useful, but

00:22:17.870 --> 00:22:22.430
<v Sjors Provoost>ultimately it's nice if you pay them. And the other thing is, let's say you have

00:22:22.430 --> 00:22:25.630
<v Sjors Provoost>a lot of transactions, and they're competing for space, and now a block is full.

00:22:27.660 --> 00:22:31.680
<v Sjors Provoost>Or, it's not full, but basically the miner has more transactions to choose from

00:22:31.680 --> 00:22:37.550
<v Sjors Provoost>than he can fit in the block. What do you do? Well, if transactions

00:22:37.550 --> 00:22:41.630
<v Sjors Provoost>pay fees, you just start with the highest fee and you work your way down. It's a

00:22:41.630 --> 00:22:44.130
<v Sjors Provoost>little bit more complicated than that because transactions might depend on each

00:22:44.130 --> 00:22:47.870
<v Sjors Provoost>other. But basically, that's the rational thing to do. Take the highest paying

00:22:47.870 --> 00:22:51.210
<v Sjors Provoost>transactions, put them in the block and leave the rest out.

00:22:51.570 --> 00:22:54.670
<v Aaron van Wirdum>Yeah, it's a bidding war between transactions in that case.

00:22:54.930 --> 00:22:57.770
<v Sjors Provoost>Well, yeah, but the bidding is, you know, it's just one bid.

00:22:58.010 --> 00:22:58.350
<v Aaron van Wirdum>Right.

00:22:58.650 --> 00:23:02.540
<v Sjors Provoost>So then the question is, can we make that a little bit smarter? And so you might

00:23:02.540 --> 00:23:06.420
<v Sjors Provoost>think it's a very quiet day, I'm going to pay the absolute minimum fee, one

00:23:06.420 --> 00:23:10.680
<v Sjors Provoost>satoshi per byte, and I'm going to send that transaction around, and then all of

00:23:10.680 --> 00:23:15.720
<v Sjors Provoost>a sudden, I don't know, BitMEX pays its daily user base,

00:23:16.060 --> 00:23:21.660
<v Sjors Provoost>and the mempool is full, or it's busy, and

00:23:21.660 --> 00:23:25.680
<v Sjors Provoost>actually your transaction is not going to confirm for hours and hours, and you're

00:23:25.680 --> 00:23:30.810
<v Sjors Provoost>like, oh, okay, what am I going to do? You increase the fee. Now, this is always

00:23:30.810 --> 00:23:34.590
<v Sjors Provoost>possible. It's always possible to increase the fee and to send it to other peers

00:23:34.590 --> 00:23:37.970
<v Sjors Provoost>and to give it to a miner. And then they may or may not...

00:23:37.970 --> 00:23:41.230
<v Aaron van Wirdum>To be technically accurate, what you're really doing is creating a new

00:23:41.230 --> 00:23:45.770
<v Aaron van Wirdum>transaction, spending the same coins to the same addresses, but with a higher fee this time.

00:23:45.870 --> 00:23:46.170
<v Sjors Provoost>Exactly.

00:23:46.490 --> 00:23:46.730
<v Aaron van Wirdum>Basically, right?

00:23:46.910 --> 00:23:50.910
<v Sjors Provoost>Yes. You're creating a new transaction that spends the same coins.

00:23:51.070 --> 00:23:53.570
<v Aaron van Wirdum>So it sort of overwrites your previous transaction.

00:23:53.850 --> 00:23:57.350
<v Sjors Provoost>Well, it's different than your previous transaction. And now the question is, why

00:23:57.350 --> 00:24:01.380
<v Sjors Provoost>would other nodes and miners care about that? Now, other nodes might not care

00:24:01.380 --> 00:24:05.400
<v Sjors Provoost>about it at all. And so initially, I think the default was that they would just

00:24:05.400 --> 00:24:09.780
<v Sjors Provoost>ignore it. Because for them, other nodes, there's nothing in it to relay your

00:24:09.780 --> 00:24:13.900
<v Sjors Provoost>transactions. It's just using their bandwidth. So they're not going to do that.

00:24:14.680 --> 00:24:18.380
<v Sjors Provoost>but you could send it directly to a miner, and the miner might look at this and

00:24:18.380 --> 00:24:21.520
<v Sjors Provoost>say, well, this new transaction you're sending me pays me more than the other

00:24:21.520 --> 00:24:25.100
<v Sjors Provoost>thing I had, so I'll happily replace that and put that in the block.

00:24:25.300 --> 00:24:25.500
<v Aaron van Wirdum>Right.

00:24:25.680 --> 00:24:29.120
<v Sjors Provoost>And so if you can reach the miner in time, it'll get replaced. And in this case,

00:24:29.220 --> 00:24:33.680
<v Sjors Provoost>of course, because the mempool is very busy, you have plenty of time to do this.

00:24:34.760 --> 00:24:39.000
<v Sjors Provoost>But there was no official mechanism for that. And so some people would do that

00:24:39.000 --> 00:24:43.240
<v Sjors Provoost>and other people would not. But generally, most of the time, it wouldn't be done.

00:24:43.320 --> 00:24:48.800
<v Sjors Provoost>And so people kind of started trusting, okay, if I send a transaction, it's

00:24:48.800 --> 00:24:53.740
<v Sjors Provoost>probably not going to get replaced by something else. So I can just accept it.

00:24:55.860 --> 00:24:56.320
<v Aaron van Wirdum>Okay.

00:24:57.250 --> 00:25:02.390
<v Sjors Provoost>but eventually a mechanism was introduced to formally ask for a fee raise,

00:25:02.630 --> 00:25:06.750
<v Sjors Provoost>essentially to ask nicely, hey, this transaction has a higher fee, please replace

00:25:06.750 --> 00:25:11.690
<v Sjors Provoost>it. And then other nodes, if you use that scheme, would do that for you. And you

00:25:11.690 --> 00:25:15.770
<v Sjors Provoost>would indicate in advance, okay, if this transaction is, if I offer a higher fee,

00:25:15.850 --> 00:25:17.310
<v Sjors Provoost>then you should relay the higher one.

00:25:17.570 --> 00:25:23.050
<v Aaron van Wirdum>Right. So then nodes will accept a new transaction and forward it for miners to

00:25:23.050 --> 00:25:25.730
<v Aaron van Wirdum>ultimately take it and replace the previous one.

00:25:25.870 --> 00:25:30.270
<v Sjors Provoost>And there were some rules there. For example, the fee has to be substantially

00:25:30.270 --> 00:25:31.830
<v Sjors Provoost>higher than the previous one.

00:25:33.510 --> 00:25:39.010
<v Sjors Provoost>And so that way you're kind of disincentivizing, DoSing all your peers. And then

00:25:39.010 --> 00:25:40.390
<v Sjors Provoost>all the peers would relay it.

00:25:41.350 --> 00:25:43.150
<v Aaron van Wirdum>How much higher does it need to be?

00:25:43.230 --> 00:25:48.230
<v Sjors Provoost>Just one Satoshi. No, I think the minimum relay fee. So if the mempool is empty

00:25:48.230 --> 00:25:52.790
<v Sjors Provoost>or not busy, then that's just one Satoshi per byte. But if there's a lot of

00:25:52.790 --> 00:25:56.190
<v Sjors Provoost>transactions in there, and say the minimum transaction fee is 100 Satoshi per

00:25:56.190 --> 00:26:02.110
<v Sjors Provoost>byte, if you then want to [unclear], if you then want to bump the fee, you'd have

00:26:02.110 --> 00:26:04.030
<v Sjors Provoost>to bump it with another 100 Satoshi per byte.

00:26:04.950 --> 00:26:05.510
<v Aaron van Wirdum>I see.

00:26:05.910 --> 00:26:08.330
<v Sjors Provoost>I think. Or it's, I don't know.

00:26:08.410 --> 00:26:09.190
<v Aaron van Wirdum>So that's a big difference.

00:26:09.410 --> 00:26:11.990
<v Sjors Provoost>At least one Satoshi per byte. I think it depends on how busy the mempool is.

00:26:12.110 --> 00:26:12.230
<v Aaron van Wirdum>Right.

00:26:12.230 --> 00:26:13.150
<v Sjors Provoost>You have to look it up.

00:26:13.410 --> 00:26:13.630
<v Aaron van Wirdum>Okay.

00:26:15.380 --> 00:26:19.990
<v Sjors Provoost>Anyway. So it's just a way to coordinate this fee-bumping thing. But

00:26:19.990 --> 00:26:24.310
<v Sjors Provoost>fundamentally, a miner can do whatever they want. They don't have to care about

00:26:24.310 --> 00:26:29.630
<v Sjors Provoost>this RBF flag being present or not. There's a lot of debate about whether you

00:26:29.630 --> 00:26:33.630
<v Sjors Provoost>should make this deliberately unsafe to discourage people to

00:26:33.630 --> 00:26:39.150
<v Sjors Provoost>not accept unconfirmed transactions. It gets a little political

00:26:39.150 --> 00:26:43.990
<v Sjors Provoost>or practical. In practice, how high is this risk? Some businesses are happy to

00:26:43.990 --> 00:26:47.850
<v Sjors Provoost>accept unconfirmed transactions for small amounts because they realize that it

00:26:47.850 --> 00:26:51.090
<v Sjors Provoost>doesn't happen, it doesn't go wrong that often, or they have other fraud

00:26:51.090 --> 00:26:54.830
<v Sjors Provoost>detection mechanisms to keep them safe. But anyway.

00:26:56.240 --> 00:27:01.280
<v Aaron van Wirdum>And on the plus side, I would say it makes the fee market operate way more

00:27:01.280 --> 00:27:01.960
<v Aaron van Wirdum>smoothly.

00:27:02.820 --> 00:27:06.560
<v Sjors Provoost>Yeah, but the concept of raising fees in general is good for the fee market.

00:27:06.720 --> 00:27:11.770
<v Sjors Provoost>Using the specific mechanism of RBF is just one way to do that. that people

00:27:11.770 --> 00:27:14.710
<v Sjors Provoost>happen to have agreed upon, like this is the way to signal it and these are the

00:27:14.710 --> 00:27:19.190
<v Sjors Provoost>rules, rather than just say everybody for themselves, you decide when you accept

00:27:19.190 --> 00:27:22.070
<v Sjors Provoost>a new transaction or not with a higher fee.

00:27:23.250 --> 00:27:29.170
<v Aaron van Wirdum>Yes, but by adding flags like this and tricks like this, it allows the fee market

00:27:29.170 --> 00:27:34.390
<v Aaron van Wirdum>to be more efficient. Or at least, as a user, I can start with a lower bid. And

00:27:34.390 --> 00:27:38.990
<v Aaron van Wirdum>only if I see it's not enough, I can start to increase my bid. As opposed to

00:27:38.990 --> 00:27:44.310
<v Aaron van Wirdum>having to go gung-ho on the first bid and lose money

00:27:44.310 --> 00:27:45.610
<v Aaron van Wirdum>unnecessarily to miners.

00:27:45.930 --> 00:27:51.070
<v Sjors Provoost>But now the problem is, let's say your wallet is receiving such a transaction.

00:27:53.120 --> 00:27:57.980
<v Sjors Provoost>And now the question is, what do you do? What do you show the user? And so

00:27:57.980 --> 00:28:00.540
<v Sjors Provoost>usually a wallet receives a transaction and says, well, this transaction is

00:28:00.540 --> 00:28:06.480
<v Sjors Provoost>unconfirmed. And then when it's replaced with a different transaction, well, then

00:28:06.480 --> 00:28:10.960
<v Sjors Provoost>you just show the other transaction and say it's unconfirmed. But maybe you want

00:28:10.960 --> 00:28:14.720
<v Sjors Provoost>to have a more consistent, like it might look a little weird for a transaction to

00:28:14.720 --> 00:28:19.290
<v Sjors Provoost>disappear and to reappear, or even for two transactions to appear. So maybe you

00:28:19.290 --> 00:28:24.340
<v Sjors Provoost>want to make that UI look nicer. But it gets complicated quickly. And one of the

00:28:24.340 --> 00:28:28.360
<v Sjors Provoost>things that you can change about a transaction is you can bump the fee, but you

00:28:28.360 --> 00:28:32.380
<v Sjors Provoost>can also completely change the destination. As far as I know, there's no rule

00:28:32.380 --> 00:28:32.880
<v Sjors Provoost>against that.

00:28:33.710 --> 00:28:34.690
<v Aaron van Wirdum>I don't think so.

00:28:34.990 --> 00:28:39.270
<v Sjors Provoost>Yeah. So one moment you think you've received a transaction, and then the fee is

00:28:39.270 --> 00:28:42.690
<v Sjors Provoost>bumped, and you're not receiving that transaction anymore. It goes to somebody

00:28:42.690 --> 00:28:47.650
<v Sjors Provoost>else. So your wallet needs to be smart enough to realize that, to say, okay, wait

00:28:47.650 --> 00:28:50.350
<v Sjors Provoost>a minute, this is no longer going to me. It's going somewhere else.

00:28:50.590 --> 00:28:50.770
<v Aaron van Wirdum>Right.

00:28:51.210 --> 00:28:56.760
<v Sjors Provoost>Another complexity is that somebody might send a transaction with a higher fee,

00:28:57.430 --> 00:28:58.450
<v Sjors Provoost>but...

00:29:00.160 --> 00:29:04.400
<v Sjors Provoost>a block is mined, and that transaction with the higher fee reached you just in

00:29:04.400 --> 00:29:09.420
<v Sjors Provoost>time for your wallet to see it, but then it sees the new block, and it goes away

00:29:09.420 --> 00:29:12.540
<v Sjors Provoost>again. So the experience can be quite confusing, depending on the timing,

00:29:12.720 --> 00:29:16.260
<v Sjors Provoost>depending on who relays what fee increase, all that sort of stuff.

00:29:17.690 --> 00:29:21.650
<v Sjors Provoost>And it's possible to make mistakes in that, and that's what happened. And that's

00:29:21.650 --> 00:29:26.040
<v Sjors Provoost>why the internet is on fire, and Bitcoin is... It's all being sold to Peter

00:29:26.040 --> 00:29:26.920
<v Sjors Provoost>Schiff for $1.

00:29:27.200 --> 00:29:30.760
<v Aaron van Wirdum>So what's the mistake? It's a wallet problem.

00:29:31.060 --> 00:29:31.200
<v Sjors Provoost>Yes.

00:29:31.620 --> 00:29:35.680
<v Aaron van Wirdum>Wallets are just not showing unconfirmed transactions as unconfirmed

00:29:35.680 --> 00:29:36.140
<v Aaron van Wirdum>transactions?

00:29:36.480 --> 00:29:40.040
<v Sjors Provoost>No, I think one problem that was described as one wallet might have been the

00:29:40.040 --> 00:29:41.780
<v Sjors Provoost>Ledger desktop wallet.

00:29:41.960 --> 00:29:42.960
<v Aaron van Wirdum>Yeah, Ledger Live, I think.

00:29:43.040 --> 00:29:48.260
<v Sjors Provoost>Yeah, that was pretty much doing what I just described. It would show a

00:29:48.260 --> 00:29:52.910
<v Sjors Provoost>transaction, unconfirmed transaction. To you, it would increase your balance, you

00:29:52.910 --> 00:29:56.750
<v Sjors Provoost>know, saying, okay, look, you've already got more. But then if somebody changed

00:29:56.750 --> 00:30:01.290
<v Sjors Provoost>the destination, it would not lower the balance again. So you would see the wrong

00:30:01.290 --> 00:30:01.730
<v Sjors Provoost>balance.

00:30:01.910 --> 00:30:02.130
<v Aaron van Wirdum>Right.

00:30:02.630 --> 00:30:04.710
<v Sjors Provoost>And I think even if a transaction then confirmed,

00:30:04.910 --> 00:30:06.230
<v Aaron van Wirdum>it wouldn't forget about it.

00:30:06.450 --> 00:30:07.310
<v Sjors Provoost>So that's a bug.

00:30:07.490 --> 00:30:07.650
<v Aaron van Wirdum>Yeah.

00:30:07.690 --> 00:30:12.600
<v Sjors Provoost>At least. Yes. And, you know, they should fix that because it can, you know,

00:30:12.680 --> 00:30:18.600
<v Sjors Provoost>cause problems for their users. And the other problem sort of related to that is

00:30:18.600 --> 00:30:23.600
<v Sjors Provoost>if your wallet can spend an unconfirmed transaction,

00:30:25.480 --> 00:30:29.260
<v Sjors Provoost>your wallet has to choose a bunch of coins to spend, a bunch of inputs to spend.

00:30:29.520 --> 00:30:32.700
<v Sjors Provoost>And the question is which inputs is it going to pick. And maybe it does it

00:30:32.700 --> 00:30:37.940
<v Sjors Provoost>randomly. But now let's say it also includes unconfirmed transactions and it's

00:30:37.940 --> 00:30:41.140
<v Sjors Provoost>completely random. And now for some reason you have like a million unconfirmed

00:30:41.140 --> 00:30:46.740
<v Sjors Provoost>transactions because of all these RBF bumps. You keep picking these unconfirmed

00:30:46.740 --> 00:30:48.280
<v Sjors Provoost>pieces to compose your transaction.

00:30:48.500 --> 00:30:52.600
<v Aaron van Wirdum>And the reason it could plausibly be a million is because once someone has your

00:30:52.600 --> 00:30:57.820
<v Aaron van Wirdum>address they can just keep sending you transactions which they then replace so

00:30:57.820 --> 00:31:01.200
<v Aaron van Wirdum>it's plausible that this could happen to your wallet

00:31:01.200 --> 00:31:05.640
<v Sjors Provoost>yeah and one transaction could contain you know I don't know, hundreds of outputs

00:31:05.640 --> 00:31:09.220
<v Sjors Provoost>that all go to the same address, and then with a slightly different amount, and

00:31:09.220 --> 00:31:12.600
<v Sjors Provoost>then you keep replacing the transaction with a transaction that has the same

00:31:12.600 --> 00:31:15.700
<v Sjors Provoost>outputs, but with slightly different amounts, or different outputs altogether,

00:31:16.080 --> 00:31:19.640
<v Sjors Provoost>and you could keep doing that, and your wallet would just be totally confused. So

00:31:19.640 --> 00:31:25.120
<v Sjors Provoost>that's a way to sort of DoS a wallet. It seems a bit of a far-fetched attack to

00:31:25.120 --> 00:31:28.360
<v Sjors Provoost>do, but it's possible, and there might be an economic reason to do it. So again,

00:31:28.480 --> 00:31:30.060
<v Sjors Provoost>defense in depth, you just want to deal with that.

00:31:31.400 --> 00:31:35.390
<v Sjors Provoost>But... And one way to deal with it is the way Bitcoin Core does it, which is a

00:31:35.390 --> 00:31:40.270
<v Sjors Provoost>lazy approach, perhaps, but very robust against it. You cannot spend unconfirmed

00:31:40.270 --> 00:31:44.870
<v Sjors Provoost>transactions, period. You just have to wait for confirmation. So there might be

00:31:44.870 --> 00:31:50.230
<v Sjors Provoost>some noise. I think Bitcoin Core even shows all the different versions of an RBF

00:31:50.230 --> 00:31:55.770
<v Sjors Provoost>transaction in a row, like they're separate transactions. So I'm not saying it's

00:31:55.770 --> 00:32:01.700
<v Sjors Provoost>the best UI ever. but you can't spend it until it's confirmed,

00:32:01.800 --> 00:32:04.720
<v Sjors Provoost>so it's not really bothered by this particular attack.

00:32:06.520 --> 00:32:10.460
<v Sjors Provoost>But I'm sure there's other ways to fix it too. Anyway, this was presented as a

00:32:10.460 --> 00:32:14.260
<v Sjors Provoost>complete drama, and I think it was marketing for a new wallet.

00:32:14.460 --> 00:32:17.260
<v Aaron van Wirdum>It seemed to me like this was an issue between...

00:32:18.600 --> 00:32:23.000
<v Aaron van Wirdum>wallet developers like hey guys look this is something you need to fix we found a

00:32:23.000 --> 00:32:26.360
<v Aaron van Wirdum>bug in your wallet and like that's it there was no news value to it other than

00:32:26.360 --> 00:32:30.700
<v Aaron van Wirdum>that we found a bug in your wallet it was presented as if it was a big problem

00:32:30.700 --> 00:32:34.560
<v Aaron van Wirdum>with bitcoin itself as if someone figured out how to double spend bitcoin but

00:32:34.560 --> 00:32:35.040
<v Aaron van Wirdum>that's not

00:32:35.040 --> 00:32:40.600
<v Sjors Provoost>well i'm not sure who did that because There's also just the news media,

00:32:40.940 --> 00:32:46.580
<v Sjors Provoost>like CoinDesk, that needs to sell clicks, and I think they also just

00:32:46.580 --> 00:32:48.980
<v Sjors Provoost>made a bit of a mess of the article.

00:32:49.240 --> 00:32:54.340
<v Aaron van Wirdum>Maybe, maybe, but I'd be curious to see the press release that was sent to them,

00:32:54.360 --> 00:32:59.080
<v Aaron van Wirdum>because I've seen press releases where... You know, they try to make it sound

00:32:59.080 --> 00:33:02.260
<v Aaron van Wirdum>dramatic as well in order to get a journalist to write about it.

00:33:02.420 --> 00:33:06.540
<v Sjors Provoost>The blog post published by this wallet was very sensational and quite ridiculous.

00:33:06.620 --> 00:33:09.460
<v Sjors Provoost>But I don't think they were claiming Bitcoin was broken. I think they were just

00:33:09.460 --> 00:33:11.880
<v Sjors Provoost>claiming that these other wallets were broken.

00:33:12.140 --> 00:33:12.320
<v Aaron van Wirdum>Right.

00:33:13.860 --> 00:33:18.140
<v Sjors Provoost>But, you know, by the time this reaches CNN, Bitcoin is broken. And that's how that goes.

00:33:18.260 --> 00:33:19.160
<v Aaron van Wirdum>Yes, that's how it works.

00:33:19.280 --> 00:33:24.220
<v Sjors Provoost>But the thing is, security vulnerabilities, I'm very happy that more and more...

00:33:24.030 --> 00:33:29.310
<v Sjors Provoost>Companies are taking security work seriously, Google Zero, etc. They're doing a

00:33:29.310 --> 00:33:32.950
<v Sjors Provoost>lot of very important security work. But they're also using it as a marketing

00:33:32.950 --> 00:33:38.190
<v Sjors Provoost>tool. And at some point, when the marketeers start to get a little bit too

00:33:38.190 --> 00:33:43.390
<v Sjors Provoost>dominant... They have an incentive to make a problem sound way worse than it is.

00:33:43.830 --> 00:33:48.030
<v Sjors Provoost>Sometimes bounty systems also make that the case because you get more for severe

00:33:48.030 --> 00:33:50.290
<v Sjors Provoost>bounties, so you just make it sound very severe.

00:33:51.750 --> 00:33:55.830
<v Sjors Provoost>So that incentive sometimes gets out of hand and people just start making a lot

00:33:55.830 --> 00:34:00.510
<v Sjors Provoost>of noise about something that's probably not that bad just to get more clicks.

00:34:02.250 --> 00:34:06.230
<v Sjors Provoost>I mean, it keeps everybody sharp, but at the same time, if there really is a bug

00:34:06.230 --> 00:34:11.670
<v Sjors Provoost>that is really severe, like, I don't know, an inflation bug, then there has to be

00:34:11.670 --> 00:34:15.990
<v Sjors Provoost>some language left to describe something that is actually severe, could actually

00:34:15.990 --> 00:34:18.970
<v Sjors Provoost>hurt people very, very badly.

00:34:19.410 --> 00:34:20.510
<v Aaron van Wirdum>So was this bug fixed?

00:34:21.330 --> 00:34:26.850
<v Sjors Provoost>I don't know. I'm guessing that they'll release a fix. I mean, the Ledger Live

00:34:26.850 --> 00:34:29.990
<v Sjors Provoost>software auto-updates, or at least you can click to update it.

00:34:30.630 --> 00:34:33.790
<v Aaron van Wirdum>I'm fairly sure that at least for some of the wallets it was fixed. I don't

00:34:33.790 --> 00:34:37.890
<v Aaron van Wirdum>remember which one fixed it exactly and which one didn't yet. Some of them fixed it.

00:34:38.030 --> 00:34:43.270
<v Sjors Provoost>It sounds to me mostly like a denial of service attack, which is a problem. But

00:34:43.270 --> 00:34:45.310
<v Sjors Provoost>it's not necessarily going to steal your coins.

00:34:47.140 --> 00:34:48.740
<v Aaron van Wirdum>Alright, so Bitcoin is still alive.

00:34:49.670 --> 00:34:50.470
<v Sjors Provoost>I don't know.

00:34:50.910 --> 00:34:51.330
<v Aaron van Wirdum>I think so.

00:34:51.790 --> 00:34:53.290
<v Sjors Provoost>Yeah. Last I checked, it was running.

00:34:53.470 --> 00:34:53.690
<v Aaron van Wirdum>All right.

00:34:55.000 --> 00:34:55.440
<v Aaron van Wirdum>Good, right?

00:34:55.800 --> 00:34:55.920
<v Sjors Provoost>Yeah.

00:34:56.440 --> 00:34:57.060
<v Aaron van Wirdum>Anything else?

00:34:57.380 --> 00:34:58.340
<v Sjors Provoost>No, I think that's it.

00:34:58.740 --> 00:35:02.400
<v Aaron van Wirdum>That was it. Oh, we needed a closing sentence as well.

00:35:02.600 --> 00:35:04.940
<v Sjors Provoost>Thank you for listening to the Van Wirdum Sjorsnado.

00:35:06.510 --> 00:35:07.290
<v Aaron van Wirdum>There you go.

