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

00:00:16.660 --> 00:00:20.600
<v Aaron van Wirdum>Live from Utrecht, this is Bitcoin, Explained. Hey, Sjors.

00:00:20.820 --> 00:00:21.040
<v Sjors Provoost>Hello.

00:00:21.420 --> 00:00:21.940
<v Aaron van Wirdum>Hey, Josie.

00:00:22.100 --> 00:00:22.280
<v Josie>Hey.

00:00:22.540 --> 00:00:23.020
<v Aaron van Wirdum>Hey, Ruben.

00:00:23.260 --> 00:00:23.520
<v Ruben Somsen>Hey.

00:00:23.880 --> 00:00:27.000
<v Aaron van Wirdum>We've got two guests today, Sjors. Is that the first time we've had two guests?

00:00:27.040 --> 00:00:30.680
<v Sjors Provoost>I believe that is a record number. We have doubled the number of guests.

00:00:31.200 --> 00:00:33.880
<v Aaron van Wirdum>That is amazing. You know what else is amazing, Sjors?

00:00:34.140 --> 00:00:36.560
<v Sjors Provoost>The 9-volt battery thing that you have in your hands.

00:00:36.820 --> 00:00:40.980
<v Aaron van Wirdum>You just pushed a... This is a Coinkite product as well?

00:00:41.120 --> 00:00:44.340
<v Sjors Provoost>I don't know if they really sell it, but I think they have it, yeah.

00:00:44.620 --> 00:00:45.940
<v Aaron van Wirdum>Explain what you just gave me.

00:00:46.280 --> 00:00:50.880
<v Sjors Provoost>You put it on top of a 9-volt battery and then it has a USB port so you can

00:00:50.880 --> 00:00:56.880
<v Sjors Provoost>charge your devices offline in a nuclear shelter, etc. But they

00:00:56.880 --> 00:00:57.580
<v Sjors Provoost>also have hardware wallets.

00:00:57.580 --> 00:00:58.160
<v Aaron van Wirdum>Charge what offline?

00:00:58.500 --> 00:01:03.120
<v Sjors Provoost>Your devices. But I guess it's mostly used to not charge the hardware wallet, but

00:01:03.120 --> 00:01:04.400
<v Sjors Provoost>just to turn it on and keep it on.

00:01:05.580 --> 00:01:11.220
<v Aaron van Wirdum>Anyways, another amazing Coinkite product. And here's another one. The

00:01:11.220 --> 00:01:12.620
<v Aaron van Wirdum>COLDCARD Q.

00:01:14.250 --> 00:01:20.450
<v Aaron van Wirdum>Sjors has got many COLDCARD Coinkite devices. Buy them all.

00:01:21.070 --> 00:01:21.550
<v Sjors Provoost>Exactly.

00:01:21.830 --> 00:01:26.030
<v Aaron van Wirdum>Okay, let's get to our episode. We're going to discuss... Silent payments.

00:01:26.370 --> 00:01:29.590
<v Sjors Provoost>That's right. And we talked about that in episode number...

00:01:31.110 --> 00:01:32.910
<v Aaron van Wirdum>52 from the top of my head, actually.

00:01:33.210 --> 00:01:36.190
<v Ruben Somsen>Somewhere around there. I don't remember exactly, but it was somewhere

00:01:36.190 --> 00:01:36.750
<v Ruben Somsen>50-something.

00:01:36.970 --> 00:01:41.190
<v Aaron van Wirdum>Yeah, so we did one episode on silent payments right after you, Ruben, proposed

00:01:41.190 --> 00:01:42.890
<v Aaron van Wirdum>it on the Bitcoin dev mailing list.

00:01:42.970 --> 00:01:43.230
<v Ruben Somsen>Yes.

00:01:43.570 --> 00:01:45.350
<v Aaron van Wirdum>Now, fast forward two years later.

00:01:45.530 --> 00:01:49.170
<v Sjors Provoost>This episode is still up to date and perfectly fine, so you can stop listening.

00:01:50.250 --> 00:01:53.290
<v Ruben Somsen>Almost. No, there are a few things we can talk about, but it was surprisingly

00:01:53.290 --> 00:01:56.710
<v Ruben Somsen>accurate, so definitely something to go back and listen to.

00:01:56.850 --> 00:02:01.580
<v Aaron van Wirdum>Yeah, we'll give our dear listener... You, our dear listener, a short update. But

00:02:01.580 --> 00:02:07.550
<v Aaron van Wirdum>first, let's do a short introduction also. So Ruben, you are our... de

00:02:07.550 --> 00:02:13.370
<v Aaron van Wirdum>facto complicated second layer expert who also came up with silent payments, right?

00:02:13.490 --> 00:02:19.210
<v Ruben Somsen>Which is not a second layer. So basically breaking the rule there. But you could

00:02:19.210 --> 00:02:22.450
<v Ruben Somsen>kind of see it as a second layer because it's a sort of secondary way of

00:02:22.450 --> 00:02:25.430
<v Ruben Somsen>interpreting data on the Bitcoin blockchain. So sure, let's say.

00:02:25.470 --> 00:02:26.030
<v Aaron van Wirdum>No, no, no.

00:02:27.850 --> 00:02:31.950
<v Aaron van Wirdum>I'm just giving a picture of who you are usually. But this is a different

00:02:31.950 --> 00:02:36.110
<v Aaron van Wirdum>proposal for you. Josie, our listeners don't know you yet. Who are you?

00:02:36.430 --> 00:02:41.830
<v Josie>I am a Bitcoin Core developer. So I started contributing about three or three-ish

00:02:41.830 --> 00:02:46.550
<v Josie>years ago, I think. I started off in the wallet, mostly out of an interest in

00:02:46.550 --> 00:02:51.270
<v Josie>privacy stuff. And also just usability because I use the Bitcoin Core wallet,

00:02:51.310 --> 00:02:54.690
<v Josie>which was part of what got me so excited about silent payments. It was kind of

00:02:54.690 --> 00:02:58.110
<v Josie>the feature that I felt like was missing. But yeah, I spent a lot of time in the

00:02:58.110 --> 00:03:01.750
<v Josie>wallet and also a lot of time thinking about privacy improvements without

00:03:01.750 --> 00:03:02.290
<v Josie>soft forks.

00:03:02.630 --> 00:03:06.610
<v Aaron van Wirdum>So what happened here? At some point you read Ruben's proposal and you decided to

00:03:06.610 --> 00:03:07.150
<v Aaron van Wirdum>implement it?

00:03:07.350 --> 00:03:13.330
<v Josie>No, I heard him present on it at TabConf in

00:03:13.330 --> 00:03:18.590
<v Josie>October of 2022, I think. I think you had just kind of written the gist and had

00:03:18.590 --> 00:03:24.010
<v Josie>been talking to people, maybe following the Prague discussions. So Ruben gave a

00:03:24.010 --> 00:03:27.590
<v Josie>presentation on it and I don't think he and I had officially met at that point.

00:03:28.050 --> 00:03:32.200
<v Josie>And I was so excited. After the talk was finished, I went up to him afterwards

00:03:32.200 --> 00:03:36.160
<v Josie>and I was like, what do we got to do to make this a reality? This sounds awesome.

00:03:37.930 --> 00:03:41.650
<v Josie>And then I think at that point we decided the next step would be to write the

00:03:41.650 --> 00:03:46.130
<v Josie>BIP. And so we decided that's where we would spend the next amount of time just

00:03:46.130 --> 00:03:50.850
<v Josie>kind of refining the idea. And then after writing the BIP, I started working on

00:03:50.850 --> 00:03:52.210
<v Josie>an implementation for Bitcoin Core.

00:03:53.030 --> 00:03:56.270
<v Aaron van Wirdum>And a lot of this work was done in Utrecht. Is that right?

00:03:56.590 --> 00:03:56.930
<v Josie>Yeah.

00:03:57.110 --> 00:03:57.290
<v Aaron van Wirdum>Yeah.

00:03:57.510 --> 00:04:01.550
<v Josie>Like I said, we hadn't really met each other before. So at one point Ruben was

00:04:01.550 --> 00:04:04.330
<v Josie>like, well, it's going to be hard to coordinate. I'm in Utrecht. And I was like,

00:04:04.410 --> 00:04:08.690
<v Josie>dude, I'm in Amsterdam. This is perfect. So then I would catch the train down to

00:04:08.690 --> 00:04:10.830
<v Josie>Utrecht about once a week and we'd sit in a Starbucks.

00:04:11.070 --> 00:04:16.870
<v Ruben Somsen>Yep. Talk for hours. A lot of fun and very useful. I think especially. So the

00:04:16.870 --> 00:04:21.350
<v Ruben Somsen>funny thing is, even though like the previous episode, which by the way is

00:04:21.350 --> 00:04:23.080
<v Ruben Somsen>episode 58.

00:04:23.360 --> 00:04:23.780
<v Aaron van Wirdum>58.

00:04:24.040 --> 00:04:28.660
<v Ruben Somsen>Yeah, so just a correction there. Although it's very accurate, there were still a

00:04:28.660 --> 00:04:34.460
<v Ruben Somsen>bunch of details that were very tricky to work out. We're

00:04:34.460 --> 00:04:38.040
<v Ruben Somsen>not really going to go into them, I think, for this discussion because they're

00:04:38.040 --> 00:04:43.500
<v Ruben Somsen>not really relevant for understanding the protocol necessarily, but there was

00:04:43.500 --> 00:04:47.040
<v Ruben Somsen>still a lot of work to be done and we had a lot of pitfalls, like malleability

00:04:47.040 --> 00:04:51.380
<v Ruben Somsen>issues, things like that. So there was a lot of work left, even though it seemed

00:04:51.380 --> 00:04:56.040
<v Ruben Somsen>like it was pretty cut and dry. It certainly wasn't.

00:04:56.560 --> 00:05:00.180
<v Aaron van Wirdum>Yeah. Well, I just wanted to point out that it's the second great Utrecht

00:05:00.180 --> 00:05:03.500
<v Aaron van Wirdum>homegrown project, which I'm very proud of. The first one, of course, being

00:05:03.500 --> 00:05:06.020
<v Aaron van Wirdum>Bitcoin Explained, needless to say.

00:05:06.280 --> 00:05:06.520
<v Sjors Provoost>Aha.

00:05:07.660 --> 00:05:12.900
<v Aaron van Wirdum>So the BIP is BIP 352, 352. And this was

00:05:12.900 --> 00:05:15.200
<v Aaron van Wirdum>finalized a couple of weeks ago.

00:05:15.880 --> 00:05:17.560
<v Josie>Maybe a month at this point.

00:05:18.000 --> 00:05:20.600
<v Ruben Somsen>It must have been two months ago now.

00:05:20.860 --> 00:05:23.920
<v Josie>Maybe it's worth mentioning because I think there's a lot of confusion about

00:05:23.920 --> 00:05:28.460
<v Josie>this. We were kind of considering the BIP somewhat final, maybe a few months

00:05:28.460 --> 00:05:34.330
<v Josie>before that, where the protocol was done. And we had test vectors. But then it

00:05:34.330 --> 00:05:37.070
<v Josie>took about another two months for the BIP to actually get merged. And then all of

00:05:37.070 --> 00:05:41.310
<v Josie>the changes were just like copy edits. And we actually had people starting to

00:05:41.310 --> 00:05:46.590
<v Josie>build implementations before the BIP was finalized. But the BIP actually merged

00:05:46.590 --> 00:05:48.390
<v Josie>into the repo maybe two months ago.

00:05:48.830 --> 00:05:53.590
<v Sjors Provoost>I did a little testing myself because I was maintaining a small indexer pull

00:05:53.590 --> 00:05:58.810
<v Sjors Provoost>request on top of your pull request to see if it's compatible, and then other

00:05:58.810 --> 00:06:01.450
<v Sjors Provoost>people would have other implementations, and I would run a little script that

00:06:01.450 --> 00:06:05.450
<v Sjors Provoost>would just compare them to make sure that for our mainnet, every silent payment

00:06:05.450 --> 00:06:08.470
<v Sjors Provoost>tweak, and I guess we'll get back to what that is, is the same. And the answer

00:06:08.470 --> 00:06:13.170
<v Sjors Provoost>was usually, but there were still a few inconsistencies. Some bugs on our end,

00:06:13.230 --> 00:06:17.390
<v Sjors Provoost>and some bugs on other people's end, so it's always useful to compare. And, you

00:06:17.390 --> 00:06:21.380
<v Sjors Provoost>know, so even when the BIP is final, you still want to maybe not... tattoo your

00:06:21.380 --> 00:06:22.240
<v Sjors Provoost>silent payment address.

00:06:22.760 --> 00:06:26.580
<v Aaron van Wirdum>Yeah, well, you were kind of going to do that now, we thought, because on the

00:06:26.580 --> 00:06:31.610
<v Aaron van Wirdum>previous episode, you said no time for tattoos yet, but there's still no time for

00:06:31.610 --> 00:06:32.850
<v Aaron van Wirdum>tattoos. Now you're just copping out.

00:06:33.110 --> 00:06:34.030
<v Ruben Somsen>Now the BIP is final.

00:06:35.530 --> 00:06:38.130
<v Sjors Provoost>I'm starting to talk to my tattoo consultant.

00:06:38.410 --> 00:06:43.070
<v Josie>Wait for BOLT 12, because then you can get a unified QR code tattoo of BOLT 12

00:06:43.070 --> 00:06:46.070
<v Josie>and silent payments. Unless you want to get two tattoos.

00:06:46.690 --> 00:06:51.310
<v Aaron van Wirdum>Okay, I'm going to give a one-sentence explanation of what this sort of is, and

00:06:51.310 --> 00:06:54.870
<v Aaron van Wirdum>then we'll go to a short recap. But you can correct me if I'm wrong. So

00:06:54.870 --> 00:06:59.240
<v Aaron van Wirdum>basically, right now, we use Bitcoin addresses, which are great. The problem is

00:06:59.240 --> 00:07:04.040
<v Aaron van Wirdum>that you can't, well, you can reuse them, but it's really bad for privacy. So if

00:07:04.040 --> 00:07:07.660
<v Aaron van Wirdum>you, for example, want to put up a donation address on your website, then people

