Track 2 · Keys & identity · lesson 4
Signatures
9 min
A signature proves two things at once: that a specific key approved a specific message, and that the message has not changed since.
Sign something below, then break it.
Sign lab
- private key
- generating…
- address
- …
What just happened
Signing combines your private key with a hash of the message to produce a signature. Verification runs the process in reverse: given the message and the signature, it recovers the address that must have produced it.
Nobody supplies a public key to verify a signature. It falls out of the recovery.
That is why an Ethereum transaction has no "from" field. The sender is not declared — it is computed from the signature. There is nothing to forge, because there is nothing to claim.
The failure mode is quiet
Notice what tampering did not do. Nothing threw an error. The signature still decoded perfectly.
It just recovered a different address.
Predict
A tampered message recovers a valid-looking address that isn't yours. Why does that matter?
Where signatures show up
- Every transaction. Sender, nonce and content are all covered.
- Sign-in. "Sign in with Ethereum" signs a text challenge — no transaction, no gas, and the site learns nothing but that you hold the key.
- Gasless approvals. ERC-20
permitlets you sign an approval that someone else submits and pays for. - Allowlists. A server signs "this address may mint"; the contract verifies the signature instead of storing thousands of addresses.
Check
Verifying a signature requires which pieces?
Worth remembering
- A signature proves a specific key approved a specific message, and that the message is unchanged.
- Verification recovers the signer's address — the public key is never supplied.
- Ethereum transactions have no `from` field because the sender is computed from the signature.
- Tampering does not error; it recovers a different address, so you must compare.
- In Solidity, `ecrecover` can return the zero address — always reject it.