<p>TL;DR: Yes, once a transaction is confirmed, unless a chain reorganization makes it unconfirmed again, no forms of malleability are possible. SegWit specifically fixed TXID malleability of unconfirmed transactions, but other forms of malleability are possible.</p>
<hr />
<p>Transaction malleability in general refers to the possibility of a third party changing some parts of a transaction without making it invalid. For example, with ECDSA it's possible to change a valid signature into a different signature that is still valid for the same message. This isn't a problem in most cryptosystems, but because in pre-SegWit transactions the TXID depends on the transaction signatures and transaction inputs reference the TXID of a transaction whose outputs they're spending, this makes it unsafe to rely on chains of unconfirmed transactions (required by off-chain protocols such as Lightning).</p>
<p>While there were proposals to limit the ECDSA scheme to remove this vulnerability (see <a href="https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki" rel="nofollow noreferrer">BIP62</a> which also covers other malleability vectors), SegWit took a more general approach by introducing the &quot;witness&quot;, a new transaction component where signatures and other data needed to satisfy scripts go, that isn't depended on by the TXID. This was a superior solution in that it's now possible to create chains of unsigned or partially signed transactions and know that no matter what signatures and other data will be included in the witness, the TXIDs will stay the same and the chain remains valid.</p>
<p>However, TXID malleability isn't the only type of malleability to look out for. Some scripts can be satisfied in multiple ways, and if a third party can come up with a solution that takes more space in the witness, they can reduce the fee rate of your transaction. As another example, it was recently <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-February/021452.html" rel="nofollow noreferrer">discussed</a> that if a Taproot script tree includes the same script multiple times on different levels, a third party that knows the tree structure can change the witness to spend the script at a deeper level, which again increases the witness size and lowers your fee rate. These sources of malleability can generally be avoided.</p>

CC BY-SA 4.0
2023-04-22T23:34:03.980Z
2023-04-22T23:39:13.507Z
2023-04-22T23:39:13.507Z
Vojtěch Strnad
<p>I do understand what is transaction malleability and how to do it in practice eg. DER-encoded ASN.1, ECDSA and know that these 2 have been fixed.<br />
Also there are some other types (do not know examples), and SegWit fixed all possible transaction malleability.</p>
<p><strong>Question:</strong><br />
My understanding is that transaction malleability is only possible if transaction is non SegWit eg. P2PKH and only while it is unconfirmed, once it is confimed (is in some mined block) it is not possible any more to change txid.<br />
<strong>Is this understanding correct?</strong></p>
<p>If not what am I missing?</p>

<segregated-witness><transaction-malleability>
Bitcoin transaction malleability is it only for unconfirmed transaction?
WebOrCode
# Bitcoin transaction malleability is it only for unconfirmed transaction?

(Asked by: username_0 on 2023-04-22)

I do understand what is transaction malleability and how to do it in practice eg. DER-encoded ASN.1, ECDSA and know that these 2 have been fixed.  
Also there are some other types (do not know examples), and SegWit fixed all possible transaction malleability.

**Question:**  
My understanding is that transaction malleability is only possible if transaction is non SegWit eg. P2PKH and only while it is unconfirmed, once it is confimed (is in some mined block) it is not possible any more to change txid.  
**Is this understanding correct?**

If not what am I missing?

**Tags:** segregated-witness, transaction-malleability


---

## 1 answers

### Answer by username_1 on 2023-04-22. Score: 3 | Accepted answer

TL;DR: Yes, once a transaction is confirmed, unless a chain reorganization makes it unconfirmed again, no forms of malleability are possible. SegWit specifically fixed TXID malleability of unconfirmed transactions, but other forms of malleability are possible.

---

Transaction malleability in general refers to the possibility of a third party changing some parts of a transaction without making it invalid. For example, with ECDSA it's possible to change a valid signature into a different signature that is still valid for the same message. This isn't a problem in most cryptosystems, but because in pre-SegWit transactions the TXID depends on the transaction signatures and transaction inputs reference the TXID of a transaction whose outputs they're spending, this makes it unsafe to rely on chains of unconfirmed transactions (required by off-chain protocols such as Lightning).

While there were proposals to limit the ECDSA scheme to remove this vulnerability (see [BIP62](https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki) which also covers other malleability vectors), SegWit took a more general approach by introducing the "witness", a new transaction component where signatures and other data needed to satisfy scripts go, that isn't depended on by the TXID. This was a superior solution in that it's now possible to create chains of unsigned or partially signed transactions and know that no matter what signatures and other data will be included in the witness, the TXIDs will stay the same and the chain remains valid.

However, TXID malleability isn't the only type of malleability to look out for. Some scripts can be satisfied in multiple ways, and if a third party can come up with a solution that takes more space in the witness, they can reduce the fee rate of your transaction. As another example, it was recently [discussed](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-February/021452.html) that if a Taproot script tree includes the same script multiple times on different levels, a third party that knows the tree structure can change the witness to spend the script at a deeper level, which again increases the witness size and lowers your fee rate. These sources of malleability can generally be avoided.


---

