Gas - Reading Assignment

  1. You add up all the gas costs for executing each part of a transaction and use of a smart contract.
  2. It is the maximum cost of gas a user is willing to pay for a transaction or deployment of a smart contract.
  3. The transaction will not execute fully and be rejected. The Ether transaction fee will be lost, but the main funds, if the transaction was sending funds, will not leave the wallet.
  4. Unspent gas will be refunded automatically.
  5. 1 gwei is 1 billion wei. A wei is one unit or Ether.
1 Like
  1. How do we calculate the total gas cost for a transaction?
    The cumulative sum of all the operations is the total gas cost for the transaction.

  2. What is gas limit?
    it is maximum limit that you are willing to pay for transaction.

  3. What happens if we specify a gas limit that is too low?
    transaction wont happen but gas will be kept by miners.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    unspent gas will be refunded back automatically

  5. What is a gwei?
    1 000 000 000 of wei. 1 wei is smallest ether unit.

1 Like
  1. We calculated the total gas cost by adding up all the pre-determined costs per operation and the transaction cost is subject to a minimum of 21000 Gas
  2. Gas limit is the maximum amount of gas that you are willing to pay for a transaction.
  3. Providing too little gas will result in a failed transaction, the fees are kept by the miner. the blockchain does not reflect a transfer, so the main funds essentially never left the wallet
  4. Ethereum blocks have a gas limit size, so it is likely that the transaction will stay in the mempool as miners will not want to deal with the transaction because it is not computationally dense enough. Miners only get paid for the actual gas consumed to perform a transaction.
  5. Gwei is the fractional amount of ether and unit of measurement for gasprice
1 Like
  1. How do we calculate the total gas cost for a transaction?
    Total sum of all operations makes up the total cost of gas in a transaction.

  2. What is gas limit?
    The maximum of gas that one wants to spend for a transaction

  3. What happens if we specify a gas limit that is too low?
    Your transaction may not be fully executed but the Gas you spent is non-refundable.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The transaction may not get processed as the block is filled with gas but not enough transactions for the miners to want.

  5. What is a gwei?
    The smallest unit of Ether * 1,000,000,000.

1 Like
  1. How do we calculate the total gas cost for a transaction?
    Adding all of the Gas required to run each line of code in the transaction and converting that to Eth.

  2. What is gas limit?
    The maximum amount of Gas you are willing to pay.

  3. What happens if we specify a gas limit that is too low?
    The transaction won´t get through and you´ll lose the transaction fee

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The gas witch left will be returned

  5. What is a gwei?
    The smallest measure unit of ETH.

1 Like
  1. How do we calculate the total gas cost for a transaction?
    The total gas is calculated based on the functions you are executing.

  2. What is gas limit?
    This is the maximum limit for the gas you need to pay to execute a certain function

  3. What happens if we specify a gas limit that is too low?
    When a gas limit is too low the function is not completed. The amount of gas you spend on this to trigger this process will be lost.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    You will receive the remaining gas back (and not spend it)

  5. What is a gwei?
    It is gas weight. Also sometimes called nano etherium currency to pay for triggering transactions on the etherium network.

1 Like

1. How do we calculate the total gas cost for a transaction?
Different types of operations have a different fixed cost in gas.
2. What is gas limit?
It represents the maximum amount of gas which a developers define at transaction submission.
3. What happens if we specify a gas limit that is too low?
The transaction will be rolled back and will not be committed onto the blockchain, however already spent gas will not be refunded.
4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
The gas amount which is not used will be refunded, however the transaction has a chance of not being processed if the gas limit is reached on the block.
5. What is a gwei?
A unit of measuring Gas on Ethereum network.

1 Like
  1. The minimum gas limit for transaction is 21000 + the amount to execute any fallback functions if it’s sent to a contract, but the actual blocks also have a gas limit that specifies the maximum amount of gas all transactions in the block can consume.

  2. Gas Limit is the maximum amount of gas allotted to the transaction.

  3. Insufficient gas in the Gas Limit will result in a failed transaction, the fee paid will be lost, but the ether transferred never leaves the wallet since the blockchain was never updated.

  4. Extra, unspent gas is refunded automatically.

  5. Gas price is usually some amount of gwei. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like
  1. How do we calculate the total gas cost for a transaction?
    We calculate gas according to the complexity of the transaction.

  2. What is gas limit?
    Is the maximum amount of gas all transactions in the block can consume.

  3. What happens if we specify a gas limit that is too low?
    Transaction will start executing but will be run out of gas before is finished and then swill be stopped.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The gas exceeded will be refunded

  5. What is a gwei?
    gwei is a unit mesurement of Ether gwei= 1000000000 wei (Wei is smallest unit of Ether)

1 Like
  1. The sum off all operation is calculated and that’s how you get the transaction cost.
  2. Gas limit is the maximum amount of gas you are willing to pay for the current transaction.
  3. When the gas limit is too low the transaction will be returned but the gas fee will be still taken by the miner
    4.The excess amount is returned to the wallet.
  4. gwei is 1,000,000,000 wei, wei is the smallest unit of ether.
  1. Gas limit * Gas Price
  2. Gas limit is the max gas you are willing to spend per unit of gas for a transaction.
  3. The transaction will fail but the fee will be kept by the miner that consumed the gas in an attempt to process the transaction.
  4. If the transaction is picked up then a refund for the amount not consumed will be returned to your wallet.
  5. Gwei is a unit of either which is equal to 1 billion of the smallest unit of ether defined as wei.
