SIGHASH_SINGLE vbuterin/pybitcointools

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

Posted 2017-02-03T09:18:40.100

Reputation: 2 382

Answers

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

Posted 2017-02-03T09:18:40.100

Reputation: 2 382