Qaynaq LABS · TOOLS

CRYPTO GLOSSARY

Transaction malleability

A vulnerability where a third party alters the unique identifier (transaction ID) of a valid transaction before it is confirmed, without changing its meaning or effect. This can cause confusion in tracking payments.

Technical definition

Transaction malleability arises from the fact that the transaction ID (TXID) in many blockchain systems is derived from the transaction's raw data, including its signature. An attacker can modify non-critical parts of the transaction (e.g., the signature's encoding) without invalidating the transaction, resulting in a different TXID. Since the TXID is used to track transaction confirmation status, this can lead to race conditions where exchanges or services mistakenly believe a transaction failed, prompting users to resubmit payments. The issue is particularly relevant in systems using unconfirmed transactions for state transitions, such as the Lightning Network.

An analogy

Imagine sending a signed contract through a courier, but before delivery, someone alters the envelope’s label (e.g., changes the handwriting slightly) without changing the contract’s content. The recipient sees a different label and assumes the contract wasn’t delivered, even though it was. The contract itself remains valid, but the tracking system is confused.

Why it matters

Transaction malleability can disrupt payment processing systems, leading to double-spending risks, failed transactions, or unnecessary resubmissions. It undermines the reliability of transaction tracking, which is critical for services relying on unconfirmed transactions.

Where it came from

The issue was first publicly discussed in 2014, notably exploited in the Mt. Gox exchange collapse, where attackers manipulated unconfirmed Bitcoin transactions to trick the exchange into refunding users. It has since been addressed in Bitcoin Core with SegWit (2017), which separates transaction signatures from the TXID calculation.

Example in practice

A user sends 1 BTC to an exchange. An attacker intercepts the unconfirmed transaction and modifies its signature encoding, changing the TXID. The exchange, seeing the new TXID, believes the transaction failed and requests the user to resend the payment. The user sends another 1 BTC, resulting in a double spend of 2 BTC (the original and the resubmitted transaction).

Common misconceptions

  • Misconception: Transaction malleability allows attackers to steal funds. → Correction: It does not allow theft; it only manipulates transaction IDs, potentially causing confusion in tracking.
  • Misconception: All blockchains are vulnerable to transaction malleability. → Correction: Some blockchains (e.g., those using SegWit or alternative signature schemes) mitigate this issue by changing how TXIDs are calculated.

Risks & limitations

  • Exchanges or services may incorrectly mark transactions as failed, leading to lost funds or unnecessary resubmissions.
  • Can be exploited in combination with other attacks (e.g., 0-conf attacks) to disrupt payment processing.
  • May cause temporary confusion in transaction tracking, though modern systems have largely mitigated this risk.
  • In systems relying on unconfirmed transactions (e.g., Lightning Network), malleability can lead to channel state inconsistencies.

Related terms

About "Transaction malleability" in crypto

Cryptocurrency vocabulary moves faster than any other technical field. New terms appear weekly, old terms quietly change meaning, and most "definitions" online were written by someone trying to sell you something. Qaynaq Labs' crypto glossary aims for the opposite: neutral, accurate, skeptical explainers that include the downside.

This entry covers the technical mechanics, a real-world analogy, where the concept came from, and what could go wrong. Pair it with the related terms to build a working mental model of how the pieces fit together.

Frequently asked

Can transaction malleability be fixed entirely?

Yes, through protocol changes like SegWit, which removes signature data from the TXID calculation. However, legacy systems or other blockchains may still be vulnerable if they do not implement similar fixes.

Does transaction malleability affect confirmed transactions?

No. Once a transaction is included in a block and confirmed, its TXID cannot be malleated, as the block’s hash and Merkle tree structure make such changes detectable.

Is transaction malleability the same as double-spending?

No. Double-spending involves spending the same funds twice, while transaction malleability involves altering a transaction’s ID without changing its meaning or effect.