00:07:07.660 --> 00:07:12.820
<v Aaron van Wirdum>can donate to you, but then they also see exactly, anyone can see exactly, you

00:07:12.820 --> 00:07:16.160
<v Aaron van Wirdum>know, when you're spending your money and how much money you received and all of

00:07:16.160 --> 00:07:21.800
<v Aaron van Wirdum>that. So silent payment addresses are also something you can post publicly, but

00:07:21.800 --> 00:07:26.080
<v Aaron van Wirdum>then whoever is paying you basically generates a new address for you every time.

00:07:26.720 --> 00:07:30.680
<v Aaron van Wirdum>with you being the only one to be able to spend from that. Right? Well, this was

00:07:30.680 --> 00:07:31.500
<v Aaron van Wirdum>more than one sentence.

00:07:31.620 --> 00:07:35.420
<v Sjors Provoost>Yeah, and so the cool part there is that you as the sender are generating the

00:07:35.420 --> 00:07:39.320
<v Sjors Provoost>address for the recipient in a way, so you don't need to talk to the recipient at

00:07:39.320 --> 00:07:42.540
<v Sjors Provoost>that point, because normally the recipient has to do that for you. So it's not

00:07:42.540 --> 00:07:45.860
<v Sjors Provoost>interactive. But the recipient knows what that address is going to be. So it's

00:07:45.860 --> 00:07:48.860
<v Sjors Provoost>also, as the sender, you don't have to send an email to the recipient saying,

00:07:48.880 --> 00:07:49.640
<v Sjors Provoost>please look here.

00:07:50.090 --> 00:07:55.930
<v Aaron van Wirdum>Yeah, so the challenge of doing something like this is how can a

00:07:55.930 --> 00:08:01.810
<v Aaron van Wirdum>sender generate an address that the recipient can then

00:08:01.810 --> 00:08:04.610
<v Aaron van Wirdum>spend from? That's basically the challenge that had to be solved, right?

00:08:04.610 --> 00:08:09.030
<v Ruben Somsen>And only the recipient can recognize also, right? Spend from and recognize.

00:08:09.110 --> 00:08:12.930
<v Aaron van Wirdum>Only the recipient will know that that address is also... Well, the sender will

00:08:12.930 --> 00:08:14.370
<v Aaron van Wirdum>know as well, but no one else will know.

00:08:14.470 --> 00:08:19.390
<v Ruben Somsen>So in three words, I would say private reusable addresses.

00:08:20.160 --> 00:08:21.920
<v Sjors Provoost>Single payment identifier.

00:08:22.980 --> 00:08:24.540
<v Josie>Static payment codes.

00:08:24.820 --> 00:08:26.060
<v Ruben Somsen>All right. Everybody has a difference.

00:08:26.840 --> 00:08:28.060
<v Josie>Naming is art, guys.

00:08:28.380 --> 00:08:30.640
<v Ruben Somsen>As long as people understand it, that's the important part.

00:08:30.800 --> 00:08:36.640
<v Josie>I think maybe one distinction, the difference here is the sender

00:08:36.640 --> 00:08:42.270
<v Josie>generates an address that is only spendable or knowable by the recipient but also

00:08:42.270 --> 00:08:46.690
<v Josie>in a way that the recipient can find it without requiring extra data on the

00:08:46.690 --> 00:08:50.630
<v Josie>blockchain or out-of-band communication. So the recipient, and this is a

00:08:50.630 --> 00:08:55.130
<v Josie>distinction against like xpubs and BIP 32 style addresses, the recipient doesn't

00:08:55.130 --> 00:08:59.350
<v Josie>actually know about the address until the sender creates it and it's confirmed in

00:08:59.350 --> 00:08:59.770
<v Josie>the blockchain.

00:09:00.840 --> 00:09:06.800
<v Aaron van Wirdum>Okay, so even though we did already discuss this in episode 58, let's do

00:09:06.800 --> 00:09:10.800
<v Aaron van Wirdum>a recap of how this works. Last time Ruben did it, so maybe Josie, do you want to

00:09:10.800 --> 00:09:11.580
<v Aaron van Wirdum>give this a try?

00:09:11.780 --> 00:09:16.650
<v Josie>Yeah, yeah. So in a nutshell, we are

00:09:16.710 --> 00:09:21.810
<v Josie>reusing information that is already in the transaction to establish a shared

00:09:21.810 --> 00:09:27.030
<v Josie>secret and that shared secret is only valid for that single transaction and it's

00:09:27.030 --> 00:09:31.340
<v Josie>a shared secret between the sender and the recipient. The shared secret is what

00:09:31.340 --> 00:09:36.180
<v Josie>allows the recipient to find the outputs. And then the thing that we do to make

00:09:36.180 --> 00:09:41.140
<v Josie>it only spendable by the recipient is there's… of the output that is created,

00:09:41.300 --> 00:09:46.450
<v Josie>which is a Taproot public key. The output is created by combining the shared

00:09:46.450 --> 00:09:52.170
<v Josie>secret with the recipient spend public key. So basically the transaction itself

00:09:52.170 --> 00:09:57.350
<v Josie>becomes kind of the notification of a payment. And I guess the clever trick

00:09:57.350 --> 00:10:03.030
<v Josie>is to do a shared secret. Elliptic curve Diffie-Hellman is kind of the standard

00:10:03.030 --> 00:10:08.630
<v Josie>for that. And that involves a private key, public key pair. And so the sender is

00:10:08.630 --> 00:10:13.250
<v Josie>just reusing the private keys of the UTXOs that they want to spend. And then the

00:10:13.250 --> 00:10:17.910
<v Josie>recipient is finding that shared secret by looking at the public keys of those

00:10:17.910 --> 00:10:18.430
<v Josie>UTXOs.

00:10:18.670 --> 00:10:24.340
<v Aaron van Wirdum>Yeah, we're going to break this down. So first, to start, what actually is a

00:10:24.340 --> 00:10:28.820
<v Aaron van Wirdum>silent address? Like, is it basically a regular Bitcoin address? Could you also

00:10:28.820 --> 00:10:32.640
<v Aaron van Wirdum>just send money to it and then spend from the private key? No, it's a special

00:10:32.640 --> 00:10:34.740
<v Aaron van Wirdum>type of, but it is a public key, right?

00:10:35.000 --> 00:10:35.980
<v Josie>It's two public keys.

00:10:36.340 --> 00:10:38.260
<v Aaron van Wirdum>The silent address is two public keys.

00:10:38.500 --> 00:10:43.900
<v Josie>So it's more specifically, it's a bech32m encoding of two public keys.

00:10:44.350 --> 00:10:47.690
<v Josie>So it has an HRP. Instead of BC, it has SP.

00:10:47.890 --> 00:10:50.330
<v Aaron van Wirdum>I have no idea what any of this means. Do you, Sjors?

00:10:50.510 --> 00:10:51.450
<v Sjors Provoost>It's the HRP.

00:10:52.670 --> 00:10:56.870
<v Sjors Provoost>Human readable part is what HRP means. So when you look at a Bitcoin address that

00:10:56.870 --> 00:11:01.810
<v Sjors Provoost>starts with, say, BC1P, the BC stands for Bitcoin. It's like it doesn't have any

00:11:01.810 --> 00:11:05.390
<v Sjors Provoost>meaning for the computer other than, well, a little bit, but it's human readable.

00:11:05.390 --> 00:11:09.610
<v Sjors Provoost>So you can say, oh, this is a Bitcoin address and not a, say, testnet address.

00:11:09.890 --> 00:11:13.170
<v Sjors Provoost>And a silent payment address starts with SP, so you know it's a silent payment address.

00:11:14.160 --> 00:11:17.880
<v Aaron van Wirdum>Okay, you were actually literally talking about the address format, how the

00:11:17.880 --> 00:11:18.400
<v Aaron van Wirdum>address starts.

00:11:18.560 --> 00:11:21.820
<v Sjors Provoost>But I would say that yes, there's two public keys, but for the purpose of

00:11:21.820 --> 00:11:26.120
<v Sjors Provoost>explaining this shared secret, just assume it's one public key because you don't

00:11:26.120 --> 00:11:28.640
<v Sjors Provoost>need to know about the second one.

00:11:29.020 --> 00:11:29.200
<v Ruben Somsen>Yep.

00:11:29.900 --> 00:11:32.880
<v Sjors Provoost>Because we were trying to explain how the shared key works, right?

00:11:33.060 --> 00:11:37.560
<v Aaron van Wirdum>Well, I mean, first of all, I guess I'm trying to get to how the shared secret is generated.

00:11:37.860 --> 00:11:43.820
<v Sjors Provoost>Yeah, it uses both, I think. But for the sake of simplicity, just assume

00:11:43.820 --> 00:11:47.000
<v Sjors Provoost>it's just one. So you have a public key of somebody else, the person you want to

00:11:47.000 --> 00:11:50.970
<v Sjors Provoost>send money to. And they have the private key belonging to that public key, which

00:11:50.970 --> 00:11:52.750
<v Sjors Provoost>is an important ingredient for a shared secret.

00:11:53.050 --> 00:11:56.750
<v Josie>Yeah, I do think it's worth talking about them separately, though, because I

00:11:56.750 --> 00:12:01.700
<v Josie>think separating them was kind of something we... took from the Monero community

00:12:01.700 --> 00:12:04.980
<v Josie>of having the scan key or the view key and the spend key.

00:12:05.360 --> 00:12:08.260
<v Ruben Somsen>It's not from the Monero community. It was before that and it was already a thing.

00:12:08.620 --> 00:12:08.800
<v Josie>Okay.

00:12:08.980 --> 00:12:09.700
<v Ruben Somsen>So, but yeah.

00:12:09.860 --> 00:12:13.080
<v Josie>But I think the distinction is good to mention there are two keys because that

00:12:13.080 --> 00:12:15.180
<v Josie>allows for a separation of responsibility.

00:12:15.820 --> 00:12:19.760
<v Aaron van Wirdum>Okay. So the silent payments address has two public keys and two private keys.

00:12:20.020 --> 00:12:25.280
<v Josie>Well, two public keys where the recipient owns both of the private keys for the address.

00:12:25.660 --> 00:12:31.300
<v Aaron van Wirdum>Sure. Yes, exactly. Okay, so how is this shared secret now? So let's say

00:12:31.300 --> 00:12:36.260
<v Aaron van Wirdum>you've posted this somewhere, Josie, and I want to pay you. So how do I now

00:12:36.260 --> 00:12:38.720
<v Aaron van Wirdum>create a shared secret between us?

00:12:38.900 --> 00:12:42.280
<v Josie>Yeah, so you would first do your coin selection and figure out which coins you

00:12:42.280 --> 00:12:45.280
<v Josie>want to spend. You would take the private keys of all of those coins and you

00:12:45.280 --> 00:12:50.340
<v Josie>would add them up to get one new private key. Then you multiply.

00:12:50.540 --> 00:12:53.620
<v Aaron van Wirdum>Can we for simplicity just say I'm using one UTXO?

00:12:53.740 --> 00:12:58.500
<v Josie>Yep, so you take that one UTXO. You take the one private key from that UTXO. You

00:12:58.500 --> 00:13:00.280
<v Josie>multiply that one private key.

00:13:01.850 --> 00:13:06.490
<v Josie>With the first public key from my address, which is the scan public key. So your

00:13:06.490 --> 00:13:08.830
<v Josie>private key times my public key.

00:13:09.010 --> 00:13:13.470
<v Aaron van Wirdum>Yeah. What you're describing right now is the general Diffie-Hellman exchange.

00:13:13.610 --> 00:13:13.810
<v Josie>Exactly.

00:13:14.190 --> 00:13:19.690
<v Sjors Provoost>Right. Because you know Josie's public key because he put it on the internet. And

00:13:19.690 --> 00:13:23.090
<v Sjors Provoost>Josie will know your public key because that's where the money is coming from.

00:13:23.250 --> 00:13:28.550
<v Josie>It'll be in the transaction. So now you've created a shared secret. You take that

00:13:28.550 --> 00:13:32.170
<v Josie>shared secret, you do some things to it in the protocol, and then you take that

00:13:32.170 --> 00:13:37.250
<v Josie>second public key from the address and you add it to the shared secret. And then

00:13:37.250 --> 00:13:40.770
<v Josie>that makes something that is findable by me, but only spendable by me.

00:13:41.050 --> 00:13:45.390
<v Aaron van Wirdum>Right, okay, yeah. So for those, there might be listeners that don't know this,

00:13:45.530 --> 00:13:49.830
<v Aaron van Wirdum>but the general idea of the Diffie-Hellman exchange is that we both have a public

00:13:49.830 --> 00:13:55.190
<v Aaron van Wirdum>key and we both have a private key by combining, or what's a better word,

00:13:55.350 --> 00:13:55.770
<v Aaron van Wirdum>factoring.

00:13:56.900 --> 00:13:57.240
<v Josie>Multiplying.

00:13:57.480 --> 00:14:02.480
<v Aaron van Wirdum>Multiplying one of our private keys. So I will use my private key in combination

00:14:02.480 --> 00:14:05.540
<v Aaron van Wirdum>with your public key. And you can do the opposite, your private key with my

00:14:05.540 --> 00:14:05.960
<v Aaron van Wirdum>public key.

00:14:06.140 --> 00:14:06.280
<v Josie>Exactly.

00:14:06.320 --> 00:14:10.140
<v Aaron van Wirdum>Then we create one shared secret that only us will know because you need at least

00:14:10.140 --> 00:14:11.960
<v Aaron van Wirdum>one private key to generate it.

00:14:12.040 --> 00:14:15.100
<v Sjors Provoost>Yeah. But of course, because both of you know it, you can't send it to that

00:14:15.100 --> 00:14:16.740
<v Sjors Provoost>because then you can just take the money back.

00:14:17.660 --> 00:14:22.660
<v Aaron van Wirdum>Yeah, exactly. So that's where the second public key in the silent payment

00:14:22.660 --> 00:14:26.820
<v Aaron van Wirdum>address comes in. And can you repeat that for me? So what do you do with that?

00:14:26.980 --> 00:14:31.000
<v Josie>So before we talk about that one, just maybe to make it clear, the public key

00:14:31.000 --> 00:14:35.900
<v Josie>that I use to find the payment is already existing in the transaction. And this

