I wonder if there is a way to trace fund flows in the Bitcoin network using transaction data. I'm using Google BigQuery public data and their Bitcoin transaction dataset has following columns:
I've been trying to trace fund flows among Bitcoin addresses by extracting input and output addresses in a transaction from the inputs_addresses and output_addresses columns and the corresponding input and output amounts from the value columns. However, many transactions have multiple inputs and multiple outputs and it's hard to tell which input address paid what amount to a certain output address.
For example, let's say there is a transaction that has two inputs and two outputs. Address A paid 0.5 BTC and Address B paid 0.5 BTC in the transaction and Address C received 0.8 BTC and Address D received 0.2 BTC. I can tell how much each Address paid/received in the transaction but can't really say how much Address A paid Address C. Is there any way to find out how much each input address paid to each output address using any of the existing columns like spent_output_index and script_hex?
If that's not possible, can I at least assume the connections/fund flows among addresses based on the following logic?
Let's say Address A paid 1 BTC and Address B paid 2 BTC in a transaction. Address C received 3 BTC in the same transaction. If I want to trace where this 3 BTC Address C received went after this transaction, should I look for transactions whose "input" is from Address C? Since Address C was an "output" address in the first transaction, I wonder if I can trace where this 3 BTC went by looking at transactions whose "input" address is Address C.