<p>yes, it is. For each input you create a raw transaction with the pubkey script in the scriptsig "slot". Then this raw tx gets seigned. Each input has a different "source" (previous input tx and previous input "outpoint"), since they are hashed before signing, it creates a different result. A sample how to do this for two inputs is shown here: </p>

<blockquote>
  <p><a href="https://bitcoin.stackexchange.com/questions/41209/how-to-sign-a-transaction-with-multiple-inputs">How to sign a transaction with multiple inputs?</a></p>
</blockquote>

CC BY-SA 3.0
2017-12-27T15:41:33.357Z
Thanks! In that case, which hash is eventually placed in the transaction "hash" field?
user2298995
CC BY-SA 3.0
2017-12-27T15:44:29.947Z
for each input, the hash of the previous tx, from which you'd want to spend (in the example it is displayed as aaaa and bbbb).
pebwindkraft
CC BY-SA 3.0
2017-12-27T19:03:10.690Z
Yes, basically you create the whole tx (with tx hash and outpoint from previous transaction), and put the pubkey script into the location of the script sig, and then sign it, and repeat this for all inputs. Ken Shirrif’s webpage “http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html” gives a good overview for a single input tx.
pebwindkraft
CC BY-SA 3.0
2017-12-27T19:48:37.260Z
Thanks for all your help. When creating the transaction we have a "hash" parameter. Until now I thought it was the double hashed raw transaction (before signing). Is that the actual case?
user2298995
CC BY-SA 3.0
2017-12-28T07:34:04.877Z
see here the detailed, step-by-step explanation in the answer section: https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx
pebwindkraft
CC BY-SA 3.0
2017-12-27T15:37:00.807Z
2017-12-27T15:37:00.807Z
pebwindkraft
<p>Since scriptSig is a signed transaction hash with the spender's private key, how is the scriptsig different for each input?</p>

<input-script>
Is scriptSig different for each input?
user2298995
# Is scriptSig different for each input?

(Asked by: username_0 on 2017-12-27)

Since scriptSig is a signed transaction hash with the spender's private key, how is the scriptsig different for each input?

**Tags:** input-script


---

## 1 answers

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

yes, it is. For each input you create a raw transaction with the pubkey script in the scriptsig "slot". Then this raw tx gets seigned. Each input has a different "source" (previous input tx and previous input "outpoint"), since they are hashed before signing, it creates a different result. A sample how to do this for two inputs is shown here:

> [How to sign a transaction with multiple inputs?](https://bitcoin.stackexchange.com/questions/41209/how-to-sign-a-transaction-with-multiple-inputs)

> **Comments:**
> **username_0**: Thanks! In that case, which hash is eventually placed in the transaction "hash" field?  
> **username_1**: for each input, the hash of the previous tx, from which you'd want to spend (in the example it is displayed as aaaa and bbbb).  
> **username_1**: Yes, basically you create the whole tx (with tx hash and outpoint from previous transaction), and put the pubkey script into the location of the script sig, and then sign it, and repeat this for all inputs. Ken Shirrif’s webpage “http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html” gives a good overview for a single input tx.  
> **username_0**: Thanks for all your help. When creating the transaction we have a "hash" parameter. Until now I thought it was the double hashed raw transaction (before signing). Is that the actual case?  
> **username_1**: see here the detailed, step-by-step explanation in the answer section: https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx  

---