00:14:35.900 --> 00:14:39.760
<v Josie>is kind of the important part of silent payments. There is nothing extra. Because

00:14:39.760 --> 00:14:43.920
<v Josie>I think in stealth addresses, they... They had a similar way where you would have

00:14:43.920 --> 00:14:46.920
<v Josie>this ephemeral secret and then they would encrypt it in an OP_RETURN. But then it

00:14:46.920 --> 00:14:50.780
<v Josie>was kind of obvious and the user had to pay more. So once I've created that

00:14:50.780 --> 00:14:56.580
<v Josie>shared secret as the sender, like Sjors mentioned, if I

00:14:56.580 --> 00:14:59.900
<v Josie>use just the shared secret, both of us know the shared secret. So then either one

00:14:59.900 --> 00:15:05.360
<v Josie>of us could spend it. When I take the spend public key and I add it to the shared

00:15:05.360 --> 00:15:10.220
<v Josie>secret, I now have something where... Both of us can find it with the shared

00:15:10.220 --> 00:15:14.180
<v Josie>secret, but then only I can spend it because only I know the private key to the

00:15:14.180 --> 00:15:14.940
<v Josie>spend public key.

00:15:15.360 --> 00:15:21.160
<v Ruben Somsen>Okay, so maybe one thing to sort of add here and to clarify is that last time

00:15:21.160 --> 00:15:25.780
<v Ruben Somsen>when we talked about this, there was just one key that we basically talked about.

00:15:25.920 --> 00:15:29.180
<v Ruben Somsen>And even back then, there was already the separation of there being two keys. But

00:15:29.180 --> 00:15:34.500
<v Ruben Somsen>just for simplicity, we didn't really talk about it. So you have a key with which

00:15:34.500 --> 00:15:38.440
<v Ruben Somsen>you generate the shared secret. And then there's a separate key that you add to

00:15:38.440 --> 00:15:43.940
<v Ruben Somsen>it. And the reason we have the separation of two keys is purely to have

00:15:43.940 --> 00:15:49.800
<v Ruben Somsen>the functionality of finding out whether or not you get paid, which requires what

00:15:49.800 --> 00:15:54.620
<v Ruben Somsen>we call the scan key, and actually spending from it, which we call the spend key,

00:15:55.420 --> 00:16:00.240
<v Ruben Somsen>we can separate that out. So you can have a device that does all the scanning

00:16:00.240 --> 00:16:05.340
<v Ruben Somsen>that checks, hey, did I get paid or not? And generates the shared secret and then

00:16:05.340 --> 00:16:11.080
<v Ruben Somsen>checks, is this actually a payment? And actually spending it. That key can just

00:16:11.080 --> 00:16:14.560
<v Ruben Somsen>be on a hardware wallet that isn't necessarily connected to the internet, cannot

00:16:14.560 --> 00:16:18.500
<v Ruben Somsen>really do the scanning in an efficient way. In theory, probably they could, but

00:16:18.500 --> 00:16:22.460
<v Ruben Somsen>in practice, that's difficult. So that's why we have this separation of having

00:16:22.460 --> 00:16:28.400
<v Ruben Somsen>these two keys. But if you sort of forget about that separation, you could

00:16:28.400 --> 00:16:32.480
<v Ruben Somsen>do this whole thing with a single key. It just means you can't separate out the

00:16:32.480 --> 00:16:33.880
<v Ruben Somsen>spending from the scanning.

00:16:34.180 --> 00:16:38.950
<v Aaron van Wirdum>Yeah, as I recall in the... earlier podcast with the previous podcast we did on

00:16:38.950 --> 00:16:44.490
<v Aaron van Wirdum>this you just tweaked the same to say yeah you use the same key to tweak it again

00:16:44.490 --> 00:16:48.870
<v Aaron van Wirdum>and that was to make sure that only the recipient can spend the money afterwards

00:16:48.870 --> 00:16:52.290
<v Aaron van Wirdum>yeah right and you're saying that that

00:16:53.650 --> 00:16:58.870
<v Aaron van Wirdum>it was implemented differently because this makes it easier to scan to see if you

00:16:58.870 --> 00:17:00.390
<v Aaron van Wirdum>receive the payment. Am I hearing that right?

00:17:00.610 --> 00:17:05.050
<v Ruben Somsen>It means you have two separate, you can have two separate devices that do two

00:17:05.050 --> 00:17:08.530
<v Ruben Somsen>separate things. You can have a device that does the scanning. You can have a

00:17:08.530 --> 00:17:13.010
<v Ruben Somsen>device that does the spending. And that would generally be a hardware wallet. And

00:17:13.010 --> 00:17:16.990
<v Ruben Somsen>so the last time we talked about this, basically you just, I tried to keep it

00:17:16.990 --> 00:17:21.160
<v Ruben Somsen>simple. So I didn't talk about this distinction. But since this is the second

00:17:21.160 --> 00:17:23.880
<v Ruben Somsen>time, I thought it would be good to sort of bring it up. And Josie brought it up.

00:17:24.100 --> 00:17:28.020
<v Josie>Yeah. And I think maybe to give a concrete example, when you're the recipient,

00:17:28.320 --> 00:17:34.240
<v Josie>the way that you scan is by having your scan private key in a hot online

00:17:34.240 --> 00:17:39.740
<v Josie>device. And so in the old method where we were reusing the same key, that means

00:17:39.740 --> 00:17:43.720
<v Josie>in order to scan the private key that you need to find the payments and also

00:17:43.720 --> 00:17:47.520
<v Josie>spend the payments is now on an internet connected device. And that's really not

00:17:47.520 --> 00:17:50.800
<v Josie>a great idea, right? So by having two separate keys in the separation of

00:17:50.800 --> 00:17:56.620
<v Josie>responsibility you can hand out that scan key to an online device and that online

00:17:56.620 --> 00:18:00.940
<v Josie>device will do the scanning for you, which, if that device gets hacked or

00:18:00.940 --> 00:18:05.240
<v Josie>whatever and someone gets that key, it's the same as leaking your xpub. Someone

00:18:05.240 --> 00:18:08.040
<v Josie>would be able to see your payments, but they wouldn't be able to spend them. So I

00:18:08.040 --> 00:18:10.840
<v Josie>think that's really kind of the critical thing why the two keys is so important.

00:18:11.220 --> 00:18:16.200
<v Aaron van Wirdum>I want to pause here for a second on the scanning issue. So how does the scanning

00:18:16.200 --> 00:18:19.920
<v Aaron van Wirdum>actually, like how do you know you've been paid? How does this actually like

00:18:19.920 --> 00:18:20.340
<v Aaron van Wirdum>work?

00:18:20.990 --> 00:18:26.390
<v Josie>Yeah, so you look at a transaction and there's a couple criteria that we can use

00:18:26.390 --> 00:18:31.330
<v Josie>to see whether or not the transaction is even eligible to be a silent payment

00:18:31.330 --> 00:18:35.350
<v Josie>transaction. So the first one is it needs to have at least one Taproot output.

00:18:36.730 --> 00:18:40.810
<v Josie>You can even go further and say, well, I'm not really interested in other

00:18:40.810 --> 00:18:43.430
<v Josie>people's silent payments, so I'm only going to scan transactions that have at

00:18:43.430 --> 00:18:45.790
<v Josie>least one unspent Taproot output.

00:18:45.990 --> 00:18:51.810
<v Aaron van Wirdum>And to be clear, it scans for Taproot because it uses the Taproot. It uses

00:18:51.810 --> 00:18:56.010
<v Aaron van Wirdum>Schnorr, basically, I would say, right? So if it doesn't have the Taproot...

00:18:56.650 --> 00:18:59.090
<v Aaron van Wirdum>output, then there's no way it can be a silent payment.

00:18:59.430 --> 00:19:04.630
<v Josie>Yeah, we specified in the BIP that the sender always generates a Taproot output.

00:19:04.650 --> 00:19:08.450
<v Josie>So you can skip all transactions that don't have Taproot outputs. You can also

00:19:08.450 --> 00:19:12.270
<v Josie>skip all transactions where all the Taproot outputs are spent. Then the second

00:19:12.270 --> 00:19:15.410
<v Josie>thing you look at is what are the inputs of the transaction? And there needs to

00:19:15.410 --> 00:19:21.330
<v Josie>be at least one input that is specified in the BIP. So like a native SegWit input

00:19:21.330 --> 00:19:26.720
<v Josie>or a wrapped SegWit input or... pay-to-public-key and or a legacy, so pretty much like—

00:19:26.720 --> 00:19:27.320
<v Aaron van Wirdum>Why is that?

00:19:27.320 --> 00:19:33.040
<v Josie>Um, there's complications with other inputs, like the old bare multi-sig style,

00:19:33.040 --> 00:19:37.120
<v Josie>where, like, like Ruben had mentioned earlier one of the things we were working

00:19:37.120 --> 00:19:41.040
<v Josie>through in the BIP was dealing with these cases of malleability, and so that's

00:19:41.040 --> 00:19:44.240
<v Josie>that's one example of it. Okay, so if you look at the inputs and there's nothing

00:19:44.240 --> 00:19:46.480
<v Josie>in there that's specified in the BIP, you're like, okay, I'm gonna skip this

00:19:46.480 --> 00:19:51.000
<v Josie>transaction. Now, when you see a transaction that has an unspent Taproot output

00:19:51.000 --> 00:19:52.560
<v Josie>and at least one eligible input.

00:19:52.720 --> 00:19:57.260
<v Aaron van Wirdum>So just to stop you for one second, what you've described right now is like,

00:19:57.380 --> 00:19:59.480
<v Aaron van Wirdum>could it technically be a silent payment?

00:19:59.680 --> 00:19:59.730
<v Josie>Exactly.

00:20:00.260 --> 00:20:03.400
<v Aaron van Wirdum>Payment. That's the first thing. Okay, now the answer is yes. It could

00:20:03.400 --> 00:20:04.740
<v Aaron van Wirdum>technically be. Now what?

00:20:04.900 --> 00:20:08.280
<v Josie>Now the question is, okay, this could be a silent payment. Is it a silent payment

00:20:08.280 --> 00:20:13.080
<v Josie>to me? So then you take the inputs, you get the public keys from the inputs, and

00:20:13.080 --> 00:20:16.760
<v Josie>each input kind of has its own way of doing that, but you get the public key. If

00:20:16.760 --> 00:20:21.760
<v Josie>there are multiple inputs, you sum up those to get one single public key, and

00:20:21.800 --> 00:20:25.840
<v Josie>then you take that public key, you multiply it by your scan private key, generate

00:20:25.840 --> 00:20:30.240
<v Josie>the shared secret, and then you add your spend public key to it. which then

00:20:30.240 --> 00:20:34.760
<v Josie>creates a new public key. And you see if that public key is present as any of the

00:20:34.760 --> 00:20:39.080
<v Josie>Taproot outputs. If that public key that you just created matches one of the

00:20:39.080 --> 00:20:42.900
<v Josie>Taproot outputs, then that Taproot output is yours and it's only spendable by

00:20:42.900 --> 00:20:46.380
<v Josie>you. And you add it to the wallet and then move on to the next transaction.

00:20:46.780 --> 00:20:52.780
<v Sjors Provoost>So any wallet will look at every transaction in a block to see if the transaction

00:20:52.780 --> 00:20:56.560
<v Sjors Provoost>is going to them. So that's conceptually not new. But what is new is that you

00:20:56.560 --> 00:20:57.900
<v Sjors Provoost>need to do a bunch of extra math,

00:21:00.350 --> 00:21:05.130
<v Sjors Provoost>multiplying two points or a private key and a public key in order to even see if

00:21:05.130 --> 00:21:09.810
<v Sjors Provoost>this is going to you. So it makes it computationally a little heavier to scan.

00:21:09.810 --> 00:21:15.190
<v Josie>And maybe to put some context around how much is that extra computation,

00:21:15.510 --> 00:21:20.330
<v Josie>when you verify a signature, so a full node sees a transaction, it verifies all

00:21:20.330 --> 00:21:25.070
<v Josie>the signatures, you're doing a multiplication to verify those signatures. So the

00:21:25.070 --> 00:21:30.280
<v Josie>amount of work that you're doing to check a silent payment, is roughly a

00:21:30.280 --> 00:21:34.540
<v Josie>signature check. So it is more work, but I think it's good to quantify how much

00:21:34.540 --> 00:21:38.380
<v Josie>more work are we talking about. So it's basically like if a transaction had three

00:21:38.380 --> 00:21:43.800
<v Josie>inputs, you're verifying a transaction as if it had four inputs. So not that much

00:21:43.800 --> 00:21:44.920
<v Josie>more work for a full node.

00:21:44.960 --> 00:21:48.680
<v Sjors Provoost>Right, it's one signature equivalent per transaction, but a transaction can have

00:21:48.680 --> 00:21:49.480
<v Sjors Provoost>multiple inputs.

00:21:49.640 --> 00:21:49.820
<v Josie>Correct.

00:21:49.980 --> 00:21:54.960
<v Sjors Provoost>So it doesn't double the time to validate a block, but it adds a bit to it.

00:21:55.120 --> 00:21:57.100
<v Josie>Yeah, I would say maybe...

00:21:58.850 --> 00:22:01.870
<v Ruben Somsen>I think that's the most accurate thing to say, right? Like just one additional

00:22:01.870 --> 00:22:03.090
<v Ruben Somsen>signature check, which is…

00:22:03.090 --> 00:22:07.550
<v Sjors Provoost>Yeah, and so then it depends on what you are. If you are a full node and you are

00:22:07.550 --> 00:22:10.670
<v Sjors Provoost>in the business of doing this once every 10 minutes as a new block comes in,

00:22:10.830 --> 00:22:16.030
<v Sjors Provoost>it'll take you normally, I think, far less than a second to verify a new block

00:22:16.030 --> 00:22:20.030
<v Sjors Provoost>when it comes in. So now it'll take you far less than a second plus a little bit.

00:22:20.290 --> 00:22:20.530
<v Ruben Somsen>Yeah.

00:22:20.770 --> 00:22:22.530
<v Sjors Provoost>So for a full node, this is no extra work.

