Currently looking at https://medium.com/google-cloud/how-to-query-balances-for-all-ethereum-addresses-in-bigquery-fb594e4034a7 and in the SQL Query to calculate address balances there is a part for tranasction feed debits miners incur? How does that work? Miners are spending gas to mine?

-- transaction fees debits
select miner as address, sum(cast(receipt_gas_used as numeric) * cast(gas_price as numeric)) as value
from `bigquery-public-data.crypto_ethereum.transactions` as transactions
join `bigquery-public-data.crypto_ethereum.blocks` as blocks on blocks.number = transactions.block_number
group by blocks.miner

2 Answers 2


This is a fee owed to the miner, rather than one they've incurred.

If you look at the final entry - transaction fees credits - it starts with select from_address as address, and as the sender of the transaction, the from_address is clearly going to be the one paying the transaction fee (with the miner therefore receiving it).

(In double-entry bookkeeping I'm pretty sure a debit of an asset to your balance sheet is actually noted as a balance increase. Someone who knows more about accounting can confirm... )



"For example, a debit increases asset accounts but decreases liability and equity accounts, which supports the general accounting equation of Assets = Liabilities + Equity."


The above section of the SQL query represents transaction fees that are incurred by senders and that are delivered to miners.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.