Tuesday, October 1, 2024

segregated witness – Bitcoin transaction malleability is it just for unconfirmed transaction?

TL;DR: Sure, as soon as a transaction is confirmed, until a series reorganization makes it unconfirmed once more, no types of malleability are attainable. SegWit particularly mounted TXID malleability of unconfirmed transactions, however different types of malleability are attainable.


Transaction malleability normally refers to the potential for a 3rd social gathering altering some elements of a transaction with out making it invalid. For instance, with ECDSA it is attainable to alter a legitimate signature into a special signature that’s nonetheless legitimate for a similar message. This is not an issue in most cryptosystems, however as a result of in pre-SegWit transactions the TXID depends upon the transaction signatures and transaction inputs reference the TXID of a transaction whose outputs they’re spending, this makes it unsafe to depend on chains of unconfirmed transactions (required by off-chain protocols resembling Lightning).

Whereas there have been proposals to restrict the ECDSA scheme to take away this vulnerability (see BIP62 which additionally covers different malleability vectors), SegWit took a extra basic strategy by introducing the “witness”, a brand new transaction element the place signatures and different knowledge wanted to fulfill scripts go, that is not trusted by the TXID. This was a superior answer in that it is now attainable to create chains of unsigned or partially signed transactions and know that it doesn’t matter what signatures and different knowledge might be included within the witness, the TXIDs will keep the identical and the chain stays legitimate.

Nevertheless, TXID malleability is not the one kind of malleability to look out for. Some scripts could be happy in a number of methods, and if a 3rd social gathering can give you an answer that takes extra space within the witness, they will cut back the charge charge of your transaction. As one other instance, it was not too long ago mentioned that if a Taproot script tree contains the identical script a number of occasions on completely different ranges, a 3rd social gathering that is aware of the tree construction can change the witness to spend the script at a deeper stage, which once more will increase the witness measurement and lowers your charge charge. These sources of malleability can usually be prevented.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles