Blockplain, home page
← Back to home

Keys and signatures

On a blockchain, nobody logs in. Each user holds a pair of keys instead: a private key they keep secret, and a public key anyone can see. Signing with the private key proves that a message came from whoever holds it.

Information, not advice.

Two keys that belong together

The two keys are made as a pair and are linked by mathematics. The public key can be shared with anyone. The private key must stay secret. Knowing the public key does not let anyone work out the private key.

Technical detail

This is asymmetric-key cryptography, also called public-key cryptography. A common signing method in blockchains is ECDSA, the Elliptic Curve Digital Signature Algorithm. NIST IR 8202 cites FIPS 186-4 for it; the current edition is FIPS 186-5, published on 3 Feb 2023.

On Ethereum an account is a pair of keys; the public key is worked out from the private key, and not the other way round.

A signature

To send a transaction, the holder signs it with their private key. Anyone can check that digital signature with the matching public key.

The check passes only if the message is exactly what was signed and the matching private key signed it. Change one letter and the check fails.

Try it below: make a key pair, sign a message, then change the message and check again.

Try it

Worked out in your browser. Nothing you type or choose is sent anywhere.

Technical detail

FIPS 186-5: digital signatures are used to detect changes to data and to authenticate who signed it, and the signer cannot easily deny the signature later (non-repudiation).

The Bitcoin paper defines a coin as a chain of digital signatures: each owner passes it on by signing a hash of the previous transaction and the next owner's public key.

The try-it uses ECDSA on the P-256 curve, because that is built into web browsers. It shows how signing works; its keys are not Bitcoin or Ethereum keys and hold nothing.

Addresses

An address is a shorter string worked out from the public key with a hash. It is what people paste to send something, and it is not secret.

Anyone can make as many key pairs, and so addresses, as they like, without giving a name. A signature links a transaction to a key, not to a person.

Technical detail

On Ethereum, an address is the last 20 bytes of the Keccak-256 hash of the public key, written with 0x in front: 42 characters in all.

NIST calls this pseudonymous: the user is not named, but the address is, and every transaction on an open network is public. A real-world identity can be linked to an address from outside the blockchain, for example through an exchange's records.

Why a lost key cannot be reset

There is no “forgot my password” button, and on an open network there is usually no company holding a copy. If the private key is lost, whatever it controls is lost too, because the same key cannot be made again.

If the key is stolen, the thief can sign as the owner, and a transfer they make generally cannot be undone. When the news says crypto was stolen, NIST notes it almost always means private keys were found and used, not that the blockchain itself was broken.

Software that stores keys is called a wallet. Some people keep keys on special hardware, or with a firm that holds the key for them.