<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/feed.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>petal</title>
  <subtitle>A small blog about software, security and things that take a while to grow.</subtitle>
  <id>https://petal.cafe/</id>
  <link rel="alternate" type="text/html" href="https://petal.cafe/"/>
  <link rel="self" type="application/atom+xml" href="https://petal.cafe/atom.xml"/>
  <updated>2026-10-07T00:00:00.000Z</updated>
  <author><name>cstef</name></author>
  <entry>
    <title>Sunflowers have math in them, wtf?</title>
    <id>https://petal.cafe/posts/sunflowers/</id>
    <link href="https://petal.cafe/posts/sunflowers/"/>
    <published>2026-10-07T00:00:00.000Z</published>
    <updated>2026-10-07T00:00:00.000Z</updated>
    <category term="maths"/>
    <category term="plants"/>
    <summary>How to pack as many seeds as possible into a sunflower head: Fibonacci</summary>
    <content type="html">&lt;p&gt;In the middle of a sunflower, if you look hard enough, you’ll see two families of &lt;a href=&quot;https://en.wikipedia.org/wiki/Phyllotaxis&quot;&gt;spirals&lt;/a&gt;, one turning clockwise &lt;math&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;↻&lt;/mo&gt;&lt;/math&gt; and the other counterclockwise &lt;math&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;↺&lt;/mo&gt;&lt;/math&gt;. Count each one and you usually get two approximate &lt;a href=&quot;https://en.wikipedia.org/wiki/Fibonacci_sequence&quot;&gt;Fibonacci numbers&lt;/a&gt;, like 55 or 66. It looks like the plant calculating it, which can seem a bit absurd. It actually isn’t counting anything (duh), it’s just following one dumb rule for the sake of efficiency and the numbers appear on their own.&lt;/p&gt;
&lt;h2 id=&quot;the-dumb-rule&quot;&gt;The dumb rule&lt;/h2&gt;
&lt;p&gt;A sunflower grows new seeds one at a time at the centre and shoves the older ones &lt;strong&gt;outwards&lt;/strong&gt;. Each new seed goes a fixed angle, say &lt;math&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;/math&gt;, around from the previous one. The question is now: which angle packs it best?&lt;/p&gt;
&lt;p&gt;Think of &lt;math&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;/math&gt; as a fraction of a full turn. If that fraction is a ratio of small integers, say &lt;math&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/mfrac&gt;&lt;/math&gt; or &lt;math&gt;&lt;mfrac&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mfrac&gt;&lt;/math&gt;, the seeds stack into a few straight spokes with ugly gaps between them.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/sunflowers/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;details class=&quot;typst-source&quot;&gt;&lt;summary&gt;Typst source&lt;/summary&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;typ&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;@preview/cetz:0.5.2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;: canvas, draw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;360deg&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;  // 2/5 of a turn&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; arms &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; seeds &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;150&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; head-radius &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;3.5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;head-radius &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(seeds)  &lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;// seed n sits at radius c * sqrt(n)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; seed &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;  // dot radius&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; palette &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;series&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;#canvas&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;  draw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;circle&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;), radius: head-radius &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; seed, stroke: (paint: theme&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;line, dash: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;dashed&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;, seeds &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;    draw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;circle&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      (r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle), r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle)),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      radius: seed,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      fill: palette&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;at&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;rem&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;rem&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n, arms), palette&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;())),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      stroke: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;none&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;    )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;
&lt;p&gt;You want the fraction that stays away from lining up for as long as possible, and that’s the &lt;a href=&quot;https://en.wikipedia.org/wiki/Golden_ratio&quot;&gt;golden ratio&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝜑&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msqrt&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/msqrt&gt;&lt;/mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;mo&gt;≈&lt;/mo&gt;&lt;mn&gt;1.618&lt;/mn&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;It’s the hardest number to approximate with fractions, because its &lt;a href=&quot;https://en.wikipedia.org/wiki/Continued_fraction&quot;&gt;continued fraction&lt;/a&gt; is nothing… but ones.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝜑&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;+&lt;/mo&gt;&lt;mi&gt;⋱&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h2 id=&quot;the-golden-angle&quot;&gt;The golden angle&lt;/h2&gt;
&lt;p&gt;Turn a full circle by &lt;math&gt;&lt;msup&gt;&lt;mi&gt;𝜑&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt; and you get the &lt;a href=&quot;https://en.wikipedia.org/wiki/Golden_angle&quot;&gt;golden angle&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mn&gt;360&lt;/mn&gt;&lt;mi&gt;°&lt;/mi&gt;&lt;/mrow&gt;&lt;msup&gt;&lt;mi&gt;𝜑&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mfrac&gt;&lt;mo&gt;≈&lt;/mo&gt;&lt;mn&gt;137.508&lt;/mn&gt;&lt;mi&gt;°&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Fibonacci appears because the ratio of consecutive terms of &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐹&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝐹&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝐹&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt; converges to &lt;math&gt;&lt;mi&gt;𝜑&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0.16666666666666666em&quot;&gt;lim&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;→&lt;/mo&gt;&lt;mi&gt;∞&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;msub&gt;&lt;mi&gt;𝐹&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝐹&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝜑&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;So the best rational approximations to the golden angle come from Fibonacci numbers, and those are the spiral counts you see in the head.&lt;/p&gt;
&lt;h2 id=&quot;placing-the-seeds&quot;&gt;Placing the seeds&lt;/h2&gt;
&lt;p&gt;Seed &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; sits at angle &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;/math&gt;. Its distance from the center grows with the square root of &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt;, keeping the area per seed constant. A disc of radius &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; has area &lt;math&gt;&lt;mi&gt;𝜋&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;, so if each seed takes area &lt;math&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt;, then &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; seeds fill&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝜋&lt;/mi&gt;&lt;msubsup&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mspace width=&quot;1em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⇒&lt;/mo&gt;&lt;mspace width=&quot;1em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msqrt&gt;&lt;mfrac&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mi&gt;𝜋&lt;/mi&gt;&lt;/mfrac&gt;&lt;/msqrt&gt;&lt;msqrt&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msqrt&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;With &lt;math&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msqrt&gt;&lt;mfrac&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mi&gt;𝜋&lt;/mi&gt;&lt;/mfrac&gt;&lt;/msqrt&gt;&lt;/math&gt;, the coordinates are:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;msqrt&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msqrt&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0.16666666666666666em&quot; rspace=&quot;0em&quot;&gt;cos&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;msqrt&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msqrt&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0.16666666666666666em&quot; rspace=&quot;0em&quot;&gt;sin&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/sunflowers/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;details class=&quot;typst-source&quot;&gt;&lt;summary&gt;Typst source&lt;/summary&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;typ&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;@preview/cetz:0.5.2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;: canvas, draw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; phi &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;)) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;360deg&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;pow&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(phi, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; arms &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;21&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; seeds &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;400&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; head-radius &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;3.4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;head-radius &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(seeds)  &lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;// seed n sits at radius c * sqrt(n)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; seed &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;  // dot radius&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; palette &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;series&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;#canvas&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;, seeds &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;    draw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;circle&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      (r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle), r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle)),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      radius: seed,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      fill: palette&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;at&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;rem&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;rem&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n, arms), palette&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;())),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      stroke: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;none&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;    )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/sunflowers/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;details class=&quot;typst-source&quot;&gt;&lt;summary&gt;Typst source&lt;/summary&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;typ&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;@preview/cetz:0.5.2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;: canvas, draw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; phi &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;)) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;360deg&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;pow&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(phi, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; arms &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;34&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; seeds &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;400&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; head-radius &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;3.4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;head-radius &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(seeds)  &lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;// seed n sits at radius c * sqrt(n)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; seed &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;  // dot radius&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; palette &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;series&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;#canvas&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;, seeds &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#3A94C5;--shiki-dark:#7FBBB3&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;c &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sqrt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;    draw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;circle&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      (r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle), r &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; angle)),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      radius: seed,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      fill: palette&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;at&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;rem&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(calc&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;rem&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;(n, arms), palette&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;())),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;      stroke: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#F85552;--shiki-dark:#E67E80&quot;&gt;none&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;    )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;
&lt;p&gt;That’s pretty much it! If you want to see more, check out &lt;a href=&quot;https://www.youtube.com/watch?v=sj8Sg8qnjOg&quot;&gt;this video on the golden ratio&lt;/a&gt; by Numberphile :D&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>CTFs are dead</title>
    <id>https://petal.cafe/posts/ctfs/</id>
    <link href="https://petal.cafe/posts/ctfs/"/>
    <published>2026-03-21T00:00:00.000Z</published>
    <updated>2026-03-21T00:00:00.000Z</updated>
    <category term="rant"/>
    <summary>LLMs are killing CTFs</summary>
    <content type="html">&lt;p&gt;I just came back from Insomni’Hack 2026, it was a great experience, lots of interesting talks! On the last day, from friday evening to saturday morning, the traditional on-site CTF takes place at the SwissTech. It’s generally a very fun event, you meet a lot of people there and the challenges are very well balanced in terms of difficulty.&lt;/p&gt;
&lt;p&gt;However, this year’s wasn’t the same. With LLMs becoming better and better at solving these kinds of tasks, CTFs have become a &lt;strong&gt;nightmare&lt;/strong&gt;. Capture the flag competitions are mostly fun because it’s a way to show off your skills, learn new stuff and challenge your ideas against others. People mindlessly using LLMs to solve challenges defeats all three of those points at the same time. Do they even realize?&lt;/p&gt;
&lt;p&gt;After wandering in the event and taking glances at everyone’s screen, I would say about 30-40% were just blatantly slop-solving challenges with stuff like codex or claude code. I even heard people being proud of doing this! They were flexing how easy it was to slop-solve the challenges and climb to the top 5 on the scoreboard, even emphasizing &lt;strong&gt;themselves&lt;/strong&gt; that they did not understand a single thing from the solution, but that it still got them their points.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;CTF players distracted by slop-solving&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;750&quot; height=&quot;500&quot; src=&quot;https://petal.cafe/_astro/meme.kPoDIF_d_1gFhtp.webp&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;CTFs, as we know them, are dead.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Look, I don’t want to generalize this type of behavior, I know this was an extreme example and that everyone is not as clueless as this guy was. We need to find other ways to assess skill in those fields, or put some serious and efficient restrictions on the usage of LLMs. I’m not saying either that we should be abolishing LLMs completely, they are great tools! But too many people treat them as a complete source of truth and then parade around with points they didn’t earn.&lt;/p&gt;
&lt;p&gt;I don’t know what the fix is. Air-gapped rooms? Making people explain their solves on the spot? Honestly, I’m not sure any of that would even work. But something has to change, because right now there’s no point in competing.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>LLMs killed my will to do stuff</title>
    <id>https://petal.cafe/posts/llms/</id>
    <link href="https://petal.cafe/posts/llms/"/>
    <published>2026-01-18T00:00:00.000Z</published>
    <updated>2026-01-18T00:00:00.000Z</updated>
    <category term="rant"/>
    <summary>How llms replaced my ability to sit with hard problems, and why it maybe matters</summary>
    <content type="html">&lt;p&gt;I was 12, in some hotel room in italy, trying to make a discord bot work. My dad helped me smuggle in a raspberry pi and keyboard. I unplugged the tv, booted up the board, followed some random ass tutorial for javascript. The code was a mess, nothing worked right. I spent hours reading error messages I didn’t understand, copying stack overflow answers I understood even less, and &lt;del&gt;painfully&lt;/del&gt; slowly making progress. By the end of the weekend, I had something functional. It was a complete catastrophe (each command’s event listener was a separate process), but hey, &lt;span class=&quot;highlight&quot;&gt; it was mine!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2026. I’m lying in bed with my laptop, trying to figure out what to build next. Nothing comes to my mind, so I just open mistral and ask for project ideas. I iterate over and over again. Nothing clicks. I give up.&lt;/p&gt;
&lt;p&gt;A few days later, I finally find something worth building. I start scaffolding it out by hand, making decent progress. Then I hit a wall: some bug I can’t immediately solve, or a feature that needs research. First instinct? Open the llm, ask it to fix the problem, let it write the solution.&lt;/p&gt;
&lt;p&gt;I catch myself doing this even when I know I shouldn’t, even when I know that figuring it out myself is the point.
And look, I was always kind of a lazy guy: school never pushed me hard, I could get through with minimal effort, university is the same. I grew up in this “get rewarded for doing barely anything, if not nothing” environment, and it warped how I approach everything, including programming. Long-term effort feels pointless when shortcuts have always worked.&lt;/p&gt;
&lt;p&gt;But I don’t think llms created this problem in me, they just made it much worse.&lt;/p&gt;
&lt;p&gt;And maybe it’s because they feel like a conversation: it responds, adapts, seems to &lt;em&gt;understand&lt;/em&gt; context. It’s really easy to forget you’re talking to statistics and matrix multiplication. Your brain treats it like asking a friend instead of looking something up, feels less like cheating, more like collaboration, even when you know it’s not.&lt;/p&gt;
&lt;p&gt;I think my generation is lucky, we learned &lt;span class=&quot;text-muted-foreground&quot;&gt;[to code]&lt;/span&gt; before you could just ask an ai to do it. We had to sit with confusion, read documentation (who writes docs anyways?) or articles that didn’t make sense until suddenly it just magically did. We had to &lt;em&gt;earn&lt;/em&gt; our understanding through trial and error and frustration.
When you can just bypass the struggle entirely, you never build the muscle memory of thinking through problems by yourself.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;old man yells at cloud from the simpsons&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1895&quot; height=&quot;1060&quot; src=&quot;https://petal.cafe/_astro/old-man.2E9FzMMN_Z2qAxjT.webp&quot;&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;
&lt;small class=&quot;text-muted-foreground&quot;&gt;this is how I feel while writing this but whatever&lt;/small&gt;
&lt;/p&gt;
&lt;p&gt;I see this in myself. I used to be able to sit with a bug/idea for hours, motivated and &lt;em&gt;somewhat&lt;/em&gt; focused. Now my attention span has become catastrophic, why bother with something when I can paste it into a chat window and get an answer in seconds?&lt;/p&gt;
&lt;p&gt;The fucked up part is that I know this is happening. I can see myself getting worse at the things I care about, yet I still go for the easy solutions anyway.
I don’t think the answer is to pretend these tools don’t exist, but I do think we’re not talking/caring enough about what we’re &lt;strong&gt;losing&lt;/strong&gt;. maybe I’m overthinking this, but I kinda miss being stuck on something.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>No Ads, No Algorithms, No Problem</title>
    <id>https://petal.cafe/posts/rss/</id>
    <link href="https://petal.cafe/posts/rss/"/>
    <published>2025-03-21T00:00:00.000Z</published>
    <updated>2025-03-21T00:00:00.000Z</updated>
    <category term="rss"/>
    <summary>Big techs hate it! This one simple trick lets you read what you want</summary>
    <content type="html">&lt;p&gt;Back when the Internet was still young (I wasn’t even born), folks would dial up to their favorite BBS (Bulletin Board System) and dive into whatever people were talking about.
It was so basic - just pure text posts lined up by date. No flashy ads, no infinite-doomscroll apps.
Just people talking to each other.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ansi&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;                    __&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;                   /  \      r e a l i t y c h e c k B B S&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;                  /|oo \&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3a94c5;--shiki-dark:#7fbbb3&quot;&gt;             san francisco, ca usa&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;                 (_|  /_)              &lt;/span&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-light-font-weight:bold;--shiki-dark:#a7c080;--shiki-dark-font-weight:bold&quot;&gt;realitycheckbbs.org&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da10180;--shiki-light-font-weight:bold;--shiki-dark:#a7c08080;--shiki-dark-font-weight:bold&quot;&gt;                 _&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;`@/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5c6a7280;--shiki-dark:#d3c6aa80&quot;&gt;_&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt; \     _&lt;/span&gt;&lt;span style=&quot;--shiki-light:#3a94c5;--shiki-dark:#7fbbb3&quot;&gt;              via telnet/web&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#3a94c580;--shiki-dark:#7fbbb380&quot;&gt;                |     |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt; \    \\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da10180;--shiki-dark:#a7c08080&quot;&gt;                | (*) |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;  \    ))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da10180;--shiki-dark:#a7c08080&quot;&gt;                |__U__|&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt; /  \ //          &lt;/span&gt;&lt;span style=&quot;--shiki-light:#3a94c5;--shiki-dark:#7fbbb3&quot;&gt;fidonet 1:218/700&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;    ______        _//|| _\   /           &lt;/span&gt;&lt;span style=&quot;--shiki-light:#3a94c5;--shiki-dark:#7fbbb3&quot;&gt;region 10 mailhub&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;   / fido \      (_/(_|(____/        &lt;/span&gt;&lt;span style=&quot;--shiki-light:#3a94c5;--shiki-dark:#7fbbb3&quot;&gt;california/nevada usa&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8da101;--shiki-dark:#a7c080&quot;&gt;  (________)          &lt;/span&gt;&lt;span style=&quot;--shiki-light:#5c6a7280;--shiki-dark:#d3c6aa80&quot;&gt;(jm)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p align=&quot;center&quot;&gt;&lt;small&gt;They had cool ASCII arts too &lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Then, as everyone’s grandmother started getting online, the Internet turned into this crazy fight for eyeballs. Companies began watching everything you clicked, trying to get inside your head. Suddenly, you’re drowning in ads, getting pushed toward certain articles, and your feed’s all shuffled around just to keep you glued to your screen.&lt;/p&gt;
&lt;p&gt;Today’s Internet feels like walking into a library where librarians follow you around, constantly swapping books on the shelves based on which covers you glance at longest. Look at a cookbook for too long, and suddenly the poetry section is full of food-themed sonnets. Want to read a novel? Too bad, you’re getting a comic book today. It’s like the whole place is trying to sell you something, and it’s &lt;em&gt;exhausting&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id=&quot;return-to-roots&quot;&gt;Return to Roots&lt;/h2&gt;
&lt;p&gt;A quite funny thing happened, though. People started realizing. Realizing that their addiction to these never-ending streams of content was making them miserable.&lt;/p&gt;
&lt;p&gt;That’s when some Internet old-timers started whispering about something that had been there all along: &lt;strong&gt;RSS&lt;/strong&gt;. Really Simple Syndication. A technology from the early 2000s that never actually died, just got buried under mountains of algorithmic feeds and walled gardens.
RSS is beautifully simple. You choose what websites you want to follow, and their latest posts come to you in chronological order. You very own (free) newspaper, curated by you.&lt;/p&gt;
&lt;p&gt;It typically looks like this:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;xml&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; version&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; encoding&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;rss&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; version&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&quot;2.0&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;channel&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;RSS Title&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;This is an example of an RSS feed&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;http://www.example.com/main.html&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;copyright&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;2020 Example.com All rights reserved&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;copyright&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;lastBuildDate&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;Mon, 6 Sep 2010 00:01:00 +0000&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;lastBuildDate&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;pubDate&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;Sun, 6 Sep 2009 16:20:00 +0000&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;pubDate&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;ttl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;1800&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;ttl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;            &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;Example entry&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;            &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;An interesting description.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;            &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;http://www.example.com/blog/post/1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;            &amp;lt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;pubDate&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;Sun, 6 Sep 2009 16:20:00 +0000&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;pubDate&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;        &amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;    &amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;channel&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;rss&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;how-to-use-rss&quot;&gt;How to Use RSS&lt;/h2&gt;
&lt;h3 id=&quot;as-a-reader&quot;&gt;As a Reader&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Find an RSS Reader&lt;/strong&gt;: There are many out there, but some popular ones are &lt;a href=&quot;https://ranchero.com/netnewswire/&quot;&gt;NetNewsWire&lt;/a&gt;, &lt;a href=&quot;https://github.com/glanceapp/glance&quot;&gt;Glance&lt;/a&gt;, &lt;a href=&quot;https://folo.is/&quot;&gt;Folo&lt;/a&gt; or &lt;a href=&quot;https://miniflux.app/&quot;&gt;miniflux&lt;/a&gt; (my favorite)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe to Websites&lt;/strong&gt;: Sometimes this is as easy as pasting the website’s URL into your reader. Other times, you might need to look for an icon like this: &lt;img alt=&quot;RSS icon&quot; src=&quot;https://petal.cafe/img/rss/rss.png&quot; style=&quot;width: 1.5rem; height: 1.5rem; border-radius: 0px; display: inline-block; vertical-align: text-bottom;&quot;&gt; or try your luck with &lt;code&gt;/(feed|rss|atom)(\.xml)?&lt;/code&gt; at the end of the URL.&lt;/p&gt;
&lt;p&gt;For websites/content sources that don’t have an RSS feed (e.g. Telegram channels), you can use a bridge service like &lt;a href=&quot;https://docs.rsshub.app/&quot;&gt;RSSHub&lt;/a&gt; to generate one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Enjoy&lt;/strong&gt;: At the beginning, you may find it a bit underwhelming to have a feed with just a few posts. But as you add more and more sources, you’ll have a personalized feed that’s just right for you.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;as-a-publisher&quot;&gt;As a Publisher&lt;/h3&gt;
&lt;p&gt;Most static site generators already support RSS feed generation. Very often, it’s just a matter of enabling it in the configuration file or installing a package. Here’s a list of some popular static site generators and their documentation on RSS feed generation:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Static Site Generator&lt;/th&gt;
&lt;th&gt;Documentation&lt;/th&gt;
&lt;th&gt;Enabled by Default&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hugo&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://gohugo.io/templates/rss/&quot;&gt;gohugo.io&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jekyll&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://jekyllrb.com/tutorials/convert-site-to-jekyll/#10-rss-feed&quot;&gt;jekyllrb.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zola&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.getzola.org/documentation/templates/feeds/&quot;&gt;getzola.org&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pelican&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.getpelican.com/en/stable/settings.html#feed-settings&quot;&gt;docs.getpelican.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Yes (Atom)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gatsby&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.gatsbyjs.com/docs/how-to/adding-common-features/adding-an-rss-feed/&quot;&gt;gatsbyjs.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Astro&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.astro.build/en/recipes/rss/&quot;&gt;docs.astro.build&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Eleventy&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.11ty.dev/docs/plugins/rss/&quot;&gt;11ty.dev&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If your static site generator doesn’t support RSS feed generation, get your hands dirty and write a script to do it! It’s not that hard, and you’ll learn a lot in the process :^)&lt;/p&gt;
&lt;h2 id=&quot;atom--rss-&quot;&gt;Atom ? RSS ?&lt;/h2&gt;
&lt;p&gt;You might have heard of &lt;a href=&quot;https://en.wikipedia.org/wiki/Atom_(web_standard)&quot;&gt;Atom&lt;/a&gt; feeds as well. Atom is another XML-based web feed format that’s quite similar to RSS. Atom was created in 2005 as an alternative to RSS, and it’s a bit more modern and extensible. But in practice, the two formats are pretty much interchangeable. Most feed readers can handle both, pick one and stick with it, you’ll be fine. (no harm in supporting both though)&lt;/p&gt;
&lt;h2 id=&quot;start-using-it&quot;&gt;Start using it!!!&lt;/h2&gt;
&lt;p&gt;If that’s the kind of web you want to exist, start using it. Start sharing it. And maybe, just maybe, we can make it happen.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SquarePants Sponge Hashing</title>
    <id>https://petal.cafe/posts/sponge/</id>
    <link href="https://petal.cafe/posts/sponge/"/>
    <published>2025-01-06T00:00:00.000Z</published>
    <updated>2025-01-06T00:00:00.000Z</updated>
    <category term="crypto"/>
    <summary>A quick explanation of the sponge hashing algorithm, notably used in SHA-3</summary>
    <content type="html">&lt;p&gt;In 2007, the NIST (National Institue of Standards and Technology) announced a Cryptographic Hash Algorithm Competition, with the winner being awarded the grant to be standardized as the new SHA-3. It ended in 2012 with &lt;math&gt;&lt;span&gt;K​&lt;/span&gt;&lt;span scriptlevel=&quot;1&quot; style=&quot;math-shift: compact&quot;&gt;ECCAK&lt;/span&gt;&lt;/math&gt; being announced as the winner.&lt;/p&gt;
&lt;p&gt;The function uses a &lt;strong&gt;sponge construction&lt;/strong&gt;, but what the hell is even this thing? Let’s take a look!&lt;/p&gt;
&lt;p&gt;We have a message &lt;math&gt;&lt;mi&gt;𝑀&lt;/mi&gt;&lt;/math&gt; as our input and the final hash &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;/math&gt;. We then have two “registers”: &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/math&gt;, which both make up our state &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;. These two are initialized with &lt;math&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt;s in them.&lt;/p&gt;
&lt;p&gt;The message &lt;math&gt;&lt;mi&gt;𝑀&lt;/mi&gt;&lt;/math&gt; is first padded so that it can fit in exactly &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;ℕ&lt;/mi&gt;&lt;/math&gt; parts &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;, each of size &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt;. The process of “absorption” is the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;XOR (denoted &lt;math&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;⊕&lt;/mo&gt;&lt;/math&gt;) the message-part &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; with the register &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; bit-by-bit&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Scramble the whole register &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt; (&lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/math&gt;) altogether to produce a new state &lt;math&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;/math&gt; by applying &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;/math&gt;
The function &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;/math&gt; needs to generate a pseudo-random permutation of the bits in &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/sponge/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pass on the state to the next iteration&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We can now “squeeze” our sponge to extract the hash from it, by applying &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;/math&gt; again and taking a small chunk &lt;math&gt;&lt;msub&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; (&lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; bits) over and over until we have enough for our desired output length.&lt;/p&gt;
&lt;p&gt;This whole process can be described with the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/sponge/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This whole process can also be modified to fit streaming needs, by combining both absorption and squeezing steps at each iteration.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/sponge/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Adaptor Signatures FtW</title>
    <id>https://petal.cafe/posts/adaptor/</id>
    <link href="https://petal.cafe/posts/adaptor/"/>
    <published>2024-12-03T00:00:00.000Z</published>
    <updated>2024-12-03T00:00:00.000Z</updated>
    <category term="crypto"/>
    <summary>A simple and neat way to &quot;lock&quot; your Schnorr signatures, enabling atomic swaps and more!</summary>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;[!NOTE]
I am not a cryptographer, nor a mathematician. This article is the result of my own research and understanding of the subject. If you find any mistakes, &lt;a href=&quot;mailto:hi@petal.cafe&quot;&gt;please let me know&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;The vast majority of what is written here is taken from various sources, which are listed at the &lt;a href=&quot;#references-and-suggested-readings&quot;&gt;end of this article&lt;/a&gt;. I highly recommend you to read them if you want to dive deeper into the subject.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When we compute and share a Schnorr signature, anyone can directly verify if it is valid for the attached message and signer. But what if we wanted to defer revealing the full signature while already emitting it to other people? We can produce such a signature by encrypting the nonce it contains with an additional scalar &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;This scalar will be published “along” with the signature in its public form &lt;math&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;. The basic signing process is the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Sample the random nonce &lt;math&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝔽&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;, along with the locking scalar &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝔽&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;Compute their public versions &lt;math&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;Compute the &lt;em&gt;aggregated&lt;/em&gt; public nonce &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;li&gt;Hash the challenge &lt;math&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; using the &lt;em&gt;aggregated&lt;/em&gt; nonce &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;, where &lt;math&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt; is the private key of the signer.&lt;/li&gt;
&lt;li&gt;Compute and publish the (encrypted) locked signature &lt;math&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;[!NOTE]
You may notice that we’re never actually using &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; in the signing process. This is a feature, not a bug! We can also generate this locked signature only knowing &lt;math&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The final published data should be &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; (along with the message &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt; of course).&lt;/p&gt;
&lt;p&gt;Anyone with &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; will now be able to get the “decrypted” signature &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;, which is behind the locking point &lt;math&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;With &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;, we will define &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt; as follows:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Likewise, if someone had both &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;/math&gt;, they would also be able to recover &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;While &lt;math&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;/math&gt; isn’t a valid Schnorr signature by itself:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mover&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;mo&gt;≠&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;We notice we can make the verification equation work if we add the public locking point &lt;math&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;While this doesn’t give us &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;, we can confirm that by adding &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; to &lt;math&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;/math&gt;, the resulting signature will be the one we’re expecting!&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mover&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;✓&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h2 id=&quot;atomic-swaps&quot;&gt;Atomic Swaps&lt;/h2&gt;
&lt;p&gt;Exchanging cryptocurrencies between different blockchains is hard. Typically, you’d need a trusted third party to act as a middleman, which would obviously need to be compensated financially for his work. Doing things this way is costly and pretty inefficient. Instead, we can leverage Adaptor Signatures to ensure that either both parties get what they expected, either both get nothing.&lt;/p&gt;
&lt;p&gt;We have Alice, holder of &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;♣︎&lt;/mi&gt;&lt;/math&gt;, and Bob, holder of &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;♥︎&lt;/mi&gt;&lt;/math&gt;. They want to exchange both their balances, and we assume they already know each other’s addresses on both chains.&lt;/p&gt;
&lt;p&gt;Alice starts by sampling &lt;math&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝔽&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;, and computes an adaptor signature as usual, on a message &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt; that attests the transaction of her &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;♣︎&lt;/mi&gt;&lt;/math&gt; to Bob’s address:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;The BIP340 standard expects to receive a signature pair in the form &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑂&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, on which the following check is performed:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝑂&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑂&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;If Bob was to try to give in &lt;math&gt;&lt;mi&gt;𝑂&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mover&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;≠&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Or &lt;math&gt;&lt;mi&gt;𝑂&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mover&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;≠&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;You could say that he cannot satisfy both the challenge &lt;math&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;/math&gt; &lt;strong&gt;and&lt;/strong&gt; the nonce &lt;math&gt;&lt;mi&gt;𝑂&lt;/mi&gt;&lt;/math&gt;. To do so, he needs to know &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; to compute &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; so that when he gives in &lt;math&gt;&lt;mi&gt;𝑂&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mover&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;✓&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Back to our stuff, when Bob receives the adaptor signature &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; from Alice, after having carefully verified that the given data is correct, he can also generate his own adaptor signature &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; on Alice’s &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; by using &lt;math&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝔽&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;After he sends it to Alice, she can claim the transaction linked to the signature &lt;math&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; by unlocking it with her &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; and publishing it to the blockchain. By doing so, everyone will be able to see the transaction and the associated decrypted signature &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;After this publication, Bob will also be able to compute &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; and unlock Alice’s &lt;math&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h2 id=&quot;nullifying-adaptor-signatures&quot;&gt;Nullifying Adaptor Signatures&lt;/h2&gt;
&lt;p&gt;In the previous case, we saw how two parties could jointly sign a transaction without the need for a trusted third party. But what if one of the parties wanted to cancel the transaction?&lt;/p&gt;
&lt;p&gt;If Alice wants to cancel the transaction, she can simply discard her &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; and never publish it. Bob will then be unable to unlock the signature &lt;math&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and claim the transaction.&lt;/p&gt;
&lt;p&gt;However, if Bob wants to cancel the transaction, how can Alice confirm that she will never publish &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;? There needs to be some sort of threat against Alice to ensure that she will not publish &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;h3 id=&quot;private-key-exposure-threat&quot;&gt;Private Key Exposure Threat&lt;/h3&gt;
&lt;p&gt;By publishing her random nonce &lt;math&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;, Alice guarantees that she will never publish &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;. Otherwise, Bob will be able to recover &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and thus compute Alice’s private key &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mtext&gt;known&lt;/mtext&gt;&lt;/munder&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Bob can also verify that the nonce &lt;math&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; published by Alice is authentic:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑌&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h2 id=&quot;secret-sharing--adaptor-signatures--&quot;&gt;Secret Sharing + Adaptor Signatures = ?&lt;/h2&gt;
&lt;p&gt;One cool feature of &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt;-of-&lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; treshold schemes, such as &lt;a href=&quot;https://petal.cafe/posts/shamir&quot;&gt;Shamir’s Secret Sharing&lt;/a&gt;, is that they can be integrated into pretty much anything that has a secret in it. This includes Adaptor signatures locking scalars!&lt;/p&gt;
&lt;p&gt;By defining our polynomial &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; as follows:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;We can split our locking scalar &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; into &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;With &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt; shareholders forming the recovery group &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt;, we can then collectively reconstruct &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; with &lt;a href=&quot;https://petal.cafe/posts/lagrange&quot;&gt;Lagrange interpolation&lt;/a&gt; (or any other similar interpolation method):&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;And unlock the adaptor signature!&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;̂&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h2 id=&quot;references-and-suggested-readings&quot;&gt;References and Suggested readings&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The Riddles of Adaptor Signatures&lt;/strong&gt;&lt;br&gt;
&lt;a href=&quot;https://conduition.io/scriptless/adaptorsigs&quot;&gt;conduition.io&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Bitcoin Optech - Adaptor Signatures&lt;/strong&gt;&lt;br&gt;
&lt;a href=&quot;https://bitcoinops.org/en/topics/adaptor-signatures/&quot;&gt;bitcoinops.org&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Adaptor Signatures: New Security Definition and A Generic Construction for NP Relations⋆&lt;/strong&gt;&lt;br&gt;
Xiangyu Liu, Ioannis Tzannetos, and Vassilis Zikas&lt;br&gt;
&lt;a href=&quot;https://eprint.iacr.org/2024/1051.pdf&quot;&gt;eprint.iacr.org&lt;/a&gt; &lt;small&gt;[PDF]&lt;small&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Elliptic Curves for Sane People</title>
    <id>https://petal.cafe/posts/elliptic-curve/</id>
    <link href="https://petal.cafe/posts/elliptic-curve/"/>
    <published>2024-11-29T00:00:00.000Z</published>
    <updated>2024-11-29T00:00:00.000Z</updated>
    <category term="crypto"/>
    <summary>A gentle introduction to elliptic curve cryptography, without the need for a PhD in mathematics.</summary>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;[!NOTE]
I am not a cryptographer, nor a mathematician. This article is the result of my own research and understanding of the subject. If you find any mistakes, &lt;a href=&quot;mailto:hi@petal.cafe&quot;&gt;please let me know&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;The vast majority of what is written here is taken from various sources, which are listed at the &lt;a href=&quot;#references-and-suggested-readings&quot;&gt;end of this article&lt;/a&gt;. I highly recommend you to read them if you want to dive deeper into the subject.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Elliptic curve cryptography (ECC) is a fascinating field of study that has been around for a while. It’s a cornerstone of modern cryptography, and it’s used in many applications, from secure messaging to cryptocurrencies. RSA, the most widely used public-key cryptosystem, is slowly being replaced by ECC due to its efficiency and security.&lt;/p&gt;
&lt;p&gt;The trapdoor function (easy to do one way, hard the other) for an elliptic curve is the multiplication of a point &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt; by a scalar &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; which is just adding the point &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt; to itself &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; times. This operation is denoted as &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;. If &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; is large enough, it is computationally impossible to find &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; for &lt;math&gt;&lt;mi&gt;𝑄&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;, being given both &lt;math&gt;&lt;mi&gt;𝑄&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;, in a reasonable time.&lt;/p&gt;
&lt;details&gt;
&lt;summary&gt;What is a &quot;reasonable time&quot;?&lt;/summary&gt;
&lt;p&gt;Let’s suppose we have supercomputer that is able to compute &lt;math&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;12&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt; point multiplications per second (generous assumption).&lt;/p&gt;
&lt;p&gt;In a year, we have about &lt;math&gt;&lt;mn&gt;365&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;∗&lt;/mo&gt;&lt;mn&gt;24&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;∗&lt;/mo&gt;&lt;mn&gt;60&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;∗&lt;/mo&gt;&lt;mn&gt;60&lt;/mn&gt;&lt;mo&gt;≃&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;31&lt;/mn&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mn&gt;556&lt;/mn&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mn&gt;952&lt;/mn&gt;&lt;/math&gt; seconds, that means we could compute:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mn&gt;31&lt;/mn&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mn&gt;556&lt;/mn&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mn&gt;952&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;12&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;≃&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;19&lt;/mn&gt;&lt;/msup&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mtext&gt;[keys/year]&lt;/mtext&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Let’s take a SECP256k1 private key for our example. The elliptic curve is over a 256-bit field, which means we have &lt;math&gt;&lt;msup&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mn&gt;256&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;≃&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;77&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt; possible keys.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mfrac&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;77&lt;/mn&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;19&lt;/mn&gt;&lt;/msup&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mrow&gt;&lt;mn&gt;77&lt;/mn&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;19&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;58&lt;/mn&gt;&lt;/msup&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mtext&gt;[years]&lt;/mtext&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;For reference, the age of the universe is about &lt;math&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt; years :D&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Even with a quantum computer capable of running non-stop, using Shor’s algorithm, you’d need to perform &lt;math&gt;&lt;msqrt&gt;&lt;msup&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mn&gt;256&lt;/mn&gt;&lt;/msup&gt;&lt;/msqrt&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mn&gt;128&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;≃&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;38&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt; multiplications:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mfrac&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;38&lt;/mn&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;19&lt;/mn&gt;&lt;/msup&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mn&gt;19&lt;/mn&gt;&lt;/msup&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mtext&gt;[years]&lt;/mtext&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/details&gt;
&lt;p&gt;Let’s start out by graphically representing the addition of two points &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt; in an elliptic curve.&lt;/p&gt;
&lt;p&gt;One easy way to think of the addition is to draw a line that goes through &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt;, and find the third point of intersection with the curve. The symmetrical point is the result of the addition of &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt;. This is because elliptic curve have the property that any line between two points intersects the curve at most one more time.&lt;/p&gt;
&lt;p&gt;In the case where there is no third point of intersection (i.e. the line is vertical), we define the result of the addition as the point at infinity, denoted as &lt;math&gt;&lt;mi&gt;𝒪︀&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/elliptic-curve/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The resulting point &lt;math&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt; is then reflected to &lt;math&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/math&gt; over the x-axis. This symmetry property is easily explained by the fact that the curve’s &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; coordinates are squared, so for a given &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt; coordinate, there are two possible &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; coordinates, &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;The operation can then be done over and over again to find subsequent points.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/elliptic-curve/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!NOTE]
We will be working with &lt;a href=&quot;https://en.wikipedia.org/wiki/Elliptic_curve&quot;&gt;Short Weierstrass form&lt;/a&gt; curves, which are the most common form of elliptic curves used in cryptography. The equation of the curve is &lt;math&gt;&lt;msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Given two points &lt;math&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, the resulting coordinates of the point &lt;math&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/math&gt; can be found by:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Finding the slope &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt; of the line between &lt;math&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finding the &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt; coordinate of &lt;math&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/math&gt; by substituting &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; into the curve equation.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Grouping each power of &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt; together nicely:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;We have an single-variable third degree equation, and our good old friend &lt;a href=&quot;https://en.wikipedia.org/wiki/Vieta%27s_formulas&quot;&gt;Viète&lt;/a&gt; tells us that for a polynomial &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msup&gt;&lt;/math&gt; of degree &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt;, we have &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; roots:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mtable class=&quot;cases&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Among other properties, these roots &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; always satisfy:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;munderover&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo form=&quot;prefix&quot;&gt;−&lt;/mo&gt;&lt;mfrac&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mfrac&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Which means that in our case, we can write:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo form=&quot;prefix&quot;&gt;−&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Because we already know that the line will intersect with &lt;math&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/math&gt; (the grouped equation will be satisfied at both &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;), we are left with only &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐵&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finding &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; is as easy as plugging our freshly found &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; into the equation of the line and reflecting it over the &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt;-axis:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msubsup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msubsup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;&lt;math&gt;&lt;msubsup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msubsup&gt;&lt;/math&gt; is our intermediate point before it being reflected.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo form=&quot;prefix&quot;&gt;−&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mo form=&quot;prefix&quot;&gt;−&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the case where &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt;, we can’t really draw a line between the two points, so we take the tangent to the curve at &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; and find the third point of intersection. This is the result of the addition of &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; with itself, denoted as &lt;math&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/elliptic-curve/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;To find the tangent at &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, we need to find the slope &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;Differentiating both sides with respect to &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt;, &lt;math&gt;&lt;msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;, which actually depends on &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt; can be written as  &lt;math&gt;&lt;msup&gt;&lt;mrow&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt; for clarity:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mrow&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;See this as if we were differentiating &lt;math&gt;&lt;msup&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;, where &lt;math&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;The right side is just a function of &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt;, so we can differentiate it as we would with any other function:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Our differentiated equation is:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Solving for &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Notice that the tangent’s slope depends on both &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;, which makes sense because we’d have two different slopes otherwise:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo form=&quot;prefix&quot;&gt;±&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msqrt&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/msqrt&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;And we have our tangent equation for &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑡&lt;/mi&gt;&lt;mo lspace=&quot;0.2777777777777778em&quot; rspace=&quot;0.2777777777777778em&quot;&gt;:&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h2 id=&quot;working-with-finite-fields&quot;&gt;Working with finite fields&lt;/h2&gt;
&lt;p&gt;Elliptic curves are defined over a finite field, which means that all operations are done modulo a prime number &lt;math&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt;. This is done to ensure that the curve has a finite number of points, which is necessary for cryptographic applications.&lt;/p&gt;
&lt;h2 id=&quot;references-and-suggested-readings&quot;&gt;References and Suggested readings&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A (Relatively Easy To Understand) Primer on Elliptic Curve Cryptography&lt;/strong&gt;&lt;br&gt;
Nick Sullivan&lt;br&gt;
&lt;a href=&quot;https://blog.cloudflare.com/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/&quot;&gt;cloudflare.com&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Elliptic Curve Cryptography (ECC)&lt;/strong&gt;&lt;br&gt;
Svetlin Nakov&lt;br&gt;
&lt;a href=&quot;https://cryptobook.nakov.com/asymmetric-key-ciphers/elliptic-curve-cryptography-ecc&quot;&gt;cryptobook.nakov.com&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Lagrange Interpolation Primer</title>
    <id>https://petal.cafe/posts/lagrange/</id>
    <link href="https://petal.cafe/posts/lagrange/"/>
    <published>2024-11-29T00:00:00.000Z</published>
    <updated>2024-11-29T00:00:00.000Z</updated>
    <category term="maths"/>
    <summary>A quick and simple explanation on the concept of polynomial interpolation, here Lagrange's in particular.</summary>
    <content type="html">&lt;p&gt;You may remember, when in High School, being asked to find the equation of a line that goes through two points. The process was straightforward: you would calculate the slope &lt;math&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/math&gt; and the intercept &lt;math&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/math&gt; of the line &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;This is a simple example of polynomial interpolation, where we are trying to find a polynomial that goes through a set of points. While the process is simple for a line, it becomes slightly more complex for higher degree polynomials.&lt;/p&gt;
