Author: Johnson Lau 2018-11-23 10:47:10
Published on: 2018-11-23T10:47:10+00:00
The sighash cache is not necessary nor efficient in the next-generation SIGHASH and is not a sufficient reason to remove OP_CODESEPARATOR. An adversarial miner could use non-standard sighash types to nullify any attempt to cache sighash values, so the only way to prevent this is to reject OP_CODESEPARATOR, FindAndDelete(), and non-standard SIGHASH with a softfork. However, this doesn't work in the next-generation SIGHASH, as tens of standard sighash types will exist. There is a general negative sentiment against OP_CODESEPARATOR but it should be evaluated on a case by case basis. Each call to OP_CODESEPARATOR / OP_CHECKSIG pair requires recomputing a new #5. scriptCode from BIP 143, and hence computes a new transaction digest. This issue was the main motivation for wanting to deprecate OP_CODESEPARATOR and remove it from later versions of script.
Updated on: 2023-05-20T18:06:35.450226+00:00