2

are any of the following transaction malleability "attack" vectors currently feasible?

alter scriptsig from:

OP_PUSHDATA <sig> OP_PUSHDATA <pubkey>

to one of:

1) OP_1 OP_SHA1 OP_DROP OP_PUSHDATA <sig> OP_PUSHDATA <pubkey>
2) OP_PUSHDATA <sig> OP_PUSHDATA <pubkey> OP_1 OP_SHA1 OP_DROP
3) OP_PUSHDATA <sig> OP_PUSHDATA <pubkey> OP_NOP

so that the corresponding scriptpubkey still evaluates to true:

OP_DUP OP_HASH160 OP_PUSHDATA <address> OP_EQUALVERIFY OP_CHECKSIG

i can't tell if this is handled by point 6 in bip 62 or not:

  1. Superfluous scriptSig operations Adding extra data pushes at the start of scripts, which are not consumed by the corresponding scriptPubKey, is also a source of malleability.

judging by the code it looks like it has been taken care of, but my c++ knowledge is not great...

1 Answer 1

1

Point (6) does not eliminate this source of malleability. Rather, point (2) of BIP62 disallows all three modifications you suggested. BIP62 describes the problem:

Non-push operations in scriptSig Any sequence of script operations in scriptSig that results in the intended data pushes, but is not just a push of that data, results in an alternative transaction with the same validity.

And the proposed solution:

Non-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.

2
  • one last one - how about a doubling the scriptsig content:OP_PUSHDATA <sig> OP_PUSHDATA <pubkey> OP_PUSHDATA <sig> OP_PUSHDATA <pubkey> - i think this would still evaluate to true, right? Commented Jun 16, 2015 at 0:05
  • 1
    @mulllhausen Point (6) prevents against that. It would evaluate to true with a typical transaction, but it would be a non-standard and not relayed. For transactions in which bip62 goes into effect, it would evaluate to false, though.
    – morsecoder
    Commented Jun 16, 2015 at 0:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.