00:22:24.030 --> 00:22:27.490
<v Sjors Provoost>Complexity starts when you're dealing with light clients, light wallets, mobile

00:22:27.490 --> 00:22:28.590
<v Sjors Provoost>wallets, those kind of things.

00:22:28.890 --> 00:22:29.050
<v Aaron van Wirdum>Yeah.

00:22:29.170 --> 00:22:29.330
<v Josie>That's right.

00:22:29.570 --> 00:22:35.110
<v Aaron van Wirdum>Okay, let's get there. So just to recap, usually any full node always checks any

00:22:35.110 --> 00:22:39.710
<v Aaron van Wirdum>transaction in a block to see if it is being paid, plus checks if the signatures

00:22:39.710 --> 00:22:44.050
<v Aaron van Wirdum>are valid. Now with this, it would be one extra check to see if you're paid

00:22:44.050 --> 00:22:45.350
<v Aaron van Wirdum>through a silent payment.

00:22:45.590 --> 00:22:45.830
<v Josie>Correct.

00:22:46.130 --> 00:22:50.550
<v Aaron van Wirdum>Okay. What about, so light clients, it's more complicated for light clients than,

00:22:50.790 --> 00:22:55.590
<v Aaron van Wirdum>because light clients don't usually check every transaction to see if it's, well,

00:22:55.650 --> 00:22:57.670
<v Aaron van Wirdum>they don't check every transaction to begin with.

00:22:57.710 --> 00:23:00.370
<v Sjors Provoost>Yeah, there's different kinds of light clients, right? There is the old school

00:23:00.370 --> 00:23:04.490
<v Sjors Provoost>Electrum style, well, even older school Bloom filters, I believe, but let's not

00:23:04.490 --> 00:23:07.150
<v Sjors Provoost>even talk about that. And then you have, well,

00:23:08.730 --> 00:23:13.420
<v Sjors Provoost>Electrum style, which basically tells a server somewhere on the internet. hey,

00:23:13.660 --> 00:23:18.040
<v Sjors Provoost>here are my addresses, please tell me my balance. That is not optimal for

00:23:18.040 --> 00:23:22.200
<v Sjors Provoost>privacy. Also, wouldn't work directly with silent payments, right? You would have

00:23:22.200 --> 00:23:27.700
<v Sjors Provoost>to give them your scanning key and then they could decide. But there are better

00:23:27.700 --> 00:23:32.940
<v Sjors Provoost>ways and we did an episode about it, BIP-157. Used to be called Neutrino Filters.

00:23:33.040 --> 00:23:34.860
<v Sjors Provoost>I don't know if anybody still uses that term.

00:23:35.120 --> 00:23:38.480
<v Ruben Somsen>Yeah, I mean, I think that was more of a marketing name on the lightning side,

00:23:38.640 --> 00:23:39.120
<v Ruben Somsen>but yeah.

00:23:39.620 --> 00:23:42.080
<v Josie>So yeah, BIP-157 and BIP-158.

00:23:43.040 --> 00:23:48.940
<v Sjors Provoost>We did an episode about it, but the bottom line is you, instead of telling

00:23:48.940 --> 00:23:54.930
<v Sjors Provoost>somebody else what your addresses are, you... ask them for sort of a summary of

00:23:54.930 --> 00:23:58.830
<v Sjors Provoost>the block, a filter of the block. And you download these summaries, which are

00:23:58.830 --> 00:24:01.590
<v Sjors Provoost>much shorter than blocks. And then based on that, you're able to calculate

00:24:01.590 --> 00:24:06.130
<v Sjors Provoost>whether or not that block has any transaction that pays you. Or at least guess.

00:24:06.290 --> 00:24:10.550
<v Sjors Provoost>Like, you might be wrong in the sense that there can be false positives. So once

00:24:10.550 --> 00:24:14.130
<v Sjors Provoost>you think there's a transaction for you, you download the actual block. And

00:24:14.130 --> 00:24:17.770
<v Sjors Provoost>you're going to download slightly too many blocks. But this is a nice way so that

00:24:17.770 --> 00:24:20.730
<v Sjors Provoost>as a light client, you're only going to download a fraction of all the blocks to

00:24:20.730 --> 00:24:25.010
<v Sjors Provoost>see if there's a transaction for you. This can be used with silent payments, but

00:24:25.010 --> 00:24:28.770
<v Sjors Provoost>it's just one of the ingredients. You need to do more because this does not do

00:24:28.770 --> 00:24:29.790
<v Sjors Provoost>the multiplication trick.

00:24:30.240 --> 00:24:35.040
<v Ruben Somsen>So maybe one thing to sort of start with for this conversation that's important

00:24:35.040 --> 00:24:39.700
<v Ruben Somsen>to mention is what is even the definition of a light client? And I think one

00:24:39.700 --> 00:24:43.720
<v Ruben Somsen>useful definition that isn't really used today, but I think is important to

00:24:43.720 --> 00:24:48.820
<v Ruben Somsen>highlight, is that you somehow figure out whether or not you got paid

00:24:48.820 --> 00:24:54.280
<v Ruben Somsen>without a full node doing all the work for you. Right? Because normally,

00:24:54.660 --> 00:24:55.480
<v Ruben Somsen>like...

00:24:55.480 --> 00:24:59.360
<v Sjors Provoost>Without your full node doing all the work for you. Somebody else's full node will do it.

00:24:59.440 --> 00:25:03.380
<v Ruben Somsen>No, but that's what I mean, right? Like, I think connecting to a full node,

00:25:03.500 --> 00:25:07.100
<v Ruben Somsen>whether or not that's yours, I think sort of defeats the purpose of a light

00:25:07.100 --> 00:25:11.340
<v Ruben Somsen>client. Obviously, if you connect to your full node, you will know whether or not

00:25:11.340 --> 00:25:14.380
<v Ruben Somsen>you got paid. Is that a light client? Not really, I would say.

00:25:14.600 --> 00:25:16.780
<v Sjors Provoost>No, I would call it more like a remote control.

00:25:17.100 --> 00:25:21.400
<v Ruben Somsen>Exactly. But then, like, if that remote control full node is somebody else's...

00:25:21.550 --> 00:25:24.670
<v Ruben Somsen>Now suddenly it becomes a light client. I don't think that makes a lot of sense, actually.

00:25:24.790 --> 00:25:27.540
<v Sjors Provoost>No, then it becomes a trusted... Yes.

00:25:27.540 --> 00:25:31.680
<v Ruben Somsen>But I think today when we talk about light clients, a lot of people call the

00:25:31.680 --> 00:25:35.920
<v Ruben Somsen>connect to somebody else's node model, they call that a light client. And I think

00:25:35.920 --> 00:25:40.600
<v Ruben Somsen>that's kind of a mistake or at least something we should differentiate. And we

00:25:40.600 --> 00:25:44.740
<v Ruben Somsen>should say, no, if you connect to somebody else's full node and they do all the

00:25:44.740 --> 00:25:50.000
<v Ruben Somsen>work as if it was your full node, I don't think that really is what we want from

00:25:50.000 --> 00:25:52.220
<v Ruben Somsen>a light client at least or what we should call a light client.

00:25:52.720 --> 00:25:56.940
<v Aaron van Wirdum>In either case, in these cases, the silent payments thing is still easy. The full

00:25:56.940 --> 00:25:58.420
<v Aaron van Wirdum>node just does it and tells you what's going on.

00:25:58.420 --> 00:25:58.920
<v Ruben Somsen>Yes and no.

00:25:58.960 --> 00:25:59.800
<v Aaron van Wirdum>So the challenge...

00:25:59.800 --> 00:26:04.440
<v Sjors Provoost>Yeah, not really, because you have this one extra calculation per block, per

00:26:04.440 --> 00:26:07.380
<v Sjors Provoost>transaction that we talked about. But if you're doing this on behalf of a million

00:26:07.380 --> 00:26:12.440
<v Sjors Provoost>people, now for every block, you have, you know... 10,000 transactions in the

00:26:12.440 --> 00:26:17.660
<v Sjors Provoost>block plus a million checks. So that does not scale very well at all for this way

00:26:17.660 --> 00:26:19.040
<v Sjors Provoost>of doing whatever you want to call it.

00:26:19.580 --> 00:26:21.480
<v Aaron van Wirdum>So are we going to try to solve this problem?

00:26:21.592 --> 00:26:22.104
<v Sjors Provoost>[unclear] block scanning [unclear].

00:26:22.900 --> 00:26:28.700
<v Josie>I would mention it is feasible, but the problem, and this is usually what spooks

00:26:28.700 --> 00:26:33.440
<v Josie>engineers, is that it scales linearly in the number of users. So the more users

00:26:33.440 --> 00:26:37.860
<v Josie>are connecting to your node, the more work you have to do. Now, because that work

00:26:37.860 --> 00:26:42.880
<v Josie>is roughly a signature check, If I'm a wallet provider and I'm running like some

00:26:42.880 --> 00:26:46.860
<v Josie>pretty nice hardware, this is feasible. And I did some like back of the number

00:26:46.860 --> 00:26:50.800
<v Josie>math on it at some point. And, you know, you could scale up to like 10 million

00:26:50.800 --> 00:26:56.240
<v Josie>users with, you know, Amazon hardware and whatnot. But the reason I don't think

00:26:56.240 --> 00:27:01.740
<v Josie>this is super interesting is those users are giving all of their privacy to that

00:27:01.740 --> 00:27:05.720
<v Josie>server. It's the same as if you just handed your xpub to a server and said, hey,

00:27:05.720 --> 00:27:10.200
<v Josie>just tell me when I get paid. Now there are some models where I think users might

00:27:10.200 --> 00:27:11.620
<v Josie>want to do this um…

00:27:11.620 --> 00:27:14.120
<v Sjors Provoost>I mean, you're describing the norm, basically.

00:27:14.120 --> 00:27:16.000
<v Josie>Yeah, I mean, that's basically how…

00:27:16.000 --> 00:27:17.700
<v Sjors Provoost>We'd like to avoid that [unclear], right?

00:27:17.700 --> 00:27:20.760
<v Josie>And so, but I want to mention, I don't think that's really… It's not

00:27:20.760 --> 00:27:24.920
<v Josie>computationally infeasible. I just don't think it's an interesting route to

00:27:24.920 --> 00:27:26.540
<v Josie>pursue or to even advocate for.

00:27:27.170 --> 00:27:31.090
<v Ruben Somsen>Yeah. And I think that goes into the second distinction I wanted to make, which

00:27:31.090 --> 00:27:35.390
<v Ruben Somsen>is whether or not it's a light client is one of them. And the second one is

00:27:35.390 --> 00:27:40.150
<v Ruben Somsen>whether or not you figuring out whether or not you got paid, whether you did that

00:27:40.150 --> 00:27:44.050
<v Ruben Somsen>in a private way or not. Right? Because the non-private way is sort of simple.

00:27:44.170 --> 00:27:48.030
<v Ruben Somsen>Like you give someone an address and you just ask like, hey, did I get paid? And

00:27:48.030 --> 00:27:51.710
<v Ruben Somsen>they'll say yes or no. Well, now you lose all your privacy. And I think

00:27:51.710 --> 00:27:55.230
<v Ruben Somsen>especially for a protocol like this, where privacy is sort of like a big

00:27:56.780 --> 00:28:01.160
<v Ruben Somsen>point, it makes even less sense to sort of combine this with a wallet that is

00:28:01.160 --> 00:28:01.660
<v Ruben Somsen>non-private.

00:28:02.090 --> 00:28:02.530
<v Josie>Yeah.

00:28:02.650 --> 00:28:04.510
<v Aaron van Wirdum>So what problem are we going to solve here? Both?

00:28:04.810 --> 00:28:08.890
<v Ruben Somsen>Yeah. So we want to be able to figure out whether or not we got paid without

00:28:08.890 --> 00:28:13.710
<v Ruben Somsen>having a full node do all the work for us and without losing our privacy.

00:28:13.970 --> 00:28:14.250
<v Aaron van Wirdum>Okay.

00:28:14.310 --> 00:28:19.250
<v Ruben Somsen>That is essentially what we want. And one of the big components there that Sjors

00:28:19.250 --> 00:28:25.010
<v Ruben Somsen>mentioned is BIP 157, BIP 158. That is one component. But

00:28:25.010 --> 00:28:30.540
<v Ruben Somsen>the first thing sort of we need to answer... the scanning question is sort of

00:28:30.540 --> 00:28:35.740
<v Ruben Somsen>like how do we get a light client? How do we get a phone to figure out

00:28:35.740 --> 00:28:41.340
<v Ruben Somsen>to do basically the equivalent of scanning without outsourcing it to somebody

00:28:41.340 --> 00:28:46.440
<v Ruben Somsen>else and losing all their privacy? And the answer to that is essentially that for

00:28:46.440 --> 00:28:50.360
<v Ruben Somsen>every transaction in the Bitcoin blockchain, every silent payment eligible

00:28:50.360 --> 00:28:56.140
<v Ruben Somsen>transaction, a full node or some kind of server can

00:28:56.140 --> 00:29:02.070
<v Ruben Somsen>generate a single 33-byte value, and send that to the light client. And the

00:29:02.070 --> 00:29:06.750
<v Ruben Somsen>light client can use that to generate what essentially would be the address if it

00:29:06.750 --> 00:29:08.570
<v Ruben Somsen>was a payment for them.

00:29:08.710 --> 00:29:13.330
<v Sjors Provoost>So this 32 bytes per transaction is the same for everyone? Just like the filters

00:29:13.330 --> 00:29:15.010
<v Sjors Provoost>in BIP-158 are the same for everyone?

00:29:15.230 --> 00:29:15.570
<v Josie>Correct.

00:29:15.810 --> 00:29:19.630
<v Sjors Provoost>So it's not a privacy-sensitive thing. You just ask it from any node. They'll

00:29:19.630 --> 00:29:22.090
<v Sjors Provoost>give it to you. They don't know anything about you other than that you're

00:29:22.090 --> 00:29:23.070
<v Sjors Provoost>interested in silent payments.

00:29:23.270 --> 00:29:26.870
<v Josie>Not only is it the same for everyone, it's also public information. It's

00:29:26.870 --> 00:29:31.450
<v Josie>basically, so light clients don't have access to blocks or transactions. So this

