Why SegWit Anyway?



Summary:

A user on the bitcoin-dev mailing list asked why the format of transactions needs to be changed for SegWit, and suggested computing the Transaction ID (TxID) in the same way the hash for signing the transaction is computed. However, this would not work due to different SIGHASH flags resulting in multiple ways to hash a transaction. Changing the definition of TxID would require a hardfork change, meaning everyone would need to upgrade or a chain split would occur. Instead, it is possible to use “normalised TxID” (BIP140) as a softfork solution to fix the malleability issue. BIP140 does not change the definition of TxID, but rather uses the normalized txid (i.e. txid with scriptSig removed) when making signatures. This approach does not have the side-effect of block size increase like segwit (BIP141), but makes the UTXO set permanently bigger as the database needs to store both txid and normalized txid.


Updated on: 2023-05-20T04:21:59.802265+00:00