&lt;h3 id=&quot;polynomials&quot;&gt;Polynomials&lt;/h3&gt;
&lt;p&gt;One of the most, if not &lt;em&gt;the&lt;/em&gt; most important property of polynomials, is that each one of them can uniquely be described by &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; points for a polynomial of degree &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt;, noted &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℙ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;The most straightforward way of seeing this is by setting an equation for each point &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; we have:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mtable class=&quot;cases&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;We can see that we have &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; equations for &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; factors of &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt;, noted &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt;, which could also be represented with the following Vandermonde matrix equation:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mtable&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋱&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mtable&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mtable&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Written as &lt;math&gt;&lt;mi&gt;𝑉&lt;/mi&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;, we can solve this by inverting &lt;math&gt;&lt;mi&gt;𝑉&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑉&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;This is doable by applying the &lt;a href=&quot;https://en.wikipedia.org/wiki/Gaussian_elimination&quot;&gt;Jordan-Gauss algorithm&lt;/a&gt; to the augmented matrix &lt;math&gt;&lt;mi&gt;𝑉&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝐼&lt;/mi&gt;&lt;/math&gt;, where &lt;math&gt;&lt;mi&gt;𝐼&lt;/mi&gt;&lt;/math&gt; is the identity matrix (diagonal filled with &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;s), until we only have pivots equal to &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mtable&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msubsup&gt;&lt;mi&gt;&lt;span style=&quot;white-space: pre-wrap&quot;&gt;&amp;#x20;&lt;/span&gt;&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msubsup&gt;&lt;mi&gt;&lt;span style=&quot;white-space: pre-wrap&quot;&gt;&amp;#x20;&lt;/span&gt;&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋱&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;mi&gt;&lt;span style=&quot;white-space: pre-wrap&quot;&gt;&amp;#x20;&lt;/span&gt;&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋱&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msubsup&gt;&lt;mi&gt;&lt;span style=&quot;white-space: pre-wrap&quot;&gt;&amp;#x20;&lt;/span&gt;&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;If you prefer to see this in a graphical way, let’s consider the following example:&lt;/p&gt;
&lt;p&gt;We have two points &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mo form=&quot;prefix&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;. We can represent them as follows:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;It is visually obvious that we can only draw a single line that goes through both points.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;A line is essentially just &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/math&gt;, which is of degree &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;. We can guess and deduce we need at least &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; points to describe a polynomial function &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℙ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;The same goes if we add a third point &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If we did not add this third point and still tried to find a polynomial &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, we would have an infinite number of solutions:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;But now the question is: how do we actually find the polynomial that goes through all the points? This is where Lagrange interpolation comes into play.&lt;/p&gt;
&lt;h3 id=&quot;lagrange-interpolation&quot;&gt;Lagrange Interpolation&lt;/h3&gt;
&lt;p&gt;Let’s take &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; to demonstrate this method.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The main principle behind this is to split the wanted function into multiple sub-functions &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, that each contribute to one given point, also called “node”.&lt;/p&gt;
&lt;p&gt;We want to construct &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; so that:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mtable class=&quot;cases&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mtext&gt;if&lt;/mtext&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mtext&gt;if&lt;/mtext&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Making a function equal to &lt;math&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt; at a certain point &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; is as simple as multiplying it by &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;. Based on this property, we can already “guess” &lt;math&gt;&lt;msubsup&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msubsup&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;details&gt;
&lt;summary&gt; Why does multiplying by &lt;span&gt;
&lt;p&gt;&lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/span&gt; add a root ?&lt;/summary&gt;&lt;/p&gt;
&lt;p&gt;For a function &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;mi&gt;ℝ&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;[&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;]&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, when &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/details&gt;
&lt;p&gt;That’s a good start! But we have a problem: &lt;math&gt;&lt;msubsup&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; is not equal to &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; at &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;. We can fix this by dividing &lt;math&gt;&lt;msubsup&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; by &lt;math&gt;&lt;msubsup&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;msubsup&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;msubsup&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;And we effectively have &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;. We can now repeat this process for &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The polynomial &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℙ&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; is computed by summing all the &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; together and multiplying them by the corresponding &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And we have our final polynomial which effectively goes through all the points:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/lagrange/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Generalizing this process, we can write the function &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℙ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; that goes through &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; points &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/munderover&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>Using ECC for (Multi-)Signatures</title>
    <id>https://petal.cafe/posts/multi-sig/</id>
    <link href="https://petal.cafe/posts/multi-sig/"/>
    <published>2024-11-29T00:00:00.000Z</published>
    <updated>2024-11-29T00:00:00.000Z</updated>
    <category term="crypto"/>
    <summary>Math-powered methods for proving message authenticity, sounds great, doesn't it?</summary>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;[!NOTE]
