Difference between revisions of "Talk:OP CHECKSIG"

From Bitcoin Wiki
Jump to: navigation, search
(Code samples and raw dumps)
Line 8: Line 8:
  
 
However, doesn't step 6 seem redundant? [[User:Vegard|Vegard]]
 
However, doesn't step 6 seem redundant? [[User:Vegard|Vegard]]
 +
   
 +
Answer:  [[User:sirk390|sirk390]]
 +
    See comment for step 6. in the bitcoin sources (script.cpp:882)
 +
      // In case concatenating two scripts ends up with two codeseparators,
 +
      // or an extra one at the end, this prevents all those possible incompatibilities.
 +
 +
    In step 2, only OP_CODESEPARATOR before OP_CHECKSIG are removed. In step OP_CODESEPARATOR after OP_CHECKSIG are also removed.

Revision as of 14:57, 30 July 2011

Redundant step?

Under "How it works", we have steps 2 and 6:

- 2. A new subscript is created from the instruction from the most recent OP_CODESEPARATOR to the end of the script. If there is no OP_CODESEPARATOR the entire script becomes the subscript (hereby referred to as subScript)

- 6. All OP_CODESEPARATORS are removed from subScript

However, doesn't step 6 seem redundant? Vegard

Answer: sirk390

   See comment for step 6. in the bitcoin sources (script.cpp:882)
      // In case concatenating two scripts ends up with two codeseparators,
      // or an extra one at the end, this prevents all those possible incompatibilities.
   In step 2, only OP_CODESEPARATOR before OP_CHECKSIG are removed. In step OP_CODESEPARATOR after OP_CHECKSIG are also removed.