Let's say I am a node. A transaction has been relayed to me, and one of the scriptSig fields is:

<sig> <pubKey>

  1. What is the easiest way for me to malleate this transaction?

    • For example, could I just add a "dummy" opcode to it, like this: OP_NOP <sig> <pubKey>?
  2. Also, are certain types of scriptSig easier to malleate than others?

Basically, I'm interested in the most practical way a third party might go about malleating a transaction.

  • I don't believe adding a dummy opcode would work. You can't change the payload of the transaction at all without invalidating the signature - that's a key property of any usable digital signature algorithm. Instead, you have to keep the payload the same, but modify the format of the signature itself. Jun 13 '17 at 20:15
  • Adding a dummy opcode would actually be valid, however the result would be non-standard at least in Bitcoin Core. Aug 12 '17 at 21:08

The easiest way to malleate a transaction is to just change the signature from Low-S to High-S and vice versa.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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