2

From Gavin Wood's yellow paper:

In general, Ether used to purchase gas that is not refunded is delivered to the beneficiary address, the address of an account typically under the control of the miner.

This looks like a way to tip the miner. I'm trying to understand how it works.

Inside a transaction, there are:

  • value field is the amount of ether to transfer to the recipient. So the tip paid to the beneficiary shouldn't be included here.

  • gasLimit field is the max gas to pay the gas costs of the contract steps. Any unused gas will be re-funded. Is there a mechanism for the sender to say to miner: "Hey why don't you keep the change? "

I looked at other fields but they all seem to be unrelated. So how does this work?

Also, since sender can set gasPrice higher which can be a way to tip the miner, so what's the point of including another way of tipping?

Thanks!

1

"Ether used to purchase gas that is not refunded" is a poorly worded way to say "transaction fee."

value is the amount of the transaction and has nothing to do with the mining. If I send you ten ether, you get ten ether.

gasLimit is the max amount in gas you're willing to pay for the transaction. It's in addition to the value.

gasUsed (which you don't mention) is the amount of gas actually used for the calculation which will always be less than or equal to gasLimit.

gasUsed times gasPrice calculates out to be the max amount of ether you're willing to pay to have the transaction processed. In other words, the transaction fee. (It's not a tip because it is not optional. If you don't pay the gas, your transaction will most likely not get processed.)

  • The paper also says It is named gasLimit since any unused gas at the end of the transaction is refunded (at the same rate of purchase) to the sender’s account. So the transaction fee (that goes to miner beneficiary) should be equal to actually used amount of gas times gasPrice and the rest will be refunded. Is that right? – user10375 Jun 12 '17 at 12:24
  • That is correct. I corrected my post. – Thomas Jay Rush Jun 12 '17 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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