How to manually sign a transaction with multiple inputs and multiple outputs? I'm developing transaction constructor, but i faced several problems.  To some of which i found answer in How to sign a transaction with multiple inputs?, for the rest i'll try to explain:


When we have multiple inputs and multiple outputs and try to sign every input what do we fill in the output value section for each one of them: The total sum of the transaction inputs or the corresponding amount that every input that we sign has and we distribute between the outputs?


'version': 1,
'inputs': (2)
    {
    'output_tx_hash': 'aaaa',
    'output_position': 0,
    'script': the original script, like: '76a914' + hash + '88ac',
    'sequence': ffffffff,
    }, {
    'output_tx_hash': 'bbbb',
    'output_position': 1,
    'script': '', # Nothing
    'sequence': ffffffff,
    }
'outputs': (2)
    'value' : 100000
    'script' : '76a914' + hash of btc pub key + '88ac'
    'value' : 50000
    'script' : '76a914' + hash of btc pub key + '88ac'
'locktime': 0


In the section script in inputs, there is "Nothing", but what is the exact byte count of it - 1 byte, 4 bytes or something else?
Is there a step-by-step guide or tutorial for manual transaction building and signing that covers multiple inputs and multiple outputs transaction. I successfully send transactions to the blockchain but only the ones with one input.
When it comes to transactions, I think that a hex representation can explain more unambigiously than words.
That's why my answer uses hex along every step of the signature.
Given your P2PKH transaction with two inputs, here's the raw transaction that has to be signed with the private key corresponding to the first outpoint:
01000000
02
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
00000000
19
76a914&lt;your-first-pkhash(160bit)&gt;88ac
ffffffff
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
01000000
00
ffffffff
02
a086010000000000
19
76a914&lt;hash-of-target-btc-pubkey1(160bit)&gt;88ac
50c3000000000000
19
76a914&lt;hash-of-target-btc-pubkey2(160bit)&gt;88ac
00000000
01000000

Here's the raw transaction that has to be signed with the private key corresponding to the second outpoint:
01000000
02
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
00000000
00
ffffffff
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
01000000
19
76a914&lt;your-second-pkhash(160bit)&gt;88ac
ffffffff
02
a086010000000000
19
76a914&lt;hash-of-target-btc-pubkey1(160bit)&gt;88ac
50c3000000000000
19
76a914&lt;hash-of-target-btc-pubkey2(160bit)&gt;88ac
00000000
01000000

And here is the resulting signed transaction:
01000000
02
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
00000000
6a
47
304&lt;...rest-of-signature&gt;
01
21
&lt;your-first-pk(264bit)&gt;
ffffffff
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
01000000
6a
47
304&lt;...rest-of-signature&gt;
01
21
&lt;your-second-pk(264bit)&gt;
ffffffff
02
a086010000000000
19
76a914&lt;hash-of-target-btc-pubkey1(160bit)&gt;88ac
50c3000000000000
19
76a914&lt;hash-of-target-btc-pubkey2(160bit)&gt;88ac
00000000

Assumptions: (1) You're using compressed public keys. (2) type is SIG_ALL
Note: Length of signatures can vary, and as a result the bytes that indicate script length can differ from the example above.

Answering your 3rd question, there is a description here