<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohitejaikumar on Medium]]></title>
        <description><![CDATA[Stories by Mohitejaikumar on Medium]]></description>
        <link>https://medium.com/@mohitejaikumar?source=rss-43f738ba3c1d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*s7_zyhH5ZHTlkEfD</url>
            <title>Stories by Mohitejaikumar on Medium</title>
            <link>https://medium.com/@mohitejaikumar?source=rss-43f738ba3c1d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 20:48:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohitejaikumar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MuSig2 and Multi-Party Computation]]></title>
            <link>https://medium.com/@mohitejaikumar/musig2-and-multi-party-computation-3205415b15b1?source=rss-43f738ba3c1d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3205415b15b1</guid>
            <category><![CDATA[threshold-signature]]></category>
            <category><![CDATA[multi-party-computation]]></category>
            <dc:creator><![CDATA[Mohitejaikumar]]></dc:creator>
            <pubDate>Mon, 11 Aug 2025 18:27:33 GMT</pubDate>
            <atom:updated>2025-08-11T18:27:33.051Z</atom:updated>
            <content:encoded><![CDATA[<p>Multi-signature cryptography is one of the most exciting advances in securing digital transactions and collaborative decision-making. Among the various schemes, <strong>MuSig2</strong> has emerged as a game-changing protocol, compact, efficient, and highly secure under <strong><em>concurrent signing</em></strong> sessions, making it ideal for cryptocurrencies like Solana.</p><p>But before we dive into MuSig2, we need to <strong>build up the maths</strong> step-by-step. If you’re new to cryptography, don’t worry — I’ll break it down in plain language, with worked examples.</p><h3><strong>The Math Foundation: Modular Arithmetic &amp; Groups</strong></h3><p>Before you can understand Schnorr signatures (and thus MuSig2), you need the basic tools: <strong>modular arithmetic</strong>, <strong>groups</strong>, and <strong>exponentiation in groups</strong>.</p><h3>1.1 Modular Arithmetic</h3><p>When we write:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/76/1*GfKXMyznpvYqP1js09v4yQ.png" /></figure><p>we mean “the remainder when <strong><em>a</em></strong> is divided by <strong><em>p</em></strong>”.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/1*EKc0GT_54ds3tcUqU6VEaA.png" /></figure><p>In cryptography, we usually pick a very large <strong>prime modulus</strong> <strong><em>p</em></strong> (think hundreds of digits long).</p><h3>1.2 Cyclic Groups</h3><p>A <strong>group</strong> is a set of numbers with an operation (like multiplication) that satisfies:</p><ol><li><strong>Closure</strong> — multiplying two group elements gives another group element.</li><li><strong>Identity</strong> — there’s a “do nothing” element (e.g., 1 in multiplication).</li><li><strong>Inverses</strong> — for every number, there’s another that “undoes” it.</li><li><strong>Associativity</strong> — the way you group operations doesn’t matter.</li></ol><p>A <strong>cyclic group</strong> is one where you can generate every element by repeatedly applying the operation to a single element (called a <strong>generator</strong>, <strong>g</strong>).</p><p>Example (mod 7):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/125/1*KdXmYefU--fO4ny55KiANg.png" /></figure><h3>1.3 Discrete Logarithm Problem (DLP)</h3><p>Given <strong><em>g</em></strong> and <strong><em>y = g^x</em></strong><strong> mod p</strong> finding <strong><em>x</em> </strong>is extremely hard if <strong><em>p</em></strong> is huge.<br> This hardness is the foundation of <strong>Schnorr signatures</strong> and <strong>MuSig2</strong>.</p><p>Example :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*jp0PKjoSn3KjucDy0esCtQ.png" /></figure><h3>2. From Math to Cryptography: Schnorr Signatures</h3><p>Schnorr signatures are like “<strong>mathematical proof stamps</strong>” that only someone with the <strong>private key</strong> can produce, but anyone with the <strong>public key</strong> can verify.</p><h3>2.1 Key Generation</h3><ol><li>Pick a random secret <strong>x</strong>(private key).</li><li>Compute <strong>X = g^x mod p</strong> (public key).</li></ol><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*wn-dIkVBZslWUsbAlls7GQ.png" /></figure><h3>2.2 Signing</h3><p>To sign a message <strong>m</strong>:</p><ol><li>Choose random nonce <strong>r</strong>.</li><li>Compute :-</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/124/1*m0pCwlKdzCg5qoPcOZtu_A.png" /></figure><p>3. Compute challenge:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/151/1*jXPnaBTNUxKyW-4BdoCEog.png" /></figure><p>where <strong><em>H</em></strong> is a hash function.</p><p>4. Compute signature part:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/186/1*Jvd2bKVMGzSMLwUCpdK10A.png" /></figure><p>5. Signature = <strong>(R,s)</strong></p><h3>2.3 Verification</h3><p>Verifier checks:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*NF0_AfvRwQQO5tICfvSShQ.png" /></figure><p>If it matches, signature is valid.</p><h3>3. From One to Many: Multi-Signatures</h3><p>Multi-signatures let <strong>multiple parties</strong> each with their own key pair sign <strong>the same message</strong> and produce <strong>one single compact signature</strong>.</p><h3>3.1 Why Multi-Signatures?</h3><ul><li><strong>Blockchain efficiency</strong> — store one signature instead of many.</li><li><strong>Privacy</strong> — looks like a single signature; hides the fact multiple people signed.</li><li><strong>Security</strong> — prevents a single point of failure.</li></ul><h3>3.2 Naive Approach (and Why It Fails)</h3><p>We start with nnn signers who each have:</p><p><strong>Secret key</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/20/1*dD3GqmYNujrtHQQlA-TjfQ.png" /></figure><p><strong>Public key</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/110/1*kCc6xLQzL3r_9pKwsD0sBA.png" /></figure><p>They all agree on the same message `<strong><em>m`</em></strong></p><p>The naive flow is :-</p><h3>3.2.1. Each signer picks a random nonce</h3><p>Each signer <strong><em>i</em></strong> chooses a fresh random nonce :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/70/1*Q7rh1hicKsXMj1ntyjtTgQ.png" /></figure><p>computes :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/144/1*ZeVNu3raVeN2JOOzBu0Cmw.png" /></figure><p>This <strong><em>Ri</em></strong>​ is like a “<strong>one-time public key</strong>” for that signing session.</p><h3>3.2.2. Aggregate all nonces</h3><p>They multiply them together:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*S-4e8TC0nU7xgbKHt2P36g.png" /></figure><h3>3.2.3. Aggregate all public keys</h3><p>They also multiply public keys:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*ZYLgIbqpetTTAviOECxmrQ.png" /></figure><h3>3.2.4. Compute a single challenge</h3><p>Everyone uses the same hash function:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*ye5yx6mTiv-2zxjhvsz_pg.png" /><figcaption><strong>H </strong>is hash function</figcaption></figure><h3>3.2.5. Each signer makes a partial signature</h3><p>Each signer computes:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*noW6VjiXMGtFLXx6B9JFFg.png" /></figure><p>This is just the <strong>Schnorr signature equation</strong> but done individually.</p><h3>3.2.6. Combine partial signatures</h3><p>They sum:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*gX4NXpBAPHAngo_r05Jhrw.png" /></figure><p>So,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*O-TpxI1nK1Vp3E_Oiir7dA.png" /></figure><h3>3.2.7. Verification</h3><p>A verifier checks:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/193/1*RJSmlFCoSj8qfHr2QYgETg.png" /></figure><p>If expanded:</p><p>Left :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*yUptZXdqNbz8gHh22x1AEQ.png" /></figure><p>Right:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*jwe2Ud2wV9NUoXMXWG8vQw.png" /></figure><p>So if everyone is honest, it works.</p><h3>Where It Breaks: Rogue-Key Attack</h3><p>The scheme assumes public keys are just given and can be multiplied directly.<br>But in practice, <strong>you don’t know if the public keys were chosen honestly</strong>.</p><h3>The malicious trick</h3><p>Suppose <strong>signer _1</strong> is malicious. They see all honest public keys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/221/1*rWozJUzPNELUMd7tSzx-hA.png" /></figure><p>They <strong>choose</strong> their public key as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*57MJbVHPIENW4VH-Fx1ptA.png" /></figure><p>Let’s compute the aggregated key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*vnZhtCuuM78HCxf94rIJzw.png" /></figure><p>Substitute <strong><em>X1 :-</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*UbwBwDeMg632fGhaEut7EQ.png" /></figure><p>Evaluates to :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/141/1*mq7uXH0Ku9ygcIuqBSU11Q.png" /></figure><p>Now the <strong>aggregate key is just the malicious signer’s key</strong>.</p><p>This means <strong><em>signer_1</em></strong> can produce a <strong>valid signature alone</strong> for <strong>any message</strong> without any help from others, because the multi-signature verification equation is now just a normal <strong>Schnorr</strong> verification for their single key.</p><h3>4. MuSig: Secure Aggregation</h3><p>MuSig fixes this by:</p><ul><li>Assigning <strong>unique weights</strong> to each participant’s public key via hashing.</li><li>Preventing <strong><em>rogue-key</em></strong> attacks without special proofs.</li><li>But requires <strong>three rounds of communication involving commitement scheme hash and reveal step .</strong></li></ul><h3>5. MuSig2: The Two-Round Breakthrough</h3><p>MuSig2 keeps MuSig’s security but:</p><ul><li>Reduces to <strong>two rounds</strong>.</li><li>Supports <strong>preprocessing</strong> (you can do the first round before even knowing the message).</li><li>Remains secure under <strong>concurrent signing sessions</strong>.</li></ul><h3>5.1 The Core Trick — Multiple Nonces</h3><p>Instead of one nonce per signer, MuSig2 uses:</p><ul><li><strong><em>ν ≥ 2</em></strong> nonces per signer (often 2 or 4).</li><li>Aggregates them with a scalar <strong><em>b</em></strong> derived from all <strong><em>signers’ nonces</em></strong> and the message.</li><li>This breaks known <strong><em>concurrent session attacks</em></strong>.</li></ul><h3>5.2 Workflow (n-of-n Signers)</h3><p>Round 1:</p><ol><li>Each signer generates <strong><em>v ≥ 2</em></strong> random nonces and computes</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/176/1*KBlWRN4AbiPptloE2QbNdw.png" /></figure><p>2. Share <strong><em>Ri,j​</em></strong> with others .</p><p>3. Compute aggregate nonces :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/189/1*1ho8HTXtr1g8z0_eS4yJ8A.png" /></figure><p>Round 2:</p><ol><li>Compute aggregate public key <strong><em>X~ aggregate </em></strong>with key coefficients.</li><li>Compute scalar :-</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*4hBhFX3lDPzlArzhYb-t5w.png" /></figure><p>3. Combine nonces :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/211/1*ScT8LB_z-KiYACdJristWA.png" /></figure><p>4. Compute challenges :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/1*BPhZVhaEmpO0nLX_Z4PB_g.png" /></figure><p>5. Partial signature :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*cjPjk-sWdE84B2_Od9JB6w.png" /></figure><p>6. Aggregate :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/152/1*oaZlX6yVaYmNMeOnJIPu6Q.png" /></figure><p><strong>Final Signature:</strong> <strong><em>(R,s)</em></strong> — verified just like a normal <strong><em>Schnorr</em></strong> signature.</p><p>More detailed example :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VxDVbEvuLRFokq9fnwyIGg.png" /></figure><h3>Resources :-</h3><ol><li><a href="https://eprint.iacr.org/2020/1261.pdf">https://eprint.iacr.org/2020/1261.pdf</a></li><li><a href="https://github.com/ZenGo-X/solana-tss">https://github.com/ZenGo-X/solana-tss</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3205415b15b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>