[00:00.000 --> 00:03.440] Hello, everybody. Welcome to the last day at the Manara Village. [00:03.440 --> 00:12.600] If you are just wandering in here, you arrived just in time for a talk by the world-famous Cathy Heung, [00:12.600 --> 00:17.220] who is going to give us a deep dive into bulletproofs. [00:17.220 --> 00:21.180] Now, if you are a swimmer, you may be familiar with diving deep. [00:21.400 --> 00:25.180] Diving into mathematics is a lot... it's a lot different. [00:25.180 --> 00:29.280] And you come out just as exhausted, but it's a different form of exhaustion. [00:29.280 --> 00:34.540] So Cathy here is going to very gently, gently take us through bulletproofs. [00:34.880 --> 00:40.200] And I hope you all come out the other side smarter, because all of this is going to go over my head. [00:40.200 --> 00:43.580] Cathy, please... please be gentle. [00:44.440 --> 00:46.280] Oh, he's my lapel. [00:48.080 --> 00:56.140] Hi, I'm Cathy. For some context, I worked on an implementation of bulletproofs in Rust, [00:56.140 --> 01:02.080] both at Canon and Gstellar, and we have the fastest implementation in existence. [01:02.080 --> 01:07.220] And so I feel like maybe that makes me qualified to just tell you a little bit about how bulletproofs works. [01:07.320 --> 01:11.220] So maybe before I begin, there's a lot of stuff that I didn't cover. [01:11.480 --> 01:16.320] And what I cover is largely determined by what you guys want to hear. [01:16.340 --> 01:21.800] So what I submitted to this talk was, let's go really deep into the math of bulletproofs. [01:21.800 --> 01:27.800] We can do that, but we can also do less of that and talk more about the things we've built on top of bulletproofs, [01:27.800 --> 01:32.960] what other people can use it for, maybe proposals of what Monero might want to do. [01:33.100 --> 01:39.140] So maybe by a show of hands, how many people are here because they really want to just get into the math? [01:39.560 --> 01:41.400] Oh, okay, cool. Let's do that. [01:41.400 --> 01:46.760] And then if we have extra time afterwards, I'm happy to talk about other exceptions over that. [01:47.160 --> 01:47.840] Awesome. [01:49.480 --> 01:53.640] So the motivation of why we care about bulletproofs. [01:53.640 --> 01:56.420] First, I guess we should talk about why we care about zero-knowledge proofs. [01:56.420 --> 02:02.460] So for some of you, this might be redundant, but I'll just cover some basic ground first. [02:02.580 --> 02:12.160] So a zero-knowledge proof is a way to make a proof that's stating it's true about some input without revealing what that input is. [02:12.160 --> 02:14.640] So that might be a little confusing and abstract. [02:14.640 --> 02:17.400] One example of a zero-knowledge proof is a range proof. [02:17.400 --> 02:23.460] So a range proof is a proof that a certain number is in a range, usually like 0 to 2 to the n, [02:23.460 --> 02:28.900] and you can show that this proof is true without revealing what your number is. [02:28.900 --> 02:31.400] So instead of revealing your number, you're revealing it as your secret, [02:31.400 --> 02:35.520] you make a commitment to that number, and that commitment is binding, hiding, [02:35.520 --> 02:39.200] and you can show that commitment to someone without revealing your secret. [02:39.420 --> 02:43.540] So we'll talk a little bit more about range proofs, actually a lot more about range proofs, [02:43.540 --> 02:45.640] so don't be too intimidated yet. [02:45.640 --> 02:51.680] So probably a lot of things you're familiar with, but in a blockchain transaction, [02:51.680 --> 02:53.640] it's not confidential, this is what it looks like. [02:53.640 --> 02:59.660] And an important thing for validity of this transaction is that your inputs sum to the number that's equal to your outputs. [02:59.660 --> 03:06.400] So here you can visually check that 5 plus 4 equals 2 plus 6, you're not making any extra money out of thin air. [03:06.860 --> 03:11.020] And if you wanted to make this confidential, there's many ways to do this, [03:11.020 --> 03:18.340] but one proposed way is just called confidential transaction, proposed for Bitcoin, [03:18.340 --> 03:23.900] and a broken way to do this would be to use an additively homomorphic commitment, [03:23.900 --> 03:27.660] and just say, well now we're just going to do A, B, C, and D, [03:27.660 --> 03:31.220] which are the blinding and hiding for our secret values. [03:31.220 --> 03:34.400] And then you just check that A plus B equals C plus D, [03:34.400 --> 03:37.240] and this will be true with very high probability, [03:37.240 --> 03:41.800] if and only if your interior secret values actually sum up to the same value. [03:42.720 --> 03:45.080] Now, can anyone tell me why this is broken? [03:46.760 --> 03:47.640] Anyone? [03:49.280 --> 03:50.300] What's that? [03:51.240 --> 03:51.980] Yes? [03:53.980 --> 03:57.940] That is true, there's a very small chance that this can be incorrect, [03:57.940 --> 04:01.080] and this is because of the way that you have your commitment scheme, [04:01.080 --> 04:05.520] but that's like such small probabilities that that's actually not something that we're going to worry about. [04:05.520 --> 04:06.340] What about you? [04:09.870 --> 04:12.610] Exactly, yeah, so like this works with everything, [04:12.610 --> 04:16.830] but if you have a negative number, this also still works. [04:16.850 --> 04:19.190] And so this is still like technically correct, [04:19.190 --> 04:23.710] but definitely not correct in the context of a blockchain financial transaction. [04:23.710 --> 04:26.450] So we don't want this to be possible. [04:27.550 --> 04:31.110] And for those of you who want to like understand the math better, [04:31.110 --> 04:36.710] when I say a negative number, it's actually a negative number mod P, [04:36.710 --> 04:42.510] and so what this is basically equivalent to is an extremely large number in your prime order group, [04:42.510 --> 04:44.910] and so those two statements are equivalent. [04:44.910 --> 04:47.610] So you could be allowing someone to spend negative $1, [04:47.610 --> 04:51.770] or you could be allowing them to spend just like P-1, where P is very large. [04:52.090 --> 04:55.130] So that's just to be technically correct here. [04:55.370 --> 04:59.110] So what we want to do is to insert a range proof [04:59.110 --> 05:02.970] that all your secret values are in a certain range. [05:02.970 --> 05:10.330] So as long as your range proof is from zero to a number that's still smaller than your prime order group P, [05:10.810 --> 05:15.290] then this will make sure that you don't add any like negative weird numbers. [05:15.810 --> 05:21.150] So yeah, that's one example of how zero-knowledge proofs are useful in the blockchain context. [05:21.150 --> 05:23.330] Obviously, there's many other ways to use them, [05:23.330 --> 05:26.890] and there's also many ways to use zero-knowledge proofs outside of blockchains too, [05:26.890 --> 05:29.810] but you're probably interested in the blockchain applications. [05:29.930 --> 05:31.530] And what do we care about bullet proofs? [05:31.530 --> 05:33.890] So bullet proofs is a pretty cool paper. [05:33.890 --> 05:36.030] It came out in 2017 from Stanford. [05:36.110 --> 05:40.750] And it gives us a lot of properties that we really want in a blockchain context. [05:41.230 --> 05:44.810] So what we really want is a constrained proof size [05:44.810 --> 05:48.810] because all the nodes have to receive a proof and verify them. [05:48.810 --> 05:52.450] And bullet proofs provides a pretty constrained proof size O of log N, [05:52.450 --> 05:54.410] where N is the number of multipliers. [05:55.150 --> 05:57.270] It also gives us really fast verification. [05:57.270 --> 06:02.530] So that's important because, once again, you have to have all nodes sync up. [06:02.570 --> 06:06.870] And bullet proofs provides fast verification that also allows you to batch, [06:06.870 --> 06:10.710] which means that you can verify multiple proofs in parallel more efficiently, [06:11.090 --> 06:15.230] and aggregate, which means you can combine multiple proofs into one proof [06:15.230 --> 06:17.170] that they are all correct. [06:17.410 --> 06:19.710] And then lastly, this is a really nice property [06:19.710 --> 06:23.310] and sort of a big differentiator from ZK-Smart, for instance. [06:23.310 --> 06:26.550] You can have ad hoc logic that doesn't require trusted subtle. [06:26.550 --> 06:29.810] So if you wanted to create a custom smart contract, for instance, [06:29.810 --> 06:33.750] you don't have to have a trusted reference string that requires your setup string. [06:33.950 --> 06:38.970] So that is a big thing that is appealing about bullet proofs [06:38.970 --> 06:41.610] and a big pain point of using ZK-Smart. [06:41.610 --> 06:45.790] And I know a lot of more recent zero-knowledge proof protocols, [06:45.790 --> 06:49.170] such as Ksharks, which is great, H is for hybrid, [06:49.170 --> 06:52.150] actually gives you a hybrid mode between bullet proofs [06:52.150 --> 06:56.230] not requiring trusted setup and ZK-Smarts requiring trusted setup. [06:56.230 --> 06:58.970] So that's just like a fun side note. [06:59.470 --> 07:02.910] But basically, at the time, when we were looking to implement zero-knowledge proofs, [07:02.910 --> 07:05.990] bullet proofs was the thing that definitely made the most sense. [07:06.110 --> 07:09.470] So what we wanted to do was, well, first of all, understand the paper [07:09.470 --> 07:11.650] so we don't just blindly implement it, [07:11.650 --> 07:13.750] and then second, once we understood, [07:13.750 --> 07:16.630] then, you know, implement it using really best practices [07:16.630 --> 07:18.770] and existing libraries and Rust, [07:18.770 --> 07:20.290] and then make it a good performer. [07:21.230 --> 07:23.970] So you're all here to hopefully understand the paper, [07:23.970 --> 07:25.270] so let's dive right in. [07:25.270 --> 07:27.510] This is what it feels like to read the paper. [07:27.630 --> 07:30.250] We have some assumptions, for example, [07:30.250 --> 07:32.810] like we would like to prove that E is in range, [07:32.810 --> 07:36.470] and then it just gives us this massive multiscalar multiplication, [07:36.470 --> 07:38.550] and you're like, what is going on? Oh my gosh. [07:38.590 --> 07:43.590] So I would like to hopefully give you a path between step one and step two. [07:43.930 --> 07:46.990] And when we tried to figure that out, [07:46.990 --> 07:48.550] it took us actually like a month or two [07:48.550 --> 07:51.110] of just like whiteboarding out possible hypotheses [07:51.110 --> 07:53.330] of how we get from step one to step two [07:53.330 --> 07:55.190] and being like, no, that's wrong. [07:55.850 --> 07:57.290] No, that's still wrong. [07:57.370 --> 07:59.070] Okay, we actually like came up with something, [07:59.070 --> 08:01.430] and then we wrote up all of our notes online. [08:01.450 --> 08:03.090] So if you listen to this talk, [08:03.090 --> 08:05.230] you want more information, or maybe you see this talk [08:05.230 --> 08:07.110] and you're confused about some points, [08:07.110 --> 08:09.490] we actually have all of the notes for this online [08:09.490 --> 08:12.030] at docu-channel.alabic.rs. [08:13.210 --> 08:15.490] Also, I will post the slides online too, [08:15.490 --> 08:17.770] so don't worry about finding all the URLs. [08:18.870 --> 08:21.330] And then, oh, the last thing is that after we understood [08:21.330 --> 08:24.150] all of the math, Oleg came in with his graphic genius [08:24.150 --> 08:25.410] and made a cyberpunk [08:26.090 --> 08:28.530] visual of how all the math works. [08:28.650 --> 08:29.710] And so hopefully when you come back [08:29.710 --> 08:31.270] to the slide at the very end, you'll be like, [08:31.270 --> 08:33.290] oh, I understand all these transitions. [08:33.710 --> 08:35.670] That would be really great. Well, most of them. [08:36.130 --> 08:37.410] Cool, so the most [08:37.410 --> 08:39.910] fundamental building block of bulletproofs [08:39.910 --> 08:41.590] is this inner product algorithm. [08:41.810 --> 08:43.950] So this is actually not unique to bulletproofs. [08:43.950 --> 08:45.350] This was introduced by [08:45.510 --> 08:47.330] a previous paper out of UCL, [08:47.330 --> 08:49.890] and bulletproofs just made this three times more efficient. [08:50.470 --> 08:52.710] So, what is an inner product? [08:52.810 --> 08:54.110] An inner product, [08:54.110 --> 08:56.250] for instance, C is an inner product of A and B [08:56.250 --> 08:58.730] is the sum [08:58.730 --> 09:00.230] of entry-wise multiplications [09:00.230 --> 09:02.290] of vectors A and B. [09:02.370 --> 09:04.230] So for some syntax [09:04.230 --> 09:06.110] in this slide and in the bulletproof [09:06.110 --> 09:08.090] paper, bolded [09:09.090 --> 09:09.610] letters [09:09.610 --> 09:11.950] represent vectors. So here [09:11.950 --> 09:13.790] C is the inner product of vector A [09:13.790 --> 09:16.170] and vector B. So, [09:16.170 --> 09:17.970] naively, if you wanted to prove to me [09:17.970 --> 09:20.250] that C was equal to the inner product of [09:20.250 --> 09:22.550] A and B, and you had A and B, [09:22.550 --> 09:23.890] how could you do that? [09:23.970 --> 09:26.170] Just shout out some ideas, [09:26.170 --> 09:27.250] super naively. [09:30.210 --> 09:31.990] How would you do this in O of N [09:31.990 --> 09:33.350] space? [09:34.890 --> 09:35.610] Yeah, [09:35.610 --> 09:37.890] you could just send vector A, vector B [09:37.890 --> 09:39.550] and scalar C to B, and then [09:39.550 --> 09:41.530] I as the verifier could do [09:41.530 --> 09:43.650] the multiplication. So obviously this [09:43.650 --> 09:45.050] proof would be O of N [09:46.050 --> 09:47.230] space, because [09:47.230 --> 09:49.250] N is the length of A and B. [09:49.710 --> 09:50.890] The thing that [09:51.350 --> 09:53.350] boldproof introduces is a way to do this in O of [09:53.350 --> 09:54.330] N space. [09:56.370 --> 09:57.330] So what this looks [09:57.330 --> 09:59.410] like is first you start out with vectors A and B [09:59.410 --> 10:01.410] and your scalar C. [10:01.470 --> 10:03.190] Then you split A and B into [10:03.190 --> 10:05.550] two halves. Then you take [10:05.550 --> 10:07.350] this random scalar [10:07.350 --> 10:09.390] X, and right now you don't [10:09.390 --> 10:11.230] have to worry about where X comes from. [10:11.230 --> 10:13.190] All you have to know is that it's not zero, [10:13.190 --> 10:14.990] because if it's zero then you're screwed. [10:14.990 --> 10:16.690] And it's totally random. [10:16.690 --> 10:18.650] You cannot predict it ahead of time. [10:18.650 --> 10:20.770] So you take this random scalar [10:20.770 --> 10:22.990] X and you multiply it by [10:22.990 --> 10:24.370] the first half of A [10:24.370 --> 10:27.130] and you multiply the inverse by the second half of A [10:27.130 --> 10:28.810] sorry, the second half of A [10:28.810 --> 10:31.030] and then you get this A prime [10:31.030 --> 10:33.090] and then you do a split between with B prime [10:33.090 --> 10:35.150] and A prime and B prime [10:35.150 --> 10:36.490] are now half the length [10:36.490 --> 10:38.190] of A and B. [10:38.610 --> 10:39.810] And then you [10:40.890 --> 10:43.290] get this big mess for C prime [10:43.770 --> 10:45.410] But, actually watch this [10:45.410 --> 10:47.330] it's sort of magic. Because of the way [10:47.330 --> 10:49.510] that we selected the inverse and not inverse [10:49.510 --> 10:51.550] for A prime and B prime for X [10:51.550 --> 10:53.490] we can actually simplify [10:53.490 --> 10:55.730] this mess of C prime to be equal to [10:55.730 --> 10:57.550] the inner product of A low and B low [10:57.550 --> 10:59.370] plus the inner product of A high and B high [10:59.370 --> 11:01.010] plus like some garbage. [11:01.770 --> 11:03.710] And, wait for it... [11:03.710 --> 11:05.770] This, the inner product of A low and B low [11:05.770 --> 11:07.650] plus the inner product of A high and B high [11:07.650 --> 11:09.810] is, by definition of inner product proof [11:09.810 --> 11:11.430] the same thing as the inner product [11:11.430 --> 11:13.450] of A and B. So, do you see [11:13.450 --> 11:15.150] what's going on here? [11:15.150 --> 11:17.410] That line is actually the same thing as C [11:17.410 --> 11:19.430] above. Wow! [11:20.610 --> 11:21.490] Okay, [11:21.490 --> 11:23.150] can you raise your hand if you [11:23.150 --> 11:25.530] understood that. If you don't, I can repeat [11:25.530 --> 11:28.230] because I feel like this is a really critical part of understanding. [11:28.550 --> 11:29.530] Okay, cool. [11:30.210 --> 11:31.390] Sort of, sort of. [11:31.390 --> 11:33.590] Okay, so, yeah. [11:39.120 --> 11:39.700] Good, [11:39.700 --> 11:41.480] I'm getting to that. So, first [11:41.480 --> 11:43.780] we appreciate that the math works [11:43.780 --> 11:45.540] here so that you actually have C [11:45.540 --> 11:48.520] in your representation of C prime. And then you have this garbage. [11:48.700 --> 11:49.400] So, this garbage [11:49.400 --> 11:51.500] you have to just commit to it. [11:51.500 --> 11:54.040] So, let's call the thing underlined [11:54.040 --> 11:55.780] in green L and the thing underlined [11:55.780 --> 11:57.880] in red R. And then we send [11:57.880 --> 11:59.100] those two, so there are two [11:59.620 --> 12:01.580] points, we send those two points [12:01.580 --> 12:03.760] to the verifier. [12:03.940 --> 12:05.660] And you just say C prime is equal to [12:05.660 --> 12:06.940] the C from the previous round [12:06.940 --> 12:09.020] plus X squared times L [12:09.020 --> 12:11.560] plus X negative 2 [12:11.560 --> 12:12.840] times R. [12:14.440 --> 12:16.480] So, in summary, [12:16.480 --> 12:17.720] this is one round. [12:17.720 --> 12:19.460] And in one round, what we have achieved [12:19.460 --> 12:21.640] is that we have half the size of A, [12:21.640 --> 12:23.740] half the size of B, and committed to [12:23.740 --> 12:26.060] two points. That's a constant number of points. [12:26.060 --> 12:27.760] So, from, like, theory [12:27.760 --> 12:29.600] of computation, if you do [12:30.080 --> 12:31.480] a happy every step [12:31.480 --> 12:33.700] and every step you do a constant number [12:33.700 --> 12:35.500] of commitments, [12:35.500 --> 12:37.600] then you have a protocol [12:37.600 --> 12:39.760] that takes O of N, [12:39.760 --> 12:41.260] O of log N space. [12:41.600 --> 12:43.420] So I'm going to follow along so far. [12:44.460 --> 12:45.940] Okay, cool, so this is actually [12:45.940 --> 12:47.900] like the core nugget of what makes [12:47.900 --> 12:49.620] bullet proofs so efficient. [12:49.620 --> 12:51.920] Now you can, for very long vectors [12:51.920 --> 12:53.860] A and B, be able to [12:53.860 --> 12:55.680] make a proof that C is [12:55.680 --> 12:57.300] the inner product of A and B [12:57.840 --> 12:59.700] in O of log N space. [12:59.700 --> 13:01.440] Instead of before the only options [13:01.440 --> 13:03.580] are O of N space or something like on that [13:03.580 --> 13:05.760] order of code performance. [13:07.140 --> 13:07.840] Oh, and then at the [13:07.840 --> 13:09.680] very basic case, we have [13:09.680 --> 13:11.920] you know, A prime and B prime are just [13:11.920 --> 13:14.900] single scalars. [13:14.900 --> 13:15.840] And you send, you know, [13:15.840 --> 13:17.720] the single A prime to B prime [13:17.720 --> 13:19.900] and the prover, the verifier checks [13:19.900 --> 13:22.020] that that's equal to your basic case C prime. [13:22.360 --> 13:24.140] Cool, so yeah, that's [13:24.140 --> 13:26.000] sort of inner product. [13:26.220 --> 13:28.920] And then just sort of like, as a recap, [13:28.920 --> 13:30.420] if you are the prover, [13:30.420 --> 13:32.140] now you have received one L [13:32.140 --> 13:33.560] and one R point [13:33.560 --> 13:35.480] for every one of these steps. [13:35.480 --> 13:38.040] And then you also received the C prime. [13:38.040 --> 13:39.440] So you effectively like reverse [13:39.440 --> 13:41.100] this process and you build up [13:41.100 --> 13:43.240] what every higher C is [13:43.240 --> 13:44.840] using the L and R from that [13:45.540 --> 13:47.460] previous step until you get to the [13:47.460 --> 13:49.540] top level C. And if your top level C [13:49.540 --> 13:51.560] is equal to the C that you expect [13:51.560 --> 13:53.240] then you're like, wow, this all verifies [13:53.240 --> 13:55.680] for me. So that is [13:55.680 --> 13:57.920] our core building block here. [13:58.140 --> 14:00.100] Before we move on, any questions? [14:00.100 --> 14:00.880] Votes? [14:07.200 --> 14:08.160] Alright. [14:09.880 --> 14:10.360] So [14:10.360 --> 14:12.340] I did skip some things. [14:12.360 --> 14:14.240] So, one thing that I skipped is [14:14.240 --> 14:16.220] how we actually get the X. I told you don't [14:16.220 --> 14:18.360] worry about it because all you need to know [14:18.360 --> 14:20.500] is it's not zero, that it's random. [14:20.600 --> 14:22.300] In practice, we [14:22.300 --> 14:24.220] use the Fiat-Humier heuristic to get [14:24.220 --> 14:26.280] these challenge scales. What we actually [14:26.280 --> 14:28.160] do is we bind the X to all [14:28.160 --> 14:29.980] of the things in the previous round. [14:29.980 --> 14:31.980] So that you only get this random X [14:31.980 --> 14:34.140] once you've come into everything before. So you can't [14:34.140 --> 14:35.880] actually maliciously choose this X. [14:35.880 --> 14:38.060] So that's something that I didn't talk too much about. [14:38.120 --> 14:40.360] If you're curious about it, I can explain more. [14:40.600 --> 14:42.160] I also didn't talk about how [14:42.160 --> 14:44.000] operations are actually over commitments [14:44.000 --> 14:46.040] over the plain values. In all [14:46.040 --> 14:47.960] of these examples, I just used a plain [14:47.960 --> 14:50.120] A and B, but we actually are operating [14:50.120 --> 14:52.280] over additively homomorphic commitments [14:52.280 --> 14:53.720] in the exact same way that [14:53.720 --> 14:56.040] in our earlier example for our confidential [14:56.040 --> 14:58.000] transaction, we're actually operating [14:58.000 --> 14:59.800] over additively homomorphic commitments [14:59.800 --> 15:02.080] when we check that they add to the same else. [15:02.940 --> 15:04.040] And then the last one [15:04.040 --> 15:05.200] is just a performance thing. [15:05.360 --> 15:07.900] We use multi-exponentiation to have faster [15:07.900 --> 15:09.960] verification, but that's [15:10.700 --> 15:12.080] not fundamental to the math. [15:12.080 --> 15:14.360] It's just cool performance speedups. [15:15.100 --> 15:15.900] Alright, so [15:15.900 --> 15:17.640] we just covered the inner product [15:17.640 --> 15:20.220] building block, and now you might be wondering [15:20.220 --> 15:21.500] why do we even care? [15:21.500 --> 15:24.180] Why does it matter that C is the inner product [15:24.180 --> 15:26.300] of A and B? Whatever. [15:26.540 --> 15:28.540] And the reason that it's actually really cool [15:28.540 --> 15:30.420] or why we care about this form [15:30.420 --> 15:31.940] is because we can actually [15:31.940 --> 15:34.460] by applying math and cryptography [15:34.460 --> 15:36.060] to a statement [15:36.060 --> 15:38.020] we can represent effectively any [15:38.020 --> 15:40.740] statement as an inner product. [15:41.080 --> 15:42.000] If you don't believe me, [15:42.000 --> 15:43.800] I'll show you with this range proof, [15:43.800 --> 15:45.400] and then I can also show you with [15:46.100 --> 15:48.300] our generalized constraint system [15:48.300 --> 15:50.100] proof, which [15:50.100 --> 15:52.840] therefore reduces from any statement. [15:54.120 --> 15:56.300] But, let's look at the range proof [15:56.300 --> 15:58.140] first. So, here what we want [15:58.140 --> 16:00.080] to do is we want to start out with [16:00.240 --> 16:02.440] a statement of range. 0 is less than or equal to [16:02.440 --> 16:04.320] v, which is less than 2 to the n. [16:04.320 --> 16:06.180] We want to do some things to it [16:06.180 --> 16:08.460] tbd, until it's in the form [16:08.460 --> 16:10.340] of C equals inner product of A and B [16:10.340 --> 16:11.700] such that [16:11.700 --> 16:15.120] if C is equal [16:15.120 --> 16:16.580] to the inner product of A and B [16:16.580 --> 16:18.560] then with very high probability [16:18.560 --> 16:20.460] v is in range. [16:21.180 --> 16:22.240] Cool. Is everyone [16:22.240 --> 16:24.280] on board with this solution? Any questions [16:24.280 --> 16:26.200] so far? Alright, so now [16:26.200 --> 16:28.220] we're just looking at this in-between math and [16:28.220 --> 16:29.460] computer science. [16:30.220 --> 16:32.120] Alright, so the first thing that we want to [16:32.120 --> 16:34.680] observe is really interesting. [16:34.680 --> 16:35.780] So, if [16:36.360 --> 16:38.320] v is in range from 0 to [16:38.320 --> 16:40.140] 2 to the n, then v [16:40.140 --> 16:42.840] must be a binary number of like n. [16:42.920 --> 16:44.160] So, in this example, [16:44.160 --> 16:46.320] if v is 3, v is [16:46.320 --> 16:47.920] definitely in range between 0 to [16:48.420 --> 16:50.420] 2 to the n if n is 4. [16:50.420 --> 16:52.000] So, you must be able to represent [16:52.000 --> 16:54.180] v as a binary number of [16:54.180 --> 16:56.280] like 4. Cool. [16:56.280 --> 16:58.300] So, as a mental exercise [16:58.300 --> 17:00.400] you can try [17:00.400 --> 17:02.600] this with any value [17:02.600 --> 17:04.160] between 0 and 2 to the 4 [17:04.160 --> 17:06.820] and you'll see that yes, indeed, it does work. [17:06.820 --> 17:08.540] And if you try to represent something larger [17:08.540 --> 17:10.440] so 2 to the 4 plus 1 [17:10.440 --> 17:12.260] you'll see that you cannot actually fit everything [17:12.260 --> 17:14.400] in these boxes. Cool. So, [17:14.400 --> 17:16.460] by definition, binary numbers. [17:17.920 --> 17:18.480] So, I think this is [17:18.480 --> 17:20.300] pretty cool, first of all. [17:20.660 --> 17:22.120] Any questions so far? [17:23.400 --> 17:24.360] If you [17:24.360 --> 17:26.720] don't follow this, you'll be lost with the rest of this [17:26.720 --> 17:28.980] explanation, so I want to make sure it's on board. [17:30.040 --> 17:30.900] Don't be embarrassed. [17:31.240 --> 17:32.800] It took us at least a month [17:32.800 --> 17:34.500] to figure this out, so don't be embarrassed [17:34.500 --> 17:36.580] for covering it in like two minutes. [17:37.440 --> 17:39.740] Cool. So, [17:39.740 --> 17:40.340] we now have [17:40.340 --> 17:42.520] v of 3, this is our secret [17:42.520 --> 17:44.680] value, and we want to prove that it's between [17:44.680 --> 17:46.540] 0 and 2 to the 4. [17:46.900 --> 17:47.980] What we do [17:48.960 --> 17:50.780] is we call the binary representation [17:50.780 --> 17:52.440] of v, A sub L [17:52.440 --> 17:54.600] and this is what the paper uses, so I'm just [17:54.600 --> 17:56.660] trying to be consistent. And then we can say [17:56.660 --> 17:58.760] that v is the inner product of [17:58.760 --> 18:00.620] A sub L and 2 to the N. [18:00.620 --> 18:02.480] Remember, inner products can be of any two [18:02.480 --> 18:04.560] vectors that are the same length. So here we're [18:04.560 --> 18:05.440] actually representing [18:06.420 --> 18:08.400] v as an inner product. [18:09.180 --> 18:10.660] So, maybe some of you [18:10.660 --> 18:12.260] are thinking like, whoa, we've actually [18:12.260 --> 18:14.600] jumped from this v in [18:14.600 --> 18:16.580] range all the way to the inner product statement. [18:16.580 --> 18:18.400] Are we done? I wish. [18:18.400 --> 18:19.480] That would be really nice. [18:20.160 --> 18:21.600] No, we're not done. [18:21.720 --> 18:23.700] And the reason for this is because if this is your [18:23.700 --> 18:25.680] only statement, you can actually do something malicious [18:26.140 --> 18:27.600] with your A sub L. [18:27.700 --> 18:29.600] Does anyone have any guesses as to what you [18:29.600 --> 18:31.920] can do with this selection of A sub L [18:31.920 --> 18:33.680] that would be malicious, that would [18:33.680 --> 18:35.640] allow you to make a value [18:35.640 --> 18:37.720] that's outside of the range, but for whom [18:37.720 --> 18:40.280] this inner product argument is actually true? [18:41.840 --> 18:43.980] Yes, exactly. A sub L, [18:43.980 --> 18:45.600] nothing about the statement v equals [18:45.600 --> 18:47.360] the inner product of A sub L and 2 to the N [18:47.940 --> 18:49.540] requires that A sub L is actually just [18:49.540 --> 18:51.460] binary. So, if we have [18:51.980 --> 18:53.700] last digit or the first digit [18:53.700 --> 18:55.440] is 100, then v would be a huge [18:55.440 --> 18:57.560] number, but this inner product statement [18:57.560 --> 18:58.720] would still be true. [18:59.280 --> 19:01.280] So, what we want to do... [19:01.280 --> 19:03.580] Oops, I actually have slides to watch all of this. [19:03.580 --> 19:04.600] There we go. So, here's [19:05.520 --> 19:07.460] some examples of [19:07.460 --> 19:09.520] v. What we want to do [19:09.520 --> 19:11.540] is basically add another statement that [19:11.540 --> 19:13.880] A sub L has to be binary. [19:14.000 --> 19:15.620] And the way that we do this is we create [19:15.620 --> 19:17.720] an A sub R. A sub R is [19:17.720 --> 19:19.700] the bits of A sub L minus 1. [19:19.700 --> 19:21.560] So, if you have 0, 0, 1, 1, then [19:21.560 --> 19:24.100] A sub R is negative 1, negative 1, 0, 0. [19:24.380 --> 19:25.540] So, this has a really [19:26.040 --> 19:27.800] neat property where if you multiply [19:27.800 --> 19:29.500] every bit of A sub L [19:29.500 --> 19:32.220] with the corresponding bit of A sub R, [19:32.220 --> 19:33.940] then if A sub L [19:33.940 --> 19:36.340] is only bits, then you'll get a vector of zeros. [19:36.880 --> 19:37.640] If A sub L [19:37.640 --> 19:39.840] is anything else, for example 100, [19:39.840 --> 19:41.500] then you'll get 100 times 99 [19:41.500 --> 19:43.860] and that's not a zero. So, this is actually [19:43.980 --> 19:45.840] a statement that makes sure [19:46.680 --> 19:47.880] that A sub L [19:47.880 --> 19:49.780] is comprised of bits. [19:50.000 --> 19:51.600] So, now we have three statements. One being [19:51.600 --> 19:53.420] the vector is actually A sub L times [19:53.420 --> 19:55.880] inner product of 2 to the N. The second one [19:55.880 --> 19:57.940] being A sub L times A sub R [19:57.940 --> 19:59.560] equals zeros. And the third [19:59.560 --> 20:01.400] being the definition of A sub R. [20:02.320 --> 20:03.840] Cool. So, [20:03.840 --> 20:05.600] how's everyone doing? Does this make sense? Why do we [20:05.600 --> 20:07.880] use A sub R? Cool. And obviously [20:07.880 --> 20:09.780] you can combine steps 2 and 3 [20:09.780 --> 20:11.540] into just one statement without [20:11.540 --> 20:13.180] defining A sub R, but [20:13.180 --> 20:15.480] we tried to do that and then [20:15.480 --> 20:17.180] realized that that breaks the protocol [20:17.180 --> 20:19.540] because you have to separately make a commitment to A sub R. [20:19.540 --> 20:21.540] So, just trust me that you actually need to [20:21.540 --> 20:23.200] do all three of these things. [20:23.880 --> 20:24.960] Cool. So, now we [20:25.540 --> 20:27.260] have come up with these three statements. [20:27.260 --> 20:29.380] If they're true, then [20:29.380 --> 20:31.320] your original range statement is true. [20:32.660 --> 20:33.580] So, [20:33.580 --> 20:35.380] before moving on, [20:35.380 --> 20:37.280] I need to introduce another [20:37.280 --> 20:39.280] mathematical building block that [20:39.280 --> 20:40.940] allows you to combine statements. [20:41.180 --> 20:43.220] So, the same way that we got [20:43.400 --> 20:44.860] a challenge scalar last time, [20:44.860 --> 20:47.180] previously in the inner product group, here [20:47.180 --> 20:49.180] let's just pretend we have a challenge scalar. Let's not [20:49.180 --> 20:51.200] worry about how we get it, which is [20:51.200 --> 20:52.620] random and it's not zero. [20:52.940 --> 20:55.180] If A equals zero, if B equals [20:55.180 --> 20:57.140] zero, then you can actually combine these [20:57.140 --> 20:59.300] two statements together into one statement [20:59.300 --> 21:01.060] using this random challenge [21:01.060 --> 21:03.780] by saying A plus B equals zero. [21:03.780 --> 21:05.240] And as long as X is random, [21:05.240 --> 21:07.580] then with extremely high probability, [21:07.580 --> 21:09.360] this last statement will be true [21:09.360 --> 21:11.820] if and only if A equals zero and B equals zero. [21:11.960 --> 21:13.860] Does this make sense? Let's see. [21:14.580 --> 21:15.720] And if you want to be [21:15.720 --> 21:17.500] malicious, and also to check [21:17.500 --> 21:19.580] your understanding, can someone tell me what [21:19.580 --> 21:20.800] X has to be in order to [21:21.700 --> 21:23.700] maliciously make an X [21:23.700 --> 21:25.460] such that A plus BX equals zero [21:25.460 --> 21:27.960] even if A and B do not equal zero? [21:29.320 --> 21:30.140] Zero. [21:30.960 --> 21:33.420] Yeah, that's true, yes. And also [21:33.420 --> 21:35.540] you can set X as equal to [21:35.540 --> 21:37.020] A divided by B. [21:37.120 --> 21:38.940] And that will also give you maliciously [21:39.160 --> 21:41.620] a way to circumvent [21:41.620 --> 21:42.860] this double [21:43.440 --> 21:44.860] combination step. [21:44.860 --> 21:47.220] So we just have to check X is not equal to zero [21:47.220 --> 21:49.180] and sample X in such a large space [21:49.180 --> 21:51.080] that the probability that it's equal [21:51.080 --> 21:53.160] to A divided by B is so small [21:53.160 --> 21:54.680] that we don't even worry about it. [21:55.000 --> 21:56.800] And in practice, we sample X from [21:57.300 --> 21:59.500] 2 to the 255 minus 19, [21:59.500 --> 22:01.440] so we're fine. Don't worry about it. [22:02.100 --> 22:02.980] Cool. [22:03.700 --> 22:04.900] So, we can actually [22:04.900 --> 22:07.120] do this multiple times. Don't be scared. [22:07.120 --> 22:08.800] This is the same idea. We can do this [22:08.800 --> 22:10.900] multiple times, but instead of [22:10.900 --> 22:13.120] using X once, we can multiply [22:13.120 --> 22:15.060] the first one by nothing, the second one by [22:15.060 --> 22:16.820] well, here our conuscular is Y [22:16.820 --> 22:19.700] by Y, our third one by Y squared, [22:19.700 --> 22:20.900] so on and so forth, and [22:20.900 --> 22:23.120] everyone has a different exponent of Y. [22:23.260 --> 22:24.940] And the reason that we'll have to do this is [22:24.940 --> 22:27.040] because if Y is random, then taking [22:27.040 --> 22:29.120] Y to a certain exponent is also going to give you [22:29.120 --> 22:31.760] something that is random in that space. [22:31.760 --> 22:33.600] And so, [22:33.600 --> 22:35.660] the way that we [22:35.660 --> 22:37.820] write this combination is [22:37.820 --> 22:39.840] the inner product of A and B [22:39.840 --> 22:41.480] times the vector of Y to the N [22:41.480 --> 22:43.640] equals 0. So, it's a little bit [22:43.640 --> 22:45.740] weird syntax, [22:45.740 --> 22:47.380] but that's just how we write it. [22:47.700 --> 22:49.840] And so, since the prover can't predict Y, [22:49.840 --> 22:51.740] the latter statement, this inner [22:51.740 --> 22:53.760] product of A and B times Y to the [22:53.760 --> 22:55.740] N equals 0 is true with very [22:55.740 --> 22:57.760] high probability. Alright, so this [22:57.760 --> 22:59.820] is our building block. I'm just showing [22:59.820 --> 23:02.020] you how you can use random calendars to combine [23:02.140 --> 23:03.900] a bunch of statements together, and hopefully [23:03.900 --> 23:05.920] you'll also have a little inkling of [23:05.920 --> 23:07.700] like, hmm, this is interesting, because [23:07.700 --> 23:10.000] this last statement is actually an inner [23:10.000 --> 23:11.780] product statement. So, [23:11.780 --> 23:13.980] remember how this whole journey [23:13.980 --> 23:16.140] is us trying to start with a [23:17.440 --> 23:18.320] range statement [23:18.320 --> 23:20.300] and ending up with an inner product? [23:20.300 --> 23:22.160] This is actually a tool that we'll use [23:22.160 --> 23:25.360] to get to that inner product. [23:25.360 --> 23:26.200] So, [23:26.200 --> 23:27.860] the way that we'll use this tool is that [23:27.860 --> 23:29.920] the verifier gives us a random [23:29.920 --> 23:32.020] form of scalar Y. So, [23:32.020 --> 23:33.860] this comes from somewhere. In practice, it [23:33.860 --> 23:35.580] comes from the Pyatchenko heuristic. [23:35.800 --> 23:37.960] Then, we rewrite the second two [23:37.960 --> 23:39.620] statements, because the first statement is already [23:39.620 --> 23:41.860] in the inner product proof form, [23:41.860 --> 23:43.500] so we're already pretty [23:43.500 --> 23:45.540] well along there. But the second [23:45.540 --> 23:47.540] two statements, we use this Y [23:47.540 --> 23:49.660] to combine the statements [23:49.660 --> 23:51.720] together into inner [23:51.720 --> 23:53.700] product forms. So, once [23:53.700 --> 23:55.940] again, originally, [23:55.940 --> 23:58.160] the second statement, A sub L times A sub Y [23:58.160 --> 23:59.960] equals zero, a vector of zeros, [23:59.960 --> 24:01.860] is actually multiple statements. [24:01.860 --> 24:03.820] It's N statements, one [24:03.820 --> 24:05.880] statement for each index of A sub L [24:05.880 --> 24:07.900] and A sub R. And what we actually do [24:07.900 --> 24:09.780] is we're combining all of those statements [24:09.780 --> 24:11.900] by multiplying each of those [24:11.900 --> 24:13.640] statements by a different power of Y. [24:13.640 --> 24:16.460] And then, we're combining them in one inner product argument. [24:16.460 --> 24:17.680] So, this is just the format [24:17.680 --> 24:19.980] that we write it in [24:19.980 --> 24:21.660] once we combine it with Y. [24:21.660 --> 24:23.420] And then, we do the same for the second one. [24:24.100 --> 24:25.420] Cool. So, [24:25.420 --> 24:27.040] how are you feeling about that? [24:27.040 --> 24:28.580] We use this challenge scalar, [24:28.580 --> 24:30.480] do some crazy stuff, and [24:31.300 --> 24:33.120] three inner product arguments. [24:34.400 --> 24:35.120] Alright. [24:36.100 --> 24:38.080] And then, we do it again. [24:38.820 --> 24:39.720] Now, we take [24:39.900 --> 24:41.600] a random talent scalar, Z, [24:41.600 --> 24:43.420] and our [24:43.960 --> 24:45.400] argument, remember how I was saying [24:45.400 --> 24:47.700] if A equals zero and B equals zero, [24:47.700 --> 24:49.540] then, like, A plus B times [24:49.680 --> 24:51.100] a challenge scalar X equals zero. [24:51.100 --> 24:52.960] So, we're doing the exact same thing here. [24:53.260 --> 24:54.220] Here, we have [24:55.180 --> 24:56.840] B equals A sub L [24:56.840 --> 24:59.020] inner product of two to the N, which you [24:59.020 --> 25:00.060] can actually rewrite as [25:00.980 --> 25:01.860] zero equals [25:04.340 --> 25:05.500] A sub L [25:05.500 --> 25:07.520] inner product of two to the N minus B. [25:07.840 --> 25:09.100] And what you do is you just [25:09.100 --> 25:11.060] multiply that by Z squared, [25:11.060 --> 25:12.900] multiply the second thing by Z, [25:12.900 --> 25:15.200] multiply the third thing by C to the zero. [25:15.880 --> 25:17.080] And then, you end up with this [25:17.080 --> 25:19.120] statement. Cool. [25:19.120 --> 25:21.140] Now, you have one statement. [25:21.140 --> 25:23.220] Remember how our goal is to get one statement [25:23.220 --> 25:25.680] that is one inner product argument. [25:25.820 --> 25:27.100] So, we're really close. We have one [25:27.100 --> 25:29.140] statement that's three inner product arguments. [25:29.920 --> 25:31.240] And then, [25:31.240 --> 25:33.300] we do some [25:33.300 --> 25:35.220] math that I'm not going to bore you [25:35.220 --> 25:37.140] with that's basically just algebra. [25:37.140 --> 25:39.240] You just, like, take some things apart and rearrange them. [25:39.240 --> 25:41.240] And then, you end up with this [25:41.700 --> 25:42.800] inner product statement [25:42.800 --> 25:45.060] equals this thing on the right. [25:45.360 --> 25:47.080] So, if you're curious about [25:47.080 --> 25:48.580] what that math is, [25:48.580 --> 25:50.620] we wrote it up here. It's really not [25:50.620 --> 25:52.860] actually that interesting. [25:53.540 --> 25:55.020] But, look here [25:55.020 --> 25:56.920] on the right. This is exactly the format [25:56.920 --> 25:59.060] that we want. We want an inner product [25:59.060 --> 26:01.100] argument where the thing [26:01.100 --> 26:02.880] on the left, inner product of the thing [26:02.880 --> 26:04.880] on the right equals C. [26:05.040 --> 26:06.900] So, we can essentially represent [26:07.520 --> 26:08.840] we can think of [26:08.840 --> 26:11.120] the thing before the comma as A [26:11.120 --> 26:13.100] and the thing after the comma as B [26:13.100 --> 26:15.420] and the thing after the equals as C. [26:16.440 --> 26:18.040] So, to recap [26:18.820 --> 26:19.700] we have [26:19.700 --> 26:20.900] or, sorry, LOR [26:20.900 --> 26:23.820] I forget the letters I used. [26:23.820 --> 26:25.500] But, to recap, this is our journey. We started [26:25.500 --> 26:27.680] with a range statement. We broke [26:27.680 --> 26:29.480] it up into three separate statements that [26:29.480 --> 26:31.580] must all be true if this range is actually [26:31.580 --> 26:33.780] if the values are actually in range. [26:33.880 --> 26:35.360] And then we applied these, like, random [26:35.360 --> 26:37.700] challenge scalars such that we [26:37.700 --> 26:39.760] could rearrange all three of these [26:39.760 --> 26:41.820] into one inner product argument. [26:41.920 --> 26:43.420] And that is basically in the same format [26:43.420 --> 26:45.540] as what we wanted. T is the inner product [26:45.540 --> 26:47.200] of LOR. And [26:48.020 --> 26:49.540] going all the way back to the [26:49.540 --> 26:51.220] beginning, now that it's in this inner product [26:51.220 --> 26:53.420] argument, if and only if this [26:53.420 --> 26:55.360] inner product is true, then the B [26:55.360 --> 26:57.620] is in range. And we have a really efficient [26:57.620 --> 26:59.320] way in O of all N to [26:59.320 --> 27:01.920] prove that this inner product is true. [27:02.460 --> 27:03.180] Cool, so it comes [27:03.180 --> 27:04.200] full circle. [27:06.960 --> 27:07.480] Yeah, [27:07.480 --> 27:09.300] this is LOR of T [27:09.760 --> 27:11.020] of inner product. [27:11.020 --> 27:12.560] So, [27:12.560 --> 27:14.920] before I move on to how [27:14.920 --> 27:16.880] this is actually kind of [27:16.880 --> 27:18.620] oversimplifying it, I want to make sure that [27:18.620 --> 27:21.340] the simplification makes sense to everyone. [27:21.980 --> 27:23.660] Anyone have questions? [27:23.960 --> 27:25.080] Yes. [27:26.920 --> 27:28.040] Yes, [27:28.040 --> 27:28.980] for sure. [27:30.920 --> 27:32.040] So, [27:32.040 --> 27:33.100] so the first part [27:33.100 --> 27:35.220] is we took this Y [27:35.220 --> 27:36.860] and we took the Y to rewrite [27:36.860 --> 27:38.780] each of these. So now we have [27:38.780 --> 27:40.740] here on the right hand side, [27:40.740 --> 27:42.640] here on the left hand side, we now have [27:42.640 --> 27:45.120] three statements, and these three statements have to be true. [27:45.120 --> 27:46.740] But we want some way to somehow [27:46.740 --> 27:48.740] smush all of these three statements into [27:48.740 --> 27:50.780] one statement. So if we're [27:50.780 --> 27:52.920] not looking at all the annoying math, [27:52.920 --> 27:54.440] but we just have three statements that are like [27:54.440 --> 27:57.060] A equals 0, B equals 0, C equals 0, [27:57.060 --> 27:58.540] and you want to represent that as just [27:58.540 --> 28:00.600] one statement, what you can do is you can [28:00.600 --> 28:02.500] take a random number, Z [28:02.500 --> 28:04.260] in this case, and you can say [28:05.240 --> 28:06.800] if A plus [28:06.800 --> 28:08.960] B times Z plus C [28:08.960 --> 28:10.880] times Z squared equals 0, [28:10.880 --> 28:12.800] then with extremely high probability, [28:12.800 --> 28:14.620] we know that all our [28:14.620 --> 28:16.960] three individual statements, A equals 0, B equals 0, [28:16.960 --> 28:18.680] C equals 0, those are all true. [28:18.680 --> 28:20.540] So that's exactly what we're doing here. [28:20.540 --> 28:23.520] We're multiplying the first thing by Z squared, [28:23.520 --> 28:25.180] multiply the second thing by Z, [28:25.180 --> 28:26.620] multiply the third thing by [28:26.620 --> 28:28.120] Z to the 0, or nothing. [28:29.100 --> 28:30.680] And then that gives us [28:30.680 --> 28:32.680] the equation on the right. And then we just move [28:32.680 --> 28:34.600] the Z to the end, just because [28:34.600 --> 28:35.620] it's pretty random. [28:36.560 --> 28:38.780] Cool, does that answer your question? [28:39.100 --> 28:40.360] Okay, so I have one on my hand. [28:40.360 --> 28:40.900] Yeah? [28:43.140 --> 28:45.000] Ooh, oh man. [28:45.420 --> 28:46.940] I was hoping that, you know, [28:48.140 --> 28:48.940] this delta [28:48.940 --> 28:50.520] represents all of the messy [28:50.520 --> 28:52.960] casements that we don't actually want to write out. [28:53.220 --> 28:53.940] And I think [28:54.500 --> 28:56.800] if we go on to the next slide, [28:56.800 --> 28:58.800] the same way that in the previous slide [28:58.800 --> 29:00.780] I was like, these are things that I'm not diving into [29:00.780 --> 29:02.620] even deeper, that's one of the things [29:02.620 --> 29:04.420] is that delta just represents everything [29:04.420 --> 29:06.620] that is a public knowledge. So delta [29:07.940 --> 29:08.880] doesn't have anything [29:08.880 --> 29:10.540] that's secret in it. The proof and the [29:10.540 --> 29:12.480] verifier both know what's in delta. [29:12.480 --> 29:14.420] And that's why we can just abstract it into this delta [29:14.420 --> 29:16.820] nice thing. [29:17.460 --> 29:18.400] Because it doesn't [29:18.400 --> 29:20.940] contain anything too important or too secret. [29:21.420 --> 29:22.940] Cool, any other questions? [29:24.240 --> 29:24.700] Alright, [29:24.700 --> 29:27.560] so that's a good segue into the next section, [29:27.560 --> 29:28.560] which is that [29:30.040 --> 29:30.860] as you might [29:30.860 --> 29:32.780] notice, A sub L [29:32.780 --> 29:34.320] minus Z on the [29:35.300 --> 29:37.260] left-hand side of the product, [29:37.260 --> 29:38.820] if you were just to send it to the [29:40.860 --> 29:41.660] verifier, [29:41.660 --> 29:42.880] the verifier would just learn [29:42.880 --> 29:44.860] when your A sub L is, and then be like [29:44.860 --> 29:46.880] oh, I knew your secret, come on. [29:47.300 --> 29:49.500] So that's sort of silly. [29:50.220 --> 29:50.740] And so [29:50.740 --> 29:52.600] what we actually do in practice [29:52.600 --> 29:54.940] is we make a commitment to [29:54.940 --> 29:57.400] what's on the left and the right of the inner product. [29:57.660 --> 29:59.020] And then really nice, [29:59.020 --> 30:00.860] and then also, so like [30:00.860 --> 30:03.020] these are things that we actually want to make commitments [30:03.020 --> 30:04.740] to, and we will send over the [30:04.740 --> 30:06.720] commitments instead of sending over the plain [30:06.720 --> 30:08.060] secrets. [30:08.620 --> 30:09.960] What does that look like? [30:10.760 --> 30:12.640] Maybe first I should, you know, [30:12.640 --> 30:14.480] review what commitments are. [30:14.480 --> 30:16.840] So if you have an additively homomorphic [30:16.840 --> 30:19.540] commitment, like I mentioned way at the beginning of the talk, [30:19.540 --> 30:20.900] then if you have [30:20.900 --> 30:23.320] some secrets, A plus B equals C plus C, [30:23.320 --> 30:24.780] then your commitments will [30:24.780 --> 30:27.100] also maintain the additive property [30:27.100 --> 30:29.160] of those secrets. So then the commitment [30:29.160 --> 30:31.060] of A plus the commitment of B would be equal to the [30:31.060 --> 30:32.940] commitment of C plus the commitment of D. [30:33.180 --> 30:35.020] And then similarly, this also extends [30:35.020 --> 30:36.940] to multiplication by scaling. [30:37.260 --> 30:39.980] So if you have 2 times E equals F, [30:39.980 --> 30:41.100] then 2 times the commitment of [30:41.100 --> 30:42.540] E equals the commitment of F. [30:42.540 --> 30:45.000] So you don't have to worry about how this works, you can just [30:45.000 --> 30:46.660] sort of treat this as a black box. [30:46.840 --> 30:48.980] If you do want to learn about how this works, it's really [30:48.980 --> 30:50.940] just a Peterson commitment, and it's really [30:50.940 --> 30:53.000] straightforward, you're just multiplying by a group element [30:53.000 --> 30:55.080] and adding a blind factor times [30:55.080 --> 30:57.180] another group element that's orthogonal, it's not [30:57.180 --> 30:59.060] that crazy, I'm also happy to dive into that [30:59.060 --> 31:01.140] more. But if you want to [31:01.140 --> 31:03.360] treat this as a black box, then basically [31:03.980 --> 31:05.300] all you do is you start out [31:05.300 --> 31:07.420] with the thing on the left of the inner product, [31:07.420 --> 31:09.180] the thing on the right of the inner product, and the thing [31:09.180 --> 31:11.120] on the side, and you just make commitments [31:11.120 --> 31:12.920] to them. And if [31:12.920 --> 31:15.120] the inner product of those [31:15.120 --> 31:17.060] commitments is true, then [31:17.060 --> 31:19.040] with extremely high probability, then the [31:19.040 --> 31:21.260] secrets inside those commitments are also true. [31:21.680 --> 31:23.200] So that's really nice, [31:23.200 --> 31:25.260] because that's sort of the magic of an additively [31:25.260 --> 31:26.880] homomorphic scheme. [31:28.200 --> 31:29.200] And in practice, that's [31:29.200 --> 31:31.200] what we do. So, [31:31.200 --> 31:32.580] as a recap, [31:34.020 --> 31:34.980] let's see... [31:34.980 --> 31:37.220] Yeah, so, as a recap, [31:38.240 --> 31:39.140] this sort of takes us [31:39.140 --> 31:41.060] full circle, we can send over this inner [31:41.060 --> 31:42.980] product argument without fearing that [31:42.980 --> 31:45.080] we're revealing any secrets. So things [31:45.080 --> 31:46.720] that I omitted are how the column [31:46.720 --> 31:48.780] scalars are generated, how [31:48.780 --> 31:51.080] the commitments work in detail, once again [31:51.080 --> 31:53.080] there are some commitments, and [31:53.080 --> 31:55.060] I also skipped over how the [31:55.060 --> 31:57.080] values are blinded, that's [31:57.080 --> 31:59.200] part of how the commitments work. So if you want [31:59.360 --> 32:01.060] a deeper dive into that, I'm also happy to [32:01.060 --> 32:03.060] talk about that, but it's okay just treating it as [32:03.140 --> 32:05.060] a black box and being like, yes, that's [32:05.060 --> 32:07.020] how it works. So the [32:07.020 --> 32:09.580] end result of, you know, [32:09.580 --> 32:11.280] we understood the paper, we implemented [32:11.280 --> 32:13.120] it, and then [32:13.120 --> 32:14.980] sort of, oh, I forgot to [32:14.980 --> 32:16.880] include that it's less than one millisecond per [32:17.320 --> 32:19.540] 64-bit input verification, [32:19.540 --> 32:21.780] and that's even without patching. [32:21.780 --> 32:23.620] So if you were to patch, you can get multiple [32:23.620 --> 32:26.680] verifications in even less time. [32:26.680 --> 32:27.740] And so, yeah, that's [32:27.740 --> 32:28.860] our numbers, [32:30.060 --> 32:31.680] and I think that's [32:31.680 --> 32:33.640] all of the material [32:33.640 --> 32:35.340] that I've had for today. [32:36.020 --> 32:37.540] I'm also happy to talk [32:37.540 --> 32:39.580] about, you know, how we [32:39.580 --> 32:41.360] use this and other ways to [32:41.360 --> 32:43.800] abstract, you know, bullet groups over [32:43.800 --> 32:45.600] arbitrary statements instead of [32:45.600 --> 32:47.360] only over range groups. [32:47.360 --> 32:49.260] So maybe, um, let's start with [32:49.260 --> 32:51.480] some questions. Let's see if I have time. [32:52.000 --> 32:53.320] Let's start with some questions [32:53.320 --> 32:54.920] about the actual, like, math [32:54.920 --> 32:57.220] part of this talk, and then maybe after that [32:57.220 --> 32:59.340] I'll just take requests for [32:59.340 --> 33:01.800] other things that we want to hear about. [33:03.180 --> 33:03.880] Any questions [33:03.880 --> 33:05.320] about the math? Anything [33:05.320 --> 33:07.380] that you guys are happy to do for me? Yes. [33:19.550 --> 33:20.430] Yes. [33:20.790 --> 33:22.350] Great question. So the reason [33:22.350 --> 33:24.370] that we do this, um, [33:24.370 --> 33:25.930] well, we, meaning really, like, Benedict [33:25.930 --> 33:28.130] who wrote the paper, um, the reason that he does this [33:28.130 --> 33:30.470] is because then you have some really cool property [33:30.470 --> 33:32.410] where, um, [33:32.410 --> 33:34.030] here, you actually get [33:34.030 --> 33:35.870] the x of the b-low [33:35.870 --> 33:38.670] to, uh, sorry, the x that is, uh, [33:38.670 --> 33:40.590] x inverse attached with b-low [33:40.590 --> 33:42.730] to cancel out the x in a-low. [33:42.910 --> 33:44.410] So, here, [33:44.410 --> 33:46.410] let me just, like, review [33:46.410 --> 33:48.310] how this works. So, [33:48.310 --> 33:50.250] if you have the inner product of this [33:50.250 --> 33:52.270] with this, what you're actually doing [33:52.270 --> 33:54.410] is you're taking this and multiplying it [33:54.410 --> 33:56.330] by this, and that gives you a-low [33:56.330 --> 33:58.110] times b-low, or any a-low [33:58.110 --> 34:00.110] product with b-low. And then here, [34:00.110 --> 34:02.130] the x inverse here cancels out with x here, [34:02.130 --> 34:04.850] and that gives you a-high inner product with b-high. [34:04.850 --> 34:06.270] And so that's just a nice [34:06.270 --> 34:08.330] sort of magic. [34:08.870 --> 34:10.330] Um, and if you didn't have that, like, [34:10.330 --> 34:12.370] canceling out the property, the axiom wouldn't be able to [34:12.930 --> 34:13.730] reconstruct c [34:14.310 --> 34:16.170] from, um, c prime. [34:16.870 --> 34:18.190] So, good question. [34:18.190 --> 34:20.210] Um, that is really cool. [34:21.470 --> 34:22.390] Cool. [34:22.390 --> 34:24.400] Any other, um, [34:25.030 --> 34:26.510] questions about math? [34:26.850 --> 34:28.050] Yes, hi. [34:28.630 --> 34:34.670] Oh, yes, um, [34:34.670 --> 34:36.890] ladies at this, so you're also [34:36.890 --> 34:38.550] kind of blonde, but [34:39.190 --> 34:41.210] it's, um, [34:41.210 --> 34:42.930] sorry, I also have these slides [34:42.930 --> 34:45.250] online if you want to just, like, [34:45.250 --> 34:46.350] review the slides. It's [34:46.350 --> 34:47.950] darkintangle.org.rs [34:47.950 --> 34:49.970] slash bulletproofs. If you just go to [34:49.970 --> 34:51.950] that, you can navigate all the notes. [34:52.170 --> 34:53.870] Um, the distinction between [34:53.870 --> 34:56.190] I'm so sorry, I should make the URL bigger. [34:56.190 --> 34:57.690] Um, the distinction between doc internal [34:57.690 --> 34:59.710] and doc, like, external, [34:59.710 --> 35:02.270] is that the doc.doc.rs [35:02.270 --> 35:04.030] actually gives you the API and all [35:04.030 --> 35:06.330] the documentation for the API for how to use this, [35:06.330 --> 35:07.990] whereas doc internal gives you an internal look [35:07.990 --> 35:10.010] of the math, and this is a really nice thing [35:10.010 --> 35:11.930] that we have because we made everything [35:11.930 --> 35:14.330] in Rust. We have, like, Rust documentation for many. [35:14.890 --> 35:16.250] Um, yeah. [35:16.250 --> 35:16.950] Awesome. [35:18.030 --> 35:20.130] Okay, uh, any other questions about [35:20.130 --> 35:22.130] the math? And if not, [35:22.130 --> 35:24.210] uh, I can take requests for things [35:24.210 --> 35:26.010] that you would like to hear about that [35:26.010 --> 35:27.770] are sort of above and beyond this. I can [35:27.770 --> 35:30.250] choices of, like, what I can talk about. I have [35:30.250 --> 35:32.310] uh, we worked a lot on constraint systems, [35:32.310 --> 35:34.090] which is basically how to [35:34.090 --> 35:35.990] build an arbitrary [35:36.450 --> 35:38.150] statement and then make proof about [35:38.150 --> 35:40.230] it. Uh, I can talk about Cloak, which is [35:40.230 --> 35:42.070] how we build a confidential assets protocol [35:42.590 --> 35:44.210] using all of this. I can talk about [35:44.210 --> 35:46.310] CKBM, which is like a smart contract language [35:46.310 --> 35:48.050] that we built on top of all this. [35:48.530 --> 35:50.370] Anyone super excited about any of these things? [35:50.370 --> 35:50.970] Yes. [35:55.380 --> 35:57.180] Oh, definitely. Um, yeah, relatively [35:57.180 --> 35:59.000] cool. Um, I don't [35:59.000 --> 36:00.700] might have slides for it, but basically [36:01.260 --> 36:02.740] um, the idea is [36:02.740 --> 36:04.960] when you have a paper that says [36:04.960 --> 36:06.940] like, the prover gives something to the [36:06.940 --> 36:08.880] verifier. The verifier, like, does [36:08.880 --> 36:10.840] this random challenge sampling and then gives [36:11.100 --> 36:12.980] a challenge back. Um, [36:12.980 --> 36:14.780] in the paper, usually they say, like, [36:14.780 --> 36:16.960] this is an interactive coin protocol. [36:17.060 --> 36:18.860] We naively, like, obviously just [36:18.860 --> 36:20.620] use the fiat from your peers to make this [36:20.620 --> 36:22.400] non-interactive. And then as an [36:22.400 --> 36:24.120] implementer, you're like, what? [36:24.700 --> 36:26.540] Like, how? And so Mervin [36:26.540 --> 36:28.540] has basically a strobe-based [36:28.540 --> 36:30.920] transcript protocol that Henry made. [36:30.920 --> 36:32.500] Henry was one of my colleagues who helped with the [36:32.500 --> 36:34.780] Bulletproofs implementation. We were working on, like, [36:34.780 --> 36:36.560] how do we make this non-interactive? [36:36.580 --> 36:38.060] And he was like, this would be a really good [36:38.960 --> 36:40.300] use case for a library [36:40.300 --> 36:42.620] that takes care of all of that for you. [36:42.620 --> 36:44.500] In practice, for papers, when you [36:44.500 --> 36:46.640] implement the fiat from your peers thing, [36:46.640 --> 36:48.420] a lot of times people just hash the things that the [36:48.420 --> 36:50.600] prover gives to the verifier. You're like, we just [36:50.600 --> 36:52.640] hash this, and then we take the challenge [36:52.640 --> 36:54.720] from it, and then we use the challenge. [36:54.720 --> 36:56.580] So just, sorry, here's [36:56.580 --> 36:57.380] an example. [36:58.560 --> 37:01.020] If you wanted to take a challenge, like, here, [37:01.020 --> 37:02.660] for instance, x, like, where does this x come [37:02.660 --> 37:04.260] from? And a lot of times, [37:04.760 --> 37:06.760] a lot of the time people just, like, take, [37:06.760 --> 37:08.860] for example, the vector a [37:08.860 --> 37:10.640] and hash it into the vector b and hash it [37:10.640 --> 37:13.140] into the vector y somehow, and get the challenge x. [37:13.140 --> 37:14.400] But this is sort of [37:14.860 --> 37:16.560] easy to misuse, or [37:16.560 --> 37:18.440] easy to get a little bit wrong, [37:18.440 --> 37:20.320] and also really complicated [37:20.320 --> 37:22.340] if you're doing multiple rounds of this. [37:22.420 --> 37:24.660] And so that's why Henry made Merlin, which is [37:25.060 --> 37:26.660] effectively a black box, where you're like, [37:26.660 --> 37:28.560] I put my randomness in here. I don't have to worry [37:28.560 --> 37:30.540] about the clouds behind the scenes, and I get some [37:30.540 --> 37:32.300] randomness back that I have guarantees [37:32.300 --> 37:34.760] about that it's actually fully random, [37:34.760 --> 37:36.360] that it's domain separated, [37:36.360 --> 37:38.560] you don't have, like, hash collisions, [37:38.560 --> 37:39.360] things like that. [37:39.360 --> 37:42.400] So that's actually, [37:42.400 --> 37:44.320] and so that's where we get x from. We actually use [37:44.320 --> 37:46.520] the Merlin transcripts [37:46.520 --> 37:48.300] to get x, to get the y, to get the z [37:48.300 --> 37:50.360] for all of these random challenge scalars. [37:51.620 --> 37:52.220] Yeah. [37:52.840 --> 37:54.420] Anything else? Anyone want [37:54.420 --> 37:56.500] to hear about any other things? I could also be [37:56.500 --> 37:57.200] done. [37:59.380 --> 38:00.560] Way more. Okay. [38:01.260 --> 38:02.000] I think the [38:02.700 --> 38:03.460] coolest thing [38:04.480 --> 38:06.440] that we built on top of this [38:06.440 --> 38:08.520] is the cloak protocol. [38:08.520 --> 38:10.400] So let me just pull up my slides [38:10.400 --> 38:12.780] for that. Sorry. [38:12.940 --> 38:26.310] All right. [38:26.310 --> 38:26.490] So [38:27.490 --> 38:31.350] I guess maybe to back up, [38:31.350 --> 38:31.510] so [38:31.510 --> 38:33.550] Bulletproof is not just a [38:33.550 --> 38:36.150] range-proof protocol, it's [38:36.150 --> 38:37.390] a, they call it in the paper, [38:37.390 --> 38:39.590] they call it circuit-proof protocol [38:39.590 --> 38:42.030] as well, where you can take any arbitrary [38:42.030 --> 38:43.690] arithmetic circuit and then make a proof [38:43.690 --> 38:45.150] that it is correct over some inputs while [38:45.150 --> 38:46.650] keeping those inputs secret. [38:46.730 --> 38:49.350] It turns out that coding up arithmetic circuits [38:49.350 --> 38:51.090] is like a huge pain, [38:51.090 --> 38:52.810] and so we actually just changed the representation [38:52.810 --> 38:54.770] to a constraint system. [38:54.810 --> 38:56.710] They're really easily translatable [38:56.710 --> 38:59.090] from one to the next, but constraints are a little [38:59.090 --> 39:01.070] bit easier to talk about. So you have a multiplicative [39:01.070 --> 39:02.810] constraint, which is you have [39:02.810 --> 39:04.850] three variables, and you have [39:04.850 --> 39:07.010] the additional constraint that x times y [39:07.010 --> 39:09.250] equals z for each of those secret variables. [39:09.250 --> 39:10.850] And you also have a linear constraint, [39:10.850 --> 39:12.890] which is like some linear combination [39:12.890 --> 39:15.550] of secret variables with clear text weights. [39:15.550 --> 39:16.850] So these are like the tools [39:16.850 --> 39:18.710] that you have with which to build up this constraint [39:18.710 --> 39:19.710] system. [39:20.910 --> 39:22.790] And with a constraint system, [39:22.790 --> 39:24.870] you can actually represent anything that is [39:24.870 --> 39:26.890] efficiently verifiable. So by this, [39:26.890 --> 39:28.710] I mean any NP-complete program [39:28.710 --> 39:30.270] can be, you know, [39:30.890 --> 39:33.010] changed into or represented as a [39:33.010 --> 39:35.110] constraint system. So that's pretty [39:35.110 --> 39:36.950] nice. [39:36.950 --> 39:39.090] Fun side note is that the extension [39:39.090 --> 39:40.690] that my colleague, Oleg, made over [39:40.690 --> 39:42.010] this constraint system protocol [39:43.690 --> 39:44.810] actually broadens [39:44.810 --> 39:45.950] the things that you can represent [39:46.690 --> 39:48.630] from NP-complete to [39:49.210 --> 39:50.730] PSPACE. So like if [39:50.730 --> 39:52.610] you're a theory [39:52.610 --> 39:54.850] nerd, that's like free fun. [39:54.850 --> 39:56.970] But if you're not, it doesn't matter. [39:57.910 --> 39:58.470] So [39:58.470 --> 40:00.630] you can represent basically any program [40:00.630 --> 40:02.630] you want as a constraint system. [40:02.630 --> 40:04.770] So what we wanted to do was to make [40:04.910 --> 40:06.630] a confidential assets protocol. [40:06.790 --> 40:08.570] And confidential assets is [40:09.290 --> 40:10.730] a lot harder to make than a confidential [40:10.730 --> 40:12.490] transaction protocol because you want to keep [40:12.490 --> 40:14.850] the asset types secret. [40:15.350 --> 40:16.450] And so like, my idea [40:16.450 --> 40:18.390] is you're just like, I want to add together [40:18.390 --> 40:20.630] all the sums of all the different [40:20.630 --> 40:22.610] asset types. Then you have to specify [40:22.610 --> 40:24.490] which assets are the same, and that would reveal [40:24.490 --> 40:26.010] which assets are which [40:26.590 --> 40:28.130] over enough analysis. [40:28.490 --> 40:30.470] So you can't just sort of sum together things [40:30.470 --> 40:32.770] the same way that you do for confidential transactions [40:32.770 --> 40:34.130] with one asset type. [40:34.350 --> 40:36.550] So what we came up with was [40:36.550 --> 40:38.570] sort of multiple gadgets that we [40:38.570 --> 40:40.430] composed together. So [40:40.430 --> 40:42.910] on the right hand side we have a [40:42.910 --> 40:44.990] range gadget, that's what we call it, [40:44.990 --> 40:47.070] which is a collection of constraints [40:47.070 --> 40:49.370] that basically make sure that the variables [40:49.370 --> 40:50.760] in the constraint system [40:51.110 --> 40:53.130] are in range. [40:53.130 --> 40:55.010] And then we add some new ones. [40:55.750 --> 40:56.790] So a shuffle gadget [40:56.790 --> 40:58.820] is basically a collection of constraints [40:59.210 --> 41:00.890] that make sure that the inputs [41:00.890 --> 41:03.430] and the outputs are validly ordering over each other. [41:03.430 --> 41:04.770] So you can't just introduce a new input [41:04.770 --> 41:06.870] and introduce a new output. Then the shuffle [41:06.870 --> 41:08.710] gadget would fail. [41:08.850 --> 41:10.690] And then there's a merge gadget, which [41:10.690 --> 41:12.790] either merges two inputs into [41:12.790 --> 41:14.650] one, or just moves them without [41:14.650 --> 41:16.690] altering. Same with split. [41:16.690 --> 41:18.730] Split either splits one item [41:18.730 --> 41:21.010] into two, or it moves [41:21.010 --> 41:22.650] the two inputs into the two outputs without [41:22.650 --> 41:24.210] altering it at all. [41:24.490 --> 41:26.930] So, I guess [41:26.930 --> 41:28.750] before I jump into [41:28.750 --> 41:31.090] how this is all assembled, [41:31.090 --> 41:32.690] intuitively, if you're dealing [41:32.690 --> 41:34.330] with multiple assets and you want [41:34.330 --> 41:36.230] to have some way to prove that [41:36.230 --> 41:37.990] your input to this protocol [41:37.990 --> 41:40.430] and your output to this protocol are valid, [41:40.430 --> 41:42.430] you want to prove that your inputs have been [41:42.430 --> 41:44.250] rearranged in such a way that [41:44.250 --> 41:45.630] the asset types are preserved [41:46.910 --> 41:48.110] but without creating [41:48.110 --> 41:49.770] or destroying value. [41:50.030 --> 41:52.090] So this is really tricky because you can't [41:52.090 --> 41:54.130] actually reveal what asset groupings [41:54.130 --> 41:56.450] you have. So this is like a [41:56.450 --> 41:58.150] fine, it took us a while [41:58.150 --> 42:00.090] to come up with this solution. But what it [42:00.090 --> 42:01.010] does is basically [42:01.010 --> 42:04.050] we group these gadgets together [42:04.050 --> 42:05.390] such that any [42:06.090 --> 42:07.990] output reordering is a valid [42:07.990 --> 42:09.930] actual transaction [42:09.930 --> 42:11.590] output reordering that [42:11.590 --> 42:13.910] of the inputs should be able to [42:13.910 --> 42:16.230] satisfy this collection of gadgets. [42:16.610 --> 42:17.930] Let me walk you through why [42:17.930 --> 42:20.710] this is the case, or how you actually prove this. [42:21.130 --> 42:22.050] So suppose [42:22.050 --> 42:24.050] that your inputs are $5, 3 yen [42:24.050 --> 42:25.890] and $4. What you [42:25.890 --> 42:27.790] as a prover would do, since you have [42:27.870 --> 42:29.530] a lot of secrets, you would [42:29.530 --> 42:31.770] look at this and be like, okay, well I know that [42:31.770 --> 42:33.730] I have to group all of my [42:33.730 --> 42:35.850] assets of the same kind together [42:35.850 --> 42:37.650] into the same chunks. [42:37.650 --> 42:39.690] So you would use the shuffle to reorder this [42:39.690 --> 42:41.790] such that your dollar amounts are together and your [42:41.790 --> 42:43.390] yen is at the very end. [42:44.350 --> 42:45.770] Then you will merge [42:45.770 --> 42:47.770] your dollar amounts into one lump sum [42:48.170 --> 42:49.630] and you'll merge again. [42:49.630 --> 42:51.090] Well, you will, because you only have one. [42:51.410 --> 42:53.450] And then you shuffle it such that your [42:53.450 --> 42:55.590] non-zero values are at the very top of the shuffle [42:55.590 --> 42:57.150] for each asset type. [42:57.610 --> 42:59.610] And then, this is the part that's like, hopefully [42:59.610 --> 43:01.650] the intuition, is that you're going to split [43:01.650 --> 43:03.470] your lump sum into whatever [43:03.470 --> 43:05.470] your target amounts are. So here [43:05.470 --> 43:07.450] I offer target amounts of 3 yen, 6 dollars [43:07.450 --> 43:09.650] and 3 dollars, so you'll take your 9 dollars and split it [43:09.650 --> 43:11.290] into 6 dollars and 3 dollars. [43:11.450 --> 43:14.050] And then you'll be able to go down the coast. It's just one output. [43:14.670 --> 43:15.630] And then, just to [43:15.630 --> 43:17.610] preserve the randomness of your output, you'll shuffle [43:17.610 --> 43:19.590] it one more time. You'll apply [43:19.870 --> 43:21.570] a range check [43:21.570 --> 43:23.890] to it to make sure that none of these are negative. [43:23.890 --> 43:25.310] And then you get your outputs. [43:25.610 --> 43:27.910] And so, if your [43:27.910 --> 43:29.870] outputs are valid, then you should be able to do this [43:29.870 --> 43:31.830] successfully. If your outputs are not [43:31.830 --> 43:33.750] valid, suppose that one of your outputs you wanted to [43:33.750 --> 43:35.810] make it 100 dollars, you would [43:35.810 --> 43:37.890] not actually be able to correctly satisfy [43:37.890 --> 43:40.150] all these guys. One of these guys would be like, [43:40.150 --> 43:42.030] wait, where did this extra money come from? [43:42.030 --> 43:44.370] Like, this is not a valid constraint of satisfaction. [43:44.670 --> 43:45.970] So this is the intuition [43:45.970 --> 43:47.710] for how it works. And then [43:47.710 --> 43:50.030] for a verifier, the verifier actually [43:50.030 --> 43:52.030] only receives these commitments to the input [43:52.030 --> 43:53.990] and commitments to the outputs. And it [43:53.990 --> 43:56.150] can't tell what happened within [43:56.150 --> 43:57.830] each of the gadgets because all of it are just [43:57.830 --> 44:00.110] like commitments to the verifier. But all [44:00.110 --> 44:02.030] it can do is verify that, yes indeed, [44:02.030 --> 44:03.850] this proof succeeded or this proof [44:03.850 --> 44:05.710] failed. And then, you know, [44:05.710 --> 44:07.210] valid and invalid transaction. [44:07.970 --> 44:10.570] So that's the intuition for Cloak. [44:10.590 --> 44:12.130] And I think the important [44:12.130 --> 44:14.050] thing to illustrate here is that this is just one [44:14.050 --> 44:15.810] of many uses for the [44:15.810 --> 44:18.350] Bulletproof Constraint System API that you can come up with. [44:18.350 --> 44:19.910] We just sort of made this by hand after [44:19.910 --> 44:22.030] figuring out what would make sense as a way [44:22.030 --> 44:23.770] to build it. And anyone else can [44:23.770 --> 44:25.830] basically make their own protocols and [44:25.830 --> 44:27.990] proofs as well. So that's [44:27.990 --> 44:29.350] cool. That's my little [44:29.350 --> 44:31.990] I think I'm out of time. Do I [44:31.990 --> 44:34.050] have time for questions maybe? Or should I just... [44:34.690 --> 44:35.930] Alright, any questions about [44:35.930 --> 44:37.090] the last bit? [44:37.790 --> 44:38.670] Yes. [44:44.690 --> 44:46.390] Yeah, so here at the very end [44:46.390 --> 44:48.530] we have a range check. And so basically [44:48.530 --> 44:50.070] the output of the third shuffle [44:50.070 --> 44:52.430] right here is 3 yen, 6 dollars [44:52.430 --> 44:54.470] and 3 dollars, right? And we just want to [44:54.470 --> 44:56.590] add a range check that all of those values [44:56.590 --> 44:58.490] are between 0 and 2 to the n for some [44:58.490 --> 45:00.570] large amount. For example, if we wanted [45:00.570 --> 45:02.410] to maliciously make a $100 [45:02.410 --> 45:04.470] output, then we [45:04.470 --> 45:06.410] would basically end up with shuffle 3 and [45:06.410 --> 45:08.310] we'd want to somehow make $100 [45:08.310 --> 45:10.490] as one of the outputs and then [45:11.530 --> 45:13.010] negative... math is hard... [45:13.010 --> 45:14.650] negative 92, something... [45:14.650 --> 45:16.450] another negative number. But then [45:16.450 --> 45:18.350] that would fail the range check. So basically the range check [45:18.350 --> 45:21.010] makes sure that we can't make extra money. [45:21.010 --> 45:23.550] Sorry. You can ask more questions afterwards. [45:23.550 --> 45:25.250] I'm going to cut off. Thank you for all of your [45:25.250 --> 45:25.670] attention.