1

Does a transaction with 50 inputs have 50 different hashofthingtosign, one for each input, or does it just have one that is used for all the input scripts?

Mine
  • 1,406
  • 2
  • 16
  • 27

1 Answers1

1

It is different for each input. Each input's hash preimage contains that input's previous output's scriptPubKey in that input's scriptSig. All other inputs have empty scriptSigs. This means that the preimage for each input is unique, and thus has a unique hash.

Ava Chow
  • 70,382
  • 5
  • 81
  • 161
  • A large portion (but not all) of the hash preimage consists of the serialized transaction where all inputs except the one being signed for have empty scriptSigs. – Ava Chow Aug 08 '17 at 04:38
  • I don't know if this is something I'm allowed to ask, if not, totally erase it. Is there a way I can just pay someone to make a python script for me where I put in the transaction id and it sends the hash of each "input script" from that transaction to a file? I've got some serious OCD on this. Its a puzzle I must complete! – Mine Aug 08 '17 at 05:33
  • Sure you can, but this is not the right place to ask for such a thing. Such a script would require having the entire blockchain and know where each transaction is in the blockchain. – Ava Chow Aug 08 '17 at 05:35
  • Where would be the right place to ask for something like that? and blockcypher.com has stuff that gives people access to such stuff within python, they could have it kick back the whole data set for a particular transaction if I have read it correctly. – Mine Aug 08 '17 at 05:38
  • Try asking on bitcointalk.org or in the various Bitcoin subreddits (r/bitcoin, r/jobs4bitcoins) – Ava Chow Aug 08 '17 at 05:40
  • take a look here: https://bitcoin.stackexchange.com/questions/41209/how-to-sign-a-transaction-with-multiple-inputs - this explains, what you are looking for (and the referenced links). I had a set of shell scripts to do the same, but not python... but there are many python tools out there as well. Check with bitcointalk as well. – pebwindkraft Aug 08 '17 at 06:45
  • Not to drag out the conversation in comments, but if you have any such shell scripts I would be interested in any context. I'm just using python as one of the easier examples I can actually use. – Mine Aug 09 '17 at 05:52