> For the complete documentation index, see [llms.txt](https://docs.leather.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.leather.io/learn/transaction-malleability.md).

# What is Transaction Malleability?

Transaction malleability let a third party change a Bitcoin transaction's ID before it confirmed. Why that mattered and how SegWit fixed it.

Transaction malleability is a flaw in which someone can change a Bitcoin transaction's ID (TXID) before it confirms, without changing what the transaction does. The amounts and recipients stay the same; only the identifier changes.

## How it worked

A TXID is a hash of the whole transaction. Before SegWit, that included the signatures. Some parts of a signature can be encoded in more than one valid way. Anyone who relayed a transaction could re-encode the signature, so the transaction stayed valid but got a different TXID. Either version could confirm.

## Why it mattered

* **Tracking:** wallets and exchanges that followed payments by TXID could lose track of a payment that confirmed under a different ID.
* **Fraud:** an attacker could claim a withdrawal never arrived, pointing at the original TXID, and ask for it again.
* **Layers:** protocols that sign transactions spending outputs of other unconfirmed transactions, such as Lightning, need TXIDs that cannot change.

## How SegWit fixed it

SegWit, activated in 2017, moved signatures into separate witness data and left them out of the TXID. Changing a signature's encoding no longer changes the TXID of a SegWit transaction. Legacy transactions can still be malleated.

A replacement made with Replace-By-Fee is a different case: it is a new transaction with a new TXID, made by the sender on purpose.

## In Leather

Leather's Native SegWit and Taproot addresses both spend with witness data, so transactions from Leather are not malleable. See [What is Segregated Witness (SegWit)?](/learn/segwit.md).
