<p>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.</p>

CC BY-SA 3.0
2017-08-08T04:38:21.883Z
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
CC BY-SA 3.0
2017-08-08T05:33:52.453Z
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
CC BY-SA 3.0
2017-08-08T05:35:23.773Z
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
CC BY-SA 3.0
2017-08-08T05:38:59.523Z
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
CC BY-SA 3.0
2017-08-08T05:40:31.953Z
Try asking on bitcointalk.org or in the various Bitcoin subreddits (r/bitcoin, r/jobs4bitcoins)
Ava Chow
CC BY-SA 3.0
2017-08-08T06:45:27.387Z
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
CC BY-SA 3.0
2017-08-09T05:52:37.637Z
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
CC BY-SA 3.0
2017-08-08T02:56:40.590Z
2017-08-08T02:56:40.590Z
Ava Chow
<p>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?</p>

<transactions><hash><signature><input>
Is the HashOfThingToSign (used in signature generation) the same for each input of a transaction or is it different for each input of a transaction?
Mine
# Is the HashOfThingToSign (used in signature generation) the same for each input of a transaction or is it different for each input of a transaction?

(Asked by: username_0 on 2017-08-08)

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?

**Tags:** transactions, hash, signature, input


---

## 1 answers

### Answer by username_1 on 2017-08-08. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_1**: 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.  
> **username_0**: 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!  
> **username_1**: 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.  
> **username_0**: 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.  
> **username_1**: Try asking on bitcointalk.org or in the various Bitcoin subreddits (r/bitcoin, r/jobs4bitcoins)  
> **username_2**: 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.  
> **username_0**: 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.  

---

