Home › Glossary › Transaction malleability

Transaction malleability

Also called: malleability, txid malleability, tx malleability, signature malleability.

Transaction malleability is the ability to change a transaction's ID without changing what it does, for example by re-encoding its signatures.

Transaction malleability means a transaction can be altered so that its txid changes while it still spends the same coins to the same outputs. Before SegWit, signatures were part of the data hashed into the txid, and a signature can be written in more than one valid form. Anyone relaying a transaction could change that form, producing a different txid for an equivalent transaction, and either version might be the one that confirms.

Why malleability was a problem

The payment itself was safe, but anything that referred to the original txid broke. Wallets could lose track of their own payments, and protocols that pre-sign a child transaction spending an unconfirmed parent, such as payment channels, could be left with a refund that points to a parent that never confirms. In 2014 the exchange Mt. Gox cited malleability when it halted withdrawals.

How it was fixed

Bitcoin closed the gaps step by step:

  • BIP 62 catalogued the sources of malleability and proposed a rule for each; it was later closed, as SegWit solved the problem more thoroughly.
  • BIP 66 made strict DER signature encoding a consensus rule (block 363,725, July 2015).
  • BIP 146 proposed low-S signatures and NULLFAIL, and BIP 147 required the dummy element of CHECKMULTISIG to be empty (NULLDUMMY).
  • BIP 141 moved signatures into the witness, which the txid doesn't cover. Once every input is a signed SegWit input, third parties can't change the txid at all.

Fixing malleability is what made the Lightning Network practical, and Tapscript closes further gaps by making MINIMALIF a consensus rule. See the malleability topic for every related BIP.

BIPs that define Transaction malleability

  • BIP 62: Dealing with malleability: Closed. Proposed a set of rules to stop third parties from altering a transaction's ID without changing what it does, a problem called malleability. It was withdrawn after Segregated Witness (SegWit) solved…
  • BIP 66: Strict DER signatures: Deployed. Required all signatures to follow one strict encoding format, known as DER. Different software interpreted loosely encoded signatures differently, which risked splitting the network and let…
  • BIP 146: Dealing with signature encoding malleability: Closed. Tightens the rules on how digital signatures may be formatted, so a third party cannot slightly alter a signature's encoding and thereby change a transaction's ID. Removing this form of malleability…
  • BIP 147 (NULLDUMMY): Dealing with dummy stack element malleability: Deployed. Fixes a quirk in Bitcoin's multisignature opcode, which consumes an extra unused value that anyone could modify without invalidating the transaction. Requiring that value to be empty removes one…
  • BIP 141 (SegWit): Segregated Witness (Consensus layer): Deployed. Defines Segregated Witness (SegWit), which moves signatures into a separate "witness" section of each transaction while remaining compatible with older nodes. This fixed transaction malleability,…

Related terms

  • TXID: A TXID (transaction ID) is the 32-byte hash that identifies a Bitcoin transaction, shown as 64 hex characters in wallets and block explorers.
  • Witness: The witness is the part of a SegWit transaction that holds signatures and scripts, kept out of the txid so it can't be changed to alter the transaction ID.
  • SegWit (Segregated Witness): SegWit (Segregated Witness) is the 2017 soft fork that moved signatures into a separate witness, fixing malleability and introducing block weight.
  • Lightning Network: The Lightning Network is a layer-2 payment network on Bitcoin: users pay through chains of off-chain channels and settle on-chain only when needed.

Learn more

Guides