00:29:31.450 --> 00:29:37.150
<v Josie>33 byte value is a summary of the input public keys of the transaction. So

00:29:37.150 --> 00:29:40.090
<v Josie>it's the same information anybody would have just by looking at the blockchain.

00:29:40.310 --> 00:29:44.270
<v Josie>And so we'll call it an indexing server. An indexing server just sees

00:29:44.270 --> 00:29:49.200
<v Josie>transactions coming in. It says, hey. Could this be a silent payment? If yes, let

00:29:49.200 --> 00:29:53.560
<v Josie>me sum up the inputs, store that 33-byte key in an index, and then any client

00:29:53.560 --> 00:29:57.620
<v Josie>that requests it, I'll just send them the 33 bytes that they need to complete

00:29:57.620 --> 00:29:58.760
<v Josie>that Diffie-Hellman operation.

00:29:59.160 --> 00:30:02.940
<v Sjors Provoost>Yeah, because remember, the whole way you figure out whether you get paid was to

00:30:02.940 --> 00:30:05.060
<v Sjors Provoost>start with these inputs to look at them.

00:30:05.550 --> 00:30:10.130
<v Aaron van Wirdum>But this sounds to me like light clients would still be checking every

00:30:10.130 --> 00:30:11.150
<v Aaron van Wirdum>transaction in a way.

00:30:11.330 --> 00:30:11.630
<v Ruben Somsen>Right.

00:30:12.030 --> 00:30:16.350
<v Sjors Provoost>Yes, but they're checking only 32 bytes for every transaction versus the whole

00:30:16.350 --> 00:30:21.030
<v Sjors Provoost>transaction. So a whole transaction might be 150 bytes, but this summary is only

00:30:21.030 --> 00:30:25.030
<v Sjors Provoost>32 bytes and you're only getting the summary for transactions that can be a

00:30:25.030 --> 00:30:28.330
<v Sjors Provoost>silent payment. So you're getting not all the transactions in a block and you're

00:30:28.330 --> 00:30:32.470
<v Sjors Provoost>getting not all of the transactions, not all of the transaction data.

00:30:32.940 --> 00:30:37.620
<v Ruben Somsen>And one important point here is that we can save a lot of bandwidth by...

00:30:39.280 --> 00:30:43.780
<v Ruben Somsen>discarding all the transactions where all the outputs were spent. So the longer

00:30:43.780 --> 00:30:47.240
<v Ruben Somsen>you wait, the more outputs are spent, the less data you have to download to

00:30:47.240 --> 00:30:48.660
<v Ruben Somsen>actually check whether or not [unclear] got spent.

00:30:48.860 --> 00:30:51.580
<v Sjors Provoost>Assuming you keep track of what you've seen before, right? So you're a light

00:30:51.580 --> 00:30:56.800
<v Sjors Provoost>wallet. You have at some point detected a silent payment to you. You remember

00:30:56.800 --> 00:30:59.460
<v Sjors Provoost>that for the next time you start the wallet, you say, okay, give me all the

00:30:59.460 --> 00:31:04.340
<v Sjors Provoost>blocks. Give me these summaries starting from block 100,000 blocks ago. And then

00:31:04.340 --> 00:31:07.520
<v Sjors Provoost>it's going to say, well, you're not going to be interested since you asked

00:31:07.520 --> 00:31:11.700
<v Sjors Provoost>before. you're not going to be interested in anything that somebody else spent

00:31:11.700 --> 00:31:15.080
<v Sjors Provoost>because that couldn't have been your coins. So assuming you have a single wallet

00:31:15.080 --> 00:31:18.620
<v Sjors Provoost>that's keeping track of what it's already asked, yeah, it can ask for a summary.

00:31:19.300 --> 00:31:23.080
<v Sjors Provoost>This cut through idea where anything that's already been spent was obviously not

00:31:23.080 --> 00:31:24.660
<v Sjors Provoost>spent by you. So it wasn't sent to you.

00:31:24.920 --> 00:31:29.800
<v Josie>And the cut through has a really nice property here where the longer. So when you

00:31:29.800 --> 00:31:33.020
<v Josie>first hear this, the initial thought is the longer the light client stays

00:31:33.020 --> 00:31:36.420
<v Josie>offline, the more data they're going to have to download. And this has been a

00:31:36.420 --> 00:31:40.340
<v Josie>problem, I think, in other light clients that do this downloading stuff. If you

00:31:40.340 --> 00:31:43.260
<v Josie>leave it off for a month, well, now you need to download a month's worth of

00:31:43.260 --> 00:31:48.700
<v Josie>transactions, which is just not feasible with the cut through. The data that the

00:31:48.700 --> 00:31:52.960
<v Josie>light client needs to download kind of asymptotically approaches this constant

00:31:52.960 --> 00:31:58.280
<v Josie>value because the longer, and this is kind of an interesting property of Bitcoin,

00:31:58.520 --> 00:32:03.820
<v Josie>the UTXO set is split into what I would call like hot coins and cold coins. UTXOs

00:32:03.820 --> 00:32:08.440
<v Josie>get created and never spent. or UTXOs get created and get spent within three

00:32:08.440 --> 00:32:12.880
<v Josie>days. And there's not really much in between there. So if a light client were to

00:32:12.880 --> 00:32:17.000
<v Josie>scan once every three days, they're skipping a whole lot of transactions that are

00:32:17.000 --> 00:32:20.960
<v Josie>just not relevant to them. And this is, I think, the trick that we realize

00:32:20.960 --> 00:32:23.200
<v Josie>actually makes light client scanning feasible.

00:32:23.440 --> 00:32:25.840
<v Sjors Provoost>The one trick they did not want you to know about.

00:32:26.280 --> 00:32:27.120
<v Josie>It's one trick.

00:32:27.440 --> 00:32:32.500
<v Sjors Provoost>And so once you have this list of these tweaks, you can now...

00:32:33.010 --> 00:32:38.990
<v Sjors Provoost>What you do is you use that 32-byte number, you multiply it or

00:32:38.990 --> 00:32:43.270
<v Sjors Provoost>whatever it is with your own private key, your own silent payment private key,

00:32:43.330 --> 00:32:48.250
<v Sjors Provoost>and then you know what address you should have been paid to. So basically the

00:32:48.250 --> 00:32:52.950
<v Sjors Provoost>result of this calculation is an address. And now you use the traditional BIP-158

00:32:52.950 --> 00:32:57.830
<v Sjors Provoost>filters to say, hey, is there a payment to this address? And you would ask that

00:32:57.830 --> 00:33:01.130
<v Sjors Provoost>for this subset of blocks, right? So you might get slightly too many blocks.

00:33:02.930 --> 00:33:08.290
<v Josie>Maybe take one step back. You create what I would call potential public keys. So

00:33:08.290 --> 00:33:11.770
<v Josie>you do an ECDH with each of these inputs, which means you create all these

00:33:11.770 --> 00:33:16.690
<v Josie>Taproot outputs. Now you need a way as the light client to know if any of these

00:33:16.690 --> 00:33:21.950
<v Josie>public keys exist in the UTXO set. There are many ways you could do this. One way

00:33:21.950 --> 00:33:25.650
<v Josie>would be just connect to an Electrum server or an address lookup server and just

00:33:25.650 --> 00:33:28.550
<v Josie>hammer them with like 2000 addresses and be like, hey, tell me if any of these

00:33:28.550 --> 00:33:32.510
<v Josie>exist in the UTXO set. That's not private. And it's also kind of a denial of

00:33:32.510 --> 00:33:36.970
<v Josie>service on the Electrum server. So the much better way from a performance and

00:33:36.970 --> 00:33:41.990
<v Josie>privacy standpoint is to get some efficient summary

00:33:42.650 --> 00:33:46.930
<v Josie>of UTXOs in a block, which I think BIP-158 is the best example of that. So you

00:33:46.930 --> 00:33:51.110
<v Josie>download these filters and you take these public keys and you test to exist

00:33:51.110 --> 00:33:55.230
<v Josie>whether or not they exist in the filter. If they exist in the filter, that means

00:33:55.230 --> 00:33:59.210
<v Josie>that there's a UTXO corresponding to this and you know I'm the only person who

00:33:59.210 --> 00:34:03.390
<v Josie>would be able to create this UTXO. So then you download the block and get it. But

00:34:03.390 --> 00:34:08.150
<v Josie>I make that distinction there because if we think about, okay, now I have all

00:34:08.150 --> 00:34:12.110
<v Josie>these... public keys and I need to know whether or not they exist, you could use

00:34:12.110 --> 00:34:16.230
<v Josie>any method for querying a UTXO set, whether that's address lookup, private

00:34:16.230 --> 00:34:20.910
<v Josie>information retrieval, BIP 158, and I think BIP 158 is just the best example that

00:34:20.910 --> 00:34:21.490
<v Josie>we have right now.

00:34:22.610 --> 00:34:28.070
<v Aaron van Wirdum>Right. This sounds clever. There's one part that's not really clear to me but I

00:34:28.070 --> 00:34:31.590
<v Aaron van Wirdum>sense that that's maybe more something if people want to know they'll have to

00:34:31.590 --> 00:34:36.950
<v Aaron van Wirdum>read the BIP which is how… How the calculation is actually done from these 33

00:34:36.950 --> 00:34:41.730
<v Aaron van Wirdum>bytes? Like what is actually calculated there? Is that something that audio will

00:34:41.730 --> 00:34:44.910
<v Aaron van Wirdum>allow you to explain or should we just refer people to the paper?

00:34:45.050 --> 00:34:50.810
<v Josie>No, I think it's really simple. So a Bitcoin public key is usually serialized in

00:34:50.810 --> 00:34:55.670
<v Josie>what's called a compressed format. So that's 33 bytes. The first byte tells you

00:34:55.670 --> 00:35:00.300
<v Josie>whether it's an even or an odd point, and then the next 32 bytes is an encoding

00:35:00.300 --> 00:35:05.580
<v Josie>of the x coordinate of the point. So what the client does is it downloads these

00:35:05.580 --> 00:35:11.500
<v Josie>33 bytes, which is a serialization of a public key. It deserializes that

00:35:11.500 --> 00:35:15.380
<v Josie>public key into an actual point and then does the multiplication. Right.

00:35:16.020 --> 00:35:19.160
<v Sjors Provoost>Then you're just multiplying your private key with this public key that you just

00:35:19.160 --> 00:35:21.080
<v Sjors Provoost>found. A point is a public key.

00:35:21.080 --> 00:35:22.420
<v Aaron van Wirdum>Yeah, okay.

00:35:23.930 --> 00:35:28.890
<v Aaron van Wirdum>Somewhat clear enough to me. Last time, Sjors brought up something that he calls

00:35:28.890 --> 00:35:33.250
<v Aaron van Wirdum>the Hotel California problem. Sjors, do you want to repeat what this problem is?

00:35:34.910 --> 00:35:40.570
<v Sjors Provoost>Yes. I mean, yeah. So the idea is that because this is a little bit of extra work

00:35:40.570 --> 00:35:45.450
<v Sjors Provoost>for every block that you want to scan, if you decide to have a silent payment

00:35:45.450 --> 00:35:48.990
<v Sjors Provoost>address and you make it known to the world, you now need to do this extra work

00:35:48.990 --> 00:35:53.870
<v Sjors Provoost>forever. And so the question is, should there be a way to expire this thing?

00:35:54.880 --> 00:35:57.820
<v Sjors Provoost>And then, you know, we'll let Josie take over from here.

00:35:58.180 --> 00:36:00.560
<v Aaron van Wirdum>Josie, Ruben, is there a way to expire this thing?

00:36:00.700 --> 00:36:02.880
<v Ruben Somsen>Josie is most passionate about this.

00:36:02.880 --> 00:36:08.860
<v Josie>Yeah, this is what I'm passionate about. So first of all, this problem is

00:36:08.860 --> 00:36:14.430
<v Josie>not unique to silent payments. If I were to post a, you know,

00:36:14.610 --> 00:36:19.690
<v Josie>regular SegWit address somewhere on the internet, I now have to keep checking

00:36:19.690 --> 00:36:23.730
<v Josie>that address for eternity to make sure that I actually get payments.

00:36:23.970 --> 00:36:27.050
<v Sjors Provoost>But it doesn't need so much CPU power to boil the oceans.

00:36:27.290 --> 00:36:33.110
<v Josie>I mean, it kind of does in a way, because with assuming that you

00:36:33.110 --> 00:36:37.310
<v Josie>got that from an xpub, you now have kind of this gap limit thing to worry about.

00:36:37.490 --> 00:36:42.420
<v Josie>So I think it's a bit of a misconception that... you know, silent payments is

00:36:42.420 --> 00:36:46.360
<v Josie>like an order of magnitude more work for a full node. I think any type of address

00:36:46.360 --> 00:36:49.760
<v Josie>scanning requires some amount of work and some amount of querying the UTXO set,

00:36:49.860 --> 00:36:52.900
<v Josie>which is an expensive operation. So really what we have is kind of this like

00:36:52.900 --> 00:36:57.140
<v Josie>stale data problem, where if I post payment instructions in a public place, I

00:36:57.140 --> 00:37:00.660
<v Josie>should probably keep checking for them. It was brought up with silent payments

00:37:00.660 --> 00:37:05.320
<v Josie>because then people kind of realized, oh, these are designed to be reused.

00:37:05.540 --> 00:37:08.900
<v Josie>Because today, if I post an address somewhere, Most people aren't going to use it

00:37:08.900 --> 00:37:11.360
<v Josie>because they're like, I don't really want to dox my payment to the whole world.

00:37:12.390 --> 00:37:17.350
<v Josie>But I would argue that this is a problem that it really shouldn't be solved in

00:37:17.350 --> 00:37:20.730
<v Josie>the silent payments BIP because now we have this scope creep where silent

00:37:20.730 --> 00:37:26.230
<v Josie>payments, the BIP, BIP 352 is supposed to be a very, you know, concrete

00:37:26.230 --> 00:37:30.230
<v Josie>proposal for doing this shared secret exchange for address generation. And the

00:37:30.230 --> 00:37:34.530
<v Josie>BIP should just be focused on that. If we start throwing in like expiry times and

