Sunday, December 22, 2024

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

TL;DR: Sure, as soon as a transaction is confirmed, until a sequence 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 basically refers to the opportunity of a 3rd social gathering altering some components of a transaction with out making it invalid. For instance, with ECDSA it is attainable to alter a sound signature into a unique 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 will depend on 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 normal strategy by introducing the “witness”, a brand new transaction part the place signatures and different information 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 information will probably be included within the witness, the TXIDs will keep the identical and the chain stays legitimate.

Nonetheless, TXID malleability is not the one sort of malleability to look out for. Some scripts may be glad in a number of methods, and if a 3rd social gathering can provide you with an answer that takes more room within the witness, they will scale back the payment price of your transaction. As one other instance, it was lately mentioned that if a Taproot script tree consists of 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 payment price. These sources of malleability can usually be prevented.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles