Learn how Bitcoin works, and how to analyze block statistics, transaction values, active addresses, and address balances using Dune!
The "Bitcoin Balances" query only checks WHERE i.spent_tx_id = o.tx_id to discard spent outputs.
Shouldn't it consider i.spent_tx_id = o.tx_id AND o.index = i.spent_output_number ?
The input could be spending another output from the same transaction!
that's a great point! I've fixed it, thank you for catching my mistake.
The "Bitcoin Balances" query only checks WHERE i.spent_tx_id = o.tx_id to discard spent outputs.
Shouldn't it consider i.spent_tx_id = o.tx_id AND o.index = i.spent_output_number ?
The input could be spending another output from the same transaction!
that's a great point! I've fixed it, thank you for catching my mistake.