— —
Follow on X
LESSONS

Signatures: ECDSA and Schnorr

A signature proves knowledge of a private key for one exact message. ECDSA was Bitcoin's original scheme; Schnorr, added with Taproot, is smaller and lets keys combine.

6 MIN READ
Two panels comparing ECDSA and Schnorr signatures.
LEVEL · Advanced
IN THIS LESSON · 5 OF 9
BY THE END YOU WILL BE ABLE TO ANSWER
  • What does a signature commit to?
  • What does Schnorr's linearity make possible?
  • What must a signer do for each ECDSA signature?
  • A Schnorr signature is 64 bytes. A DER-encoded ECDSA signature is typically how many bytes, give or take one?

Then prove it: a 3-question quiz · a challenge. The lesson marks itself complete at 100%.

After this lesson you can: explain what Schnorr changed.

A digital signature proves that the holder of a private key approved a specific message, here the transaction (or the parts of it the signature commits to), without revealing the key. Anyone with the public key can verify it.

ECDSA, in outline

To sign, pick a fresh random number, multiply G by it and take the x-coordinate (that is r); then combine r, the private key, and the message hash into s. The signature is (r, s). Verification recombines the public key, r, s and the hash and checks that the x-coordinate matches r. Two warnings from history: reusing the random number across two signatures leaks the private key (it happened to Sony and to several wallets), and ECDSA signatures could be re-encoded without invalidating them, which caused transaction malleability until SegWit moved signatures out of the txid.

Sighash flags

Two columns comparing ECDSA and Schnorr signatures.
Same curve, simpler math, one new property.

A signature commits to parts of the transaction chosen by a flag. SIGHASH_ALL (the default) commits to all inputs and outputs. Others (SINGLE, NONE, ANYONECANPAY) allow partially open transactions used in some protocols.

Schnorr

Added in 2021 with Taproot (BIP 340). Same curve, simpler math: the signature is a point and a scalar, 64 bytes. The key property is linearity: signatures from several keys can be added into one that verifies against the sum of the keys. That gives:

  • MuSig: a multisig that appears on-chain as a single key and a single signature. Smaller, cheaper, private.
  • Batch verification: nodes can verify many signatures at once, faster.
  • Adaptor signatures: signatures deliberately missing a secret, used in advanced Lightning and swap protocols.

What you need to know as a user

Three keys aggregate into one key and one signature on-chain.
MuSig: three signers, one key, one signature. On-chain it looks like anyone else’s payment.

Nothing changes in practice: your wallet signs. But Taproot wallets get smaller transactions, and multisig users get privacy they did not have before.

MINI CHALLENGESignature size

A Schnorr signature is 64 bytes. A DER-encoded ECDSA signature is typically how many bytes, give or take one?

bytes
CHECK YOURSELF
1/3 What does a signature commit to?
2/3 What does Schnorr's linearity make possible?
3/3 What must a signer do for each ECDSA signature?
pick an answer for each question

SOURCES

  1. Learn Me A Bitcoin: Signature
  2. BIP 340: Schnorr Signatures
Progress is saved in this browser only.