Proving ownership without revealing your secret key
Imagine your Bitcoin is locked in a treasure chest. Only you have the secret key. But how do you prove it's your chest without showing the secret key to everyone?
That's what a digital signature does! It's cryptographic proof that says "I own this" without revealing your secret.
Bitcoin has two ways to do this:
• ECDSA (the original way, since 2009)
• ✨ Schnorr (the new way, since 2021) — smaller, faster, more private!
Bitcoin uses elliptic curve cryptography (secp256k1) for digital signatures. Private keys sign transactions, public keys verify signatures. The mathematical relationship is one-way: easy to derive public from private, impossible to reverse.
Two signature algorithms: ECDSA (original, 2009-present) and Schnorr (Taproot, 2021+). Schnorr enables signature aggregation and batch verification for improved efficiency and privacy.
Bitcoin originally implemented ECDSA (Elliptic Curve Digital Signature Algorithm) over secp256k1 curve. Private key k generates public key P = k·G where G is generator point. Signature (r,s) proves knowledge of k without revealing it. Verification: s⁻¹(H(m)·G + r·P) = R validates ownership.
BIP-340 (Schnorr): Introduced with Taproot (2021). Uses x-only pubkeys, tagged hashes, and enables linear aggregation via MuSig2. Signature verification: s·G = R + e·P where e = HashBIP0340/challenge(r || P || m).
Click the button to create your secret key and public key.
This demo shows ECDSA (the original signature scheme). We'll compare it with Schnorr signatures below.
ECDSA implementation: Generate random k per signature, compute (r,s) where r = x(k·G), s = k⁻¹(H(m) + r·x) mod n
Your Secret Key (never share this!)
🔓 Your Public Key (totally safe to share!)
Type any message (pretend it's a Bitcoin payment):
This creates an "ECDSA signature" (the original Bitcoin method from 2009). We'll try Schnorr next!
Your Digital Signature:
Now anyone can check that YOU really signed it. Try to break it — it's impossible!
Test signature verification - try changing the message or tampering with the signature!
Correct message + correct signature = ✅ Real!
Change anything = ❌ Fake!
You just tried ECDSA (the original way). Now let's try Schnorr — the 2021 upgrade that made Bitcoin better!
What makes Schnorr special? It's smaller, faster, and has a powerful feature: multiple people can sign together and it looks like just one person signed!
| What You Do | What the World Sees |
|---|---|
| 1 person signs | ✅ 1 tiny signature |
| 3 people sign together | ✅ Still 1 tiny signature! |
| 100 people sign (CoinJoin) | ✅ Still 1 tiny signature! |
| Complex smart contract | ✅ Still 1 tiny signature! |
🎉 That's the power! Everyone's complex transactions look exactly like a normal payment from one person. Total privacy!
Schnorr signatures (activated in Bitcoin via Taproot in 2021) are simpler, more efficient, and enable powerful features like signature aggregation and batch verification.
Signature: (r, s) where r and s are derived separately
Verification: Complex multi-step process
Size: ~72 bytes (DER-encoded)
Aggregation: ❌ Not possible
Malleability: ⚠️ Signature can be tweaked
Signature: (R, s) where R is a curve point, s is scalar
Verification: Simple equation: s·G = R + e·P
Size: 64 bytes (always fixed)
Aggregation: ✅ Multiple signatures → 1 signature!
Malleability: ✅ Impossible to tweak
Verification: Check if s·G = R + e·P. If true, signature is valid!
Schnorr's linearity property allows signature aggregation: Multiple parties can combine their signatures into a single signature. This makes complex multisig setups look identical to single-key spends on-chain — massive privacy and efficiency gains!
Schnorr signatures (BIP-340) provide provable security, linearity enabling key and signature aggregation, and batch verification. Bitcoin's implementation uses secp256k1 curve with x-only public keys and tagged hashing.
Pagg = P1 + P2 + ... + Pn (with key coefficient adjustments)
sagg = s1 + s2 + ... + sn mod n
Indistinguishable from single-key signature. Enables n-of-n multisig with constant O(1) space and verification time.
Sign a message with Schnorr and watch multiple signatures combine into one!
Taproot = The Invisible Smart Contract
It combines Schnorr with hidden backup plans. 99% of the time, you just use one simple signature. But if something goes wrong, you can reveal your backup plan.
New Address Type: Taproot addresses start with bc1p...
Two Ways to Spend Your Bitcoin:
Just one tiny Schnorr signature. Cheap and private. This is what 99% of people use!
Only reveal this if something goes wrong (like losing a key). Your backup plan stays hidden until you need it!
🎉 Privacy win: On the blockchain, everything looks like a normal single-person payment, even if it's actually a complex 10-person multisig!
Taproot outputs (P2TR) commit to a tweaked key that optionally includes a hidden script tree. You can spend via key-path (cheap) or reveal one Merkle branch (script-path).
The tweaked key Q becomes the address. Scripts stay hidden in the hash until you need them.
Without Taproot: Everyone sees it's a 2-of-3 multisig. ~200 bytes on-chain.
With Taproot: If all 3 cooperate, use key-path (64 bytes, looks like single-sig). If one is unavailable, reveal script-path. Privacy + efficiency!
Taproot witness program: 1-byte version (0x01) + 32-byte x-only pubkey Q. SegWit v1 uses Bech32m encoding. Key-path spends are indistinguishable from each other regardless of hidden scripts.
| Component | ECDSA (Legacy) | Schnorr + Taproot |
|---|---|---|
| Address Type | P2PKH (1...), P2WPKH (bc1q...) | P2TR (bc1p...) |
| Signature Size | ~72 bytes (DER encoded) | 64 bytes (fixed) |
| Multisig | Visible on-chain, multiple sigs | Aggregated → looks like 1 sig |
| Privacy | Lower (script types visible) | Higher (key-path hides complexity) |
Key Point: Every Bitcoin transaction input requires a valid signature. Schnorr + Taproot make complex smart contracts indistinguishable from simple payments.
✅ How digital signatures prove ownership without revealing secrets
✅ The difference between ECDSA (old) and Schnorr (new) signatures
✅ How Taproot makes complex Bitcoin transactions look simple
✅ Why Bitcoin's privacy and efficiency improved in 2021
✅ ECDSA signature generation and verification mechanics
✅ Schnorr's linearity property enables signature aggregation
✅ Taproot's key-path vs script-path spending trade-offs
✅ How MuSig2 enables efficient n-of-n multisig with Schnorr
✅ ECDSA: (r,s) where r = x(k·G), s = k⁻¹(H(m) + r·x) mod n
✅ Schnorr (BIP-340): (r,s) where s = k + e·x, e = HashBIP0340/challenge(r || P || m)
✅ Taproot (BIP-341): Q = P + HashTapTweak(P || t)·G
✅ MuSig2: Non-interactive n-of-n with key aggregation Pagg = ∑ aiPi
Want to dive deeper? Explore the other interactive demos!