kartikeya sharma
AI Verification · Applied Cryptography · AI Safety

Why Schnorr Signatures Add Up And ECDSA Signatures Do Not

Friday, October 16, 2026

CryptographyBitcoinDigital Signatures

In Bitcoin, we're using two variations of signature schemes. You could have a Taproot transaction, or you could have the legacy transaction, and they both use different signature schemes. We've been talking about the Taproot example so far, which is the Schnorr signature scheme. Taproot is a Bitcoin upgrade, and its Schnorr signatures are specified in BIP-340. And the other version, that we haven't discussed much because it's quite messy, is ECDSA, which stands for elliptic curve digital signature algorithm.

A digital signature scheme has three functions: a key generation algorithm, a signing algorithm, and lastly a verify algorithm. We'll talk about the digital signature scheme for both of these constructions: keygen, sign and verify.

Schnorr

For Schnorr, it's quite simple. You have a private key, which is a scalar, which you randomly pick from 1 up to n − 1, where n is the order of the elliptic curve, specifically the secp256k1 elliptic curve. Then you compute your public key, which we'll call P = d·G. The generator G is a point, so it has x and y coordinates, and you add it to itself d times, where d is your private scalar value. And then your public key is another coordinate point on the secp256k1 curve. With Schnorr specifically, we only care about points where the y value is even.

For signing:

  1. You pick a random value k, again from the scalar interval, and you compute the random nonce, which is R = k·G.
  2. To make it non-interactive, we need a hash function. Typically, this is something the verifier would have to give us. But we can actually compute the challenge ourselves, by hashing the x-coordinate of the public key, the x-coordinate of R, and the message. If you don't quite understand what's going on, just imagine we're hashing P and R.
  3. Finally, you calculate your equation, s, which is your random nonce plus your challenge times your private key, mod n.
R = k·G    c = H(xR ‖ xP ‖ m)    s = k + c·d mod n    σ = (xR, s)

We spoke about what happens if we first have our challenge. From that, we could basically cheat and create a nonce R that cancels out the verification without us needing to know the private key. So this is why you first calculate R and then c. You can only find c by hashing the value of R, so there's no way you could calculate c before R.

For verification, we calculate our own R by multiplying this s value with our generator, which is public, and then we subtract our challenge times P from that. They're checking if the x coordinate of this R that they found is equal to the x coordinate of the original R. For this c, they can recompute this themselves. They don't need the signer to send them this information, because xP is public, xR has been sent with the signature, and the message is a common thing between the prover and the verifier.

R′ = s·G − c·P     accept if xR′ = xR

ECDSA

What about the elliptic curve digital signature algorithm? That's also being used, and that's an older signature scheme, and Bitcoin has since upgraded. So what is this, and why did we upgrade?

For key generation, again, you pick your private key, and again, you compute your public key, P = d·G. For signing, again, we pick a random value k, a scalar value, and we find our nonce, R = k·G. Now the computation that we do for s is a little bit more involved, and not as nice to look at. You calculate the modular inverse of the k that you just picked, and you multiply it by the hash of the message plus the x coordinate of R times the private key d. And all of that is mod n, again.

s = k−1(H(m) + xR·d) mod n

For verify, it will output accept or reject, and we have to compute our own R value as c (the hash of the message) times the modular inverse of s, times G, plus the x coordinate of R times, again, the modular inverse of s, times P. And what we're then checking is if the x coordinate of the R that we calculated is congruent to the x coordinate of the random nonce the signer sent to us, mod n.

R′ = H(m)·s−1·G + xR·s−1·P     accept if xR′ ≡ xR mod n

The modular inverse makes things hard

If we simply compare this with this, even if we say c equals the hash of the message, you can already see how this extra thing, this modular inverse, makes things hard. Why? It makes things hard for multisignatures.

When multiple people have their own random nonce values, their own challenge values, their own private keys, we're able to do simple addition. We can just add nonce values, and the addition of those nonce values scales linearly, meaning it increases linearly as you add. But with a modular inverse, that's not the case. You can pick random numbers and try to do it yourself with two people.

