freecoding.school100% FREE · NO SIGNUP
Ledger LandISSUE #7 of 90

digital signatures · sign · verify

BlockyVSDouble-Spend Dan
Blocky saysA digital signature proves a message came from a key holder and wasn’t altered.

To send a transaction, you sign it with your private key, producing a signature anyone can verify against your public key. Verification confirms two things: the signer holds the private key (authenticity) and the message is unchanged (integrity). The network checks signatures before accepting transactions — no signature, no spend. It's authorization without revealing the secret.

Power-ups you unlock

Double-Spend Dan attacks — common mistakes

Boss battleExplain the two facts a verified signature establishes.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>sign(tx, privKey) → signature
verify(tx, signature, pubKey) → true
proves: signer holds the key + tx unaltered</pre></body></html>
▶ Open the interactive comic issue
‹ Public Key Crypto · Rsa · Ecdsa · Ed25519Merkle Trees · Proofs Without The Whole Tree ›