Author: Pieter Wuille 2015-05-13 17:14:07
Published on: 2015-05-13T17:14:07+00:00
A BIP (Bitcoin Improvement Proposal) has been proposed by Christian Decker to normalize transaction IDs in order to address transaction malleability and facilitate higher level protocols. The normalized transaction ID is an alias used in parallel to the current (legacy) transaction IDs to address outputs in transactions. It is calculated by removing (zeroing) the scriptSig before computing the hash, which ensures that only data whose integrity is also guaranteed by the signatures influences the hash. Transactions get 2 txids, one used to reference them (computed as before), and one used in an (extended) sighash. The txins keep using the normal txid, so no structural changes are made to Bitcoin. The ntxid is computed by replacing the scriptSigs in inputs by the empty string, and by replacing the txids in txins by their corresponding ntxids. A new checksig operator is softforked in, which uses the ntxids in its sighashes rather than the full txid. To support efficiently computing ntxids, every tx in the utxo set (currently around 6M) stores the ntxid, but only supports lookup by txid still. This does result in a system where a changed dependency indeed invalidates the spending transaction, but the fix is trivial and can be done without access to the private key. Normalized transaction ids are only effectively non-malleable when all inputs they refer to are also non-malleable (or there can be malleability in 2nd level dependencies), so mixed usage of the txids is disallowed. They do not provide the actual benefit of guaranteed non-malleability before it becomes disallowed to use the old mechanism. That, together with the resource doubling needed for the UTXO set, makes this a bad idea. While this proposal does require a hardfork, it simplifies higher level protocols and solves a long-standing problem. It is up for discussion and improvements, but Christian Decker thinks it would be a nice addition to the functionality.
Updated on: 2023-05-19T20:24:06.057100+00:00