Is the inverse of a sum the sum of the inverses?
Schnorr needs: add, then use
kA + kB
the aggregate nonce
ECDSA would need: invert
(kA + kB)−1 mod 67
kA−1 + kB−1 mod 67
pairs (kA, kB) mod 67 where the two inverses agree
Every nonzero pair is checked exhaustively. They agree only when kA2 + kAkB + kB2 ≡ 0, which for n = 67 happens for 2 of every 66 choices of kB: an accident, not a rule anyone could build a multisig on.

ECDSA multisig: one signature per key

If you want to have five people be part of a transaction, and if you want all five to sign that transaction, and if the five people don't sign, then the transaction doesn't go through, to enable that sort of behaviour, you need multisignatures. For ECDSA, it's quite messy. For the ECDSA multisig setup, you have to first list out all the public keys that are part of the multisignature, P1, P2, all the way up to Pu. And each of these will have its own signature: signature one, signature two, signature u.

The problem with ECDSA is there's no easy way to combine these. It's not the case that signature one plus signature two is equal to their values added. It's not linear in that regard. So what the code has to do is verify each signature individually. First you would have to verify whether signature one came from P1, whether signature two came from P2, and then if all those verifications pass, then the multisignature passes. There's no one signature which you can run that just verifies everyone's signature altogether. You have to do it one by one.

Schnorr multisig: just add

With Schnorr, suppose we have two people, and let's call them Alice and Bob. They both have a private key, dA and dB, and they both have a public key, PA and PB. With Schnorr, the aggregate of the public keys is PA + PB, and the nonces can also just be added, so the aggregate will be RA + RB. That's not the case for ECDSA.

Pagg = PA + PB     Ragg = RA + RB     c = H(Pagg ‖ Ragg ‖ m)

So we have a challenge value c, which is found from the aggregate of the public keys of Alice and Bob and the aggregate of the random nonce values. Now they can compute their s values. This would be a step that each of them would have to do, because they both have their own private keys. Alice would have to calculate her own s, because only she knows her private key.

sA = kA + c·dA     sB = kB + c·dB

And now we can even find a combined signature s, which is sA + sB. If I move things around, I can factor out the c:

s = sA + sB = (kA + kB) + c·(dA + dB)

If you notice this equation, and if you notice the regular equation, which is s = k + c·d, you can see that as we are adding people, Alice and Bob in this case, we can just add the k's, and we can just add the private keys too. And c is a shared challenge value between all the people who are doing the signatures. Here it does scale linearly. By linearly, I mean if this is two and this is two, then the final answer is four. With modular inverse, that's not true.

How do we find the verification now? It's exactly the same as this verify. What we're verifying is if s·G is equal to Ragg + c·Pagg. If I isolate R, then Ragg = s·G − c·Pagg.

Ragg = s·G − c·Pagg
Add Alice's and Bob's signatures. Does the sum verify as one signature?
Toy curve y2 = x3 + 7 over F79, the same equation as secp256k1. It has 67 points, a prime, so n = 67. The hash is a toy hash reduced mod n.
AliceBob
private key d
public key P = d·G
nonce k, R = k·G
Schnorr
c = H(Pagg, Ragg, m)
sA, sB
s = sA + sB
s·G − c·Pagg
Ragg
ECDSA
H(m)
sA, sB (each verifies alone)
s = sA + sB
x of R′ from s, Pagg
x of Ragg
0 / 0Schnorr sums that verified
0 / 0ECDSA sums that verified
Keep pressing "new keys and nonces". The Schnorr sum verifies every time. The ECDSA sum only passes when the x-coordinates collide by luck, about 1 time in 30 on this 67-point curve (each x-coordinate belongs to two points), and essentially never on secp256k1.

"Doesn't that make it easier for the attacker too?"

Someone asked: if we make verification easier by making it linear, don't we make it easier for an attacker as well, and which scheme is safer?

What I have on the screen right now is not safe, and you are right to doubt it. With the Schnorr one, there's a very big problem here. If we have five people who are doing a multisignature, with this scheme right now, I could just disregard the signatures of all the other four, and I could be the only one providing signatures, and verification would pass. Let me first write this, otherwise people would think this is correct: this is not safe.

How one signer does that, the rogue-key attack, and how MuSig2 keeps the addition while stopping it, is next week.

← Back to all articles