1

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?

sr_gi
  • 3,087
  • 1
  • 11
  • 36

1 Answers1

0

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.

sr_gi
  • 3,087
  • 1
  • 11
  • 36