Are all the *coin networks consistent in which script actions are permitted and disabled?

3

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.

goodguys_activate

Posted 2012-12-20T20:22:40.390

Reputation: 11 898

Answers

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.

Nick ODell

Posted 2012-12-20T20:22:40.390

Reputation: 26 536