{"componentChunkName":"component---src-templates-post-js","path":"/blog/crypto-club-forging-without-the-key","result":{"data":{"prevPost":{"html":"<p>Last week, we started talking about the elliptic curve discrete log problem. Before that, we were talking about the standard discrete log problem: we have this function, f(x) = g<sup>x</sup> mod p, where x is your secret and p is a large prime.</p>\n<div class=\"dpw-formula\">f(x) = g<sup>x</sup> mod p</div>\n<h2 id=\"the-problem-with-p-−-1\" style=\"position:relative;\"><a href=\"#the-problem-with-p-%E2%88%92-1\" aria-label=\"the problem with p − 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The problem with p − 1</h2>\n<p>Z<sub>p</sub><sup>∗</sup>, which we said was a multiplicative group, included elements one up to p − 1. So the size of this group, what we also call order, is p − 1 exactly. If p is a prime, then this goes from one all the way up to p − 1. We don't skip anything, because every number is co-prime with p here.</p>\n<p>p is a prime, so p − 1 is a composite number, which has factors. It's an even number. There's a possibility of this whole group having multiple subgroups. The way you can think of it is, since the size of this group is composite, it's possible that we can split this group into smaller subgroups, and then we can try and attack these smaller subgroups. That makes it easier for us to break the discrete log problem. If you choose a large enough prime, then you're still dealing with very large numbers, but this is a known attack. It's called the Pohlig-Hellman algorithm.</p>\n<p>This is not really important, but I started with this because I think it gives a better intuition of how the elliptic curve discrete log problem works.</p>\n<p>What do those subgroups look like? Pick a prime, then click any number to use it as g. The filled cells are everything g can reach.</p>\n<div class=\"dpw\" id=\"cc6-zp\">\n  <div class=\"dpw-toggle-row\">\n    <span class=\"dpw-toggle-cap\">Prime p</span>\n    <button class=\"dpw-toggle\" data-p=\"23\" data-on=\"true\">23</button>\n    <button class=\"dpw-toggle\" data-p=\"47\" data-on=\"false\">47</button>\n    <button class=\"dpw-toggle\" data-p=\"29\" data-on=\"false\">29</button>\n    <button class=\"dpw-toggle\" data-p=\"31\" data-on=\"false\">31</button>\n  </div>\n  <div class=\"dpw-toggle-cap\" id=\"cc6-zcap\">&ndash;</div>\n  <div class=\"cc6-cells\" id=\"cc6-zcells\"></div>\n  <div class=\"dpw-toggle-cap\" style=\"margin-top:12px\">Subgroup sizes in this group <span class=\"dpw-inflate\">(how many numbers generate a subgroup of that size)</span></div>\n  <div class=\"cc6-pills\" id=\"cc6-pills\"></div>\n  <div class=\"dpw-readout\">\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc6-zord\">&ndash;</span><span class=\"dpw-cap\">numbers <span class=\"dpw-var\">g</span> reaches</span></div>\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc6-zfac\">&ndash;</span><span class=\"dpw-cap\"><span class=\"dpw-var\">p</span> &minus; 1</span></div>\n  </div>\n  <div class=\"dpw-verdict\" id=\"cc6-zv\">&ndash;</div>\n  <div class=\"dpw-hint\">A filled cell is a power of g mod p. The size of the subgroup g generates always divides p &minus; 1, so the only sizes that can appear are the ones listed.</div>\n</div>\n<p>For p = 23, p − 1 is 22 = 2 × 11. Ten of the 22 numbers generate a subgroup of exactly 11 elements, and 11 is prime. That subgroup is what the next section builds on purpose, with q = 11 and k = 2.</p>\n<h2 id=\"forcing-the-math-into-a-prime-order-subgroup\" style=\"position:relative;\"><a href=\"#forcing-the-math-into-a-prime-order-subgroup\" aria-label=\"forcing the math into a prime order subgroup permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Forcing the math into a prime-order subgroup</h2>\n<p>If it is the case that you can break this group of composite order into smaller subgroups to do some sort of attack, what is best practice is that the order of the group should be prime. Because if its order is prime, it can't be broken down into smaller factors.</p>\n<p>What we try to do, in the case of the discrete log problem where we're dealing with this multiplicative group of integers, is create a subgroup that is of prime order. How should we go about doing this? Because if we choose a large prime p here, we know that the total number of elements in this group goes up to p − 1. So we will always end up with a composite number.</p>\n<p>The way to do this is we choose q, which is a large prime, and then we also choose p, which is a larger prime. So we basically choose two prime numbers. And we choose p such that p = kq + 1, where q is this prime that we just chose and k is just an integer, a constant.</p>\n<div class=\"dpw-formula\">p = kq + 1 &nbsp;&nbsp;&rArr;&nbsp;&nbsp; |Z<sub>p</sub><sup>&lowast;</sup>| = p &minus; 1 = kq</div>\n<p>Let's see what happens to the size of the group. The size of this group is p − 1. If our p is a constant times another prime plus one, we get kq + 1 − 1, which equals kq. So the size of that group now will be a constant times a prime.</p>\n<p>So q divides p − 1. And if q perfectly divides p − 1, then there's a theorem that guarantees our larger group, Z<sub>p</sub><sup>∗</sup>, has a subgroup of order q. If that subgroup exists, which is a smaller subgroup, but it's a safer subgroup, then you can do all your operations in that subgroup now, instead of doing it on this one where the size is a composite number.</p>\n<h2 id=\"the-same-idea-on-bitcoins-curve\" style=\"position:relative;\"><a href=\"#the-same-idea-on-bitcoins-curve\" aria-label=\"the same idea on bitcoins curve permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The same idea on Bitcoin's curve</h2>\n<p>The reason I wanted to show this is that last week I was myself a little confused about this elliptic curve discrete log problem. We defined it like this:</p>\n<div class=\"dpw-formula\">Q = k &middot; G &nbsp;(mod p)</div>\n<p>Here, Q and G are points on the elliptic curve, and these are all points that belong to a finite field. For now, just assume it contains integers up to p. The size of this field is p. Q, in the context of Bitcoin, is our public key, and G is our generator. We're multiplying it by k, which is our secret or private key. And as someone pointed out last time, k is not a point on this graph.</p>\n<p>For Bitcoin, y<sup>2</sup> = x<sup>3</sup> + 7.</p>\n<p>Suppose you have a p, which is prime. It has a lot of elements. Now you layer this equation, y<sup>2</sup> = x<sup>3</sup> + 7, on top of this whole set of possible numbers. You're looking for values in this finite set that satisfy this equation. Some values will not work, and so they will be excluded. You started off with order p, and then you are left with, I called it n, which is all of the points, (x<sub>1</sub>, y<sub>1</sub>), (x<sub>2</sub>, y<sub>2</sub>). These are all values in this field of size a big prime p, and they are also coordinates on this curve. The size of that set, I called it n.</p>\n<p>In the case of Bitcoin, this is also a prime, and it's close to p. I'm sure this was on purpose. They purposefully chose the equation so this is the case. By the way, this is a different prime, different from p. And since it's a prime, its factors are only 1 and n.</p>\n<p>Now your k, the private key, is chosen from another field. You have a field of size p, which is a prime. Now you have another field, which is the field over which the scalar value k is chosen. We can call this field q, and the size of this field is n.</p>\n<p>The key clarification I got was that we have two fields, and they are two different fields. One is where the k is chosen from, and one is where these points Q and G are chosen. Field p works over the coordinates Q and G, and field q works over the scalar k.</p>\n<div class=\"dpw-formula\">k (mod q) &nbsp;&nbsp;&nbsp;&nbsp; Q, G (mod p)</div>\n<p>I think the reason for this is, like I tried to explain with the standard discrete log problem, that you try to force the math into a subgroup of a prime order. For Bitcoin, they chose the curve specifically so that n is also prime. But if it was not prime, you could have done an extra step, a similar exercise, to find that subgroup which is of prime order.</p>\n<p>Someone pushed back on \"two fields\" near the end. Their point: q is not chosen, it is derived. It is the number of points that satisfy the equation for the given p, and k cannot usefully be bigger than it, because after q steps you are back where you started, like a clock. What I'm wondering is, aren't we using two fields, because our first one is from 0 to p − 1? k is not chosen from this. So we would need a separate field of a different order. The size is n.</p>\n<p>Both descriptions are the same thing. Because n is prime, the whole numbers mod n are themselves a field, and that is the field the scalar k lives in.</p>\n<p>Someone suggested trying it with small numbers: keep the equation y<sup>2</sup> = x<sup>3</sup> + 7 and take p as 13. I agree. I think it helps if you work with small numbers.</p>\n<p>So here it is. How many points are on the curve for a small p, is that number prime, and can every point reach all the others?</p>\n<div class=\"dpw\" id=\"cc6-curve\">\n  <div class=\"dpw-toggle-row\">\n    <span class=\"dpw-toggle-cap\">Field prime p &nbsp;<span class=\"dpw-inflate\">(the curve is always y&sup2; = x&sup3; + 7)</span></span>\n    <button class=\"dpw-toggle\" data-p=\"13\" data-on=\"true\">13</button>\n    <button class=\"dpw-toggle\" data-p=\"17\" data-on=\"false\">17</button>\n    <button class=\"dpw-toggle\" data-p=\"31\" data-on=\"false\">31</button>\n    <button class=\"dpw-toggle\" data-p=\"43\" data-on=\"false\">43</button>\n    <button class=\"dpw-toggle\" data-p=\"79\" data-on=\"false\">79</button>\n  </div>\n  <div class=\"dpw-controls\">\n    <label class=\"dpw-label\">Generator G &nbsp; <span class=\"dpw-val\" id=\"cc6-g\">&ndash;</span> &nbsp;<span class=\"dpw-inflate\">(or click a point)</span>\n      <input type=\"range\" id=\"cc6-gr\" min=\"0\" max=\"5\" step=\"1\" value=\"0\" />\n    </label>\n    <label class=\"dpw-label\" style=\"margin-top:12px\">Private key k, the number of hops &nbsp; <span class=\"dpw-val\" id=\"cc6-k\">&ndash;</span>\n      <input type=\"range\" id=\"cc6-kr\" min=\"1\" max=\"7\" step=\"1\" value=\"5\" />\n    </label>\n  </div>\n  <svg id=\"cc6-svg\" viewBox=\"0 0 480 480\" class=\"dpw-svg\" role=\"img\" aria-label=\"The points of the curve over a small prime field, with the hops from G to Q\"></svg>\n  <div class=\"dpw-readout\">\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc6-n\">&ndash;</span><span class=\"dpw-cap\">points on the curve, <span class=\"dpw-var\">n</span></span></div>\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc6-reach\">&ndash;</span><span class=\"dpw-cap\">points G can reach</span></div>\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc6-q\">&ndash;</span><span class=\"dpw-cap\">Q = <span class=\"dpw-var\">k</span> &middot; G</span></div>\n  </div>\n  <div class=\"dpw-verdict\" id=\"cc6-cv\">&ndash;</div>\n  <div class=\"dpw-hint\">Every dot is a pair (x, y) below p that satisfies the equation mod p. n counts those dots plus the point at infinity. Filled dots are the ones G reaches by adding itself. The line follows the hops G, 2G, 3G, up to kG.</div>\n</div>\n<p>For p = 13 the curve has 7 points, and 7 is prime, so every point reaches all of them. For p = 17 it has 18, and a point can get stuck in a subgroup of 2, 3, 6 or 9. For p = 31 it has 21 = 3 × 7, which is not prime but contains a subgroup of prime order 7: that is the extra step mentioned above. The count is close to p but is a different number, and it can land on either side: 7 for p = 13, 18 for p = 17.</p>\n<h2 id=\"hopping-around-the-curve\" style=\"position:relative;\"><a href=\"#hopping-around-the-curve\" aria-label=\"hopping around the curve permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Hopping around the curve</h2>\n<p>The generator is fixed. You can Google what the Bitcoin generator is. This is hard-coded in software, hardware, etc. Now the k, which is your secret key, comes from a group of prime order. Remember, I said that if you have a group which is of composite order, you could do attacks. But if you have a group of prime order, the maximum you can reduce the problem to is that prime itself and one. And one doesn't really tell you anything, because you can't break it down further.</p>\n<p>You're going to hop k times. I told you many times that the goal of the generator is to generate the entire group if you multiply it by itself. I showed you that with this multiplicative group. The case stays the same for elliptic curves. If I pick k = 7, I'm going to go from this generator here, 1. Maybe this was the next point, 2. Then maybe this was the next point, 3. Then 4, 5, 6, 7. And then we stop here.</p>\n<p>This is not like Z<sub>p</sub><sup>∗</sup>. Z<sub>p</sub><sup>∗</sup> is a continuous set of 1, 2, 3, 4, 5, all the way up to p − 1. This looks random. You're hopping around 7 times. You end up here. What is this point now? Q, which is our public key. Of course, some stuff probably happens beyond this to make it the true public key. This is the raw public key.</p>\n<p>Now your adversary is wondering. This G is public, so they know this point, and they also know Q, because that's your public key. They're wondering, how did you get from here to here? How many hops did you make? We know we made seven hops, but because of the nature of this curve, even if the points are close together, you have no idea how to get to that point. You basically have to brute force.</p>\n<h2 id=\"two-fields-one-reason\" style=\"position:relative;\"><a href=\"#two-fields-one-reason\" aria-label=\"two fields one reason permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Two fields, one reason</h2>\n<p>Initially what I didn't understand is that we're actually operating over two fields. One is the field for the scalar value, one is the field for the coordinate points. Then I tried to understand why that is the case. I think the intuition is similar to what I explained with the discrete log problem, where you want to do your operations in a set or a field which is of order a prime number, because you cannot break those down into subgroups of those factors and then solve those. Solving smaller numbers is easier. But if the order itself is a prime number, then you're stuck with that whole value.</p>\n<p>We said we can do this trick called binary exponentiation to calculate the discrete log equation quickly. For this equation, why is calculating it easy? What are we doing? Let's talk about this next week.</p>\n<style>\n.dpw {\n  --ink: #1b2228; --ink2: #5b7085; --line: #dae4ed;\n  --maroon: #a72e2b; --maroon-d: #6a1d1b; --rose: #f2cdcc; --green: #3f8f5b; --slate: #8ba2b8;\n  border: 1px solid var(--line); border-radius: 6px; padding: 20px;\n  margin: 32px 0; background: #fff; font-family: 'Open Sans', sans-serif;\n}\n.dpw * { box-sizing: border-box; }\n/* index.scss sets font on every span directly; let class-less spans inherit from the widget instead */\n.dpw span:not([class]) { font-size: inherit; line-height: inherit; font-family: inherit; }\n.dpw-formula { text-align: center; font-family: 'Inconsolata', monospace; font-size: 17px;\n  color: #1b2228; margin: 22px 0; letter-spacing: .01em; line-height: 1.6; overflow-x: auto; }\n.dpw-formula sup, .dpw-formula sub { font-size: 11px; }\n.dpw-controls { margin-bottom: 14px; }\n.dpw-label { display: block; font-size: 13px; color: var(--ink2); }\n.dpw-label input[type=range] { display: block; width: 100%; margin: 8px 0 0; accent-color: var(--maroon); }\n.dpw-val { color: var(--maroon-d); font-family: 'Inconsolata', monospace; font-weight: 700; }\n.dpw-hint { font-size: 12px; color: var(--ink2); margin-top: 10px; font-style: italic; line-height: 1.55; }\n.dpw-svg { width: 100%; height: auto; display: block; margin: 6px 0 4px;\n  background: linear-gradient(180deg, #fbfcfe, #f4f7fa); border-radius: 4px; }\n.dpw-verdict { margin: 10px 0 4px; padding: 8px 12px; border-radius: 4px; font-size: 13px; font-weight: 700;\n  background: var(--rose); color: var(--maroon-d); text-align: center; font-family: 'Inconsolata', monospace; }\n.dpw-verdict.dpw-ok { background: #dcefe3; color: var(--green); }\n.dpw-readout { display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }\n.dpw-stat { display: flex; flex-direction: column; }\n.dpw-num { font-family: 'Josefin Sans', sans-serif; font-size: 23px; color: var(--maroon-d); line-height: 1.15; }\n.dpw-cap { font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }\n/* variable names keep their case inside the upper-cased captions (k is a number, G is a point) */\n.dpw-cap .dpw-var { text-transform: none; font-size: inherit; line-height: inherit; font-family: inherit; }\n.dpw-toggle-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }\n.dpw-toggle-cap { width: 100%; margin-bottom: 3px; font-size: 12px; color: var(--ink2); }\n.dpw-toggle { font-family: 'Inconsolata', monospace; font-size: 12px; border: 1px solid var(--line);\n  background: #fff; color: var(--ink2); padding: 5px 9px; border-radius: 4px; cursor: pointer; transition: all .15s; }\n.dpw-toggle[data-on=true] { background: var(--maroon); color: #fff; border-color: var(--maroon); }\n.dpw-inflate { font-size: 11px; color: #94a6b8; }\n.cc6-cells { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }\n.cc6-cell { font-family: 'Inconsolata', monospace; font-size: 13px; width: 32px; padding: 5px 0; text-align: center;\n  border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink2); cursor: pointer; }\n.cc6-cell[data-in=true] { background: #dcefe3; color: var(--green); border-color: #b9dcc6; }\n.cc6-cell[data-g=true] { outline: 2px solid var(--maroon); outline-offset: 1px; color: var(--maroon-d); font-weight: 700; }\n.cc6-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }\n.cc6-pill { font-family: 'Inconsolata', monospace; font-size: 12px; padding: 4px 9px; border-radius: 12px;\n  border: 1px solid var(--line); color: var(--ink2); background: #fbfcfe; }\n.cc6-pill[data-on=true] { background: var(--maroon); color: #fff; border-color: var(--maroon); }\n.cc6-pill[data-prime=true] { border-color: var(--green); }\n@media (max-width: 520px) { .dpw-readout { gap: 16px; } .dpw-num { font-size: 19px; } .cc6-cell { width: 30px; } }\n@media (prefers-reduced-motion: reduce) { .dpw * { transition: none !important; } }\n</style>\n<script>\n(function () {\n  var root = document.getElementById('cc6-zp');\n  if (!root) return;\n  if (root._cleanup) root._cleanup();\n  var L = [];\n  function on(el, ev, fn) { if (!el) return; el.addEventListener(ev, fn); L.push([el, ev, fn]); }\n  root._cleanup = function () { L.forEach(function (x) { x[0].removeEventListener(x[1], x[2]); }); };\n\n  var p = 23, g = 2;\n  var cells = root.querySelector('#cc6-zcells'), pills = root.querySelector('#cc6-pills');\n  function isPrime(n) { if (n < 2) return false; for (var d = 2; d * d <= n; d++) if (n % d === 0) return false; return true; }\n  function factor(n) { var out = [], d = 2; while (n > 1) { var e = 0; while (n % d === 0) { n /= d; e++; } if (e) out.push(d + (e > 1 ? '^' + e : '')); d++; } return out.join(' × ') || '1'; }\n  function span(a) { var s = {}, v = 1; do { v = (v * a) % p; s[v] = true; } while (v !== 1); return s; }   // everything a reaches\n  function size(s) { return Object.keys(s).length; }\n\n  function build() {\n    cells.innerHTML = '';\n    for (var a = 1; a < p; a++) (function (a) {\n      var c = document.createElement('button');\n      c.className = 'cc6-cell'; c.textContent = a; c.setAttribute('data-a', a);\n      on(c, 'click', function () { g = a; draw(); });\n      cells.appendChild(c);\n    })(a);\n  }\n\n  function draw() {\n    var s = span(g), ord = size(s), tally = {};\n    for (var a = 1; a < p; a++) { var o = size(span(a)); tally[o] = (tally[o] || 0) + 1; }\n    [].forEach.call(cells.children, function (c) {\n      var a = +c.getAttribute('data-a');\n      c.setAttribute('data-in', String(!!s[a])); c.setAttribute('data-g', String(a === g));\n    });\n    pills.innerHTML = Object.keys(tally).map(Number).sort(function (x, y) { return x - y; }).map(function (o) {\n      return '<span class=\"cc6-pill\" data-size=\"' + o + '\" data-count=\"' + tally[o] + '\" data-on=\"' + (o === ord) + '\" data-prime=\"' + isPrime(o) + '\">size ' + o + ': ' + tally[o] + '</span>';\n    }).join('');\n    root.querySelector('#cc6-zcap').textContent = 'Numbers 1 to ' + (p - 1) + ', with g = ' + g;\n    root.querySelector('#cc6-zord').textContent = ord + ' of ' + (p - 1);\n    root.querySelector('#cc6-zfac').textContent = (p - 1) + ' = ' + factor(p - 1);\n    var v = root.querySelector('#cc6-zv');\n    if (ord === 1) { v.className = 'dpw-verdict'; v.textContent = '1 only reaches itself'; }\n    else if (isPrime(ord)) { v.className = 'dpw-verdict dpw-ok'; v.textContent = g + ' generates a subgroup of prime order ' + ord + (ord < 5 ? ': it cannot be split, but ' + ord + ' elements is far too small to hide anything' : ': it cannot be split any further'); }\n    else if (ord === p - 1) { v.className = 'dpw-verdict'; v.textContent = g + ' generates the whole group, but ' + ord + ' = ' + factor(ord) + ', so it splits into smaller pieces'; }\n    else { v.className = 'dpw-verdict'; v.textContent = g + ' generates a subgroup of size ' + ord + ' = ' + factor(ord) + ', which still splits'; }\n  }\n\n  [].forEach.call(root.querySelectorAll('[data-p]'), function (b) {\n    on(b, 'click', function () {\n      p = +b.getAttribute('data-p'); g = 2;\n      [].forEach.call(root.querySelectorAll('[data-p]'), function (o) { o.setAttribute('data-on', String(o === b)); });\n      build(); draw();\n    });\n  });\n  build(); draw();\n})();\n</script>\n<script>\n(function () {\n  var root = document.getElementById('cc6-curve');\n  if (!root) return;\n  if (root._cleanup) root._cleanup();\n  var L = [];\n  function on(el, ev, fn) { if (!el) return; el.addEventListener(ev, fn); L.push([el, ev, fn]); }\n  root._cleanup = function () { L.forEach(function (x) { x[0].removeEventListener(x[1], x[2]); }); };\n\n  var SVG = 'http://www.w3.org/2000/svg', svg = root.querySelector('#cc6-svg');\n  var gr = root.querySelector('#cc6-gr'), kr = root.querySelector('#cc6-kr');\n  var p = 13, pts = [], gi = 0;\n  function el(n, at, txt) { var e = document.createElementNS(SVG, n); for (var k in at) e.setAttribute(k, at[k]); if (txt !== undefined) e.textContent = txt; return e; }\n  function mod(a) { return ((a % p) + p) % p; }\n  function inv(a) { var r = 1, b = mod(a), e = p - 2; while (e > 0) { if (e & 1) r = (r * b) % p; b = (b * b) % p; e >>= 1; } return r; }   // Fermat: a^(p-2)\n  function isPrime(n) { if (n < 2) return false; for (var d = 2; d * d <= n; d++) if (n % d === 0) return false; return true; }\n  function factor(n) { var out = [], d = 2; while (n > 1) { var e = 0; while (n % d === 0) { n /= d; e++; } if (e) out.push(d + (e > 1 ? '^' + e : '')); d++; } return out.join(' × '); }\n  // group law on y^2 = x^3 + 7 over F_p; null is the point at infinity\n  function add(P, Q) {\n    if (!P) return Q; if (!Q) return P;\n    if (P[0] === Q[0] && mod(P[1] + Q[1]) === 0) return null;\n    var m = (P[0] === Q[0] && P[1] === Q[1]) ? mod(3 * P[0] * P[0] * inv(2 * P[1])) : mod((Q[1] - P[1]) * inv(Q[0] - P[0]));\n    var x3 = mod(m * m - P[0] - Q[0]);\n    return [x3, mod(m * (P[0] - x3) - P[1])];\n  }\n  function key(P) { return P ? P[0] + ',' + P[1] : 'O'; }\n  function name(P) { return P ? '(' + P[0] + ', ' + P[1] + ')' : 'O'; }\n\n  function setP(np) {\n    p = np; pts = [];\n    for (var x = 0; x < p; x++) for (var y = 0; y < p; y++) if (mod(y * y - (x * x * x + 7)) === 0) pts.push([x, y]);\n    gi = 0; gr.max = pts.length - 1; gr.value = 0;\n    resetK(5);\n  }\n  function hops(G) { var out = [], R = G; while (R) { out.push(R); R = add(R, G); } return out; }   // G, 2G, ... up to but not including O\n  function resetK(want) { var ord = hops(pts[gi]).length + 1; kr.max = ord; kr.value = Math.min(want, ord - 1) || 1; }\n\n  function draw() {\n    var G = pts[gi], H = hops(G), ord = H.length + 1, N = pts.length + 1, k = +kr.value;\n    var Q = k <= H.length ? H[k - 1] : null;\n    var reach = {}; H.forEach(function (P) { reach[key(P)] = true; });\n    var W = 480, M = 26, S = (W - 2 * M) / (p - 1 || 1);\n    var px = W / (svg.getBoundingClientRect().width || W), FS = Math.min(18, 11 * px);\n    function X(v) { return M + v * S; } function Y(v) { return W - M - v * S; }\n    var rad = Math.max(2.2, Math.min(7, S * 0.36));\n\n    while (svg.firstChild) svg.removeChild(svg.firstChild);\n    svg.appendChild(el('rect', { x: M - S / 2, y: M - S / 2, width: W - 2 * M + S, height: W - 2 * M + S, fill: 'none', stroke: '#dae4ed' }));\n    var d = '';\n    for (var i = 0; i < Math.min(k, H.length); i++) d += (i ? 'L' : 'M') + X(H[i][0]).toFixed(1) + ' ' + Y(H[i][1]).toFixed(1);\n    if (d) svg.appendChild(el('path', { d: d, fill: 'none', stroke: '#a72e2b', 'stroke-width': 1.2, 'stroke-opacity': 0.55 }));\n    pts.forEach(function (P, idx) {\n      var isG = idx === gi, isQ = Q && P[0] === Q[0] && P[1] === Q[1];\n      var c = el('circle', { cx: X(P[0]), cy: Y(P[1]), r: isG || isQ ? rad + 1.5 : rad, style: 'cursor:pointer',\n        fill: isQ ? '#1b2228' : isG ? '#a72e2b' : reach[key(P)] ? '#3f8f5b' : '#fff',\n        stroke: reach[key(P)] ? 'none' : '#8ba2b8', 'stroke-width': 1, 'data-pt': key(P), 'data-reach': String(!!reach[key(P)]) });\n      on(c, 'click', function () { gi = idx; gr.value = idx; resetK(+kr.value); draw(); });\n      svg.appendChild(c);\n    });\n    if (k <= 12) for (var j = 0; j < Math.min(k, H.length); j++)\n      svg.appendChild(el('text', { x: X(H[j][0]) + rad + 3, y: Y(H[j][1]) - rad - 2, 'font-size': FS, fill: '#6a1d1b', 'font-family': 'Inconsolata, monospace' }, String(j + 1)));\n\n    root.querySelector('#cc6-g').textContent = name(G);\n    root.querySelector('#cc6-k').textContent = k;\n    root.querySelector('#cc6-n').textContent = N + (isPrime(N) ? ' (prime)' : ' = ' + factor(N));\n    root.querySelector('#cc6-reach').textContent = ord + ' of ' + N;\n    root.querySelector('#cc6-q').textContent = Q ? name(Q) : 'O';\n    var v = root.querySelector('#cc6-cv'), tail = Q ? '' : '. k = ' + k + ' lands on the point at infinity';\n    if (isPrime(N)) { v.className = 'dpw-verdict dpw-ok'; v.textContent = 'n = ' + N + ' is prime: this G, like every point, reaches all ' + N + tail; }\n    else if (ord === N) { v.className = 'dpw-verdict'; v.textContent = 'this G reaches all ' + N + ', but ' + N + ' = ' + factor(N) + ' is not prime, so the problem splits' + tail; }\n    else { v.className = 'dpw-verdict' + (isPrime(ord) ? ' dpw-ok' : ''); v.textContent = 'this G is stuck in a subgroup of ' + ord + (isPrime(ord) ? ' (prime)' : '') + ' out of ' + N + tail; }\n  }\n\n  [].forEach.call(root.querySelectorAll('[data-p]'), function (b) {\n    on(b, 'click', function () {\n      [].forEach.call(root.querySelectorAll('[data-p]'), function (o) { o.setAttribute('data-on', String(o === b)); });\n      setP(+b.getAttribute('data-p')); draw();\n    });\n  });\n  on(gr, 'input', function () { gi = +gr.value; resetK(+kr.value); draw(); });\n  on(kr, 'input', draw); on(window, 'resize', draw);\n  setP(13); draw();\n})();\n</script>","headings":[{"value":"The problem with p − 1","depth":2},{"value":"Forcing the math into a prime-order subgroup","depth":2},{"value":"The same idea on Bitcoin's curve","depth":2},{"value":"Hopping around the curve","depth":2},{"value":"Two fields, one reason","depth":2}],"frontmatter":{"date_created":"2026-09-11","path":"/blog/crypto-club-prime-order-subgroups","tags":["Cryptography","Bitcoin","Elliptic Curves"],"title":"Why Bitcoin Wants A Group Of Prime Order"}},"currPost":{"html":"<p>So let's talk about digital signatures. Maybe a lot of you have heard what they are, but the key idea is I have some secret, and that secret basically identifies me, you could say. And if I create something using that secret, people are able to know, with some good level of certainty, that I was the one who created that new thing, because only I have that secret.</p>\n<p>If we bring it back to the technical terms: you have a sender. The sender has a secret key. The sender uses the secret key to sign a message, and this produces a signature, and anyone with the sender's public key can verify that the message was signed by the sender.</p>\n<p>There are a few properties that digital signatures preserve.</p>\n<ol>\n<li>Non-repudiation is a big thing. If I do an action, I'm not able to take it back. If I sign something, I can't say that I never signed this. This is pretty important in banks.</li>\n<li>Authenticity. Because only I have the secret key, you can be convinced that this message came from me.</li>\n<li>Integrity. The public key can verify that the message was signed by the sender, so it means that during the process the signature was not changed, because the secret key is tied to the public key.</li>\n</ol>\n<h2 id=\"three-algorithms\" style=\"position:relative;\"><a href=\"#three-algorithms\" aria-label=\"three algorithms permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Three algorithms</h2>\n<p>If we look at how to define the scheme, you can think of it in terms of three algorithms.</p>\n<ul>\n<li>The first algorithm is called a key gen algorithm, or a key generation algorithm, which takes as input the security parameter: how many bits of security we're using in order to generate the public key and the secret key. Let's keep it abstract for now. You get a public key and a secret key.</li>\n<li>Your second algorithm is a signing algorithm. This takes as input the secret key and the message, and the output is a signature.</li>\n<li>Our third algorithm is called verify. Verify takes in the public key, which was generated in the key gen step, and it takes the message, which is also public, because we want to know if this message corresponds to this signature. It outputs either accept or reject.</li>\n</ul>\n<div class=\"dpw-formula\">KeyGen(1<sup>&lambda;</sup>) &rarr; (pk, sk) &nbsp;&nbsp; Sign(sk, m) &rarr; &sigma; &nbsp;&nbsp; Verify(pk, m, &sigma;) &rarr; accept / reject</div>\n<p>When we pass verify the public key, the message, and the output of the signing algorithm on the secret key and that message, the result is accept. This must hold true for any digital signature scheme to be correct. If you are not getting that, then you don't have a correct digital signature scheme.</p>\n<div class=\"dpw-formula\">Verify(pk, m, Sign(sk, m)) = accept</div>\n<h2 id=\"the-more-power-the-adversary-gets-the-more-secure-the-scheme\" style=\"position:relative;\"><a href=\"#the-more-power-the-adversary-gets-the-more-secure-the-scheme\" aria-label=\"the more power the adversary gets the more secure the scheme permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The more power the adversary gets, the more secure the scheme</h2>\n<p>Our goal for a digital signature scheme is that it should not be possible to forge signatures. We have many standards for what a digital signature scheme is secure against. The strongest standard, which gives the adversary the most power to do many things, is called existential unforgeability under chosen message attack (EUF-CMA).</p>\n<p>The more power you give the adversary while still being able to defend against that very powerful adversary, the more secure your scheme is. If our scheme was only secure against an adversary that is not able to do a lot of things, then that's less secure than a scheme where an adversary is able to basically test out, or play around with, this scheme many times and still not be able to break it. That's an important intuition to understand, which carries on for all protocols.</p>\n<h2 id=\"the-game\" style=\"position:relative;\"><a href=\"#the-game\" aria-label=\"the game permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The game</h2>\n<p>Power is usually defined with an interactive game. It's basically how much information we give the adversary and how much information we continue giving.</p>\n<ol>\n<li>It starts between a challenger and an adversary. The challenger calls the KeyGen algorithm and gets the secret key and public key, and he gives the adversary the public key. The adversary has the public key. The challenger keeps the secret key.</li>\n<li>The adversary creates a message, and the challenger signs that message with the secret key and sends back the signature for that message. The adversary is able to do this as many times as they want, but it has to be a different message every time.</li>\n<li>Imagine the adversary has created this whole dossier of messages and signatures. Now, to win, the adversary has to find a new message, which is not one of these, and output a valid signature for that new message. If this gives accept, then the scheme is broken. The adversary wins.</li>\n</ol>\n<p>Without any interaction from the challenger, they have to create another message, which cannot be the same message that already has a signature, and they have to create a valid signature. Now, they can do this however they want. They can even guess. So if you're guessing, that's okay. You have like one in a billion chance of getting it correct, but there's a chance. It's not zero. It's very close to zero. That is what \"not with more than negligible probability\" means. How close to zero depends on the security parameter.</p>\n<div class=\"dpw\" id=\"cc7-guess\">\n  <div class=\"dpw-q\">How lucky would an adversary who just guesses have to be?</div>\n  <div class=\"dpw-controls\">\n    <label class=\"dpw-label\">Security parameter &lambda; (bits) &nbsp; <span class=\"dpw-val\" id=\"cc7g-l\">128</span>\n      <input type=\"range\" id=\"cc7g-s\" min=\"8\" max=\"256\" step=\"1\" value=\"128\" /></label>\n    <label class=\"dpw-label\">Guesses per second &nbsp; <span class=\"dpw-val\" id=\"cc7g-r\">10<sup>12</sup></span>\n      <input type=\"range\" id=\"cc7g-rs\" min=\"0\" max=\"21\" step=\"1\" value=\"12\" /></label>\n  </div>\n  <div class=\"dpw-line\"><span>chance one guess verifies</span><span><b id=\"cc7g-p\"></b></span></div>\n  <div class=\"dpw-line\"><span>expected time to land one forgery</span><span><b id=\"cc7g-t\"></b></span></div>\n  <div class=\"dpw-line\"><span>chance of success within the age of the universe</span><span><b id=\"cc7g-u\"></b></span></div>\n  <div class=\"dpw-verdict\" id=\"cc7g-v\"></div>\n  <div class=\"dpw-hint\">The adversary only gets one call to Verify in the real game. This widget is generous: it lets them keep guessing. Age of the universe taken as 1.38 &times; 10<sup>10</sup> years.</div>\n</div>\n<p>Just think of it like signing checks at a bank. You do a signature and then you deposit the check or take money out. What I have the ability to do is look at that check as many times as I want, basically study your signature. And then the hundredth time I forge your signature and I go to the bank and pretend I'm you. If I'm able to do that, then I basically forged your signature, which is the whole point of the scheme. I should not be able to forge signatures.</p>\n<h2 id=\"the-adversary-doesnt-need-your-secret-key\" style=\"position:relative;\"><a href=\"#the-adversary-doesnt-need-your-secret-key\" aria-label=\"the adversary doesnt need your secret key permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The adversary doesn't need your secret key</h2>\n<p>I don't need to have your secret key, because if you look at this verify function, it only requires the public key, which is public knowledge, and the message-signature pair. If I can make these message-signature pairs follow the same distribution as the ones that are correct, then I win. I don't even need to know your secret key.</p>\n<p>Notice here the requirement was not \"when you create this signature, you have to use sign.\" I never said that. I'll just create some other function, fake sign, that takes in all my knowledge about what I learned from all of your interactions. The adversary just needs to create a valid message-signature pair. Like I said, they could even guess it. We don't care if they actually use sign.</p>\n<p>There are two ways this could be accepted. One is the secret key was compromised. That's one case where I can always create valid signatures. The other way is: forget about the secret key. Learn about message-signature pairs enough to create your own message-signature pair.</p>\n<p>You shouldn't take it for granted or assume that once a private key is generated, it's always safe and secure. There are ways to learn maybe bits of information about the private key, or maybe break it down into easier problems, and then solve for the private key.</p>\n<h2 id=\"a-forgery-against-a-scheme-where-signatures-add-up\" style=\"position:relative;\"><a href=\"#a-forgery-against-a-scheme-where-signatures-add-up\" aria-label=\"a forgery against a scheme where signatures add up permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>A forgery against a scheme where signatures add up</h2>\n<p>Someone in the room gave an example of the second way: suppose the scheme has the property that the signature of m<sub>1</sub> + m<sub>2</sub> is σ<sub>1</sub> + σ<sub>2</sub>. That's a much better explanation. If I just recap:</p>\n<p>Step 1. We got two messages. Adversary said, \"Hey, sign this message,\" and the challenger signed it. Adversary said, \"Hey, sign this message,\" and the challenger signed it.</p>\n<p>Step 2. Knowing these message-signature pairs, I tried to basically calculate: what could the formula actually be, where our signatures are created? So I try adding up the messages, and I realized that if I also add up the signatures, the sum of the signatures is the signature of the sum of the messages. This is my hypothesis.</p>\n<p>Step 3. So now I ask for signature three with the challenger, and he gives me signature three, and I check this against what I hypothesized. And indeed it turns out that it was what I thought it was going to be.</p>\n<p>Step 4. So now I can stop the interaction here. I can cut off my interaction with the challenger, and I can say, \"Hey, I'm ready for the test.\" For the message, I'm going to choose m<sub>4</sub>, which, if you notice, we never chose. We chose m<sub>1</sub>, m<sub>2</sub> and m<sub>3</sub>. Those are the only three messages we asked about. So m<sub>4</sub> = m<sub>1</sub> + m<sub>3</sub>, and σ<sub>4</sub> = σ<sub>1</sub> + σ<sub>3</sub>.</p>\n<div class=\"dpw-formula\">Verify(pk, m<sub>1</sub> + m<sub>3</sub>, &sigma;<sub>1</sub> + &sigma;<sub>3</sub>) &rarr; accept</div>\n<p>So here we didn't even calculate anything ourselves. We just gave the addition of things we already had stored. And this should give accept.</p>\n<div class=\"dpw\" id=\"cc7-forge\">\n  <div class=\"dpw-q\">If signatures add up, how many messages can you sign after asking for only a few?</div>\n  <div class=\"dpw-detail-b\">You are the adversary. The challenger holds a secret key and signs with a scheme where &sigma;(a + b) = &sigma;(a) + &sigma;(b). Ask for signatures on messages from 1 to 99, then sit the test.</div>\n  <div class=\"dpw-toggle-row\" style=\"margin-top:12px\">\n    <input class=\"dpw-input\" id=\"cc7f-m\" type=\"number\" min=\"1\" max=\"99\" value=\"7\" aria-label=\"message to query\" />\n    <button class=\"dpw-toggle\" id=\"cc7f-ask\">ask challenger to sign</button>\n    <button class=\"dpw-toggle\" id=\"cc7f-rand\">ask a random one</button>\n    <button class=\"dpw-toggle\" id=\"cc7f-reset\">new key</button>\n  </div>\n  <div class=\"dpw-cap\" style=\"margin-top:8px\">your dossier (m &rarr; &sigma;)</div>\n  <div class=\"dpw-chips\" id=\"cc7f-dos\"></div>\n  <div class=\"dpw-readout\">\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc7f-q\">0</span><span class=\"dpw-cap\">signatures asked for</span></div>\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc7f-n\">0</span><span class=\"dpw-cap\">new messages you can now sign</span></div>\n  </div>\n  <div class=\"dpw-cap\" style=\"margin-top:10px\">messages you never asked about, but can sign by adding</div>\n  <div class=\"dpw-chips\" id=\"cc7f-forge\"></div>\n  <div class=\"dpw-toggle-row\" style=\"margin-top:12px\">\n    <span class=\"dpw-toggle-cap\">The test: pick a new message and forge its signature without the challenger</span>\n    <input class=\"dpw-input\" id=\"cc7f-t\" type=\"number\" min=\"1\" value=\"10\" aria-label=\"message to forge\" />\n    <button class=\"dpw-toggle\" id=\"cc7f-go\">forge &amp; verify</button>\n  </div>\n  <div class=\"dpw-verdict dpw-neutral\" id=\"cc7f-v\">Ask for a few signatures first.</div>\n  <div class=\"dpw-hint\">Messages are combined by adding distinct messages from your dossier, each at most once, exactly like m<sub>4</sub> = m<sub>1</sub> + m<sub>3</sub>. With n queries there are up to 2<sup>n</sup> &minus; 1 &minus; n new sums, so every signature you ask for roughly doubles what you can forge.</div>\n</div>\n<p>Here I'm just saying secret key and public key, but we'll look at actual digital signature protocols, with real formulas.</p>\n<style>\n.dpw-formula { text-align: center; font-family: 'Inconsolata', monospace; font-size: 17px;\n  color: #1b2228; margin: 22px 0; letter-spacing: .01em; line-height: 1.6; overflow-x: auto; }\n.dpw-formula sup, .dpw-formula sub { font-size: 11px; }\n.dpw {\n  --ink: #1b2228; --ink2: #5b7085; --line: #dae4ed;\n  --maroon: #a72e2b; --maroon-d: #6a1d1b; --rose: #f2cdcc; --green: #3f8f5b; --slate: #8ba2b8;\n  border: 1px solid var(--line); border-radius: 6px; padding: 20px;\n  margin: 32px 0; background: #fff; font-family: 'Open Sans', sans-serif; color: var(--ink);\n}\n.dpw * { box-sizing: border-box; }\n.dpw-q { font-family: 'Josefin Sans', sans-serif; font-size: 14px; text-transform: uppercase; letter-spacing: .04em;\n  color: var(--maroon-d); margin: 0 0 12px; line-height: 1.4; }\n.dpw-controls { margin-bottom: 14px; display: grid; gap: 12px; }\n.dpw-label { display: block; font-size: 13px; color: var(--ink2); }\n.dpw-label input[type=range] { display: block; width: 100%; margin: 8px 0 0; accent-color: var(--maroon); }\n.dpw-val { color: var(--maroon-d); font-family: 'Inconsolata', monospace; font-weight: 700; }\n.dpw-hint { font-size: 12px; color: var(--ink2); margin-top: 10px; font-style: italic; line-height: 1.55; }\n.dpw-svg { width: 100%; height: auto; display: block; margin: 6px 0 4px;\n  background: linear-gradient(180deg, #fbfcfe, #f4f7fa); border-radius: 4px; }\n.dpw-verdict { margin: 10px 0 4px; padding: 8px 12px; border-radius: 4px; font-size: 13px; font-weight: 700;\n  background: var(--rose); color: var(--maroon-d); text-align: center; font-family: 'Inconsolata', monospace; }\n.dpw-verdict.dpw-ok { background: #dcefe3; color: var(--green); }\n.dpw-verdict.dpw-neutral { background: #e3ecf4; color: #3d566b; }\n.dpw-readout { display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }\n.dpw-stat { display: flex; flex-direction: column; }\n.dpw-num { font-family: 'Josefin Sans', sans-serif; font-size: 23px; color: var(--maroon-d); line-height: 1.15; }\n.dpw-cap { font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }\n/* variable names keep their case inside the upper-cased captions */\n.dpw-cap .dpw-var { text-transform: none; font-size: inherit; line-height: inherit; font-family: inherit; }\n.dpw-toggle-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }\n.dpw-toggle-cap { width: 100%; margin-bottom: 3px; font-size: 12px; color: var(--ink2); }\n.dpw-toggle { font-family: 'Inconsolata', monospace; font-size: 12px; border: 1px solid var(--line);\n  background: #fff; color: var(--ink2); padding: 5px 9px; border-radius: 4px; cursor: pointer; transition: all .15s; }\n.dpw-toggle[data-on=true] { background: var(--maroon); color: #fff; border-color: var(--maroon); }\n.dpw-toggle:disabled { opacity: .45; cursor: default; }\n.dpw-detail { border: 1px solid var(--line); border-radius: 5px; padding: 13px 14px; margin-top: 10px; }\n.dpw-detail-h { font-family: 'Josefin Sans', sans-serif; font-size: 13px; text-transform: uppercase;\n  letter-spacing: .04em; color: var(--maroon-d); margin-bottom: 7px; }\n.dpw-detail-b { font-size: 13px; color: var(--ink2); line-height: 1.6; }\n.dpw-line { font-size: 13px; color: var(--ink2); margin: 9px 0; display: flex; justify-content: space-between;\n  align-items: baseline; gap: 10px; flex-wrap: wrap; }\n.dpw-line b { font-family: 'Inconsolata', monospace; font-size: 15px; color: var(--ink); font-weight: 700; }\n.dpw-mono { font-family: 'Inconsolata', monospace; }\n.dpw-input { font-family: 'Inconsolata', monospace; font-size: 14px; border: 1px solid var(--line); border-radius: 4px;\n  padding: 5px 8px; width: 80px; color: var(--ink); }\n.dpw-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }\n.dpw-chip { font-family: 'Inconsolata', monospace; font-size: 12px; padding: 3px 7px; border-radius: 3px;\n  background: #f4f7fa; border: 1px solid var(--line); color: var(--ink); }\n.dpw-chip.dpw-chip-hot { background: #dcefe3; border-color: #b9dcc5; color: var(--green); }\n.dpw-chip.dpw-chip-bad { background: var(--rose); border-color: #e7b3b1; color: var(--maroon-d); }\n.dpw-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }\n.dpw-table { width: 100%; border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; }\n.dpw-table td, .dpw-table th { padding: 5px 6px; border-bottom: 1px solid #eef3f7; text-align: left; }\n/* table headers hold maths: f(3) must not become F(3) */\n.dpw-table th { font-size: 11px; color: var(--ink2); text-transform: none; letter-spacing: .04em; font-weight: 600; }\n.dpw-table td.dpw-mono { white-space: nowrap; }\n@media (max-width: 560px) { .dpw { padding: 14px; } .dpw-grid2 { grid-template-columns: 1fr; } .dpw-readout { gap: 16px; } }\n@media (prefers-reduced-motion: reduce) { .dpw * { transition: none !important; } }\n</style>\n<script>\n(function () {\n  var root = document.getElementById('cc7-guess');\n  if (!root) return;\n  if (root._cleanup) root._cleanup();\n  var L = [];\n  function on(el, ev, fn) { el.addEventListener(ev, fn); L.push([el, ev, fn]); }\n  root._cleanup = function () { L.forEach(function (x) { x[0].removeEventListener(x[1], x[2]); }); };\n  var $ = function (id) { return root.querySelector('#' + id); };\n  var LOG10_2 = Math.log10(2), YEAR = 3.156e7, UNIVERSE = 1.38e10;\n  function pow10(e) {\n    if (e > -4 && e < 6) { var v = Math.pow(10, e); return v >= 100 ? Math.round(v).toLocaleString() : v.toPrecision(3); }\n    var ex = Math.floor(e), m = Math.pow(10, e - ex);\n    return m.toFixed(1) + ' &times; 10<sup>' + ex + '</sup>';\n  }\n  function dur(log10s) {\n    var u = [['seconds', 0], ['minutes', Math.log10(60)], ['hours', Math.log10(3600)], ['days', Math.log10(86400)], ['years', Math.log10(YEAR)]];\n    var pick = u[0];\n    u.forEach(function (x) { if (log10s >= x[1]) pick = x; });\n    return pow10(log10s - pick[1]) + ' ' + pick[0];\n  }\n  function draw() {\n    var l = +$('cc7g-s').value, r = +$('cc7g-rs').value;\n    $('cc7g-l').textContent = l;\n    $('cc7g-r').innerHTML = r === 0 ? '1' : '10<sup>' + r + '</sup>';\n    var lp = -l * LOG10_2;\n    $('cc7g-p').innerHTML = '2<sup>&minus;' + l + '</sup> &asymp; ' + pow10(lp);\n    var lt = (l - 1) * LOG10_2 - r;\n    $('cc7g-t').innerHTML = dur(lt);\n    var lu = Math.log10(UNIVERSE * YEAR) + r + lp;\n    $('cc7g-u').innerHTML = lu >= -0.0001 ? 'essentially certain' : pow10(lu);\n    var v = $('cc7g-v');\n    var years = lt - Math.log10(YEAR);\n    if (years < 0) { v.className = 'dpw-verdict'; v.innerHTML = 'broken: a guesser forges in under a year'; }\n    else if (years < Math.log10(UNIVERSE)) { v.className = 'dpw-verdict'; v.innerHTML = 'too small: a patient guesser gets there'; }\n    else { v.className = 'dpw-verdict dpw-ok'; v.innerHTML = 'negligible: guessing is not a strategy'; }\n  }\n  on($('cc7g-s'), 'input', draw); on($('cc7g-rs'), 'input', draw);\n  draw();\n})();\n</script>\n<script>\n(function () {\n  var root = document.getElementById('cc7-forge');\n  if (!root) return;\n  if (root._cleanup) root._cleanup();\n  var L = [];\n  function on(el, ev, fn) { el.addEventListener(ev, fn); L.push([el, ev, fn]); }\n  root._cleanup = function () { L.forEach(function (x) { x[0].removeEventListener(x[1], x[2]); }); };\n  var $ = function (id) { return root.querySelector('#' + id); };\n  var sk, dos, sums;\n  function sign(m) { return sk * m; }\n  function reset() {\n    sk = 101 + Math.floor(Math.random() * 800);\n    dos = []; recompute();\n    var v = $('cc7f-v'); v.className = 'dpw-verdict dpw-neutral'; v.innerHTML = 'Ask for a few signatures first.';\n  }\n  function recompute() {\n    // every sum of distinct dossier messages, remembering which ones it used\n    sums = {};\n    var asked = {};\n    dos.forEach(function (d) { asked[d.m] = true; });\n    var n = dos.length;\n    for (var mask = 1; mask < (1 << n); mask++) {\n      var m = 0, s = 0, parts = [];\n      for (var i = 0; i < n; i++) if (mask & (1 << i)) { m += dos[i].m; s += dos[i].s; parts.push(i); }\n      if (!asked[m] && !(m in sums)) sums[m] = { s: s, parts: parts };\n    }\n    var keys = Object.keys(sums).map(Number).sort(function (a, b) { return a - b; });\n    $('cc7f-q').textContent = n;\n    $('cc7f-n').textContent = keys.length;\n    $('cc7f-dos').innerHTML = dos.length ? dos.map(function (d) {\n      return '<span class=\"dpw-chip\">' + d.m + ' &rarr; ' + d.s + '</span>'; }).join('') : '<span class=\"dpw-hint\">empty</span>';\n    var shown = keys.slice(0, 120);\n    $('cc7f-forge').innerHTML = keys.length ? shown.map(function (k) { return '<span class=\"dpw-chip dpw-chip-hot\">' + k + '</span>'; }).join('') +\n      (keys.length > shown.length ? '<span class=\"dpw-chip\">+' + (keys.length - shown.length) + ' more</span>' : '') :\n      '<span class=\"dpw-hint\">nothing yet: you need at least two signatures to add</span>';\n  }\n  function ask(m) {\n    m = Math.round(m);\n    if (!(m >= 1 && m <= 99)) return;\n    if (dos.some(function (d) { return d.m === m; })) {\n      var v = $('cc7f-v'); v.className = 'dpw-verdict dpw-neutral';\n      v.innerHTML = 'Already in your dossier. The game wants a different message every time.'; return;\n    }\n    if (dos.length >= 12) { var w = $('cc7f-v'); w.className = 'dpw-verdict dpw-neutral'; w.innerHTML = '12 queries is plenty for this demo.'; return; }\n    dos.push({ m: m, s: sign(m) }); recompute();\n  }\n  on($('cc7f-ask'), 'click', function () { ask(+$('cc7f-m').value); });\n  on($('cc7f-rand'), 'click', function () {\n    var tries = 0, m;\n    do { m = 1 + Math.floor(Math.random() * 99); tries++; } while (dos.some(function (d) { return d.m === m; }) && tries < 500);\n    $('cc7f-m').value = m; ask(m);\n  });\n  on($('cc7f-reset'), 'click', reset);\n  on($('cc7f-go'), 'click', function () {\n    var t = Math.round(+$('cc7f-t').value), v = $('cc7f-v');\n    if (!(t >= 1)) return;\n    if (dos.some(function (d) { return d.m === t; })) {\n      v.className = 'dpw-verdict dpw-neutral'; v.innerHTML = 'You asked for ' + t + ' already, so it does not count as a forgery.'; return;\n    }\n    if (t in sums) {\n      var f = sums[t];\n      var ms = f.parts.map(function (i) { return 'm=' + dos[i].m; }).join(' + ');\n      var ss = f.parts.map(function (i) { return dos[i].s; }).join(' + ');\n      var ok = f.s === sign(t);\n      v.className = ok ? 'dpw-verdict' : 'dpw-verdict dpw-ok';\n      v.innerHTML = '' + ms + ' = ' + t + ', so &sigma;* = ' + ss + ' = ' + f.s + '. Verify &rarr; ' + (ok ? 'ACCEPT. Forged, and you never touched the secret key.' : 'reject') + '';\n    } else {\n      var guess = 101 * t + Math.floor(Math.random() * 800 * t);\n      var hit = guess === sign(t);\n      v.className = hit ? 'dpw-verdict' : 'dpw-verdict dpw-ok';\n      v.innerHTML = '' + t + ' is not a sum of your messages, so you have to guess. Guessed &sigma;* = ' + guess + '. Verify &rarr; ' + (hit ? 'ACCEPT (lucky!)' : 'reject') + '';\n    }\n  });\n  reset();\n  [7, 12].forEach(ask);\n})();\n</script>","headings":[{"value":"Three algorithms","depth":2},{"value":"The more power the adversary gets, the more secure the scheme","depth":2},{"value":"The game","depth":2},{"value":"The adversary doesn't need your secret key","depth":2},{"value":"A forgery against a scheme where signatures add up","depth":2}],"frontmatter":{"date_created":"2026-09-18","path":"/blog/crypto-club-forging-without-the-key","tags":["Cryptography","Bitcoin","Digital Signatures"],"title":"Forging A Signature Without The Secret Key"}},"nextPost":{"html":"<p>Notice how a lot of these schemes assume that this problem, the discrete log problem, is hard to solve. If someone comes up with an easy solution, then all of a sudden private keys can be computed easily. All of a sudden transactions can be signed easily, because we would be able to create a forgery of the signature.</p>\n<p>Before I talk about the actual signature scheme, we'll look at what was first discovered. The Schnorr digital signature scheme came after something called the Schnorr proof of knowledge. And this is modelled, again, as an interactive game, similar to how we saw this game between a challenger and an adversary. The goal is for a prover to prove to a verifier that they know a secret X without revealing X.</p>\n<h2 id=\"peter-and-veronica\" style=\"position:relative;\"><a href=\"#peter-and-veronica\" aria-label=\"peter and veronica permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Peter and Veronica</h2>\n<p>We have the discrete log problem, which is Y = G<sup>X</sup> mod P, where P is a prime. This Y will be our public key, and this X will be our secret key. And we basically want to prove to someone that we possess this X without showing them X. So you're proving that you have knowledge of X. You're not showing X, though.</p>\n<p>Q is a large prime, so that's public info. The generator, everyone knows. The generator is also a public parameter. Let's give them names: the prover is Peter, and V is Veronica.</p>\n<ol>\n<li>We randomly pick a secret value X from the set of integers up to Q, so this is from 0 to Q − 1. And then we calculate our public key, Y = G<sup>X</sup>. We know that if we just give Veronica a Y, it's very hard for her to get the X from this.</li>\n<li>Peter gives Veronica the output, Y. And he also creates another random value. Think of this as two steps. This random value is again from the same field. We're just going to create a random R as well, which also comes from Z<sub>Q</sub>. I'll just call this α = G<sup>R</sup>. And then we send both Y and α to Veronica.</li>\n<li>Veronica picks a random value C too, from the same field, and she sends it over to Peter.</li>\n<li>Then we just do this calculation: S = R + X·C mod Q. And then we send the output S to Veronica.</li>\n<li>What does she know right now? She knows Y, she knows α, and she just got S. So based on these values that she got, she checks if G<sup>S</sup> equals α · Y<sup>C</sup>.</li>\n</ol>\n<div class=\"dpw-formula\">s = r + x&middot;c mod q &nbsp;&nbsp;&nbsp;&nbsp; g<sup>s</sup> &#8799; &alpha; &middot; y<sup>c</sup></div>\n<p>Why does this work? If we try to expand this equation: α is G<sup>R</sup>, and Y is G<sup>X</sup>, so Y<sup>C</sup> is (G<sup>X</sup>)<sup>C</sup>. When we raise a power to a power, we multiply the exponents, and when we multiply powers of the same base, we add the exponents. So the right side becomes G<sup>R + XC</sup>. And if you notice, S was also exactly this, R + XC. So it's basically checking if G<sup>R + XC</sup> is equal to G<sup>R + XC</sup>. But obviously, they don't see this X. They're just computing on the actual output.</p>\n<p>R is supposed to be like a masking factor. If we didn't have R, and we just sent X·C mod Q, Veronica is the one who gave C, so she might be able to calculate what X is. But if we mask this whole equation with a random value, then X stays hidden, which is our secret key. We don't want Veronica to know the secret key. We just need her to know that I have this key.</p>\n<p>And why is she sending C? We need another party to send another random value. Otherwise, Peter could just create an equation that would satisfy this property without actually knowing X. So there has to be some input given to Peter that is not something he himself calculated. Both prover and verifier have skin in the game, because the verifier is the one who's controlling the C, and the prover is the one who's controlling these things.</p>\n<div class=\"dpw\" id=\"cc8-pok\">\n  <div class=\"dpw-q\">Run it: does Veronica's check pass, and does she ever see x?</div>\n  <div class=\"dpw-detail-b\">Toy parameters: p = 2039, q = 1019, g = 4 (g has order q mod p). Real Schnorr uses 256-bit numbers; the algebra is identical.</div>\n  <div class=\"dpw-toggle-row\" style=\"margin-top:12px\">\n    <button class=\"dpw-toggle\" id=\"cc8p-new\">new secret x</button>\n    <button class=\"dpw-toggle\" id=\"cc8p-show\" data-on=\"false\">peek at x</button>\n  </div>\n  <div class=\"dpw-grid2\">\n    <div>\n      <div class=\"dpw-cap\">Peter (prover)</div>\n      <div class=\"dpw-line\"><span>secret x</span><span><b id=\"cc8p-x\">hidden</b></span></div>\n      <div class=\"dpw-line\"><span>y = g<sup>x</sup> mod p</span><span><b id=\"cc8p-y\"></b></span></div>\n      <div class=\"dpw-line\"><span>mask r</span><span><b id=\"cc8p-r\">hidden</b></span></div>\n      <div class=\"dpw-line\"><span>&alpha; = g<sup>r</sup> mod p</span><span><b id=\"cc8p-a\"></b></span></div>\n    </div>\n    <div>\n      <div class=\"dpw-cap\">Veronica (verifier)</div>\n      <label class=\"dpw-label\">challenge c &nbsp; <span class=\"dpw-val\" id=\"cc8p-cv\"></span>\n        <input type=\"range\" id=\"cc8p-c\" min=\"0\" max=\"1018\" step=\"1\" value=\"300\" /></label>\n      <div class=\"dpw-line\"><span>s = r + x&middot;c mod q</span><span><b id=\"cc8p-s\"></b></span></div>\n      <div class=\"dpw-line\"><span>g<sup>s</sup> mod p</span><span><b id=\"cc8p-l\"></b></span></div>\n      <div class=\"dpw-line\"><span>&alpha;&middot;y<sup>c</sup> mod p</span><span><b id=\"cc8p-rr\"></b></span></div>\n    </div>\n  </div>\n  <div class=\"dpw-verdict dpw-ok\" id=\"cc8p-v\"></div>\n  <div class=\"dpw-hint\">Veronica only ever sees y, &alpha;, c and s. Drag the challenge: s moves all over the field, the check passes every time, and x is never sent.</div>\n</div>\n<h2 id=\"three-things-to-prove\" style=\"position:relative;\"><a href=\"#three-things-to-prove\" aria-label=\"three things to prove permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Three things to prove</h2>\n<p>With a proof of knowledge, we have to show three things.</p>\n<ul>\n<li>Completeness means an honest prover plus an honest verifier always pass the check. There shouldn't be a bug in the code where, even if we're always honest, sometimes it says you failed.</li>\n<li>Soundness means a dishonest prover, being someone who actually doesn't know X, fails the check every time, except with negligible probability. There might be a fluke once in a while, because all of these values are chosen randomly. So there is a chance of one over the order of the field that they might get it correct.</li>\n<li>Zero knowledge means that nothing about the private information, which is X in this case, leaks to the verifier. The whole point is for us to not show Veronica X.</li>\n</ul>\n<p>For completeness, I showed you how this check works during the honest case, which is the easy case.</p>\n<div class=\"dpw\" id=\"cc8-cheat\">\n  <div class=\"dpw-q\">How often does a Peter who does not know x get through?</div>\n  <div class=\"dpw-detail-b\">A cheating Peter's best move: guess the challenge c* in advance, pick any s, and send &alpha; = g<sup>s</sup>&middot;y<sup>&minus;c*</sup>. If Veronica happens to send c*, the check passes. Every run below is the real modular arithmetic.</div>\n  <div class=\"dpw-toggle-row\" style=\"margin-top:12px\">\n    <span class=\"dpw-toggle-cap\">group size q</span>\n    <button class=\"dpw-toggle\" data-q=\"11\" data-on=\"true\">q = 11</button>\n    <button class=\"dpw-toggle\" data-q=\"1019\" data-on=\"false\">q = 1019</button>\n    <button class=\"dpw-toggle\" data-q=\"big\" data-on=\"false\">q &asymp; 2<sup>256</sup></button>\n  </div>\n  <div class=\"dpw-toggle-row\">\n    <span class=\"dpw-toggle-cap\">who picks the challenge?</span>\n    <button class=\"dpw-toggle\" id=\"cc8c-v\" data-on=\"true\">Veronica, at random</button>\n    <button class=\"dpw-toggle\" id=\"cc8c-p\" data-on=\"false\">Peter, himself</button>\n  </div>\n  <div class=\"dpw-toggle-row\">\n    <button class=\"dpw-toggle\" id=\"cc8c-run\">run 10,000 cheating attempts</button>\n  </div>\n  <div class=\"dpw-readout\">\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc8c-n\">0</span><span class=\"dpw-cap\">attempts</span></div>\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc8c-w\">0</span><span class=\"dpw-cap\">passed the check</span></div>\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc8c-r\">&ndash;</span><span class=\"dpw-cap\">pass rate</span></div>\n    <div class=\"dpw-stat\"><span class=\"dpw-num\" id=\"cc8c-e\"></span><span class=\"dpw-cap\">1 / <span class=\"dpw-var\">q</span></span></div>\n  </div>\n  <div class=\"dpw-verdict dpw-neutral\" id=\"cc8c-vd\">Press run.</div>\n  <div class=\"dpw-hint\">When Peter picks c himself he passes every time without knowing x, which is why c has to come from someone else. The same trick, run with Veronica's real c, is what the zero-knowledge simulator does: it writes transcripts (y, &alpha;, c, s) that verify, and it never knew x.</div>\n</div>\n<h2 id=\"soundness-rewind-the-tape\" style=\"position:relative;\"><a href=\"#soundness-rewind-the-tape\" aria-label=\"soundness rewind the tape permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Soundness: rewind the tape</h2>\n<p>Initially, when I first learned it, I was also kind of confused, because it didn't make any practical sense. But I was told to just think of this as a mental experiment, and maybe you can also try to do the same. Hear me out, and then let's talk about it.</p>\n<p>X and R are both created from this field, and then we calculate Y = G<sup>X</sup> and α = G<sup>R</sup>, and we send both of these to the verifier. Now the verifier creates a random value, again from this field, and sends that over to the prover. We'll call this C<sub>1</sub>. And now the prover calculates this S value, I'll call it S<sub>1</sub>, which is R + C<sub>1</sub>X mod Q.</p>\n<div class=\"dpw-formula\">s<sub>1</sub> = r + c<sub>1</sub>x mod q</div>\n<p>Now what happens is we stop this game, and we rewind the tape. We rewind the program, the tape, the virtual machine, whatever you want to think of it. Basically, you go back in time to this point. And at this point, the α value is already calculated, and R is already calculated. Now what we can do is tell the prover to prove it again: \"Hey, you've done it once, do it again.\" So the verifier creates a C<sub>2</sub> and gives C<sub>2</sub> to the prover. But our random value is fixed, remember. So S<sub>2</sub> will now be the same random value plus C<sub>2</sub>X mod Q.</p>\n<div class=\"dpw-formula\">s<sub>2</sub> = r + c<sub>2</sub>x mod q</div>\n<p>We have the same R, the same X. We can subtract these equations, and the R will cancel out. R − R cancels out, and we can solve for X:</p>\n<div class=\"dpw-formula\">x = (s<sub>1</sub> &minus; s<sub>2</sub>) / (c<sub>1</sub> &minus; c<sub>2</sub>) mod q</div>\n<p>If we were able to give two challenges to a prover at this point in time, they must know X, because if they've created valid S values, then we can see that X is easily computable. And if a prover does not know X, then they would not be able to compute these S<sub>1</sub> and S<sub>2</sub> correctly, so this equation would not be possible.</p>\n<p>This is the idea behind the forking lemma. This is a point at which we forked and we fixed our random value, and then we consider two cases with the same random value. We go back, we rewind the tape, and then we look at two cases with our previous values fixed, to prove whatever we want to prove.</p>\n<div class=\"dpw\" id=\"cc8-fork\">\n  <div class=\"dpw-q\">Rewind Peter once. How much of his secret do two answers give away?</div>\n  <div class=\"dpw-detail-b\">Same toy group (p = 2039, q = 1019, g = 4). Peter commits to &alpha; once. Veronica asks c<sub>1</sub>, then the tape is rewound to just after &alpha; and she asks c<sub>2</sub>.</div>\n  <div class=\"dpw-controls\" style=\"margin-top:12px\">\n    <label class=\"dpw-label\">first challenge c<sub>1</sub> &nbsp; <span class=\"dpw-val\" id=\"cc8f-c1v\"></span>\n      <input type=\"range\" id=\"cc8f-c1\" min=\"0\" max=\"1018\" value=\"120\" /></label>\n    <label class=\"dpw-label\">second challenge c<sub>2</sub> (after rewinding) &nbsp; <span class=\"dpw-val\" id=\"cc8f-c2v\"></span>\n      <input type=\"range\" id=\"cc8f-c2\" min=\"0\" max=\"1018\" value=\"777\" /></label>\n  </div>\n  <div class=\"dpw-toggle-row\">\n    <button class=\"dpw-toggle\" id=\"cc8f-new\">new Peter (new x and r)</button>\n  </div>\n  <div class=\"dpw-line\"><span>&alpha; (fixed by the fork)</span><span><b id=\"cc8f-a\"></b></span></div>\n  <div class=\"dpw-line\"><span>s<sub>1</sub>, s<sub>2</sub> (both pass Veronica's check)</span><span><b id=\"cc8f-s\"></b></span></div>\n  <div class=\"dpw-line\"><span>(s<sub>1</sub> &minus; s<sub>2</sub>)&middot;(c<sub>1</sub> &minus; c<sub>2</sub>)<sup>&minus;1</sup> mod q</span><span><b id=\"cc8f-x\"></b></span></div>\n  <div class=\"dpw-line\"><span>Peter's actual secret x</span><span><b id=\"cc8f-xr\"></b></span></div>\n  <div class=\"dpw-verdict\" id=\"cc8f-v\"></div>\n  <div class=\"dpw-hint\">All of it. The only case that fails is c<sub>1</sub> = c<sub>2</sub>, where there is nothing to divide by.</div>\n</div>\n<p>Someone in the room connected this to signatures: if the same random value is used for two signatures, it cancels out and exposes the private key. That's the same algebra. Here the rewind is a thought experiment that proves soundness. In a signature scheme, reusing the random value by accident leaks the key.</p>\n<h2 id=\"zero-knowledge\" style=\"position:relative;\"><a href=\"#zero-knowledge\" aria-label=\"zero knowledge permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Zero knowledge</h2>\n<p>With zero knowledge, you basically want to rely on a simulator. And the simulator, imagine it's just a computer program. It should be able to simulate all of the important transcript values of the scheme without actually knowing X. Whatever it does, it should give us Y, α and S, which should be computationally indistinguishable from the real Y, α and S, which were created by the actual prover. Maybe we need a full session on this: what does it mean to be computationally indistinguishable? But if we can show that a program is able to produce this type of output, and it has no knowledge of X, then we can prove that it's zero knowledge.</p>\n<p>This is not a digital signature. This is just a proof of knowledge scheme, which came first. And then from this, Schnorr created a digital signature scheme. We'll talk about how to convert this interactive proof of knowledge into a non-interactive digital signature, and then how to turn that into an elliptic curve version, which is the one used in Bitcoin.</p>\n<style>\n.dpw-formula { text-align: center; font-family: 'Inconsolata', monospace; font-size: 17px;\n  color: #1b2228; margin: 22px 0; letter-spacing: .01em; line-height: 1.6; overflow-x: auto; }\n.dpw-formula sup, .dpw-formula sub { font-size: 11px; }\n.dpw {\n  --ink: #1b2228; --ink2: #5b7085; --line: #dae4ed;\n  --maroon: #a72e2b; --maroon-d: #6a1d1b; --rose: #f2cdcc; --green: #3f8f5b; --slate: #8ba2b8;\n  border: 1px solid var(--line); border-radius: 6px; padding: 20px;\n  margin: 32px 0; background: #fff; font-family: 'Open Sans', sans-serif; color: var(--ink);\n}\n.dpw * { box-sizing: border-box; }\n.dpw-q { font-family: 'Josefin Sans', sans-serif; font-size: 14px; text-transform: uppercase; letter-spacing: .04em;\n  color: var(--maroon-d); margin: 0 0 12px; line-height: 1.4; }\n.dpw-controls { margin-bottom: 14px; display: grid; gap: 12px; }\n.dpw-label { display: block; font-size: 13px; color: var(--ink2); }\n.dpw-label input[type=range] { display: block; width: 100%; margin: 8px 0 0; accent-color: var(--maroon); }\n.dpw-val { color: var(--maroon-d); font-family: 'Inconsolata', monospace; font-weight: 700; }\n.dpw-hint { font-size: 12px; color: var(--ink2); margin-top: 10px; font-style: italic; line-height: 1.55; }\n.dpw-svg { width: 100%; height: auto; display: block; margin: 6px 0 4px;\n  background: linear-gradient(180deg, #fbfcfe, #f4f7fa); border-radius: 4px; }\n.dpw-verdict { margin: 10px 0 4px; padding: 8px 12px; border-radius: 4px; font-size: 13px; font-weight: 700;\n  background: var(--rose); color: var(--maroon-d); text-align: center; font-family: 'Inconsolata', monospace; }\n.dpw-verdict.dpw-ok { background: #dcefe3; color: var(--green); }\n.dpw-verdict.dpw-neutral { background: #e3ecf4; color: #3d566b; }\n.dpw-readout { display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }\n.dpw-stat { display: flex; flex-direction: column; }\n.dpw-num { font-family: 'Josefin Sans', sans-serif; font-size: 23px; color: var(--maroon-d); line-height: 1.15; }\n.dpw-cap { font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }\n/* variable names keep their case inside the upper-cased captions */\n.dpw-cap .dpw-var { text-transform: none; font-size: inherit; line-height: inherit; font-family: inherit; }\n.dpw-toggle-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }\n.dpw-toggle-cap { width: 100%; margin-bottom: 3px; font-size: 12px; color: var(--ink2); }\n.dpw-toggle { font-family: 'Inconsolata', monospace; font-size: 12px; border: 1px solid var(--line);\n  background: #fff; color: var(--ink2); padding: 5px 9px; border-radius: 4px; cursor: pointer; transition: all .15s; }\n.dpw-toggle[data-on=true] { background: var(--maroon); color: #fff; border-color: var(--maroon); }\n.dpw-toggle:disabled { opacity: .45; cursor: default; }\n.dpw-detail { border: 1px solid var(--line); border-radius: 5px; padding: 13px 14px; margin-top: 10px; }\n.dpw-detail-h { font-family: 'Josefin Sans', sans-serif; font-size: 13px; text-transform: uppercase;\n  letter-spacing: .04em; color: var(--maroon-d); margin-bottom: 7px; }\n.dpw-detail-b { font-size: 13px; color: var(--ink2); line-height: 1.6; }\n.dpw-line { font-size: 13px; color: var(--ink2); margin: 9px 0; display: flex; justify-content: space-between;\n  align-items: baseline; gap: 10px; flex-wrap: wrap; }\n.dpw-line b { font-family: 'Inconsolata', monospace; font-size: 15px; color: var(--ink); font-weight: 700; }\n.dpw-mono { font-family: 'Inconsolata', monospace; }\n.dpw-input { font-family: 'Inconsolata', monospace; font-size: 14px; border: 1px solid var(--line); border-radius: 4px;\n  padding: 5px 8px; width: 80px; color: var(--ink); }\n.dpw-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }\n.dpw-chip { font-family: 'Inconsolata', monospace; font-size: 12px; padding: 3px 7px; border-radius: 3px;\n  background: #f4f7fa; border: 1px solid var(--line); color: var(--ink); }\n.dpw-chip.dpw-chip-hot { background: #dcefe3; border-color: #b9dcc5; color: var(--green); }\n.dpw-chip.dpw-chip-bad { background: var(--rose); border-color: #e7b3b1; color: var(--maroon-d); }\n.dpw-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }\n.dpw-table { width: 100%; border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; }\n.dpw-table td, .dpw-table th { padding: 5px 6px; border-bottom: 1px solid #eef3f7; text-align: left; }\n/* table headers hold maths: f(3) must not become F(3) */\n.dpw-table th { font-size: 11px; color: var(--ink2); text-transform: none; letter-spacing: .04em; font-weight: 600; }\n.dpw-table td.dpw-mono { white-space: nowrap; }\n@media (max-width: 560px) { .dpw { padding: 14px; } .dpw-grid2 { grid-template-columns: 1fr; } .dpw-readout { gap: 16px; } }\n@media (prefers-reduced-motion: reduce) { .dpw * { transition: none !important; } }\n</style>\n<script>\n(function () {\n  var P = 2039n, Q = 1019n, G = 4n;\n  function mp(b, e, m) { b %= m; if (b < 0n) b += m; var r = 1n; while (e > 0n) { if (e & 1n) r = r * b % m; b = b * b % m; e >>= 1n; } return r; }\n  function rnd(n) { return BigInt(Math.floor(Math.random() * Number(n))); }\n  function md(a, m) { a %= m; return a < 0n ? a + m : a; }\n  window.__cc8 = { P: P, Q: Q, G: G, mp: mp, rnd: rnd, md: md };\n})();\n</script>\n<script>\n(function () {\n  var root = document.getElementById('cc8-pok');\n  if (!root || !window.__cc8) return;\n  if (root._cleanup) root._cleanup();\n  var L = [];\n  function on(el, ev, fn) { el.addEventListener(ev, fn); L.push([el, ev, fn]); }\n  root._cleanup = function () { L.forEach(function (x) { x[0].removeEventListener(x[1], x[2]); }); };\n  var Z = window.__cc8, $ = function (id) { return root.querySelector('#' + id); };\n  var x, r, show = false;\n  function fresh() { x = 1n + Z.rnd(Z.Q - 1n); r = Z.rnd(Z.Q); draw(); }\n  function draw() {\n    var c = BigInt($('cc8p-c').value);\n    var y = Z.mp(Z.G, x, Z.P), a = Z.mp(Z.G, r, Z.P);\n    var s = Z.md(r + x * c, Z.Q);\n    var lhs = Z.mp(Z.G, s, Z.P), rhs = a * Z.mp(y, c, Z.P) % Z.P;\n    $('cc8p-x').textContent = show ? String(x) : 'hidden';\n    $('cc8p-r').textContent = show ? String(r) : 'hidden';\n    $('cc8p-y').textContent = String(y); $('cc8p-a').textContent = String(a);\n    $('cc8p-cv').textContent = String(c); $('cc8p-s').textContent = String(s);\n    $('cc8p-l').textContent = String(lhs); $('cc8p-rr').textContent = String(rhs);\n    var v = $('cc8p-v');\n    v.className = lhs === rhs ? 'dpw-verdict dpw-ok' : 'dpw-verdict';\n    v.innerHTML = '' + (lhs === rhs ? lhs + ' = ' + rhs + ' &rarr; Veronica accepts' : 'mismatch &rarr; reject') + '';\n  }\n  on($('cc8p-c'), 'input', draw);\n  on($('cc8p-new'), 'click', fresh);\n  on($('cc8p-show'), 'click', function () { show = !show; $('cc8p-show').setAttribute('data-on', String(show)); draw(); });\n  fresh();\n})();\n</script>\n<script>\n(function () {\n  var root = document.getElementById('cc8-cheat');\n  if (!root || !window.__cc8) return;\n  if (root._cleanup) root._cleanup();\n  var L = [];\n  function on(el, ev, fn) { el.addEventListener(ev, fn); L.push([el, ev, fn]); }\n  root._cleanup = function () { L.forEach(function (x) { x[0].removeEventListener(x[1], x[2]); }); };\n  var Z = window.__cc8, $ = function (id) { return root.querySelector('#' + id); };\n  var GROUPS = { '11': { P: 23n, Q: 11n, G: 4n }, '1019': { P: 2039n, Q: 1019n, G: 4n } };\n  var qsel = '11', peterPicks = false, n = 0, w = 0;\n  var qbtns = root.querySelectorAll('[data-q]');\n  function resetCounts() { n = 0; w = 0; paint(); $('cc8c-vd').className = 'dpw-verdict dpw-neutral'; $('cc8c-vd').innerHTML = 'Press run.'; }\n  function paint() {\n    $('cc8c-n').textContent = n.toLocaleString(); $('cc8c-w').textContent = w.toLocaleString();\n    $('cc8c-r').textContent = n ? (100 * w / n).toFixed(2) + '%' : '–';\n    $('cc8c-e').innerHTML = qsel === 'big' ? '&asymp; 10<sup>&minus;77</sup>' : (100 / Number(qsel)).toFixed(2) + '%';\n  }\n  function run() {\n    var vd = $('cc8c-vd');\n    if (qsel === 'big') {\n      n += 10000;\n      if (peterPicks) w += 10000;\n      paint();\n      vd.className = peterPicks ? 'dpw-verdict' : 'dpw-verdict dpw-ok';\n      vd.innerHTML = peterPicks ? 'Peter picks c: he passes every time, and he never knew x.'\n        : 'Too big to simulate: the chance any of these 10,000 tries passes is about 10<sup>&minus;73</sup>.';\n      return;\n    }\n    var g = GROUPS[qsel], x = 1n + Z.rnd(g.Q - 1n), y = Z.mp(g.G, x, g.P); // Peter is given y but not x\n    var yinv = Z.mp(y, g.Q - 1n, g.P);\n    for (var i = 0; i < 10000; i++) {\n      var cs = Z.rnd(g.Q), s = Z.rnd(g.Q);\n      var alpha = Z.mp(g.G, s, g.P) * Z.mp(yinv, cs, g.P) % g.P;   // alpha = g^s * y^(-c*)\n      var c = peterPicks ? cs : Z.rnd(g.Q);\n      var ok = Z.mp(g.G, s, g.P) === alpha * Z.mp(y, c, g.P) % g.P;\n      n++; if (ok) w++;\n    }\n    paint();\n    vd.className = peterPicks ? 'dpw-verdict' : 'dpw-verdict dpw-ok';\n    vd.innerHTML = peterPicks ? 'Peter picks c: he passes every time, and he never knew x.'\n      : 'Pass rate tracks 1/q. Make q 2<sup>256</sup> and the fluke is negligible.';\n  }\n  [].forEach.call(qbtns, function (b) {\n    on(b, 'click', function () {\n      qsel = b.getAttribute('data-q');\n      [].forEach.call(qbtns, function (o) { o.setAttribute('data-on', String(o === b)); });\n      resetCounts();\n    });\n  });\n  on($('cc8c-v'), 'click', function () { peterPicks = false; $('cc8c-v').setAttribute('data-on', 'true'); $('cc8c-p').setAttribute('data-on', 'false'); resetCounts(); });\n  on($('cc8c-p'), 'click', function () { peterPicks = true; $('cc8c-p').setAttribute('data-on', 'true'); $('cc8c-v').setAttribute('data-on', 'false'); resetCounts(); });\n  on($('cc8c-run'), 'click', run);\n  resetCounts();\n})();\n</script>\n<script>\n(function () {\n  var root = document.getElementById('cc8-fork');\n  if (!root || !window.__cc8) return;\n  if (root._cleanup) root._cleanup();\n  var L = [];\n  function on(el, ev, fn) { el.addEventListener(ev, fn); L.push([el, ev, fn]); }\n  root._cleanup = function () { L.forEach(function (x) { x[0].removeEventListener(x[1], x[2]); }); };\n  var Z = window.__cc8, $ = function (id) { return root.querySelector('#' + id); };\n  var x, r;\n  function fresh() { x = 1n + Z.rnd(Z.Q - 1n); r = Z.rnd(Z.Q); draw(); }\n  function draw() {\n    var c1 = BigInt($('cc8f-c1').value), c2 = BigInt($('cc8f-c2').value);\n    $('cc8f-c1v').textContent = String(c1); $('cc8f-c2v').textContent = String(c2);\n    var s1 = Z.md(r + c1 * x, Z.Q), s2 = Z.md(r + c2 * x, Z.Q);\n    $('cc8f-a').textContent = String(Z.mp(Z.G, r, Z.P));\n    $('cc8f-s').textContent = s1 + ', ' + s2;\n    $('cc8f-xr').textContent = String(x);\n    var v = $('cc8f-v');\n    if (c1 === c2) {\n      $('cc8f-x').textContent = 'divide by 0';\n      v.className = 'dpw-verdict dpw-ok'; v.innerHTML = 'Same challenge twice: s<sub>1</sub> = s<sub>2</sub>, nothing learned.'; return;\n    }\n    var inv = Z.mp(Z.md(c1 - c2, Z.Q), Z.Q - 2n, Z.Q);\n    var xr = Z.md((s1 - s2) * inv, Z.Q);\n    $('cc8f-x').textContent = String(xr);\n    v.className = 'dpw-verdict';\n    v.innerHTML = '' + (xr === x ? 'Extracted x = ' + xr + '. Two answers to the same &alpha; are the secret.' : 'mismatch') + '';\n  }\n  on($('cc8f-c1'), 'input', draw); on($('cc8f-c2'), 'input', draw); on($('cc8f-new'), 'click', fresh);\n  fresh();\n})();\n</script>","headings":[{"value":"Peter and Veronica","depth":2},{"value":"Three things to prove","depth":2},{"value":"Soundness: rewind the tape","depth":2},{"value":"Zero knowledge","depth":2}],"frontmatter":{"date_created":"2026-09-25","path":"/blog/crypto-club-rewinding-the-prover","tags":["Cryptography","Bitcoin","Digital Signatures","Zero Knowledge Proofs"],"title":"Rewinding The Prover"}}},"pageContext":{"prevPostPath":"/blog/crypto-club-prime-order-subgroups","currPostPath":"/blog/crypto-club-forging-without-the-key","nextPostPath":"/blog/crypto-club-rewinding-the-prover"}},"staticQueryHashes":[]}