5

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.

1 Answer 1

2

Short version

Yes.

Long version

Bitcoin

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;

Source.

Namecoin

Same.

LiteCoin

Same.

SolidCoin

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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