How are gas fees calculated in account based model coins like ETH?
Let's say I own 10 ETH addresses with 0 starting balance. I receive 0.1 ETH payment from 10 people - each one sending a payment of 0.1 to one of my 10 ETH addresses (Obviously in 10 separate transactions). The combined total in all 10 addresses I own is now equal to exactly 1 ETH.
I now want to "forward" (consolidate) all 10 payments received to a single ETH address under my control. According to EtherScan it costs approx. 40 gwei (or $0.90) for the transaction to be confirmed in 16 min (slowest confirmation time). Assume I chose to forward all 10 payments using 16 min confirmation time. My impression is that the combined fee should be calculated as 10 * $0.90 (or 1- * 40 gewi * 21,000) which is equal to $9. Is this correct?
If, after forwarding ("consolidating") the entire amount to one address, I now want to transfer that amount (1 ETH) to another address (single output), the fee for this transfer would only be $0.90 cents, correct (since all ETH is now originating from a single address)?
If instead of sending 1 ETH to one address, I split it between two ETH addresses (so 0.5 ETH to each address) the cost is calculated as 2 * $0.90 cents or $1.8 total or is it one fee of $0.90?
Assuming my calculation above is accurate, does the calculation change if I transferred the original 10 * 0.1 payment to the single ETH address via a single batch transaction vs. if they were transferred in 10 different transaction? My impression is that since ETH uses an account based model there's no concept of batch transfers. So whether the original 10 * 0.1 were transferred at one time vs multiple occasions/times - it would not effect the fee I pay when transferring 1 ETH to another address. Is this correct?
I hope the question is not too basic as I searched and could not find a definitive answer.
21000 * 40 * 10**9 = 840000e+9
.