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?