1

Pushdata operations that are not minimally encoded are non-standard since Bitcoin Core 0.9.

My question is: how is this check performed? From reading the source code it seems that it is performed only on executed branches of the script, but it seems not quite right. It would have made more sense to me if it were performed either on the entire script or only on the scriptSig, since malleability of pushdata operations in the scriptSig is what prompted for the check in the first place.

Am I wrong?

1 Answer 1

1

The minimal push check only needs to occur for scripts that are being executed. The malleability only comes from data that is pushed to the stack when an input is being spent. That data is not covered by any signatures which is why it is malleable. So the only data that is pushed to the stack that is malleable are the arguments required for the path taken. There won't be any arguments for the path not taken.

Of course this means that if the script has a path that is not taken, the pushes for anything in those branches are not checked. However these are not malleable. The script will have been committed to earlier in the output script of the output being spent.

1
  • I understand why checking in unexecuted branches is not useful. What I do not understand is why this check is made also on the scriptPubKey and not only on the scriptSig. You say that "So the only data that is pushed to the stack that is malleable are the arguments required for the path taken". However I think that only the data pushed to the stack by the scriptSig is malleable, because data included in the scriptPubKey, even in executed branches, is not malleable Feb 17, 2022 at 20:13

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.