I am not a cryptographer, nor a mathematician. This article is the result of my own research and understanding of the subject. If you find any mistakes, &lt;a href=&quot;mailto:hi@petal.cafe&quot;&gt;please let me know&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;The vast majority of what is written here is taken from various sources, which are listed at the &lt;a href=&quot;#references-and-suggested-readings&quot;&gt;end of this article&lt;/a&gt;. I highly recommend you to read them if you want to dive deeper into the subject.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Elliptic curves may not write your emails, but they can help prove &lt;strong&gt;&lt;em&gt;you&lt;/em&gt;&lt;/strong&gt; sent them. Our goal is to output a signature &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; for a given message &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt;, so that the recipient can verify that the sender is authentic. The sender’s keys are &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, with &lt;math&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt; the private key, and &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt; the public one.&lt;/p&gt;
&lt;h2 id=&quot;ecdsa-signatures&quot;&gt;ECDSA Signatures&lt;/h2&gt;
&lt;p&gt;Let’s take a look at the Elliptic Curve Digital Signature Algorithm (ECDSA).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compute the hash &lt;math&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; where &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; is any cryptographic hash function (e.g. SHA-256).&lt;/li&gt;
&lt;li&gt;Generate a random &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt; number in in the current subgroup.&lt;/li&gt;
&lt;li&gt;Calculate the associated random point on the curve &lt;math&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;, with &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; a generator, with &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; the &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt;-coordinate of this point.&lt;/li&gt;
&lt;li&gt;Calculate the signature &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, where &lt;math&gt;&lt;msup&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt; is the modular inverse of &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By sending &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, you confirm you know:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The content of the message &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;The private key &lt;math&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt; associated to &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The verifier may follow this procedure to check if the message &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt; that he received along with &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; is authentic:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compute the hash &lt;math&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; with the same cryptographic hash function defined before.&lt;/li&gt;
&lt;li&gt;Calculate the modular inverse of &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;: &lt;math&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;Recover the random point used in the signature process: &lt;math&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;Check whether &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt;, if so, then the message is authentic.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To prove this works, let’s start with the definition of the signature &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Incorporate &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; into &lt;math&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Which is just our definition of &lt;math&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/math&gt; when generating the signature.&lt;/p&gt;
&lt;h3 id=&quot;cool-kids-public-key-recovery&quot;&gt;Cool Kids Public Key Recovery&lt;/h3&gt;
&lt;p&gt;Let’s suppose you are talking through a &lt;a href=&quot;https://en.wikipedia.org/wiki/Tin_can_telephone&quot;&gt;Tin can telephone&lt;/a&gt; with your friend and every byte you send matters. You don’t want to send the public key &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt; along with the signature &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; because that’s just too much data. Instead, you can recover the public key from the signature and the message.&lt;/p&gt;
&lt;p&gt;Given &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;, there are typically &lt;strong&gt;two&lt;/strong&gt; candidate points &lt;math&gt;&lt;msubsup&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msubsup&gt;&lt;/math&gt; that fit. And since we know that &lt;math&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;, which we just verified works, it can be rearranged to isolate the public key &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msubsup&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;msubsup&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msubsup&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;To choose which one is the correct one, we need to verify the signature with each &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝐾&lt;/mi&gt;&lt;/msub&gt;&lt;mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;This ambiguity is often removed by adding a single bit &lt;math&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; into the signature message: &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/p&gt;
&lt;h2 id=&quot;schnorr-signatures&quot;&gt;Schnorr Signatures&lt;/h2&gt;
&lt;p&gt;Schnorr signatures are a bit like ECDSA, but faster and simpler. We are going to use the same keys &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; as before, with &lt;math&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt; the private key and &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt; the public one. We’ll first see the procedure and then discuss the mathematical proof of why this works.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Sample a random nonce &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;details&gt;
&lt;summary&gt;What the hell is &lt;span&gt;
&lt;p&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;
&lt;/span&gt;?&lt;/summary&gt;&lt;/p&gt;
&lt;p&gt;The set &lt;math&gt;&lt;msub&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; is a cyclic group of integers, isomorphic to the quotient group &lt;math&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;/&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;/math&gt;. It is basically just the set of integers modulo &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;In our case, &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; is the order (how many points are in) of the subgroup generated by &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;.
If the curve’s cofactor &lt;math&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;/math&gt; is 1, then &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; is the order of the curve. If &lt;math&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;/math&gt; is not 1, the order is &lt;math&gt;&lt;mfrac&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mtext&gt;ord&lt;/mtext&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/p&gt;
&lt;/details&gt;
&lt;ol&gt;
&lt;li&gt;Multiply it by the generator: &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;We can now compute the challenge &lt;math&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;And the signature: &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The final signature is &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;Once the signature has been emitted, verifying it is as easy as checking:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;To know &lt;math&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;/math&gt;, the verifier needs to know the message &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt;, the public key &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;. In some cases, you might not need to include the public key into the challenge and simply hash &lt;math&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;h3 id=&quot;why-it-works&quot;&gt;Why it Works&lt;/h3&gt;
&lt;p&gt;There isn’t really a proof needed for the verifying step as it’s just factoring out &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;, but here you are:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/munder&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;ℎ&lt;/mi&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/munder&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;One trickier part is to explain why we are adding a random nonce &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; to both the signature and the challenge. This value &lt;strong&gt;has&lt;/strong&gt; to be sampled randomly and &lt;strong&gt;must not&lt;/strong&gt; be reused. If it is, the private key can be recovered. Let’s first take the case where no &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; is used:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Recovering the private key is as simple as multiplying the challenge &lt;math&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;/math&gt; by the modular inverse of &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;. Not good.&lt;/p&gt;
&lt;p&gt;Now, let’s take the case where &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; is reused, with two messages &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt;, along with their respective signatures &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; and &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mtable class=&quot;cases&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mrow scriptlevel=&quot;1&quot;&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt; &lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mrow scriptlevel=&quot;1&quot;&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Combining &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; and &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mo lspace=&quot;0em&quot; stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;You may see &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;/math&gt; as an additional unknown variable that is used to prevent the linear equation system from being solved, because for &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; messages, you have &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; equations and &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; unknowns, which is unsolvable in our case.&lt;/p&gt;
&lt;h3 id=&quot;aggregating-signatures&quot;&gt;Aggregating Signatures&lt;/h3&gt;
&lt;p&gt;Schnorr signatures have the nice property that they can be aggregated, this means that a group of people can sign a message &lt;math&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/math&gt; together and the signature can be verified as if it was signed by a single person. Let’s consider our signing group &lt;math&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; for Alice, Bob and Charlie respectively.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mtext&gt;Alice&lt;/mtext&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mtext&gt;Bob&lt;/mtext&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mtext&gt;Charlie&lt;/mtext&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mspace width=&quot;1em&quot;/&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mspace width=&quot;1em&quot;/&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;The aggregated nonce is simply the sum of all nonces:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Likewise for the public key:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Each of them computes the challenge &lt;math&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;/math&gt; along with the final signature &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; with the parameters just agreed upon:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo stretchy=&quot;false&quot;&gt;‖&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Everyone now sends their &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; to the group.&lt;/p&gt;
&lt;p&gt;And aggregate again:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Because we are just adding signatures parts together, we can group the nonces and the private keys in our final signature:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mtext&gt;Nonces&lt;/mtext&gt;&lt;/munder&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mtext&gt;Private Keys&lt;/mtext&gt;&lt;/munder&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;In the verifying step, multiplying each side by &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑒&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h3 id=&quot;but-wait&quot;&gt;But wait!&lt;/h3&gt;
&lt;p&gt;At no point in this procedure, we ever check if the nonces or the public keys provided are honest. What if Charlie provided a malicious key &lt;math&gt;&lt;msubsup&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;/math&gt; in the sharing step ? Because everyone doesn’t send their public key at the exact same time, Carol could wait for everyone to send theirs, and compute:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msubsup&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;The aggregated key will look like:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mo&gt;∗&lt;/mo&gt;&lt;/msubsup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Carol just wiped everyone else from the signing key, and is now in full control of the signature. How can we prevent that ?&lt;/p&gt;
&lt;h3 id=&quot;multi-signatures-dont-trust-verify&quot;&gt;Multi-Signatures, don’t trust, verify&lt;/h3&gt;
&lt;p&gt;The most common way to prevent this is to force everyone to provide a proof that their public key is honest. This is done by providing a Proof of Knowledge for the private key, proving that they know the private key associated to the public key they provided.&lt;/p&gt;
&lt;p&gt;Let’s take the case of a prover Patricia and a verifier Victor. Patricia wants to prove that she knows the private key &lt;math&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt; associated to the public key &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;. The proof is done in four steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Patricia samples &lt;math&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; at random and sends &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; to Victor.&lt;/li&gt;
&lt;li&gt;Victor sends a challenge &lt;math&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; to Patricia.&lt;/li&gt;
&lt;li&gt;Patricia computes &lt;math&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt; and sends it to Victor.&lt;/li&gt;
&lt;li&gt;Victor verifies that &lt;math&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This works because:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑟&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;But what if Patricia doesn’t know the associated private key but still wants to prove that her key is honest ? Remember commitment schemes ? We can use them here. In our case, every participant will commit to their public key before disclosing it. Think of it as putting your public key in a box, sealing it and waiting for everyone to do the same before opening it. Let’s get back to our group &lt;math&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑐&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Each participant &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/math&gt; hashes their public key &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and sends &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; to everyone.&lt;/li&gt;
&lt;li&gt;Once everyone has sent their hash, they disclose their public key &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;li&gt;Everyone verifies that the hash they received matches the public key.&lt;/li&gt;
&lt;li&gt;The signing process continues as usual.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This way, everyone can be sure that the public keys are honest and that no one is trying to pull a fast one.&lt;/p&gt;
&lt;h3 id=&quot;theres-more&quot;&gt;There’s more!&lt;/h3&gt;
&lt;p&gt;Random nonces are also aggregated, and at no point we are verifying that they are authentic. The exploit method is a bit trickier, I recommend you to read &lt;a href=&quot;https://conduition.io/cryptography/wagner/&quot;&gt;this article&lt;/a&gt; by conduition on the subject if you want to know the details.&lt;/p&gt;
&lt;h2 id=&quot;references-and-suggested-readings&quot;&gt;References and Suggested readings&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Practical Cryptography for Developers - Digital Signatures&lt;/strong&gt;&lt;br&gt;
Svetlin Nakov&lt;br&gt;
&lt;a href=&quot;https://cryptobook.nakov.com/digital-signatures&quot;&gt;cryptobook.nakov.com&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A Dive Into the Math Behind Bitcoin Schnorr Signatures&lt;/strong&gt;&lt;br&gt;
&lt;a href=&quot;https://conduition.io/cryptography/schnorr/&quot;&gt;conduition.io&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Wagner’s Birthday Attack - How to Break InsecureMuSig&lt;/strong&gt;&lt;br&gt;
&lt;a href=&quot;https://conduition.io/cryptography/wagner/&quot;&gt;conduition.io&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;How to Prove Schnorr Assuming Schnorr: Security of Multi- and Threshold Signatures&lt;/strong&gt;&lt;br&gt;
Elizabeth Crites, Chelsea Komlo, and Mary Maller&lt;br&gt;
&lt;a href=&quot;https://eprint.iacr.org/2021/1375.pdf&quot;&gt;eprint.iacr.org&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Shamir Secret Sharing in a Nutshell</title>
    <id>https://petal.cafe/posts/shamir/</id>
    <link href="https://petal.cafe/posts/shamir/"/>
    <published>2024-11-29T00:00:00.000Z</published>
    <updated>2024-11-29T00:00:00.000Z</updated>
    <category term="crypto"/>
    <summary>How to split a secret among multiple persons, so that only any subset of n people can recover it ?</summary>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;[!NOTE]
