Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: crazy_rabbit on January 30, 2013, 06:22:05 PM



Title: Enable OP-Codes & Scripting?
Post by: crazy_rabbit on January 30, 2013, 06:22:05 PM
While I am a novice programmer, I am intrigued by the possibilities of scripting with Bitcoin but noticed that they are currently disabled, and I understand that most likely for good reason. Are there any thoughts about enabling them sometime soon? What would need to be done to enable them?


Title: Re: Enable OP-Codes & Scripting?
Post by: Peter Todd on January 30, 2013, 06:36:31 PM
They are enabled already on Testnet (https://en.bitcoin.it/wiki/Testnet) so you can try your experiments there.


Title: Re: Enable OP-Codes & Scripting?
Post by: Gavin Andresen on January 30, 2013, 09:56:36 PM
http://bitcoin.stackexchange.com/questions/5664/will-general-non-standard-transactions-ever-be-allowed


Title: Re: Enable OP-Codes & Scripting?
Post by: TheBitcoinTote on November 03, 2013, 01:28:58 AM
@Crazy_rabbit

Can or has terracoin loosen the isStandard() check?


Title: Re: Enable OP-Codes & Scripting?
Post by: Remember remember the 5th of November on November 03, 2013, 01:33:42 AM
Correct me if I am wrong, but don't most op-codes already work? Isn't like OP_CHECKSIG, OP_WHATNOT already used in Bitcoin? Aren't these op-codes?? And isn't that considered "scripting"?


Title: Re: Enable OP-Codes & Scripting?
Post by: piotr_n on November 03, 2013, 04:10:15 PM
Most of the opcodes are enabled - only these are disabled:
Code:
0x7e/*OP_CAT*/
0x7f/*OP_SUBSTR*/
0x80/*OP_LEFT*/
0x81/*OP_RIGHT*/
0x83/*OP_INVERT*/
0x84/*OP_AND*/
0x85/*OP_OR*/
0x86/*OP_XOR*/
0x8d/*OP_2MUL*/
0x8e/*OP_2DIV*/
0x95/*OP_MUL*/
0x96/*OP_DIV*/
0x97/*OP_MOD*/
0x98/*OP_LSHIFT*/
0x99/*OP_RSHIFT*/
But they seem pretty useless, anyway.

All the other opcodes should work fine, as soon as you manage to convince a miner to include such a tx for you, in a block.
I'd suggest bribing it, by leaving a decent fee - eventually they will realize that mining a non-standard txs might be a good business opportunity.


Title: Re: Enable OP-Codes & Scripting?
Post by: crazy_rabbit on November 03, 2013, 04:42:03 PM
@Crazy_rabbit

Can or has terracoin loosen the isStandard() check?

I'm not the dev for Terracoin, and for the moment I'm not really involved in anything TRC related. :-/


Title: Re: Enable OP-Codes & Scripting?
Post by: gmaxwell on November 03, 2013, 06:14:48 PM
But they seem pretty useless, anyway.
alas, actually they're useful. With them you could validate a SPV proof for a cross chain txn, for example.


Title: Re: Enable OP-Codes & Scripting?
Post by: btc4ever on November 03, 2013, 06:25:13 PM
Can anyone provide the history as to why the disabled opcodes were disabled in the first place?   Or were they simply never implemented?


Title: Re: Enable OP-Codes & Scripting?
Post by: gmaxwell on November 03, 2013, 06:27:56 PM
Can anyone provide the history as to why the disabled opcodes were disabled in the first place?   Or were they simply never implemented?
The implementations were buggy.  In the case of the LSHIFT operator there was a remotely triggerable crash. All the operators that changed the sizes of types basically got disabled as a precautionary measure.