1 Like
  1. we sum up the fas cost of all the transactions.

2.Gas limit is the maximum Gas that you are willing to pay for a transaction or a deployment of a smart contract.

3.If gas limit is too loathe transaction will be stopped when the fas is run out and the fee is lost. But the fund in the wallet will remain the same as the transaction was not completed.

4.when gas limit is too high, the unspent gas will be automatically refunded.

5.1 gwei is equal to 1 billion wei. the gas price is usually some amount of gwei.

1 Like
  1. Cumulative sum of all operations
  2. Maximum amount of gas you’re willing to spend on the transaction
  3. Failed transaction, transaction fee will be lost but ether itself won’t leave wallet
  4. Unspent gas will be refunded
  5. Gwei = another name for Ethereum
1 Like
  1. The gas cost for a transaction is defined by the rate sheet and varies depending on the complexity of the transaction.
  2. the gas limit is the maximum amount of gas that you are willing to spend to have a transaction/smart contract executed on the Ethereum network.
    3.If a gas limit is set to low the execution of the smart contract may halt half way during execution which will result in the smart contract remaining unresolved while the gas allocation will be spent
    4.In case gas limit is set to high it will be returned back to the account of sender/executor
  3. Gwei is a multiple of the basic gas unit “wei” and it equals 1000000000 wei
1 Like

Indeed sir, but Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

  1. How do we calculate the total gas cost for a transaction?
    All transactions requires some amount of operations to perform. Each of these operations has an associated cost in gas. The total cost of transaction is the total cost of gas associated with each operations to complete the transaction. Example a simple operation can cost less gas than the complex operation.

  2. What is gas limit?
    This is the maximum amount of gas we are willing to spend on the transaction.

  3. What happens if we specify a gas limit that is too low?
    We will loose the gas used and also the main funds will not be transfer.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Extra, unused gas will be refunded automatically

  5. What is a gwei?
    1 gwei = 1000000000 wei

Reading Assignment: Gas

1. How do we calculate the total gas cost for a transaction?

  • The concept of gas, exists to separate the computational cost of running an operation from the market value of ether.

  • The total cost of a transaction is the product of the gas limit and gas price; if you want to transfer all of your Ether you first need to calculate the transaction fee, you just need to know the gas price to calculate the cost of the transaction.

  • The pre-determined cost per operation is subject to a minimum of 21000 Gas.

2. What is gas limit?

  • Gas Limit is the maximum amount of gas that you are willing to pay for a transaction.

  • The default gas price is 20 Gwei, but you can sometime use lower value now.

  • Check out ETH Gas Station service for up-to-date statistics about gas price.

3. What happens if we specify a gas limit that is too low?

  • Gas Limit is the maximum amount of gas one is willing to spend on a particular transaction. The gas limit can be greater than the actual amount of gas the transaction requires.

  • Insufficient gas in the Gas Limit will result in a failed transaction, the fee paid will be lost, but the ether transferred never leaves the wallet since the blockchain was never updated.

4. What happens if we specify a gas limit that is too high and therefore not consumed fully?

  • You cannot exceed this amount if you wish for your transaction to be processed faster.

  • Miners only get paid for the actual gas consumed by a transaction, so putting a high value for the gas limit fills up the block gas limit, but isn’t computationally-dense enough for miners to want.

5. What is a gwei?

  • Gwei is a unit of ether which stands for gigawei, or rather 1,000,000,000 wei. Wei is the smallest unit or the base unit of ether. You can think of wei like what cents are to the US dollar or satoshis are to Bitcoin.

  • Gas Price is the price of each gas unit measured in a fractional amount of ether, typically gwei. Gas price varies, but 20-30 gwei on average.

  1. It is the sum of all the pre-determined costs per operations but is subject to the minimum fee.

  2. It is the maximum amount you can spend.

  3. The excess will be returned but it will likely not get processed because it won’t be dense enough

  4. It is a fractional part of Ether an is equal to 1B wei

1 Like
  1. We calculate the total cost for a transaction by determining the cost of each operation and adding them together. The sum of these costs is the total gas cost for the transaction.

  2. Gas limit is the maximum amount of gas someone is willing to spend on a transaction.

  3. If we specify a gas limit which is too low the transaction will start to be executed, but will run out of gas and be stopped.

  4. If we specify a gas limit which is too high and therefore not consumed fully the gas will be refunded to us. However the transaction may not be processed at all, because more of the block capacity will then be taken up with gas that is to be returned rather than gas which is to be earned on and so they will not want to include it.

  5. A gwei is 1 Billion (1,000,000,000) wei.

1 Like

How do we calculate the total gas cost for a transaction?
The cumulative sum of all the operations is the total gas cost for the transaction.
What is gas limit?
This corresponds the MAXIMUM amount of gas you are willing to spend on the transaction.
What happens if we specify a gas limit that is too low?
Your transaction will start to be executed, but will eventually run out of gas and be stopped. When this happens, you will not get back ether spend on the gas used, but since the transaction did not complete, the blockchain does not reflect a transfer, so the main funds essentially never left the wallet.
What happens if we specify a gas limit that is too high and therefore not consumed fully?
Extra, unspent gas is refunded automatically, but be aware, putting a high value for the gas limit fills up the block gas limit, but isn’t computationally-dense enough for miners to want.
What is a gwei?
Gas price is usually some amount of gwei. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like