Checking the implementation of Buterin's bitcoin tools I've noticed something strange. According to the Bitcoin developers guide, sighash_single signs only the outputs that match the input where the scriptSig is going to be placed, that is, input i should sign only output i. However, the code is always signing the current input with the last output of the transaction.

Is it a workaround to deal with a non-matching number of inputs and outputs, or I am missing something?


Just in case someone struggles with the same issue, the code was actually incorrect. Pull request #163 fixes the issue.

Here you can also see an equivalent solution properly commented and cited.

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.