I am not a cryptographer, nor a mathematician. This article is the result of my own research and understanding of the subject. If you find any mistakes, &lt;a href=&quot;mailto:hi@petal.cafe&quot;&gt;please let me know&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;The vast majority of what is written here is taken from various sources, which are listed at the &lt;a href=&quot;#references-and-suggested-readings&quot;&gt;end of this article&lt;/a&gt;. I highly recommend you to read them if you want to dive deeper into the subject.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The main idea behind Shamir Secret Sharing (SSS) is to split a secret &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt; into &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt; parts, such that any &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt; parts can be used to reconstruct the secret, but any &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; parts are not enough to do so, and do not give any information about the secret.&lt;/p&gt;
&lt;h3 id=&quot;splitting-the-secret&quot;&gt;Splitting the Secret&lt;/h3&gt;
&lt;p&gt;Let’s take the following example: we want to split the secret &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;42&lt;/mn&gt;&lt;/math&gt; into &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/math&gt; parts, such that any &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/math&gt; parts can be used to reconstruct the secret. It is supposed we are working in a finite field &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝔽&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; for the entirety of this post.&lt;/p&gt;
&lt;details&gt;
&lt;summary&gt;What the hell is &lt;span&gt;
&lt;p&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝔽&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/span&gt;?&lt;/summary&gt;&lt;/p&gt;
&lt;p&gt;A finite field &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝔽&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; where &lt;math&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/msup&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝒫︀&lt;/mi&gt;&lt;/math&gt; (&lt;math&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/math&gt; is a prime power), is a finite set of elements, on which we can apply our usual additions and multiplications.&lt;/p&gt;
&lt;p&gt;The most common finite field is the set of integers modulo &lt;math&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/math&gt;, &lt;math&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;/&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;, where all computations are taken &lt;math&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0.16666666666666666em&quot;&gt;mod&lt;/mo&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/math&gt;, which means that we have:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;ℤ&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;In the case of an &lt;a href=&quot;https://petal.cafe/posts/elliptic-curve&quot;&gt;elliptic curve&lt;/a&gt;, &lt;math&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/math&gt; is our curve’s order.&lt;/small&gt;&lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;The first step is to sample a random polynomial &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt; of degree &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; such that &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;. This gives us the property &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;42&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Our splits, also called shares, are in fact just points of our polynomial. We can generate them by evaluating &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; for &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;. Do &lt;strong&gt;not&lt;/strong&gt; evaluate for &lt;math&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/math&gt; as this would obviously just give away the secret.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;42&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;50&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;42&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;12&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;64&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;42&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;15&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;27&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;84&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;42&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;20&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;48&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;110&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;42&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;25&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;75&lt;/mn&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mn&gt;142&lt;/mn&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Thus, our shares are &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;50&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;64&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;84&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;110&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;142&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;Let’s now plot the polynomial &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/shamir/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;reconstructing-the-secret&quot;&gt;Reconstructing the Secret&lt;/h3&gt;
&lt;p&gt;We know that &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; points &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/math&gt; will suffice to construct the polynonial &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; of degree &lt;math&gt;&lt;mi&gt;𝑛&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;In our case, &lt;math&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;deg&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;, so we need &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt; points to restore &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, just as described in the beginning.&lt;/p&gt;
&lt;p&gt;Based on the shares we generated earlier, let’s take &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;50&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;84&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;142&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; (our recovery group &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;) to reconstruct the polynomial &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; using Lagrange interpolation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!TIP]
If you’re curious about Lagrange interpolation, I have written a &lt;a href=&quot;https://petal.cafe/posts/lagrange&quot;&gt;quick explaination&lt;/a&gt; for you to read.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mover&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mrow&gt;&lt;munder style=&quot;math-shift: normal&quot;&gt;&lt;mo lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac style=&quot;math-shift: normal&quot;&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;mo&gt;⏞&lt;/mo&gt;&lt;/mover&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mover&gt;&lt;/math&gt;&lt;/div&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;50&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;84&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;142&lt;/mn&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;25&lt;/mn&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/mfrac&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;71&lt;/mn&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/mfrac&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;21&lt;/mn&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;42&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;It’s even cooler when represented graphically:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/shamir/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;commitments-proofs-and-verifications&quot;&gt;Commitments, Proofs and Verifications&lt;/h3&gt;
&lt;p&gt;In a perfect world where everyone is honest and where there are no transmission errors caused by cosmic rays, we could just send the shares to the participants and call it a day. But guess what? &lt;a href=&quot;https://en.wikipedia.org/wiki/Murphy%27s_law&quot;&gt;Sh*t happens&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We need a way to check that the share we receive as a shareholder after the secret has been split is actually a valid one. You could gather with other bearers and collectively verify if the recovered secret is correct, but that is just too much hassle for such a simple task.&lt;/p&gt;
&lt;p&gt;Instead, let’s take advantage of the properties of elliptic curves to create a commitment scheme. After we have generated our polynomial &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, we can take each coefficient &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and multiply it by the generator point &lt;math&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; of the curve. This gives us a few values &lt;math&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; that we can send to the shareholders.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!TIP]
If you are not familiar with basic elliptic curve stuff, I recommend that you read &lt;a href=&quot;https://petal.cafe/posts/elliptic-curve&quot;&gt;my post&lt;/a&gt; on the subject or the &lt;a href=&quot;#references-and-suggested-readings&quot;&gt;references&lt;/a&gt; listed at the end of this article.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When a shareholder wants to verify their share &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, they can check with the following equation:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;You could see this procedure as computing the “public keys” of the coefficients. This method is also called “Feldman’s Verifiable Secret Sharing”.&lt;/p&gt;
&lt;p&gt;One may argue that disclosing &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; could give information about the polynomial, but if we suppose that &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt; is an EC secret key, the public key &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; is supposed public and may be shared. Finding &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;/math&gt; with &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; comes down to solving the discrete logarithm problem, which is supposed really hard here.&lt;/p&gt;
&lt;h4 id=&quot;verifying-that--is-a-private-key&quot;&gt;Verifying that &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; is a private key&lt;/h4&gt;
&lt;p&gt;We know some public key &lt;math&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; and we want to verify that the secret being shared is actually the private key &lt;math&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt;. This can be done by first checking if the commitments &lt;math&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; are valid, and then verifying that &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot;&gt;∧&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mtable class=&quot;cases&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mspace width=&quot;0.1667em&quot;/&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo separator=&quot;true&quot;&gt;?&lt;/mo&gt;&lt;/mover&gt;&lt;msubsup&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msubsup&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mspace width=&quot;0.1667em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;⟺&lt;/mo&gt;&lt;mtext&gt;The secret is&lt;/mtext&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑝&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h4 id=&quot;pedersens-verifiable-secret-sharing-pvss&quot;&gt;Pedersen’s Verifiable Secret Sharing (PVSS)&lt;/h4&gt;
&lt;p&gt;Another way the dealer could commit to the polynomial he generated without directly sharing &lt;math&gt;&lt;mi&gt;𝑠&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;, is to add a so-called “blinding polynomial”, a pretty common concept in cryptography.&lt;/p&gt;
&lt;p&gt;Let’s now instead take &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;/math&gt; where &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; comes from a randomly generated polynomial &lt;math&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;, our blinding polynomial. &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mo&gt;≠&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; is just another generator point on the curve. The dealer will now needs to distribute slightly different shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;Shareholders may now verify their shares with:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;This second method is known as &lt;strong&gt;“Pedersen’s Verifiable Secret Sharing”&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&quot;bob-just-got-hit-by-a-bus-what-now&quot;&gt;Bob just got hit by a bus, what now?&lt;/h3&gt;
&lt;p&gt;Our good old friend disappeared along with his share, and now other bearers are scared of losing too many shares until they can’t recover the secret. They could reiterate the dealing procedure by all sending their shares to a single person which then redistributes the new ones. However this is not feasible in the case where everyone distrusts each other. We need a multi-computational way of re-issuing a new share without someone ever recovering the secret.&lt;/p&gt;
&lt;p&gt;We will need &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt; shareholders, denoted &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; to re-issue a new share &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑍&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;Each shareholder begins by computing their Lagrange multiplier:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;After multiplying with their share &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, they randomly split it into &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt; so-called Lagrange-parts &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt; in order to distribute them to other bearers &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;The exchange matrix &lt;math&gt;&lt;mi&gt;𝐸&lt;/mi&gt;&lt;/math&gt; can be represented as:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝐸&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;×&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mtable&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋱&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋮&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mi&gt;⋯&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Where the &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/math&gt;&lt;sup&gt;th&lt;/sup&gt; row corresponds to the Lagrange-parts that the shareholder &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/math&gt; will &lt;strong&gt;send&lt;/strong&gt; and the &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/math&gt;&lt;sup&gt;th&lt;/sup&gt; column to the Lagrange-parts the shareholder &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/math&gt; will &lt;strong&gt;receive&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Each shareholder &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/math&gt; computes the partial-share:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;Where &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt; is the &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/math&gt;&lt;sup&gt;th&lt;/sup&gt; Lagrange-part of &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/math&gt;. They respectively send &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; to the new bearer &lt;math&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/math&gt;, which finally computes his share:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;This can be rewritten as:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝜎&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜕&lt;/mi&gt;&lt;mrow&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;h3 id=&quot;inception&quot;&gt;Inception&lt;/h3&gt;
&lt;p&gt;Another angle to tackle this problem from is to re-use Secret Sharing &lt;em&gt;inside&lt;/em&gt; our Secret Sharing scheme (Inception, anyone?).&lt;/p&gt;
&lt;p&gt;Let’s say we have our recovery group &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt;, our new shareholders &lt;math&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/math&gt; and &lt;math&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;∪&lt;/mo&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/math&gt; for convenience.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Each shareholder &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; generates a random polynomial &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; of degree &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;li&gt;They each compute the auxiliary shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; for &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;li&gt;Every shareholder &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt; receives the auxiliary shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt; from the recovery group.&lt;/li&gt;
&lt;li&gt;Each shareholder &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; computes the aggregated share &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt; and shares it to everyone in &lt;math&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;li&gt;Each future bearer &lt;math&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/math&gt; can interpolate the polynomial &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; from the shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; and compute their share
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let’s take a look at the math:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;But wait! We just learnt how to implement a secure, verifiable secret sharing scheme and we aren’t even using it!&lt;/p&gt;
&lt;h3 id=&quot;verifiable-inception&quot;&gt;Verifiable Inception&lt;/h3&gt;
&lt;p&gt;Let’s review the protocol, this time including relevant checks to ensure the data we’re receiving is genuine. We assume the original dealer was a good guy and already used Feldman’s VSS, providing the commitments &lt;math&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; for the OG polynomial &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt; to everyone.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Each shareholder &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; generates a random polynomial &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt; of degree &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;li&gt;They also compute and share for &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; to see their commitments:
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Γ&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝜓&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜓&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜓&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝜓&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;They each compute the auxiliary shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; for &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt;, and shares them &lt;strong&gt;once they have received all other &lt;math&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Γ&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Every shareholder &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt; receives the auxiliary shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt; from &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; and checks whether they match &lt;math&gt;&lt;msub&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Γ&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝜓&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msup&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Before computing anything else, each shareholder &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; commits to the upcoming &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; polynomial and sends it to &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝐴&lt;/mi&gt;&lt;/math&gt;:
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝑇&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝜓&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Each shareholder &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; computes the aggregated share &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;li&gt;Each inductee &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/math&gt; first waits to receive all &lt;math&gt;&lt;mi&gt;𝑇&lt;/mi&gt;&lt;/math&gt;, checks that they are the same from everyone, and then receives &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt;.&lt;/li&gt;
&lt;li&gt;Each future shareholder &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/math&gt; checks whether each given &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; is genuine:
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝜃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msup&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝜓&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msup&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msup&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;munderover&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Each future bearer &lt;math&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/math&gt; can interpolate the polynomial &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; from the shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and compute their share
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑑&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;single-share-issuing&quot;&gt;Single share issuing&lt;/h3&gt;
&lt;p&gt;In the case where we only want to issue a single share, &lt;a href=&quot;https://conduition.io/cryptography/shamir/#Issuing-a-New-Share&quot;&gt;conduition&lt;/a&gt; proposed a clever way to remove the subtracting step at the end by adding a root at &lt;math&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;𝑁&lt;/mi&gt;&lt;/math&gt; to the blinding polynomial. This way, we have:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt; &lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;←&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝔽&lt;/mi&gt;&lt;mi&gt;𝑞&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;[&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;]&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;When interpolating &lt;math&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, the blinding polynomials &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/math&gt; cancel out and we directly get &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mtable class=&quot;multiline-equation aligned&quot;&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;mi&gt;𝐻&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑢&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;munder&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∏&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;munder&gt;&lt;munder accentunder=&quot;true&quot;&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mo lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;mo&gt;⏟&lt;/mo&gt;&lt;/munder&gt;&lt;mrow&gt;&lt;mo form=&quot;infix&quot; lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;/mtd&gt;&lt;mtd&gt;&lt;mo form=&quot;infix&quot;&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;/msub&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;Note that we could try to add multiple roots: &lt;math&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;ℓ&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;, but then all the new shareholders would have access to the new shares.&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;You could also apply the same verifying scheme as before to this method.&lt;/p&gt;
&lt;h3 id=&quot;we-have-a-problem&quot;&gt;We have a problem&lt;/h3&gt;
&lt;p&gt;When recovering the secret, we need to trust a single recoverer to do so and all send him all of our shares. But what if we all wanted to recover the secret at the same time?&lt;/p&gt;
&lt;p&gt;One may naively try to implement a simple broadcast or pairwise exchange protocol, but if a single malicious actor &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; wanted to prevent the others from also recovering the secret, he could just wait for everyone to send their share, and never send his. He will have all the shares needed, while the others can’t do anything.&lt;/p&gt;
&lt;p&gt;If everyone distrusts each other, we will have this strange situation where no one wants to send their share first. One may prove that they own a valid share with a Zero-Knowledge Proof (ZKP), but will never be able to prove that he’s actually going to send it to the others.&lt;/p&gt;
&lt;p&gt;One “solution” to this problem (not the best though) is to set a pre-defined order in which shareholders need to reveal their shares, after which it is verified each time by the others. If the share is invalid or the bearer fails to send it within a given time, the others can post a complaint against this user and abort the process.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!WARNING]
All the methods I describe below are purely experimental, and I have no idea if they are actually secure or not. If you have any feedback, please &lt;a href=&quot;mailto:hi@petal.cafe&quot;&gt;let me know&lt;/a&gt;!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;commitments-based-ordering&quot;&gt;Commitments-based ordering&lt;/h4&gt;
&lt;p&gt;After each shareholder has shared his commitment &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; and it has been verified by everyone else, the order of reveal is defined by the value of each commitment. Let’s recall our commitments for &lt;math&gt;&lt;mi&gt;𝑓&lt;/mi&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/math&gt;:&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;mi&gt;𝐶&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;…&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑎&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;One cannot manipulate the value of &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; as it is verifiable by the others with&lt;/p&gt;
&lt;div class=&quot;math-display&quot;&gt;&lt;math display=&quot;block&quot;&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munderover&gt;&lt;mo form=&quot;prefix&quot; lspace=&quot;0em&quot;&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/munderover&gt;&lt;msub&gt;&lt;mi&gt;𝜙&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/div&gt;
&lt;p&gt;The probability of a malicious actor being placed last in the queue and thus fool everyone is &lt;math&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/mfrac&gt;&lt;/math&gt; for &lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt; recoverers if we suppose that &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo lspace=&quot;0.2222222222222222em&quot; rspace=&quot;0.2222222222222222em&quot;&gt;⋅&lt;/mo&gt;&lt;mi&gt;𝐺&lt;/mi&gt;&lt;/math&gt; is pseudorandom. Not that good.&lt;/p&gt;
&lt;h4 id=&quot;incremental-recovery&quot;&gt;Incremental recovery&lt;/h4&gt;
&lt;p&gt;Let’s instead require each bearer to &lt;strong&gt;first&lt;/strong&gt; send their share to everyone placed before them in the pre-defined order.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A figure is shown on &lt;a href=&quot;https://petal.cafe/posts/shamir/&quot;&gt;the site&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We have a single shared state &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; that needs to be kept up-to-date for everyone at each round. This is to keep track of who has and who hasn’t sent their share yet. The state &lt;math&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/math&gt; consisting of every sent share does not need to be shared as everyone can keep track of the broadcasts to &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; received.&lt;/p&gt;
&lt;p&gt;This way, a single malicious shareholder cannot dupe the rest of the group. But what if &lt;strong&gt;two&lt;/strong&gt; malicious actors &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;/msub&gt;&lt;/math&gt; tried hijacking the recovery ?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; initiates &lt;math&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; sends &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; to &lt;math&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt;, and gets accepted: &lt;math&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑦&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt; &lt;/mi&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; joins normally as well, he gets access to &lt;math&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; joins, and so on for other &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;&lt;/li&gt;
&lt;li&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;/msub&gt;&lt;/math&gt; only sends his share to &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;, which sends him &lt;math&gt;&lt;mi&gt;𝑆&lt;/mi&gt;&lt;/math&gt; back (or not)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this case, &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; (and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;/msub&gt;&lt;/math&gt;) are the only ones able to recover the secret. This isn’t of any good either…&lt;/p&gt;
&lt;h4 id=&quot;inception-again&quot;&gt;Inception, again&lt;/h4&gt;
&lt;p&gt;To prevent a single actor from hijacking the recovery, we will leverage once again an Inception-like scheme. Here, our new scheme will be &lt;math&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/math&gt;-out-of-&lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;Each shareholder &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; generates a random polynomial &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt; of degree &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt;, where &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; is their respective share.&lt;/p&gt;
&lt;p&gt;The commitment and sharing phase of &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; continues as usual, and before recovering the secret, two shareholders &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;/msub&gt;&lt;/math&gt; are chosen to reveal their shares. This way, when &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; broadcasts his shares &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt;, everyone is instantly able to recover the secret.&lt;/p&gt;
&lt;p&gt;The last step is to verify that &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;mo&gt;′&lt;/mo&gt;&lt;/msup&gt;&lt;/msub&gt;&lt;/math&gt; also sends his shares to &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;. If he does not, every other shareholder can post a complaint against him and optionally send his shares to &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mi&gt;𝑚&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt;, who can then recover the secret.&lt;/p&gt;
&lt;p&gt;We now have a pretty good guarantee that the secret will be recovered by everyone, except if that very person was being explicitly targeted by the whole recovery group (&lt;math&gt;&lt;mi&gt;𝑘&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/math&gt; people). Please also note that this method doesn’t work really well with a small number of shareholders, e.g. 3:&lt;/p&gt;
&lt;p&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; are chosen to reveal their intermediate shares, but &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; are malicious.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Each shareholder &lt;math&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;mo&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt; splits his share &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;/math&gt; into &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑧&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;𝑏&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo rspace=&quot;0em&quot;&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mi&gt;𝑥&lt;/mi&gt;&lt;/math&gt; and sends &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑔&lt;/mi&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mo lspace=&quot;0em&quot; rspace=&quot;0em&quot;&gt;|&lt;/mo&gt;&lt;mspace width=&quot;0.2222em&quot;/&gt;&lt;mi&gt;𝑖&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;𝑗&lt;/mi&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi&gt;𝑅&lt;/mi&gt;&lt;/math&gt; to everyone.&lt;/li&gt;
&lt;li&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; reveals his shares as expected, but &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; do not.&lt;/li&gt;
&lt;li&gt;&lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; are the only ones able to recover the secret, and &lt;math&gt;&lt;msub&gt;&lt;mi&gt;𝑃&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/math&gt; is left out.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;references-and-suggested-readings&quot;&gt;References and Suggested readings&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Issuing New Shamir Secret Shares Using Multi-Party Computation&lt;/strong&gt;
&lt;a href=&quot;https://conduition.io/cryptography/shamir/&quot;&gt;conduition.io&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Novel Secret Sharing and Commitment Schemes for Cryptographic Applications&lt;/strong&gt;
Mehrdad Nojoumian
&lt;a href=&quot;https://dspacemainprd01.lib.uwaterloo.ca/server/api/core/bitstreams/e180c165-7b6c-4cfc-bc5c-62dc5af674d2/content&quot;&gt;dspacemainprd01.lib.uwaterloo.ca&lt;/a&gt; &lt;small&gt;[PDF]&lt;/small&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A Share-Correctable Protocol for the Shamir Threshold Scheme and Its Application to Participant Enrollment&lt;/strong&gt;
Raylin Tso, Ying Miao, Takeshi Okamoto and Eiji Okamoto
&lt;a href=&quot;https://citeseerx.ist.psu.edu/document?repid=rep1&amp;amp;type=pdf&amp;amp;doi=634526d46b7c52c62582d7c6c32b79502bd631d3&quot;&gt;citeseerx.ist.psu.edu&lt;/a&gt; &lt;small&gt;[PDF]&lt;/small&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Feldman’s Verifiable Secret Sharing for a Dishonest Majority&lt;/strong&gt;
Yi-Hsiu Chen and Yehuda Lindell
&lt;a href=&quot;https://eprint.iacr.org/2024/031.pdf&quot;&gt;eprint.iacr.org&lt;/a&gt; &lt;small&gt;[PDF]&lt;/small&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Adaptively Secure Feldman VSS and Applications to Universally-Composable Threshold Cryptography&lt;/strong&gt;
Masayuki Abe and Serge Fehr
&lt;a href=&quot;https://eprint.iacr.org/2004/119.pdf&quot;&gt;eprint.iacr.org&lt;/a&gt; &lt;small&gt;[PDF]&lt;/small&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Oh, so you want to work at Traefik?</title>
    <id>https://petal.cafe/posts/traefik/</id>
    <link href="https://petal.cafe/posts/traefik/"/>
    <published>2024-11-12T00:00:00.000Z</published>
    <updated>2024-11-12T00:00:00.000Z</updated>
    <category term="ctf"/>
    <summary>A pretty unusual way to apply for a developer job at Traefik...</summary>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;[!WARNING]
