Clarify the interaction between BIP62 rule 6 (clean stack) and P2SH #115

pull sipa wants to merge 2 commits into bitcoin:master from sipa:bip62up4 changing 1 files +7 −7
  1. sipa commented at 7:49 am on October 26, 2014: member
  2. Instead of repeating some problem names, give the rules meaningful ones 47b050ac98
  3. BIP62 rule 6 and P2SH
    Clarify that BIP62 rule 6 (clean stack) only applies after potential P2SH redeemscript evaluation.
    Applying it before the redeemscript evaluation means that every P2SH script will fail it,
    as P2SH by definition uses an unclean stack (to specify the redeemscript inputs).
    bb863dc6d8
  4. in bip-0062.mediawiki: in bb863dc6d8
    44-# '''Zero-padded number pushes''' Any time a script opcode consumes a stack value that is interpreted as a number, it must be encoded in its shortest possible form. 'Negative zero' is not allowed. See reference: [[#numbers|Numbers]].
    45-# '''Inherent ECDSA signature malleability''' We require that the S value inside ECDSA signatures is at most the curve order divided by 2 (essentially restricting this value to its lower half range). See reference: [[#low-s-values-in-signatures|Low S values in signatures]].
    46-# '''Superfluous scriptSig operations''' scriptPubKey evaluation will be required to result in a single non-zero value. If any extra data elements remain on the stack, the script evaluates to false.
    47-# '''Inputs ignored by scripts''' The (unnecessary) extra stack element consumed by OP_CHECKMULTISIG and OP_CHECKMULTISIGVERIFY must be the empty byte array (the result of OP_0). Anything else makes the script evaluate to false.
    48+# '''Require DER encoded ECDSA signatures''' An ECDSA signature passed to OP_CHECKSIG, OP_CHECKSIGVERIFY, OP_CHECKMULTISIG or OP_CHECKMULTISIGVERIFY must be encoded using strict DER encoding. Doing a verification with a non-DER signature makes the entire script evaluate to False (not just the signature verification). See reference: [[#der-encoding|DER encoding]].
    49+# '''Only push operations in scriptSig''' Only data pushes are allowed in scriptSig. Evaluating any other operation makes the script evaluate to false. See reference: [[#push-operators|Push operators]].
    


    luke-jr commented at 8:46 am on October 26, 2014:
    IMO this shouldn’t apply to all version>=2 transactions - too limiting on future stuff…
  5. sipa commented at 7:43 am on November 5, 2014: member
    Superseded by #117 (which includes @luke-jr’s suggestion).
  6. sipa closed this on Nov 5, 2014

  7. luke-jr referenced this in commit 41f400a378 on Jun 6, 2017


sipa luke-jr


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-28 16:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me