00:37:34.530 --> 00:37:38.170
<v Josie>other things it's like, well, it's scope creep. And then, you know, if we solve

00:37:38.170 --> 00:37:40.990
<v Josie>it in silent payments, but then the problem still exists for regular addresses

00:37:40.990 --> 00:37:44.430
<v Josie>and xpubs and all this other stuff, we didn't really fix the problem for Bitcoin.

00:37:44.970 --> 00:37:50.850
<v Josie>So I would say if people believe that expiry is what they want, we should

00:37:50.850 --> 00:37:54.510
<v Josie>write a new standard, a new BIP that applies to all forms of Bitcoin payment

00:37:54.510 --> 00:37:58.190
<v Josie>instructions. You know, BOLT 12 invoices, silent payment addresses, regular

00:37:58.190 --> 00:38:03.700
<v Josie>addresses, xpubs. The second thing I would say, I don't think expiry is

00:38:03.700 --> 00:38:08.340
<v Josie>actually what you want here. And I did a write-up on the mailing list about this

00:38:08.340 --> 00:38:11.980
<v Josie>when the expiry time was first proposed and kind of listed my reasons why I think

00:38:11.980 --> 00:38:15.900
<v Josie>that expiry doesn't really get you what you want and it's kind of an inferior

00:38:15.900 --> 00:38:20.910
<v Josie>solution. What we really want is to be able to revoke something. I've posted a

00:38:20.910 --> 00:38:25.890
<v Josie>piece of data that is now stale or bad. I want to do something else now that

00:38:25.890 --> 00:38:30.470
<v Josie>communicates to everyone, hey, this data is revoked. It's no longer good. The

00:38:30.470 --> 00:38:35.730
<v Josie>problem is, and I think why people prefer expiry, revocation is really hard. It's

00:38:35.730 --> 00:38:40.690
<v Josie>just a difficult problem. But I think our energy would be better spent tackling

00:38:40.690 --> 00:38:44.730
<v Josie>the hard problem of revocation because that actually gets us what we want. And I

00:38:44.730 --> 00:38:48.770
<v Josie>think that would be extremely useful. If I could post an address and kind of just

00:38:48.770 --> 00:38:53.150
<v Josie>using the PGP analogy, because they have this concept of revocation, I post this

00:38:53.150 --> 00:38:57.260
<v Josie>key somewhere, I sign it. And now any client that wants to read my silent payment

00:38:57.260 --> 00:39:00.820
<v Josie>address, they check the signature, and they see everything's good, and they

00:39:00.820 --> 00:39:05.080
<v Josie>generate the address. If I lose my wallet, it gets hacked, or I just don't want

00:39:05.080 --> 00:39:08.620
<v Josie>to use that silent payment address anymore, I issue some sort of revocation

00:39:08.620 --> 00:39:12.140
<v Josie>signature. And then now when the client reads it, they check it, they say, oh,

00:39:12.240 --> 00:39:15.740
<v Josie>this signature has actually been revoked by this other one. I'm not going to use

00:39:15.740 --> 00:39:18.780
<v Josie>it anymore. And I think that's really the user experience that we're looking for.

00:39:19.040 --> 00:39:21.540
<v Aaron van Wirdum>But this is not implemented in this BIP.

00:39:22.920 --> 00:39:25.980
<v Aaron van Wirdum>It might be a different BIP at some point.

00:39:26.080 --> 00:39:29.200
<v Josie>I think it should be its own BIP because then we could use that same method for

00:39:29.200 --> 00:39:30.180
<v Josie>everything.

00:39:30.500 --> 00:39:35.620
<v Aaron van Wirdum>The other thing is when we spoke last time, Ruben, there was some issue with

00:39:35.620 --> 00:39:40.340
<v Aaron van Wirdum>CoinJoin. The silent payment was not compatible with CoinJoin or something along

00:39:40.340 --> 00:39:45.100
<v Aaron van Wirdum>these lines. First of all, can you maybe repeat or summarize the problem and is

00:39:45.100 --> 00:39:46.540
<v Aaron van Wirdum>that still a problem?

00:39:48.190 --> 00:39:52.590
<v Ruben Somsen>And the problem was more, so there was a solution and it's still the same

00:39:52.590 --> 00:39:57.510
<v Ruben Somsen>solution. But essentially the problem is that you, whenever you making a payment

00:39:57.510 --> 00:40:03.090
<v Ruben Somsen>with more than one person on the input side. So a CoinJoin is essentially

00:40:03.090 --> 00:40:08.030
<v Ruben Somsen>not just your inputs, but somebody else's inputs also go into the transaction.

00:40:08.510 --> 00:40:12.890
<v Ruben Somsen>And the way silent payments work is that you need all the keys from all the

00:40:12.890 --> 00:40:16.060
<v Ruben Somsen>inputs. And so now you have to collaborate with other...

00:40:16.060 --> 00:40:18.000
<v Aaron van Wirdum>You need all the private keys from all the inputs, right?

00:40:18.180 --> 00:40:22.440
<v Ruben Somsen>Yeah, you need to do some calculation with those private keys. You don't

00:40:22.440 --> 00:40:26.180
<v Ruben Somsen>necessarily need the private keys themselves. But now you have other participants

00:40:26.180 --> 00:40:31.980
<v Ruben Somsen>that have inputs. And so you need them to collaborate with you in order

00:40:31.980 --> 00:40:37.860
<v Ruben Somsen>to create a CoinJoin to a silent payment output. And in order to do that...

00:40:39.540 --> 00:40:44.540
<v Ruben Somsen>there's a naive way of doing that, which basically means that you're giving up

00:40:44.540 --> 00:40:49.320
<v Ruben Somsen>the person that you're paying. You can say to the other CoinJoin participants,

00:40:49.460 --> 00:40:53.980
<v Ruben Somsen>hey, I want to pay this person, please help me out. But if you do that, then now

00:40:53.980 --> 00:40:56.980
<v Ruben Somsen>you're revealing to them who you're paying and you don't want that in a CoinJoin

00:40:56.980 --> 00:40:59.760
<v Ruben Somsen>because CoinJoin's primarily...

00:40:59.760 --> 00:41:03.040
<v Sjors Provoost>Might be useful here also to distinguish a simple multi...

00:41:04.450 --> 00:41:08.610
<v Sjors Provoost>collaborative transaction with, say, your friends where you two and your friends

00:41:08.610 --> 00:41:11.550
<v Sjors Provoost>are combining their… Well, I guess it's three things. One, you can have a

00:41:11.550 --> 00:41:15.510
<v Sjors Provoost>multisig. With a multisig you're spending one coin, but the key is spread between

00:41:15.510 --> 00:41:19.470
<v Sjors Provoost>three people, so none of these people would have the private key for it but I

00:41:19.470 --> 00:41:22.930
<v Sjors Provoost>think for a typical multisig you're just adding up all the public keys in the

00:41:22.930 --> 00:41:26.830
<v Sjors Provoost>multisig, right? So that problem is kind of solved. Like, it just says, I'm

00:41:26.830 --> 00:41:30.460
<v Sjors Provoost>spending this coin. It's a multisig. You have three public keys. Everyone sets

00:41:30.460 --> 00:41:34.540
<v Sjors Provoost>their own signature, and then the recipient adds up those individual public keys.

00:41:34.880 --> 00:41:40.740
<v Sjors Provoost>If you do something like Schnorr, where the signature is combined, you don't,

00:41:41.040 --> 00:41:45.410
<v Sjors Provoost>but... So there you already have a problem, maybe, or not.

00:41:45.870 --> 00:41:50.290
<v Ruben Somsen>So there are a couple of things here. I would say mostly it's about collaborative

00:41:50.290 --> 00:41:55.910
<v Ruben Somsen>transactions where there are multiple participants that have some of the keys

00:41:55.910 --> 00:41:58.930
<v Ruben Somsen>that are relevant to creating the shared secrets.

00:41:59.030 --> 00:42:02.790
<v Sjors Provoost>Yeah, but in one scenario, you're fine with the other participants knowing that

00:42:02.790 --> 00:42:07.070
<v Sjors Provoost>you're making a silent payment. And in CoinJoins, you're not fine with that.

00:42:07.270 --> 00:42:13.010
<v Ruben Somsen>But even if you just know, because there's another problem, are you fine or not

00:42:13.010 --> 00:42:17.570
<v Ruben Somsen>with them knowing who you're paying? And the second question is, are you certain

00:42:17.570 --> 00:42:22.390
<v Ruben Somsen>that the data that they gave you is correct? Because the very naive way would be

00:42:22.390 --> 00:42:26.230
<v Ruben Somsen>for them to give you your private key, but that sort of defeats the purpose of

00:42:26.230 --> 00:42:26.750
<v Ruben Somsen>multisig.

00:42:27.030 --> 00:42:31.180
<v Sjors Provoost>So we're not doing that. In a CoinJoin, yeah, you can just rug them. So yeah,

00:42:31.240 --> 00:42:34.360
<v Sjors Provoost>that would be bad. Yeah, because the problem is, of course, especially in an

00:42:34.360 --> 00:42:37.120
<v Sjors Provoost>untrusted situation, but even in a situation where there might be bugs on the

00:42:37.120 --> 00:42:41.320
<v Sjors Provoost>other side, you are paying somebody to a silent payment address, but that's not a

00:42:41.320 --> 00:42:45.330
<v Sjors Provoost>Bitcoin address. whatever Bitcoin address you're seeing on your screen, the

00:42:45.330 --> 00:42:48.570
<v Sjors Provoost>wallet's saying, I'm about to send to this Bitcoin address. Trust me, it follows

00:42:48.570 --> 00:42:52.530
<v Sjors Provoost>from the silent payment protocol. It might not if the other participants do

00:42:52.530 --> 00:42:54.390
<v Sjors Provoost>something wrong. So you want to be able to check.

00:42:54.710 --> 00:43:00.130
<v Ruben Somsen>Yes, and this is even a problem on the side of hardware wallets where the

00:43:00.130 --> 00:43:04.330
<v Ruben Somsen>hardware wallet might malfunction or there might be some kind of issue. Maybe a

00:43:04.330 --> 00:43:07.310
<v Ruben Somsen>bit has flipped somewhere and the calculation that your hardware wallet did was

00:43:07.310 --> 00:43:12.140
<v Ruben Somsen>actually incorrect. You would want the software side to be able to verify what

00:43:12.140 --> 00:43:16.360
<v Ruben Somsen>the hardware wallet did and make sure that it's done correctly. So there are a

00:43:16.360 --> 00:43:16.920
<v Ruben Somsen>bunch of cases.

00:43:18.340 --> 00:43:22.190
<v Sjors Provoost>I'll just do one summary here. When you're making a payment using a hardware

00:43:22.190 --> 00:43:25.690
<v Sjors Provoost>wallet, you are the only participant. It's just you, but it's really you and your

00:43:25.690 --> 00:43:31.030
<v Sjors Provoost>hardware wallet. And normally, you look at your screen, your wallet says, I'm

00:43:31.030 --> 00:43:34.150
<v Sjors Provoost>going to send the money to this and this address. And then the hardware wallet

00:43:34.150 --> 00:43:38.170
<v Sjors Provoost>confirms, do you want to send to this and this address? And you're good. But the

00:43:38.170 --> 00:43:40.990
<v Sjors Provoost>problem with silent payment is you don't know what the address is going to be

00:43:40.990 --> 00:43:45.050
<v Sjors Provoost>because it involves the shared secret. And therefore, you need your own private

00:43:45.050 --> 00:43:48.750
<v Sjors Provoost>key to figure out what the address is. But that address is, that private key is

00:43:48.750 --> 00:43:52.210
<v Sjors Provoost>on the hardware wallet. So in order to know what address you're going to send to,

00:43:52.430 --> 00:43:55.790
<v Sjors Provoost>you need to ask the hardware wallet, hey, this is the silent payment address of

00:43:55.790 --> 00:43:59.990
<v Sjors Provoost>the person I'm going to send money to. Tell me what the address is. And then you

00:43:59.990 --> 00:44:03.910
<v Sjors Provoost>just have to kind of trust the hardware wallet. Well, hopefully not. So this is

00:44:03.910 --> 00:44:04.450
<v Sjors Provoost>what you solved.

00:44:04.700 --> 00:44:10.300
<v Ruben Somsen>Yeah, so there is a way to actually basically do an extra calculation when you're

00:44:10.300 --> 00:44:15.140
<v Ruben Somsen>generating the silent payment address. And this is called discrete log

00:44:15.140 --> 00:44:20.840
<v Ruben Somsen>equivalence proof. And basically it shows that the calculation that you did, the

00:44:20.840 --> 00:44:26.120
<v Ruben Somsen>shared secret that you generated was correctly generated. So despite not having

00:44:26.120 --> 00:44:31.270
<v Ruben Somsen>access to the private key, you get the result of the shared secret. And so

00:44:31.270 --> 00:44:36.610
<v Ruben Somsen>basically, it's like not knowing any of the private keys, but still being able to

00:44:36.610 --> 00:44:41.550
<v Ruben Somsen>validate that the shared secret was generated correctly. And with this, you can

00:44:41.550 --> 00:44:44.010
<v Ruben Somsen>actually verify that what you received was correct.

00:44:44.270 --> 00:44:46.230
<v Sjors Provoost>And this is five pages of moon math?

00:44:46.430 --> 00:44:51.890
<v Ruben Somsen>No, this is relatively simple. It's basically a Schnorr signature plus some

00:44:51.890 --> 00:44:56.280
<v Ruben Somsen>small... changes to that kind of algorithm.

00:44:56.500 --> 00:44:58.580
<v Sjors Provoost>And this fixes hardware wallets, CoinJoins,

00:44:59.080 --> 00:45:03.920
<v Ruben Somsen>Everything. So this fixes one aspect. This fixes the aspect of did the

00:45:03.920 --> 00:45:09.660
<v Ruben Somsen>shared secret that I receive from the party who has access to the private key,

00:45:09.820 --> 00:45:14.950
<v Ruben Somsen>is this the correct shared secret, yes or no? And so the second problem, the one

00:45:14.950 --> 00:45:20.250
<v Ruben Somsen>I mentioned before, is the one of privacy. How can you do this without

