Do i need to sign each input in a raw transaction? I've been reading up about raw transactions on bitcoin.org and there are two examples Simple and Complex.

What I can't tell from the information provided is if it necessary to sign each of the inputs separately, or whether you can just sign the entire tx with one.

So two examples:


Input 1 came from address A and input 2 came from address A.
Input 1 came from address B and input 2 came from address C.


For example 1, my assumption is that I could just use

bitcoin-cli signrawtransaction RAW_TX


but for example 2 I would have to use

 bitcoin-cli signrawtransaction RAW_TX [] ["ADDR_B_PRIVATE_KEY"]
 bitcoin-cli signrawtransaction PARTLY_SIGNED_RAW_TX [] ["$ADDR_B_PRIVATE_KEY"]
Do i need to sign each input in a raw transaction?


Technically, yes. But software like Bitcoin Core Client signs all inputs where the private keys are known. And of course, leave unsigned/untouched all other inputs.