A digital signature blockchain transaction proves that the owner of a private key approved that exact transaction, without ever revealing the key. The sender signs a hash of the transaction with their private key, and every node checks the signature against the matching public key. If a single byte of the transaction changes, verification fails.
This is what replaces a bank login or a handwritten signature on a blockchain. There is no central server to ask "is this really Alice?", so the math has to answer for it.
A digital signature gives three guarantees that a blockchain relies on:
| Property | Meaning on a blockchain |
|---|---|
| Authentication | Only the holder of the private key could have produced the signature |
| Integrity | The signed transaction was not altered after signing |
| Non-repudiation | The signer cannot later deny having authorised it |
A signature is not encryption. The transaction itself is public, and anyone can read it. The signature only proves authorisation.
Every account starts with a key pair generated from a large random number.
Bitcoin and Ethereum both use the secp256k1 curve for this. The mathematics of that curve is a separate topic; here, treat signing and verifying as two functions with a fixed contract.
Signing has three steps.
r and s.The signature is attached to the transaction and broadcast to the network. Signing a hash rather than the raw data keeps the input a fixed size and binds the signature to every field in the transaction.
Each node that receives the transaction runs verification independently:
verify(public_key, tx_hash, signature).A tampered amount produces a different hash, so the old signature no longer matches. A forger without the private key cannot produce a matching signature.
This example uses the cryptography library (version 44 or newer) to sign and verify a message on the secp256k1 curve.
The library hashes the message with SHA-256 and signs the digest. Real chains define their own serialisation and hash function, but the sign and verify flow is the same.
| Chain or upgrade | Scheme | Notes |
|---|---|---|
| Bitcoin (legacy and SegWit) | ECDSA on secp256k1 | Variable-length DER encoded signatures |
| Bitcoin Taproot (2021) | Schnorr (BIP-340) | Fixed 64-byte signatures, enables key aggregation |
| Ethereum | ECDSA on secp256k1 | Signature includes a recovery value so the public key can be recovered |
| Ed25519 chains such as Solana | EdDSA | Deterministic signing on Curve25519 |
k in ECDSA across two signatures leaks the private key. Good libraries derive it deterministically (RFC 6979).No. Signing computes a signature over a hash and is verified with the public key. It is a separate operation from encryption, even though older textbooks describe RSA signatures that way.
The signature is only valid for the exact transaction it covers. Nonces and chain IDs make sure the same transaction cannot be executed twice.
It is part of the transaction data included in the block, so anyone can re-verify it later.
You cannot sign, so you cannot move the funds. Nobody can recover the key for you, which is why backups matter.
A blockchain digital signature binds a transaction hash to a private key. Wallets sign, nodes verify with the public key, and any change to the data invalidates the signature. ECDSA and Schnorr on secp256k1 are the most common schemes, and safe nonce generation and replay protection are what keep them secure in practice.