00:45:20.250 --> 00:45:25.110
<v Ruben Somsen>revealing to the person who generates the shared secret, without revealing to

00:45:25.110 --> 00:45:29.290
<v Ruben Somsen>them who you are paying? And that requires what is essentially called blind

00:45:29.290 --> 00:45:29.870
<v Ruben Somsen>Diffie-Hellman.

00:45:30.070 --> 00:45:34.910
<v Sjors Provoost>So it reveals that you're about to do a silent payment, but not to which public

00:45:34.910 --> 00:45:36.710
<v Sjors Provoost>key, to which silent payment address?

00:45:36.890 --> 00:45:40.970
<v Ruben Somsen>And you could even, if you care about that, you can even go as far as to...

00:45:41.000 --> 00:45:44.900
<v Ruben Somsen>pretend you're making a silent payment as to throw them off whether or not you're

00:45:44.900 --> 00:45:48.580
<v Ruben Somsen>making a silent payment. So even that doesn't have to be revealed. But yes,

00:45:48.720 --> 00:45:54.640
<v Ruben Somsen>essentially they know you're trying to make a silent payment but they still

00:45:54.640 --> 00:45:59.760
<v Ruben Somsen>don't know who you're paying because you're asking to generate a shared secret on

00:45:59.760 --> 00:46:04.080
<v Ruben Somsen>data that's blinded and then the person who wanted that shared secret can then

00:46:04.080 --> 00:46:09.650
<v Ruben Somsen>unblind that result. and use it in the payment. And so this essentially sort of

00:46:09.650 --> 00:46:13.250
<v Ruben Somsen>completes the loop of how can we get to the point where we can do a CoinJoin,

00:46:13.650 --> 00:46:18.650
<v Ruben Somsen>know everything went correctly, and not leak any additional privacy over a

00:46:18.650 --> 00:46:19.130
<v Ruben Somsen>regular CoinJoin.

00:46:19.130 --> 00:46:22.990
<v Sjors Provoost>Yeah, and I guess, yeah, in the CoinJoin protocol, you'd say this is a CoinJoin

00:46:22.990 --> 00:46:26.010
<v Sjors Provoost>protocol that is compatible with silent payments, and then just everybody signs

00:46:26.010 --> 00:46:29.970
<v Sjors Provoost>this stuff so nobody knows if there's actually a silent payment. So even if I

00:46:29.970 --> 00:46:34.480
<v Sjors Provoost>were to look... I'm the NSA. I know every silent payment address out there

00:46:34.480 --> 00:46:39.380
<v Sjors Provoost>because I watch the internet. I still could not go back and see if it matches any of them.

00:46:39.620 --> 00:46:39.840
<v Ruben Somsen>Yes.

00:46:40.060 --> 00:46:45.240
<v Josie>Correct. I think that's the really cool part where it feels kind of magical. So

00:46:45.240 --> 00:46:48.540
<v Josie>in order to coordinate with these other participants in a CoinJoin, you would

00:46:48.540 --> 00:46:53.040
<v Josie>need to give them the public key that you want them to do this ECDH with. And as

00:46:53.040 --> 00:46:55.600
<v Josie>soon as they have that public key, well, they kind of know who you're trying to

00:46:55.600 --> 00:46:59.480
<v Josie>pay. They know what silent payment address it is. So the fact that you can, one,

00:46:59.880 --> 00:47:04.540
<v Josie>blind that public key, have them do an ECDH with it where they don't know what

00:47:04.540 --> 00:47:08.760
<v Josie>they're actually doing ECDH on, and then also have them give you a proof that

00:47:08.760 --> 00:47:12.640
<v Josie>they did it correctly for the thing that they didn't even know. It's pretty cool.

00:47:12.780 --> 00:47:17.580
<v Josie>And when you look at the math, it's not even really moon math. It's quite simple.

00:47:17.960 --> 00:47:23.600
<v Josie>And, you know, if people are interested in digging into it more. This idea of

00:47:23.600 --> 00:47:28.440
<v Josie>formalizing the discrete log equivalency proof came up in the PSBT BIP draft that

00:47:28.440 --> 00:47:32.000
<v Josie>we're working on. And then I think now it's going to be its own BIP where someone

00:47:32.000 --> 00:47:36.260
<v Josie>suggested, hey, this discrete log equivalency stuff seems generally useful. We

00:47:36.260 --> 00:47:38.580
<v Josie>should probably have a separate BIP for it.

00:47:38.740 --> 00:47:39.820
<v Ruben Somsen>Yeah, makes a lot of sense to me.

00:47:40.860 --> 00:47:43.920
<v Aaron van Wirdum>It's moon math to me, Josie. I can tell you that much.

00:47:44.080 --> 00:47:45.620
<v Josie>It's addition and subtraction, maybe.

00:47:47.320 --> 00:47:48.920
<v Sjors Provoost>It's just manipulating bits.

00:47:49.240 --> 00:47:53.460
<v Ruben Somsen>There are no additional assumptions over what we already have for Schnorr signatures.

00:47:54.860 --> 00:48:00.600
<v Ruben Somsen>In that sense, there's nothing like, oh, this is unproven math or something like

00:48:00.600 --> 00:48:01.920
<v Ruben Somsen>that. It's pretty straightforward.

00:48:02.580 --> 00:48:03.920
<v Aaron van Wirdum>Okay, last topic.

00:48:05.960 --> 00:48:11.260
<v Aaron van Wirdum>This is a new feature since we discussed this last time. So you added a concept

00:48:11.260 --> 00:48:15.160
<v Aaron van Wirdum>called labels. You added labels. What do labels do?

00:48:15.420 --> 00:48:20.780
<v Ruben Somsen>Yeah, so that's another interesting one to discuss and one that I didn't think of

00:48:20.780 --> 00:48:25.760
<v Ruben Somsen>until after we did the podcast. I think probably pretty shortly after that.

00:48:26.480 --> 00:48:27.320
<v Sjors Provoost>Minutes after.

00:48:28.400 --> 00:48:33.100
<v Ruben Somsen>Not quite that fast, I think. But essentially, in the discussions,

00:48:34.000 --> 00:48:39.300
<v Ruben Somsen>silent payments are very privacy focused, but there are scenarios where you

00:48:39.300 --> 00:48:44.800
<v Ruben Somsen>actually want less privacy. And so with silent payments you actually have a case

00:48:44.800 --> 00:48:50.190
<v Ruben Somsen>where whenever when somebody sends you money repeatedly, you don't know the same

00:48:50.190 --> 00:48:55.790
<v Ruben Somsen>person was sending you money multiple times. And that is a feature, right? As

00:48:55.790 --> 00:49:00.130
<v Ruben Somsen>the sender, you might not want the recipient even to know that you're sending

00:49:00.130 --> 00:49:05.010
<v Ruben Somsen>repeated payments to them. And that also helps in the case where the recipients

00:49:05.010 --> 00:49:06.150
<v Ruben Somsen>maybe, you know,

00:49:07.570 --> 00:49:11.630
<v Ruben Somsen>they go to jail or they have to reveal to the government certain amounts of data.

00:49:11.630 --> 00:49:15.570
<v Ruben Somsen>And now the government knows that you sent them multiple payments or something like that.

00:49:15.670 --> 00:49:20.960
<v Sjors Provoost>You have a donation address on your website, you get random donations all the

00:49:20.960 --> 00:49:24.680
<v Sjors Provoost>time. You have no idea whether that's coming from one person or from 25 people.

00:49:24.800 --> 00:49:29.600
<v Sjors Provoost>When you go to jail, you give the private keys to the police because they've been

00:49:29.600 --> 00:49:35.220
<v Sjors Provoost>torturing you for seven days of not giving you coffee. And then, I'm sure they'll

00:49:35.220 --> 00:49:40.180
<v Sjors Provoost>give you coffee. But somehow you still surrender your private keys and they still

00:49:40.180 --> 00:49:42.320
<v Sjors Provoost>don't know where those donations are coming from.

00:49:42.480 --> 00:49:45.320
<v Josie>Yeah, and this is unique to silent payments. I think this is a really, really

00:49:45.320 --> 00:49:49.600
<v Josie>cool property where in the world of anonymous donations or like adversarial

00:49:49.600 --> 00:49:53.160
<v Josie>donations, let's say I want to make a monthly donation to an organization like

00:49:53.160 --> 00:49:57.520
<v Josie>WikiLeaks. From WikiLeaks' perspective, they would just see 12 payments and they

00:49:57.520 --> 00:50:01.200
<v Josie>would have no idea that those 12 payments came from one person or 12 people or whatever.

00:50:01.380 --> 00:50:04.710
<v Sjors Provoost>With the caveat that these... payments might… You know, you do some cluster

00:50:04.710 --> 00:50:09.350
<v Sjors Provoost>analysis on them, so there's still… Yeah, but at least it's not like I gave this

00:50:09.350 --> 00:50:11.090
<v Sjors Provoost>address to this, uh, person.

00:50:11.090 --> 00:50:16.110
<v Josie>Well, let me… Yeah, let me give a more specific example. If I had an xpub or

00:50:16.110 --> 00:50:21.870
<v Josie>something like that, um, and or BIP 47, for example. BIP 47 establishes this

00:50:21.870 --> 00:50:26.890
<v Josie>payment channel, and so any payment made through that payment channel is

00:50:26.890 --> 00:50:29.690
<v Josie>clustered already. You don't need to do any chain analysis stuff.

00:50:29.690 --> 00:50:30.250
<v Aaron van Wirdum>From the same…

00:50:30.250 --> 00:50:35.720
<v Josie>Exactly. Yeah, and and, like Ruben said, there are use cases where you do want

00:50:35.720 --> 00:50:39.660
<v Josie>that, but I don't think that a protocol like silent payment should have that by

00:50:39.660 --> 00:50:43.040
<v Josie>default. So by default, you're starting with the best sender privacy possible.

00:50:43.360 --> 00:50:46.820
<v Josie>Every transaction is unique and not correlatable to any other transaction.

00:50:47.080 --> 00:50:51.870
<v Sjors Provoost>But now let's say I am an exchange and I have... I don't want to scan a million

00:50:51.870 --> 00:50:54.990
<v Sjors Provoost>keys. I don't want to scan. I don't want to have one silent payment address per

00:50:54.990 --> 00:50:58.730
<v Sjors Provoost>customer because now I have to, you know, I have millions of customers and we

00:50:58.730 --> 00:51:02.590
<v Sjors Provoost>just did the math on how many computer resources you need and exchanges, you

00:51:02.590 --> 00:51:05.990
<v Sjors Provoost>know, can't afford computers. Well, they can, they can run Ethereum nodes. They

00:51:05.990 --> 00:51:06.890
<v Sjors Provoost>can definitely run this.

00:51:07.230 --> 00:51:07.350
<v Ruben Somsen>True.

00:51:07.990 --> 00:51:08.390
<v Sjors Provoost>However.

00:51:08.770 --> 00:51:10.830
<v Ruben Somsen>Outsource Ethereum nodes. So who knows? But yeah.

00:51:12.690 --> 00:51:17.750
<v Sjors Provoost>Yeah, so it would be nice if they could have still one single payment identifier.

00:51:17.750 --> 00:51:22.550
<v Sjors Provoost>No, just one silent payment address. And then they give each customer a variation

00:51:22.550 --> 00:51:25.570
<v Sjors Provoost>on it so that they know which deposit is coming from which customer. Because as

00:51:25.570 --> 00:51:29.290
<v Sjors Provoost>an exchange, it's quite useful to know which account you want to credit when that

00:51:29.290 --> 00:51:29.970
<v Sjors Provoost>payment comes in.

00:51:30.150 --> 00:51:30.610
<v Ruben Somsen>Pretty useful.

00:51:30.910 --> 00:51:32.210
<v Sjors Provoost>And this is what labels do.

00:51:32.590 --> 00:51:35.650
<v Aaron van Wirdum>Okay, so it's still the same silent address.

00:51:35.970 --> 00:51:38.390
<v Sjors Provoost>It's not the same silent address. One of the keys is the same.

00:51:39.670 --> 00:51:42.130
<v Sjors Provoost>The spending key, so the key you need to spend money, is the same?

00:51:42.210 --> 00:51:43.410
<v Josie>The scan key is the same.

00:51:44.010 --> 00:51:46.270
<v Sjors Provoost>Oh. You should explain it.

00:51:46.310 --> 00:51:48.590
<v Ruben Somsen>I mean, it's not a big mistake.

00:51:48.690 --> 00:51:52.090
<v Sjors Provoost>One of the keys is the same. The other one is different for each customer. That

00:51:52.090 --> 00:51:55.810
<v Sjors Provoost>means that in terms of scanning, it's not that much extra work. It's a little bit

00:51:55.810 --> 00:51:59.930
<v Sjors Provoost>of extra work, but it's not like one of those elliptic curve math operations.

00:51:59.930 --> 00:52:05.430
<v Sjors Provoost>It's a cheaper operation. Like an elliptic curve math, it's like you have to copy

00:52:05.430 --> 00:52:09.830
<v Sjors Provoost>the whole Bible, whereas just the simpler operations, like you write one

00:52:09.830 --> 00:52:10.250
<v Sjors Provoost>sentence.

00:52:11.720 --> 00:52:15.640
<v Sjors Provoost>And therefore, you can tell which customer is making which deposit. So you give

00:52:15.640 --> 00:52:19.680
<v Sjors Provoost>every customer a different silent payment address. They can very obviously see

00:52:19.680 --> 00:52:21.160
<v Sjors Provoost>that it's the same entity.

00:52:22.940 --> 00:52:25.280
<v Josie>Yeah, because they all have the same scan key in common.

00:52:25.480 --> 00:52:29.300
<v Aaron van Wirdum>Hang on. I was promised labels. Now I'm just hearing different addresses.

00:52:30.640 --> 00:52:31.860
<v Aaron van Wirdum>What's a label then?

00:52:33.320 --> 00:52:34.640
<v Aaron van Wirdum>It's just different address.

00:52:34.860 --> 00:52:40.820
<v Josie>Yeah, so it's a way of tweaking with elliptic curve math. It's a way of tweaking

00:52:40.820 --> 00:52:46.580
<v Josie>one half of the silent payment address such that when you receive a silent

