OP_CODESEPARATOR Re: BIP Proposal: The Great Consensus Cleanup [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2019-03-13T01:38:44+00:00


Summary:

A proposal has been made to fix a vulnerability in Bitcoin using OP_CODESEPARATOR. The proposal suggests implementing a soft-fork rule that increases an input's weight based on the number of OP_CODESEPARATORs executed and the weight of the UTXO being spent, plus an additional 40 bytes. However, there are concerns that this may result in low fees and could be complex to implement.Another suggestion is to limit the maximum number of OP_CODESEPARATORs allowed per script. However, there is skepticism about this approach as it may render some transactions unspendable. It is emphasized that non-standardness should not be used as an excuse to permanently destroy people's funds.In an email exchange between Matt Corallo and Russell O'Connor, the topic of OP_CODESEPARATOR in non-BIP 143 scripts failing script validation was discussed. While OP_CODESEPARATOR is used for users to sign specific branches within scripts, it appears to have limited practical use cases. O'Connor argues that activating a soft-fork that disables OP_CODESEPARATOR would risk people's money and proposes alternative solutions such as increasing the transaction's weight or imposing a limit on the number of OP_CODESEPARATORs allowed per script.Corallo disagrees with this proposal, noting that such limits could make moderately-large transactions unspendable. He believes that OP_CODESEPARATOR in non-segwit scripts represents a significant vulnerability in Bitcoin and suggests a soft fork rule to address this.Russell O'Connor expresses concerns about disabling OP_CODESEPARATOR in non-BIP 143 scripts, stating that it is necessary for signing specific branches with multiple possible conditions reusing the same public key. Matt Corallo argues that despite efforts, there have been few practical use-cases for this feature. He suggests that OP_CODESEPARATOR in non-segwit scripts poses a vulnerability that needs to be addressed. Corallo dismisses the concern of funds being permanently lost, stating that it is not a sufficient reason to avoid fixing the vulnerability. He proposes increasing the transaction's weight upon OP_CODESEPARATOR execution or implementing a limit on the number of OP_CODESEPARATORs allowed per script.OP_CODESEPARATOR is a mechanism for users to sign specific branches within scripts. However, it fails script validation in non-BIP 143 scripts and poses a vulnerability in Bitcoin. Activating a soft-fork to disable OP_CODESEPARATOR could result in funds being permanently lost. To address this vulnerability, alternative solutions such as increasing the transaction's weight or imposing a limit on the number of OP_CODESEPARATORs executed per script have been suggested. The goal is to prevent fund loss without compromising security.


Updated on: 2023-08-02T00:36:47.010419+00:00