Title: script Post by: FabioCarpi on January 12, 2015, 02:41:59 PM im making a script execution routine in my program
for the multisig sig (ex: https://blockchain.info/pt/tx-index/70071473), have a OP_FALSE in the beginning in the manual (https://en.bitcoin.it/wiki/Script), says the OP_FALSE put a blank value in the stack... in my test, i got this Code: array (size=5) Its correct? And this op_false is for what? Title: Re: script Post by: amaclin on January 12, 2015, 08:37:13 PM Look here:
http://webbtc.com/tx/01ca013ca48b3dde57227086fbb884933cc24054578cb68bc7caeb4fb082638f This is the same transaction. But webbtc service has a feature "Debug --> Run Script" (at the right side) Follow to http://webbtc.com/script/01ca013ca48b3dde57227086fbb884933cc24054578cb68bc7caeb4fb082638f:0 and look to "Execution Trace" : what operations are executed and what is the stack state Title: Re: script Post by: FabioCarpi on January 12, 2015, 10:41:19 PM great site
thanks a lot Title: Re: script Post by: doof on January 12, 2015, 11:03:08 PM great site Agreed. Will book mark this one.thanks a lot Title: Re: script Post by: Saitteld on January 13, 2015, 08:00:34 AM OP_FALSE is needed due to a bug in OP_CHECKMULTISIG. See https://en.bitcoin.it/wiki/Script#Crypto "Due to a bug, one extra unused value is removed from the stack." No, this bug should not be fixed :)
Another visualization of script execution: https://curiosity-driven.org/bitcoin-contracts See: Escrow - Executing script. Title: Re: script Post by: readerbtc on January 13, 2015, 07:24:12 PM No, this bug should not be fixed :) Why not? Sure, it would be a hard fork, but couldn't clients consider block height when executing opcodes and behave accordingly?Title: Re: script Post by: amaclin on January 13, 2015, 07:47:50 PM Quote Why not? Sure, it would be a hard fork, but couldn't clients consider block height when executing opcodes and behave accordingly? Do you want to upgrade all clients in the world? ;DTell me how to do it ;D Title: Re: script Post by: readerbtc on January 14, 2015, 01:36:35 AM Won't they be upgraded, soon or later? I mean, hard forks will happen.
Title: Re: script Post by: Saitteld on January 14, 2015, 12:03:38 PM Either way Bitcoin is an interesting piece of software that needs to not only be backwards-compatible but forwards-compatible too.
Hard fork problem stems from old, not upgraded clients, they'd use the old logic and we can't ignore them. Just like amaclin said it's not upgrading most of the clients, it's upgrading all of them. And yes, in ideal world everyone would update and the bug would be fixed. But Bitcoin client does not have a spec so basically the Bitcoin Core code is the spec. Looking from this perspective maybe we shouldn't call this a "bug"? ;) By the way there are more interesting ... issues like that, see SIGHASH_SINGLE behavior when the number of inputs != number of outputs ( https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_SINGLE ). Title: Re: script Post by: amaclin on January 14, 2015, 12:38:10 PM Quote Looking from this perspective maybe we shouldn't call this a "bug"? ;) This is bug. Definitely a bug. The insect that we did not want to be here. But this is a bug in a consensus code. So, this is a bug in an amber https://upload.wikimedia.org/wikipedia/commons/b/b6/Amber2.jpg Title: Re: script Post by: readerbtc on January 15, 2015, 12:39:05 AM Quote Looking from this perspective maybe we shouldn't call this a "bug"? ;) This is bug. Definitely a bug. The insect that we did not want to be here. But this is a bug in a consensus code. So, this is a bug in an amber https://upload.wikimedia.org/wikipedia/commons/b/b6/Amber2.jpg Title: Re: script Post by: gmaxwell on January 15, 2015, 04:12:23 AM That checkmultisig reads an extra element could be used in the future to make batch validation faster (as it needs some additional side information), or for other extensions. It's commonly assumed to be a bug that it reads an extra item but might have just as well been another forward compatibility mechanism, or a left over behavior from an earlier approach.
Title: Re: script Post by: readerbtc on January 15, 2015, 04:56:06 PM That checkmultisig reads an extra element could be used in the future to make batch validation faster (as it needs some additional side information), or for other extensions. It's commonly assumed to be a bug that it reads an extra item but might have just as well been another forward compatibility mechanism, or a left over behavior from an earlier approach. I like bitcoin because it screws my notions of what is software. |