Two variants of signing transaction

0

When signing transaction I think the following is done (in short):

For each input

  • all inputs and outputs are taken
  • the respective input scriptSig is filled with txPrev.pubScript, other inputs's scriptSigs are left blank?
  • this is signed and signature is put in scriptSig

Is there any benefit for bundling all inputs prior to making each signature? Could just respective input be used when signing for that input?

croraf

Posted 2017-11-27T13:33:17.510

Reputation: 1 112

this is how segwit transactions work :) read more about quadratic hashing problem and segwit solution. you are on right wayamaclin 2017-11-27T13:57:55.390

Answers

1

Answer provided by @Andrew Chow:

The benefit is that each signature commits to the inputs and outputs of the transaction so that they cannot be changed. If each input only commit to one input, then more inputs could be added and malleate the transaction. However, there is a sighash type that allows this: sighash ANYONECANPAY.

croraf

Posted 2017-11-27T13:33:17.510

Reputation: 1 112