OP_IF safety #5639

issue BTCTaras opened this issue on January 11, 2015
  1. BTCTaras commented at 12:38 AM on January 11, 2015: none

    What I mean is, when OP_IF or OP_ENDIF occur in a script without its counterpart, the whole thing (and all associated funds) ends up ruined and unredeemable.

    I think this is an accident waiting to happen; are there any theoretical repercussions to simply ignoring an OP_IF without an associated OP_ENDIF and vice versa?

  2. sipa commented at 12:49 AM on January 11, 2015: member

    Theoretic repercussions? No, although I would personally have preferred to make such a script just syntactically invalid and illegal in transactions.

    The point is moot though: changing this requires a hard fork, which brings huge risks that nobody is willing to take for trivial issues.

  3. luke-jr commented at 2:23 AM on January 11, 2015: member

    Softfork*

    Too bad we can't make it non-IsStandard in P2SH, but by the point we know it's too late :(

  4. laanwj added the label Validation on Jan 12, 2015
  5. laanwj added the label Brainstorming on Jan 12, 2015
  6. Earlz commented at 6:06 AM on January 14, 2015: contributor

    What about rejecting such a transaction from the core wallet RPC interface? That would at least provide some warning about it

  7. gmaxwell commented at 6:55 PM on January 21, 2015: contributor

    It's infeasible (with at least cryptographic hardness) to identify every unsatisfiable transaction; just catching a few classes is unlikely to save someone unless it was especially easy to hit (and if so perhaps should be fixed at the source). That it catches some but not all might give a false sense of security.

    I think a more general script-lint would be interesting, but probably shouldn't be part of the rpc.

  8. theuni commented at 8:50 PM on January 21, 2015: member

    A linter could probably be created from libbitconsensus relatively easily if we added a mechanism for getting the error status. In this case, it'd be set to SCRIPT_ERR_UNBALANCED_CONDITIONAL.

  9. meshcollider commented at 10:16 PM on March 6, 2018: contributor

    I don't think its useful to keep this issue open any longer, its not really a bitcoin-core specific issue, maybe more suitable for a feature suggestion to another tool (e.g. https://github.com/kallewoof/btcdeb)

  10. MarcoFalke added the label Feature on Mar 7, 2018
  11. MarcoFalke commented at 1:20 PM on March 7, 2018: member

    A linter should probably be another tool

  12. MarcoFalke closed this on Mar 7, 2018

  13. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me