~$ crypto-under-the-hood

# The machinery behind the coins

~/notes / reading on-chain data

Signatures: How the Network Knows It Was You

No password is sent anywhere. The mechanism that proves authorisation without revealing the secret, and where it goes wrong in practice.

Ivan Kruse · · 3 min

When you authorise a transaction, nothing secret leaves your device. That is the property the whole system rests on, and it is worth understanding how it works.

The mechanism

Your private key is a very large number. From it, a public key is derived through an operation that is easy to perform forwards and computationally infeasible to reverse.

To authorise a transaction, your wallet combines the transaction data with the private key to produce a signature. Anyone holding the public key can check that the signature corresponds to both that key and that exact transaction data.

Two properties follow.

The signature is specific to the transaction. Change one byte of the transaction and the signature no longer validates. A signature cannot be lifted and reused on a different transaction.

The private key is not recoverable from the signature. Verification uses only the public key.

Why this replaces passwords

A password must be transmitted and stored somewhere for checking, which creates a thing that can be stolen from a server. A signature scheme has no such thing. The network never holds anything that would let it, or anyone who breaches it, act on your behalf.

This is why there is no password reset. There is no authority holding a credential to reset.

Where it goes wrong

Signing something other than what you think. The cryptography is sound and the interface is where the risk lives. A signature on a message granting unlimited token approval is just as valid as one on a transfer.

This is the entire basis of approval-based theft. Nothing was broken. You signed.

Off-chain message signatures. Some operations use a signed message rather than a transaction. These cost no gas, do not appear on-chain when signed, and can carry the same authority as a transaction. A permit signature authorising token movement is the common example, and it feels less consequential than it is.

Blind signing on hardware wallets. When a transaction is too complex for the device to display meaningfully, some wallets fall back to showing a hash. Approving it means trusting the computer that constructed it, which defeats the purpose of the device.

Where a device supports full transaction display for the operation you are performing, use it.

Reused nonces in flawed implementations. A cryptographic detail with catastrophic consequences: certain signature schemes leak the private key if the same random value is used to sign two different messages. This has produced real losses through faulty implementations, though not in well-tested wallet software.

The practical rules

Read what the wallet says you are signing. Transfer, approval, or contract call. Approvals on a screen where you expected a swap are worth stopping for.

Treat a message signature as seriously as a transaction. It carries the same consequence and none of the friction.

Use a device that displays the full details. A signature you cannot read is one you are trusting someone else about.

Use a separate wallet for unfamiliar contracts. A signature can only affect what the signing address holds.

The summary

The cryptography has not been the weak point. In more than a decade, the signature schemes underlying major chains have held.

Every significant loss in this category has come from a person signing something they did not understand, which is an interface problem and a habit problem rather than a cryptographic one. It is also why the working balance is safer at exchanges that let you specify the network than in a hot wallet that connects to unfamiliar sites: a signature can only reach what the signing address holds.

# Corrections and technical nitpicks are welcome. Send them over. They get published with the fix.

cryptographysignaturessecurity

# related notes