6

Why are the substring opcodes disabled? I understand that OP_CAT is disabled because it can blow up the stack easily (in combination with OP_DUP). But the substring opcodes reduce the stack size.

Context:

I'd like to use OP_LEFT to implement a proof of work requirement to spend a transaction. A substring operation is needed because OP_ADD (for salting) and OP_GREATERTHAN only work on 32bit values.

6

I'm afraid that my answer here can't be better than "Ask Satoshi".

There was a series of bugs found in Bitcoin's early life, and the response by its creator was to disable a number of scripting opcodes. Some of these may have been bad choices (or very wise ones...), but we don't know, and it does not matter. For all intents and purposes, these opcodes do not exist, as "reenabling" them would be just as hard as introducing them as new operations in the first place (i.e. a hard fork).

  • So do you agree with my analysis, or can you see potential issues with these substring operations? Thanks for taking the time to answer my question! – hrobeers Sep 23 '16 at 11:31
  • I do not see any issues with those operations, no. – Pieter Wuille Sep 23 '16 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.