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.