SIGHASH_SINGLE vbuterin/pybitcointools 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.