0
1
I need to find out all the bitcoins transferred from a particular address to a particular address.
For this I am using the blockexplorer API, for this I use their "Transactions for multiple addresses" API since only this provides a paginated response. Others only give 10 results by default.
So I iterate through transactions, look fromAddress in vin, similarly search for toAddress in vout. If all satisfied I take that value.
for transaction in txs:
valueIn = transaction['valueIn']
valueOut = transaction['valueOut']
confirmations = transaction['confirmations']
if confirmations >= 12:
vin = transaction['vin']
for row in vin:
if row['addr'] == fromAddress:
vout = transaction['vout']
for j in vout:
addresses = j['scriptPubKey']['addresses']
if toAddress in set(addresses):
output.append(j['value'])
But in some case I saw multiple addresses in vin, when is that?
Would my logic would still be right, if my address is part of that?
I believe this does not answer OP's question, which is about multiple addresses within one transaction input. – Pieter Wuille – 2017-09-17T00:50:28.273