If you are using this article to solve the challenge, please make sure to not just copy-paste the commands, but to understand what they do.&lt;/p&gt;
&lt;p&gt;My goal is to allow you to learn something new, not to give you the solution on a silver platter &lt;span class=&quot;sr-only&quot;&gt;wink&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot;&gt;(・ω &amp;lt;)&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;When looking for an alternative to &lt;a href=&quot;https://www.haproxy.org/&quot;&gt;HAProxy&lt;/a&gt; or &lt;a href=&quot;https://www.nginx.com/&quot;&gt;Nginx&lt;/a&gt;,
I came across &lt;a href=&quot;https://traefik.io/&quot;&gt;Traefik&lt;/a&gt;, a modern HTTP reverse proxy and load balancer made to deploy microservices with ease,
even featuring &lt;a href=&quot;https://kubernetes.io/&quot;&gt;Kubernetes&lt;/a&gt; Ingress support, or &lt;a href=&quot;https://letsencrypt.org/&quot;&gt;Let’s Encrypt&lt;/a&gt; integration.&lt;/p&gt;
&lt;p&gt;By digging a little more on their website, I found a &lt;a href=&quot;https://traefik.io/careers/developers-systems-engineers&quot;&gt;developer job application form&lt;/a&gt;.
I was surprised to see that there was no traditional CV to send, but a docker command to run.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;../../assets/posts/traefik/traefik-docker.png&quot;&gt;&lt;img alt=&quot;Traefik docker command&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1200&quot; height=&quot;627&quot; src=&quot;https://petal.cafe/_astro/traefik-docker.Dy3hVEPB_ZEj7sR.webp&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-challenge&quot;&gt;The challenge&lt;/h2&gt;
&lt;p&gt;Spun up the image as requested, I was greeted with a nice error message:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;docker&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -it&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; traefik/jobs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Helmsman, where are you? (・・?)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I immediately thought of &lt;a href=&quot;https://helm.sh/&quot;&gt;Helm&lt;/a&gt;, the package manager for Kubernetes, so I went ahead and started a &lt;code&gt;minikube&lt;/code&gt; cluster.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;minikube&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; --kubernetes-version=v1.19&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; I used the &lt;code&gt;v1.19&lt;/code&gt; version of Kubernetes because it was the latest available at the time of the last update of the Docker image. (see the &lt;a href=&quot;https://www.knowledgehut.com/blog/devops/kubernetes-versions#different-versions-of-kubernetes&quot;&gt;version list&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And then started a pod with the image.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; traefik-jobs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -it&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; --image=traefik/jobs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; --restart=Never&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Still getting an error message, but this time it was different:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;It seems I do need more permissions... May I be promoted cluster-admin? (&amp;gt;人&amp;lt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Hmmmm, it seems Helmsman deployment has an issue ( ˘︹˘ )&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I was now sure that I was on the right track.&lt;/p&gt;
&lt;p&gt;The image was kindly asking us to give it more permissions, so I naturally gave it the &lt;code&gt;cluster-admin&lt;/code&gt; role.
(I know, I know, it’s not a good practice, but it’s just for a CTF, right?)&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;# service-account.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ServiceAccount&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; rbac.authorization.k8s.io/v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ClusterRoleBinding&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-jobs-admin&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;subjects&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;    -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ServiceAccount&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      namespace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; default&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;roleRef&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ClusterRole&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; cluster-admin&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    apiGroup&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; rbac.authorization.k8s.io&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Applying the created manifest.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; apply&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; service-account.yml&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We now have a service account with the &lt;code&gt;cluster-admin&lt;/code&gt; role, so let’s set it to the pod.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;# pod.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; apps/v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; Deployment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    labels&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;spec&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    selector&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        matchLabels&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    template&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            labels&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        spec&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            serviceAccount&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            serviceAccountName&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            containers&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;                -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                  image&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik/jobs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; apply&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; pod.yml&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We have a pod running with the &lt;code&gt;cluster-admin&lt;/code&gt; role, so we should be able to take a look at the logs.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; logs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; deployments/jobs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Look at me by the 8888 ingress [⌐■-■]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Setting up an ingress on port &lt;code&gt;8888&lt;/code&gt; should do the trick.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;# ingress.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; Service&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;spec&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    selector&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    ports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;        -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; protocol&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; TCP&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;          port&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 8888&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;          targetPort&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 8888&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; networking.k8s.io/v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; Ingress&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;spec&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    rules&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;        -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; http&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;              paths&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;                  -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; path&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; /&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                    pathType&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; Prefix&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                    backend&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                        service&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                            name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                            port&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                                number&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 8888&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; apply&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; ingress.yml&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And restarting the pod.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; rollout&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; restart&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; deployment&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; jobs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The logs now say:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;You have set up your cluster in good taste (・ω&amp;lt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Now that you have set up an ingress... You should be able find me...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It should now be as simple as port-forwarding the ingress to our local machine.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; port-forward&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; deployments/jobs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; 8888:8888&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then, we can access the pod on &lt;a href=&quot;http://localhost:8888&quot;&gt;&lt;code&gt;localhost:8888&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Come on, use that damn ingress please (°▽°;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I see what you did there, Traefik.&lt;/p&gt;
&lt;p&gt;As Traefik provides an ingress controller for Kubernetes, I think it’s safe to assume that they want us to use it.&lt;/p&gt;
&lt;p&gt;Well, well, well… Let’s create a Traefik Proxy. I followed the &lt;a href=&quot;https://doc.traefik.io/traefik/getting-started/quick-start-with-kubernetes/&quot;&gt;quick-start guide&lt;/a&gt; from the documentation.&lt;/p&gt;
&lt;p&gt;Various resources are created:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;# traefik/00-role.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ClusterRole&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; rbac.authorization.k8s.io/v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-role&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;rules&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;    -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; apiGroups&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      resources&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; services&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; endpoints&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; secrets&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      verbs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; get&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; list&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; watch&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;    -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; apiGroups&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; extensions&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; networking.k8s.io&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      resources&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ingresses&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ingressclasses&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      verbs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; get&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; list&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; watch&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;    -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; apiGroups&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; extensions&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; networking.k8s.io&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      resources&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ingresses/status&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      verbs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;          -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; update&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;# traefik/00-account.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ServiceAccount&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-account&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;# traefik/01-role-binding.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ClusterRoleBinding&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; rbac.authorization.k8s.io/v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-role-binding&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;roleRef&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    apiGroup&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; rbac.authorization.k8s.io&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ClusterRole&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-role&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;subjects&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;    -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; ServiceAccount&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-account&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;      namespace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; default&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Traefik deployment itself:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;# traefik/02-traefik.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; Deployment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; apps/v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-deployment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    labels&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;spec&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    replicas&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    selector&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        matchLabels&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    template&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            labels&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        spec&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            serviceAccountName&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-account&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;            containers&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;                -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                  image&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik:v2.10&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                  args&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;                      -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; --api.insecure&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;                      -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; --providers.kubernetesingress&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                  ports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;                      -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; web&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                        containerPort&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 80&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;                      -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; dashboard&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;                        containerPort&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 8080&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And finally, the service:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;# traefik/02-traefik-services.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; Service&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-dashboard-service&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;spec&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; LoadBalancer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    ports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;        -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; port&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 8080&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;          targetPort&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; dashboard&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    selector&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;apiVersion&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;kind&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; Service&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik-web-service&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;spec&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; LoadBalancer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    ports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#35A77C;--shiki-dark:#83C092&quot;&gt;        -&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; targetPort&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; web&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;          port&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 80&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;    selector&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;        app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; traefik&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Applying the manifests.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; apply&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; 00-role.yml&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;              -f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; 00-account.yml&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;              -f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; 01-role-binding.yml&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;              -f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; 02-traefik.yml&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;              -f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; 02-traefik-services.yml&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We now have a Traefik proxy running on our cluster, and as Traefik relies on ingress resources, our pod should be directly accessible via the proxy.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; port-forward&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; deployments/traefik-deployment&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; 8080:8080&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The HTTP Service for our pod is effectively listed in the dashboard:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;../../assets/posts/traefik/traefik-dashboard.png&quot;&gt;&lt;img alt=&quot;Traefik dashboard&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;2024&quot; height=&quot;1171&quot; src=&quot;https://petal.cafe/_astro/traefik-dashboard.CU8dp8EF_ZJVf80.webp&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forwarding the proxy port to something fancy:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; port-forward&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; deployments/traefik-deployment&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; 1337:80&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Visiting &lt;a href=&quot;http://localhost:1337&quot;&gt;&lt;code&gt;localhost:1337&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;I have to tell you something...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Something that nobody should know.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;However, everyone could see it.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;It's even part of my public image.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Come back when you know more.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;But remember, it's a secret (ᵔᴥᵔ)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The message is a bit cryptic, but it seems that we have to find something in the image.&lt;/p&gt;
&lt;p&gt;Running &lt;code&gt;docker inspect&lt;/code&gt; on the image, we get a ton of information:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;docker&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; inspect&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; traefik/jobs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;sha256:...&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;RepoTags&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;traefik/jobs:latest&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Comment&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;buildkit.dockerfile.v0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Created&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;2020-10-22T13:50:23.922043068Z&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Config&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;        // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;        &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;WorkingDir&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;        &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Entrypoint&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;/start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;        &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Labels&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;            &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;helmsman&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;dcc9c530767c102764d45d621fc92317&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;    }&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Architecture&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;amd64&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Os&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;linux&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;Size&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 27754496&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;VirtualSize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DF69BA;--shiki-dark:#D699B6&quot;&gt; 27754496&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-light-font-style:italic;--shiki-dark:#859289;--shiki-dark-font-style:italic&quot;&gt;    // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And look at that, there is a &lt;code&gt;helmsman&lt;/code&gt; label with a value.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;Labels&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;    &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt;helmsman&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;dcc9c530767c102764d45d621fc92317&lt;/span&gt;&lt;span style=&quot;--shiki-light:#939F91;--shiki-dark:#859289&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#5C6A72;--shiki-dark:#D3C6AA&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This looked juicy, so I first tried to decode the value as hex, but the output was… weird.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; dcc9c530767c102764d45d621fc92317&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; xxd&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -p&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;���0v|'d�]b�#%&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Base64 wasn’t any better.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; dcc9c530767c102764d45d621fc92317&lt;/span&gt;&lt;span style=&quot;--shiki-light:#F57D26;--shiki-dark:#E69875&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt; base64&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; -d&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;u�=s�����M��x�޶��=�}{%&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Sorry, I don’t speak Minecraft enchantment table…&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I then remembered the end of the message:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;But remember, it’s a secret &lt;span class=&quot;sr-only&quot;&gt;shushing&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot;&gt;(ᵔᴥᵔ)&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It is &lt;em&gt;just&lt;/em&gt; a secret, so there is no need to decode it, we just have to set it as some kind of header or maybe an environment variable.
Setting various headers on the HTTP requests didn’t do anything, so I looked up on the Internet how to set env. variables on containers.
After a few minutes, I was feeling that I was going nowhere, so I continued looking for other ways to provide the secret to the pod.&lt;/p&gt;
&lt;p&gt;And guess what, the answer was simply to literally set the secret as… a secret.&lt;/p&gt;
&lt;p&gt;This can be done with the &lt;code&gt;kubectl create secret&lt;/code&gt; command.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes everforest-light everforest-dark&quot; style=&quot;--shiki-light:#5c6a72;--shiki-dark:#d3c6aa;--shiki-light-bg:#fdf6e3;--shiki-dark-bg:#2d353b; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#8DA101;--shiki-dark:#A7C080&quot;&gt;kubectl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; secret&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; generic&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; helmsman&lt;/span&gt;&lt;span style=&quot;--shiki-light:#DFA000;--shiki-dark:#DBBC7F&quot;&gt; --from-literal=helmsman=dcc9c530767c102764d45d621fc92317&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Restarting the pod, port-forwarding the proxy, and visiting &lt;a href=&quot;http://localhost:1337&quot;&gt;&lt;code&gt;localhost:1337&lt;/code&gt;&lt;/a&gt; again, we now get a nice form to fill and submit.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;../../assets/posts/traefik/traefik-form.png&quot;&gt;&lt;img alt=&quot;Traefik form&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1354&quot; height=&quot;1080&quot; src=&quot;https://petal.cafe/_astro/traefik-form.Dzyou21m_Z1o5T6S.webp&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;This was a fun challenge, and I learned a lot about Kubernetes and Traefik in the process.
I hope you enjoyed reading this article as much as I enjoyed solving this CTF &lt;span class=&quot;sr-only&quot;&gt;grinning&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot;&gt;(＾▽＾)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In the end, I learned how to use Traefik, which proved to be an amazing alternative to Apache or Nginx.
It’s really easy to set up, and the fact that it can automatically discover services and create routes for them is really cool.
I am definitely going to use this in future projects.&lt;/p&gt;
</content>
  </entry>
</feed>
