Can anyone explain this pseudocode to find a returning address?
Can anyone explain this pseudocode to find a returning address? I was reading a popular answer which explains how to find the address of the person who sent a transaction and the pseudocode in that answer does not make much sense to me. txid = <relevant transaction id> addresses = [] raw_tx = decoderawtransaction(getrawtransaction(txid)) for(input in raw_tx['vin']) { input_raw_tx = decoderawtransaction(getrawtransaction(input['txid'])) addresses.push(input_raw_tx['vout'][input['vout']]['scriptPubKey']['addresses'][0]) } Here is the part which I understood. A wallet which created txid can use many inputs from different addresses to send that amount of money. This is why we iterate over input in raw_tx['vin'] and create a list of addresses addresses = []. Here is a part which is unclear for me: input_raw_tx['vout'][input['vout']]['scriptPubKey']['addresses'][0] input_raw_tx['vout...