Talk:OP CHECKSIG: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Sirk390 (talk | contribs)
No edit summary
Sirk390 (talk | contribs)
No edit summary
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)
Answer: ([[User:sirk390|sirk390]])
The comment for step 6. in the bitcoin sources help to understand this (script.cpp:882)
       // In case concatenating two scripts ends up with two codeseparators,
       // In case concatenating two scripts ends up with two codeseparators,
       // or an extra one at the end, this prevents all those possible incompatibilities.
       // 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.
    In step 2, only OP_CODESEPARATOR before OP_CHECKSIG are removed. In step OP_CODESEPARATOR after OP_CHECKSIG are also removed.

Revision as of 15:01, 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) The comment for step 6. in the bitcoin sources help to understand this (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.