user133916: When we sign a transaction at least with 2 inputs and SIGHASH_ALL flag, what happend to the signature message ?
For example:
version: 01000000
inputs:  02
  txid: b7994a0db2f373a29227e1d90da883c6ce1cb0dd2d6812e4558041ebbbcfa54b
  vout: 00000000
  scriptsigsize: 19
  scriptsig: 76a9144299ff317fcd12ef19047df66d72454691797bfc88ac
  sequence: ffffffff
  ----------------------------------------------------------------------
  txid: e9431833fc2380477723e4b50aa6386dc8d6b86a3a6911a240cfacd68208ea28
  vout: 00000001
  scriptsigsize: 19
  scriptsig: 76a9144299ff317fcd12ef19047df66d72454691797bfc88ac
  sequence: ffffffff
outputs: 01
  amount: c965000000000000
  scriptpubkeysize: 19
  scriptpubkey: 76a914b3e2819b6262e0b1f19fc7229d75677f347c91ac88ac
locktime: 00000000

Step 1: Take the first input sign it and replace scriptSigSize and scriptSig by the signature size and the signature data. Then, do I have to edit the message with the replaced input scriptSig? Or Do I keep the same transaction message for every signature in the same transaction ?
Best wishes

user48884: Each input signs a different message. It is always the spending transaction with all inputs blanked out except for the input being signed. So when signing the second input, anything in the scriptSig for the first input is ignored. This allows for independent signing and verification - you don't need to have signed the first input in order to sign and verify the second input.

133916: <p>When we sign a transaction at least with 2 inputs and SIGHASH_ALL flag, what happend to the signature message ?</p>
<p>For example:</p>
<pre><code>version: 01000000
inputs:  02
  txid: b7994a0db2f373a29227e1d90da883c6ce1cb0dd2d6812e4558041ebbbcfa54b
  vout: 00000000
  scriptsigsize: 19
  scriptsig: 76a9144299ff317fcd12ef19047df66d72454691797bfc88ac
  sequence: ffffffff
  ----------------------------------------------------------------------
  txid: e9431833fc2380477723e4b50aa6386dc8d6b86a3a6911a240cfacd68208ea28
  vout: 00000001
  scriptsigsize: 19
  scriptsig: 76a9144299ff317fcd12ef19047df66d72454691797bfc88ac
  sequence: ffffffff
outputs: 01
  amount: c965000000000000
  scriptpubkeysize: 19
  scriptpubkey: 76a914b3e2819b6262e0b1f19fc7229d75677f347c91ac88ac
locktime: 00000000
</code></pre>
<p>Step 1: Take the first input sign it and replace scriptSigSize and scriptSig by the signature size and the signature data. Then, do I have to edit the message with the replaced input scriptSig? Or Do I keep the <strong>same</strong> transaction message for every signature in the same transaction ?</p>
<p>Best wishes</p>
 48884: <p>Each input signs a different message. It is always the spending transaction with all inputs blanked out except for the input being signed. So when signing the second input, anything in the scriptSig for the first input is ignored. This allows for independent signing and verification - you don't need to have signed the first input in order to sign and verify the second input.</p>
