Author: Russell O'Connor 2019-03-07 15:03:17
Published on: 2019-03-07T15:03:17+00:00
OP_CODESEPARATOR is a mechanism that allows users to sign which particular branch they are authorizing for within scripts that have multiple possible conditions that reuse the same public key. However, in non-BIP 143 scripts, OP_CODESEPARATOR fails the script validation, including OP_CODESEPARATORs in unexecuted branches of if statements, similar to other disabled opcodes, but unlike OP_RETURN. P2SH makes it impossible to know whether someone is currently using this feature, and activating a soft-fork as described above means these sorts of funds would be permanently lost, putting people's money at risk. Therefore, an alternative is suggested whereby the execution of OP_CODESEPARATOR increases the transaction's weight suitably as to temper the vulnerability caused by it. Another potential solution is to place a limit on the maximum number of OP_CODESEPARATORs allowed to be executed per script, but this would require an argument as to why exceeding that limit isn't reasonable. The goal is to prevent the loss of funds without compromising security.
Updated on: 2023-06-13T17:29:23.011905+00:00