Skip to content
ecdsa.com

Signature malleability

The property of a signature scheme or its encoding that lets anyone turn a valid signature into a different valid signature for the same message and key without knowing the private key.
Also written astransaction malleabilitysignature malleation

ECDSA is malleable by design, since (r, s) and (r, n − s) both verify, and its DER encoding adds more variants when parsers accept non-minimal lengths or padded integers (which Bitcoin's BIP 66 strict-DER rule closed in 2015). EdDSA is malleable if a verifier skips the check that S is below the group order. Malleability is not forgery: nobody can sign a new message.

It matters when the signature or a hash covering it serves as an identifier. Before SegWit, Bitcoin transaction ids hashed the signatures, so third parties could change a pending transaction's id (Mt. Gox cited this when it halted withdrawals in February 2014). Smart contracts that remember used signatures instead of used nonces, and APIs that deduplicate requests by signature, fail the same way.

Defenses: canonical encodings (strict DER, low-S, S below L), identifiers computed from the signed content rather than the signature, explicit nonces in signed payloads, and schemes that are strongly unforgeable when verified strictly, such as Ed25519 and BIP-340.

Standards and references

All terms