00:52:46.580 --> 00:52:51.770
<v Josie>payment and you're scanning, you know which address that payment was made to

00:52:51.770 --> 00:52:56.350
<v Josie>without needing to do an ECDH per address. So you do one ECDH with the scan key,

00:52:56.590 --> 00:53:00.290
<v Josie>which is the expensive part. And then you kind of have this database of all the

00:53:00.290 --> 00:53:03.930
<v Josie>labels you've used and you do a quick lookup. And then you say, ah, okay, this

00:53:03.930 --> 00:53:09.900
<v Josie>particular payment was made to this label that I handed to Sjors. So

00:53:09.900 --> 00:53:13.320
<v Josie>now I know Sjors made a payment to me. And I think the exchange is the most

00:53:13.320 --> 00:53:17.070
<v Josie>obvious use case here where, you know, going back to what I said earlier, we

00:53:17.070 --> 00:53:21.370
<v Josie>don't want the amount of work that the exchange needs to do to scale linearly

00:53:21.370 --> 00:53:25.870
<v Josie>with the customers. An exchange has 100 million customers. I don't want to do X

00:53:25.870 --> 00:53:30.810
<v Josie>work times 100 million. So the labels is this really cool way where I still I do

00:53:30.810 --> 00:53:34.570
<v Josie>a constant amount of work, no matter how many customers there are, but I do have

00:53:34.570 --> 00:53:38.850
<v Josie>a way of figuring out, okay, Sjors just made a deposit to his account. And I

00:53:38.850 --> 00:53:42.390
<v Josie>think the exchange one is obvious, but also, like, payments, right? I want to get

00:53:42.390 --> 00:53:47.530
<v Josie>paid in Bitcoin, uh, and so I post my silent payment address on my twitter for

00:53:47.530 --> 00:53:52.070
<v Josie>people who want to send donations but then I also give a labeled version of that

00:53:52.310 --> 00:53:56.850
<v Josie>same silent payment address to whoever's paying me, and now I have a way of

00:53:56.850 --> 00:54:01.350
<v Josie>knowing, ah, this particular payment was actually my paycheck, and this other one

00:54:01.350 --> 00:54:03.330
<v Josie>was a donation from my Twitter account.

00:54:03.530 --> 00:54:03.690
<v Aaron van Wirdum>Right.

00:54:03.890 --> 00:54:05.310
<v Sjors Provoost>It'd be nice if those amounts were the same.

00:54:05.550 --> 00:54:06.350
<v Josie>It would be nice.

00:54:06.790 --> 00:54:12.130
<v Aaron van Wirdum>And just to... So at the start of the episode, we mentioned a silent address

00:54:12.130 --> 00:54:16.210
<v Aaron van Wirdum>basically has two public keys embedded. Just to be clear, so one of the public

00:54:16.210 --> 00:54:18.570
<v Aaron van Wirdum>keys is just switch for a different public key, or not?

00:54:18.770 --> 00:54:20.290
<v Josie>Yeah, it is. I mean...

00:54:20.710 --> 00:54:22.230
<v Aaron van Wirdum>One is the same, one is different?

00:54:22.410 --> 00:54:25.790
<v Josie>One is the same, and then one is different. And the way that it's different is

00:54:25.790 --> 00:54:29.870
<v Josie>you take that spend key, and then you add the label tweak to the spend key.

00:54:29.910 --> 00:54:33.870
<v Sjors Provoost>And this brings up an interesting possibility as well for security. If you are

00:54:33.870 --> 00:54:37.670
<v Sjors Provoost>like a famous exchange, key, not the address, because the address is different

00:54:37.670 --> 00:54:40.050
<v Sjors Provoost>for every customer, but there's one key that's the same for all customers. You

00:54:40.050 --> 00:54:43.650
<v Sjors Provoost>make that well known to the world. And hopefully some hardware manufacturers or

00:54:43.650 --> 00:54:49.030
<v Sjors Provoost>other wallet makers are nice enough to just put that into their software as a...

00:54:49.020 --> 00:54:51.980
<v Sjors Provoost>sort of an identity key. So then when you're making a payment, it will literally

00:54:51.980 --> 00:54:54.860
<v Sjors Provoost>say, are you sure you want to pay to name of exchange?

00:54:56.420 --> 00:54:57.340
<v Sjors Provoost>Which is kind of cool.

00:54:57.540 --> 00:55:01.500
<v Josie>It's really cool. And what's even cooler is because we're dealing with public

00:55:01.500 --> 00:55:06.480
<v Josie>keys here, the exchange can provide a signature and like hardware wallets could

00:55:06.480 --> 00:55:09.980
<v Josie>trustlessly verify. This is actually the destination that I'm intending to pay.

00:55:10.280 --> 00:55:13.960
<v Josie>And so this is where, you know, the silent payment address can kind of be this

00:55:13.960 --> 00:55:18.820
<v Josie>persistent trustless identity, which plays really nicely into this use case for

00:55:18.820 --> 00:55:24.320
<v Josie>exchanges, but also BIP, what is it? 353 now, which is like human readable

00:55:25.870 --> 00:55:30.150
<v Josie>payment instructions, where you could have like a username that has an underlying

00:55:30.150 --> 00:55:33.070
<v Josie>silent payment address. And because we're dealing with public keys here, there's

00:55:33.070 --> 00:55:36.330
<v Josie>just a lot more trustlessness, but with better UX that we get.

00:55:37.320 --> 00:55:39.880
<v Aaron van Wirdum>Okay, I think it's time to start wrapping up this episode.

00:55:40.140 --> 00:55:40.800
<v Sjors Provoost>I think you're right.

00:55:40.960 --> 00:55:46.380
<v Aaron van Wirdum>So about a month ago, the BIP was finalized, roughly. What does

00:55:46.380 --> 00:55:50.560
<v Aaron van Wirdum>that mean right now? Are there wallets that have implemented? Has Bitcoin Core

00:55:50.560 --> 00:55:51.780
<v Aaron van Wirdum>implemented it yet, Sjors?

00:55:52.260 --> 00:55:56.920
<v Sjors Provoost>There are open pull requests in various states of completion that need work.

00:55:57.610 --> 00:56:00.950
<v Aaron van Wirdum>Is it coming? The answer is no, but it might come.

00:56:01.210 --> 00:56:05.570
<v Josie>I think there's a lot of conceptual buy-in for it. That was one of the things

00:56:05.570 --> 00:56:09.610
<v Josie>that I think we did well in the beginning of silent payments is we talked to a

00:56:09.610 --> 00:56:13.430
<v Josie>lot of people to be like, are we barking up the right tree? Is this a good idea?

00:56:13.690 --> 00:56:19.610
<v Josie>And so I think. So far, everyone's been pretty positive about it. We've got the

00:56:19.610 --> 00:56:24.810
<v Josie>Bitcoin Core PRs open. The reason that those aren't making progress right now is

00:56:24.810 --> 00:56:28.910
<v Josie>they're waiting on an upstream PR to libsecp, which is the cryptography library

00:56:28.910 --> 00:56:34.010
<v Josie>that we use in Bitcoin Core. And so I'm working on a PR right now with another

00:56:34.010 --> 00:56:39.600
<v Josie>contributor, where we're creating a silent payments module in libsecp that is

00:56:39.600 --> 00:56:44.240
<v Josie>super fast, super optimized, super safe. And so that PR is open right now and

00:56:44.240 --> 00:56:48.480
<v Josie>waiting for review. Again, like pretty strong conceptual buy-in. So I feel

00:56:48.480 --> 00:56:50.660
<v Josie>confident that it'll get merged eventually.

00:56:50.900 --> 00:56:52.480
<v Sjors Provoost>We have an episode about libsecp.

00:56:52.840 --> 00:56:55.140
<v Josie>Yeah, it's an amazing project.

00:56:55.640 --> 00:56:56.800
<v Aaron van Wirdum>Episode two, I think, Sjors.

00:56:57.280 --> 00:57:00.680
<v Sjors Provoost>It could be, yeah, libsecp256k1.

00:57:00.880 --> 00:57:06.630
<v Josie>Yep. So once that PR merges, now we have all the cryptography for the

00:57:06.630 --> 00:57:10.610
<v Josie>protocol. We'll use that in Bitcoin Core. And then, you know, the Bitcoin Core

00:57:10.610 --> 00:57:16.520
<v Josie>PRs can make progress. And also any hardware wallet, mobile wallet, whatever,

00:57:16.820 --> 00:57:21.560
<v Josie>can also reuse this libsecp module. And the nice thing here is we're not making

00:57:21.560 --> 00:57:24.620
<v Josie>anybody roll their own crypto. Like here's a module that does the cryptography

00:57:24.620 --> 00:57:27.200
<v Josie>part of silent payments. You don't need to worry about it. Treat it like a black

00:57:27.200 --> 00:57:33.080
<v Josie>box. So that's kind of the state of things right now. There are wallets who have

00:57:33.080 --> 00:57:37.860
<v Josie>started implementing it without that. Cake Wallet, I think, was the first one to

00:57:37.860 --> 00:57:42.230
<v Josie>have a full light client. So they have a fully private light client that it

00:57:42.230 --> 00:57:45.930
<v Josie>doesn't use BIP-158. They do a little bit of a different technique.

00:57:47.250 --> 00:57:52.030
<v Josie>But they don't have silent payments, send and receive. Last week, Blue Wallet

00:57:52.030 --> 00:57:55.850
<v Josie>merged send support. So now in Blue Wallet, you can send to a silent payment address.

00:57:57.050 --> 00:58:01.530
<v Josie>There's Donation Wallet, which I've been working with a group on, which is a

00:58:01.530 --> 00:58:06.050
<v Josie>BIP-158 style client. That one is still in testing. like in signet.

00:58:06.230 --> 00:58:08.370
<v Aaron van Wirdum>The name of the wallet is Donation Wallet?

00:58:08.450 --> 00:58:12.250
<v Josie>Yeah. It's supposed to be like the flagship use case of silent payments with

00:58:12.250 --> 00:58:17.110
<v Josie>donations. And then there's been interest from other wallets as well, but I think

00:58:17.110 --> 00:58:20.930
<v Josie>people are waiting on the libsecp module because once the libsecp module is

00:58:20.930 --> 00:58:25.710
<v Josie>there, then it can get into BDK. Once it's in BDK, it becomes easier for, you

00:58:25.710 --> 00:58:26.230
<v Josie>know, et cetera.

00:58:26.550 --> 00:58:29.090
<v Sjors Provoost>The BDK is the Bitcoin development kit. It's a Rust library.

00:58:29.290 --> 00:58:32.790
<v Josie>Yep. It's a Rust library that would then be able to wrap the libsecp.

00:58:34.190 --> 00:58:39.090
<v Josie>So there's a lot of discussions happening in these different repos where people

00:58:39.090 --> 00:58:42.810
<v Josie>are kind of waiting for the right ordering of things. Another big one for wallet

00:58:42.810 --> 00:58:46.730
<v Josie>support, at least on the sending side, is people want to have a PSBT spec. So I

00:58:46.730 --> 00:58:49.730
<v Josie>mentioned that earlier, but we've got a post on Delving Bitcoin where we've been

00:58:49.730 --> 00:58:55.690
<v Josie>talking through a draft proposal for PSBTs. So for me, it's

00:58:55.690 --> 00:59:00.220
<v Josie>been really exciting to see the enthusiasm where people are just, you know, ready

00:59:00.220 --> 00:59:04.480
<v Josie>to jump in and start building, um, but then it's also nice to see the tooling

00:59:04.480 --> 00:59:08.920
<v Josie>mature as well, because for this to be widely adopted, we want PSBT support, we

00:59:08.920 --> 00:59:11.520
<v Josie>want, like, clear specs of how to do everything safely.

00:59:11.520 --> 00:59:12.740
<v Sjors Provoost>Oh yeah, two weeks.

00:59:12.740 --> 00:59:17.740
<v Aaron van Wirdum>How many people are using this? What does the blockchain say?

00:59:18.360 --> 00:59:20.420
<v Josie>Well, that's the nice part. We don't know.

00:59:21.860 --> 00:59:24.980
<v Ruben Somsen>Maybe it's been in use for years and you just don't know it.

00:59:25.440 --> 00:59:28.940
<v Josie>Maybe Ruben is just now telling everybody about it, but he's been silent on this

00:59:28.940 --> 00:59:29.360
<v Josie>for years.

00:59:29.680 --> 00:59:35.680
<v Ruben Somsen>Been silently getting paid. But I mean, just one thing to add here, I think since

00:59:35.680 --> 00:59:39.680
<v Ruben Somsen>the BIP is final, this is really the time for any developers out there to jump

00:59:39.680 --> 00:59:45.570
<v Ruben Somsen>in, start working on it. Yes, we're still sort of like on the side

00:59:45.570 --> 00:59:50.730
<v Ruben Somsen>of libraries. There's still a lot of work to be done, but definitely I think this

00:59:50.730 --> 00:59:55.190
<v Ruben Somsen>is a time to start implementing it into wallets. There's the Keystone hardware

00:59:55.190 --> 01:00:00.510
<v Ruben Somsen>wallet that's looking into it now as well. And sending support is the thing we

01:00:00.510 --> 01:00:05.330
<v Ruben Somsen>really want all the wallets out there to support because once all the wallets

01:00:05.330 --> 01:00:08.650
<v Ruben Somsen>support sending, then it's easy for people to start using their silent payment

01:00:08.650 --> 01:00:12.560
<v Ruben Somsen>address and know that they can actually get paid. And sending support is

01:00:12.560 --> 01:00:16.820
<v Ruben Somsen>relatively simple compared to receiving because receiving requires scanning,

01:00:16.960 --> 01:00:21.440
<v Ruben Somsen>sending does not. So that's a little something I wanted to put out there.

01:00:21.940 --> 01:00:24.020
<v Aaron van Wirdum>Right. Sjors, we good?

01:00:24.320 --> 01:00:29.700
<v Sjors Provoost>I think so. So thanks Ruben and Josie for coming by and explaining all these

01:00:29.700 --> 01:00:33.180
<v Sjors Provoost>things. And dear listeners, thank you for listening to Bitcoin,

01:00:33.660 --> 01:00:34.260
<v Aaron van Wirdum>Explained.

