I just ran in to the concept of gas and found this community. This question and answer were particularly helpful, but they leave one thing unanswered for me:

If I send out a transaction with a given price I am willing to pay for gas and a cap on the gas that can be used, how do miners decide which of them should process it? Say the price I offer is really good. It seems to me they would all try to process it and collect the fee. Now say my computation runs out of gas, and all those miners try to collect the fee. I shouldn't be double-charged, yet the work was done multiple times.

Is there a system for laying claim to transactions so this duplication of work doesn't happen? If there is, how does it work? If there isn't, then which of the miners who take up my task gets to keep the fee?

  • In short: The "winning" miner - i.e. the one miner that successfully mines the block ahead of everyone else - gets the fees from the transactions inside the block. Dec 5, 2017 at 21:59
  • So there basically is no system. It is only the miner who finds the block who gets to keep the fee. How are Uncle Blocks possible? I read something about the fees intending to keep the mining network from being centralized like it has been in Bitcoin. (i.e. You have to be super powerful to have a hope of mining successfully.) How do they accomplish this? Dec 5, 2017 at 22:11
  • Anyone can join a mining pool, and earn an amount proportional to their hashing power contribution, you don't need to be a big player (but yes, they earn more). Uncle blocks (and GHOST) allow Ethereum to have a much shorter block time than Bitcoin. They're a consequence of more than one miner finding a solution at around the same time. Bitcoin also has transaction fees - the main difference is "gas", which is the fee to run a contract (rather than just transfer funds in a normal transaction). Dec 5, 2017 at 22:21


Browse other questions tagged or ask your own question.