Cryptography

Digital signatures

A digital signature lets you prove three things at once — that YOU authorised a specific message, that the message hasn’t been altered, and that you can’t later deny it — all without ever revealing your private key. Every Bitcoin transaction is one of these signatures.

How it works, in three moves

  1. Sign. You take the message (say, “pay Alice 1 coin”) and combine it with your PRIVATE key using a signing algorithm. Out comes a signature — a number tied to both that exact message and your key.
  2. Publish. You broadcast the message, the signature, and your PUBLIC key. Your private key never leaves your possession.
  3. Verify. Anyone can feed the message, signature and public key into a verification algorithm. It answers yes or no: does this signature really correspond to this message and this public key? Only the matching private key could have produced a signature that passes.

Try it — sign, then tamper

This runs real ECDSA on secp256k1 — the same signature scheme in every Bitcoin transaction. Write a message, Sign it with your private key, and it verifies against your public key. Now change a single character of the message, or swap the key: verification instantly fails. That’s integrity you can see.

Public key (compressed)
Signature — r
Signature — s

What it guarantees

  • Authenticity — only the holder of the private key could have signed, so it really came from them.
  • Integrity — the signature is bound to the exact message. Change even one character and verification fails, because the message’s hash no longer matches.
  • Non-repudiation — the signer can’t credibly deny it later; nobody else could have made a valid signature.

Signatures are the opposite of encryption. Encryption hides a message from everyone but the intended reader. A signature reveals nothing — the message is public — but proves who stands behind it. Bitcoin is built almost entirely on signatures, and barely uses encryption at all.

This is how you spend Bitcoin

When you send Bitcoin, your wallet writes a transaction (“move these coins to this address”) and signs it with your private key. The network checks the signature against your public key. If it verifies, the transaction is valid and only you could have authorised it — no bank, no approval, no permission. Ownership and authorisation are pure mathematics.

Signatures and keys both lean on that same one-way trapdoor. Before we finally open it up, one more tool completes the toolkit — encryption, and the surprising fact that Bitcoin barely uses it. Next.

Key takeaways

  • A digital signature proves you authorised a specific message with your private key, verifiable by anyone with your public key — without revealing the key.
  • It gives authenticity, integrity and non-repudiation: it came from you, unchanged, and you can’t deny it.

Check yourself

What does a digital signature let you do?

To VERIFY someone’s signature, what do you need?

Spotted an error or have feedback on this lesson? Suggest a correction ↗

Comments

Powered by Nostr — reply from any Nostr client, and zap the lesson over Lightning.