Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The reference Bitcoin client disables several script commands (the programming within a transaction) due to possible implementation issues in the network. I think it's possible that a forked client may actually enable such commands.

  • Do any of the other networks (namecoin, litecoin, test or prod, etc) enable disabled script commands?

I'd like to test and compare my implementation against others.

share|improve this question

Short version


Long version


The bitcoin implementation of banned opcodes is in script.cpp:

        if (opcode == OP_CAT ||
            opcode == OP_SUBSTR ||
            opcode == OP_LEFT ||
            opcode == OP_RIGHT ||
            opcode == OP_INVERT ||
            opcode == OP_AND ||
            opcode == OP_OR ||
            opcode == OP_XOR ||
            opcode == OP_2MUL ||
            opcode == OP_2DIV ||
            opcode == OP_MUL ||
            opcode == OP_DIV ||
            opcode == OP_MOD ||
            opcode == OP_LSHIFT ||
            opcode == OP_RSHIFT)
            return false;

Note that this is not a complete list - OP_NOTEQUAL is also disabled. This code struck me oddly because it appears to create a fork with transactions that use OP_NOTEQUAL. (Perhaps it wasn't being used.)

                // OP_NOTEQUAL is disabled because it would be too easy to say
                // something like n != 1 and have some wiseguy pass in 1 with extra
                // zero bytes after it (numerically, 0x01 == 0x0001 == 0x000001)
                //if (opcode == OP_NOTEQUAL)
                //    fEqual = !fEqual;







You didn't ask about it, but it's also the same.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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