vbuterin / pybitcointools

SImple, common-sense Bitcoin-themed Python ECC library
1.28k stars 857 forks source link

Multi-input transaction doubt #97

Closed sr-gi closed 9 years ago

sr-gi commented 9 years ago

Hi everyone,

I have a doubt related to multi-input transactions. Where the transaction is signed, the index of the input to be signed is requested in the function call:

sign(tx, i, private_key)

I don't figure out what it's used for. Is not the whole tx signed (or at least all the inputs and outputs) in order to avoid that any input or output could be modified after signing it?

Thank you.

sr-gi commented 9 years ago

I've figured out for what is needed at the end.

The signature is stored in the SigsScript field of each tx.