Gas - Reading Assignment

  1. How do we calculate the total gas cost for a transaction?
    It is the cumulative sum of all operations.

  2. What is gas limit?
    It is the maximum amount of gas you are willing to spend.

  3. What happens if we specify a gas limit that is too low?
    The result would be a failed transaction and the miner keeps the fees.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The miners will reject it because computationally it would not be dense enough, they only get paid for gas consumed.

  5. What is a gwei?
    It is 1,000,000,000 wei. Wei is the smallest amount of ether.

1 Like
  1. We add up all the transaction and calculate the cost of each operation to use the smart contract.
  2. It is the amount you are willing to pay for the transaction
  3. The gas is kept by miners but the transaction isn’t introduced into the blockchain.
  4. We get the refund of the gas not used.
  5. It is the minimal unit of the wei. 1 eth = 1 wei = 1.000.000.000 gwei
1 Like
  1. The amount of gas depends on the amount of computation required to complete the transaction.

  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. Gwei is short for gigawei, or 1,000,000,000 wei. Wei, as the smallest base unit of ether, is like what cents are to the dollar and satoshi are to bitcoin.

1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.
  2. This corresponds the maximum amount of gas you are willing to spend on the transaction.
  3. 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.
  4. The actual blocks also have a gas limit that specifies the maximum amount of gas all transactions in the block can consume. This is comparable to Bitcoin’s block size in bytes, but ether miners have the option to increase or decrease the gas limit of blocks so that they are propagated quickly. You cannot exceed this amount if you wish for your transaction to be processed.
    Miners will not want to deal with the transaction because it is not computationally dense enough. This is because the miners only get paid for the actual gas consumed to perform a transaction.
  5. A Gwei is a fractional part of Ether in that is represents 1000000000 wei. Wei is the smallest unit of Ether.
1 Like

Great answers sir, well documented! Please keep them like that :muscle:

Carlos Z.

  1. every operation has a gas cost. The sum of all the operations needed to make a transaction on the ethererum blockchain is the total gas cost. E.g. the execution of a smart contract needs more operations than a simple transaction, so you need more operations, hence it will cost more gas.

  2. the maximum gas you are willing to spend on a transaction. you can define it on your own in your wallet for every transaction, for example the metamask wallet.

  3. the transaction will not be executed (although miners try to execute it, hence, you will have to wait some time until you know it has failed), but you won’t get back ether spend on the gas used.

  4. Miners get paid for the actual gas they need to complete a transaction. Defining a too high gas limit only fills up the block gas limit but does not fasten your transaction.

  5. a gwei is a little unit of ether, or 1000000000 wei (which is the smallest unit of ether, like a satoshi is for bitcoin)

1 Like
  1. How do we calculate the total gas cost for a transaction?
    Total gas = sum of the gas cost of all operations of a transaction.

  2. What is gas limit?
    Gas limit is the maximum amount of gas a user is willing to pay for a transaction.

  3. What happens if we specify a gas limit that is too low?
    The miner will keep our ether spent on the gas used before the transaction failed.

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

  5. What is a gwei?
    A gwei is a common unit to measure gas. 1 ether = 1 billion gwei = 1 quintillion wei.

1 Like

1 The cumulative sum of all the operations is the total gas cost for the transaction.

2 It’s the max amount of gas you are willing to spend on the transaction. In other words, is the maximum amount of gas allotted to the transaction, 21000 being sufficient for simple transfers and much higher amounts for transfers to smart contracts like those in ICOs.

3 Providing too little gas will result in a failed transaction. Your transaction will start to be executed, but will eventually run out of gas and be stopped. The fees are kept by the miner.

4 Unspent gas is refunded automatically.

5 1 gwei is 1000000000 wei (10^9 wei). 1 wei is the smallest unit of ether, 10^-18 Ether; therefore 1gwei is 10^-9 Ether.

1 Like
  1. How do we calculate the total gas cost for a transaction?
    -Add the cost for each instruction to be executed in a smart contract.
  2. What is gas limit?
    -The the MAXIMUM amount of gas you are willing to spend on the transaction.
  3. What happens if we specify a gas limit that is too low?
  • Providing too little gas will result in a failed transaction, the fees are kept by the miner
  1. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    -Gets refunded automatically
  2. What is a gwei?
    -Wei is the smallest subdivision of ether. 1 wei = eth *10^-18 1gwei = eth * 10^-9
1 Like
  1. How do we calculate the total gas cost for a transaction?
    – Total GAS cost is the sum of the costs of all the operations in a transaction.

2.What is gas limit?
– GAS limit is the maximum amount you’re willing to spend on a transaction.

  1. What happens if we specify a gas limit that is too low?
    – If the specified GAS limit is too low then the transaction will fail and the miner will keep the fee?

  2. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    – If we specify too much GAS the unspent GAS is refunded automatically.

  3. What is a gwei?
    – A GWEI is 1,000,000,000 (one billion) wei. And a wei is the smallest unit of ETHER. GAS price is measured in wei

1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.
  2. most/max a person is willing to pay to excecute a eth transacation.
  3. the transaction is not completed and its as if it never occured.
  4. the excess portion is refunded.
  5. 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?
    The cumulative sum of all the operations is the total gas cost for the transaction.
  2. What is gas limit?
    The gas limit corresponds to the maximum amount of gas you are willing to spend on a transaction.
  3. What happens if we specify a gas limit that is too low?
    The transaction will start but will be stopped when the transaction runs out of gas. The funds will not leave your wallet and the transaction will be failed but you will lose the amount that you spent on gas.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    By putting a high value for the gas limit fills up the block gas limit, but isn’t computationally-dense enough for miners to want. Miners only get paid for the actual gas consumed by a transaction. The excess gas will be refunded.
  5. What is a 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?

The cumulative sum of all the operations is the total gas cost for the transaction.

  1. What is gas limit?

The MAXIMUM amount of gas you are willing to spend on the transaction

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

Providing too little gas will result in a failed transaction, the fees are kept by the miner

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

Extra, unspent gas is refunded automatically

  1. What is a gwei?

Wei is the smallest unit of ether, and gwei is simply 1000000000 wei

1 Like

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

Depends on the smart contract, the total gas cost is depend on different operations.

What is gas limit?

Gas is the price for running tx and contracts.

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

Your tx 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, and since the tx was not complete the main funds never left the wallet.

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

The block gas limit will be filled up which is set by miners, however the miners don’t want these because it is not computationally-dense for miners want. The unspent gas till be refunded automatically.

What is a gwei?

Wei is the smallest amount of Ether, Gwei is 1000000000 Wei

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

By the calculative sum of all the operations, these would equal gas cost for the transaction

What is gas limit?

The maximum amount of ether you are willing to pay

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

The transaction will not be executed

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

Whatever balance is not spent, will be reverted to you.

What is a gwei?

gwei is simply 1000000000 wei

1 Like
  1. How do we calculate the total gas cost for a transaction?
    The total price is determined by the amount and types of transactions performed on the Ethereum network.

  2. What is gas limit?
    It is the total amount of gas you wish to spend on a transaction.

  3. What happens if we specify a gas limit that is too low?
    The transaction will fail and you’ll lose the gas fee you paid to the miners.

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The unused amount is usually returned to your wallet, but if it’s too high (exceeding putting block gas limit), it may not get processed.

  5. What is a gwei?
    It’s 1000000000 wei, which is the smallest amount of ether. It also equals 0.000000001 ETH.

1 Like
  1. by adding together all calculations/operations needed to be done for a specific transaction
  2. the maximum amount of gas used as a fee/incentive for the eth miners to take and put the transaction on the eth blockchain
  3. if there is too little gas available, the code will not be fully executed and the transaction will fail. gas will be spent, but the eth will not be sent/contract will not be fulfilled
  4. the transaction might be rejected by miners as there is too little processing to do (it is not dense enough to be considered worthwhile), as all leftover gas needs to be returned
  5. gwei is a fraction of ethereum, a nano part of eth, it is used to pay transaction fees
1 Like
  1. How do we calculate the total gas cost for a transaction?
    It depends on the the type of transaction. You can specify how much you are willing to pay for it and then a miner can accept the transaction and the fee. The total gas cost is calculated by adding up all the operations.
  2. What is gas limit?
    The maximum amount you are willing to pay for a transaction
  3. What happens if we specify a gas limit that is too low?
    The transaction will fail. The gas will be lost, but everything else will stay as it was
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    You will be refunded the difference, if it is really high the contract will not execute as it not computationally dense enough.
  5. What is a gwei?
    The measurement for Gas used on Ethereum.
1 Like
  1. How do we calculate the total gas cost for a transaction? - gas*gwei=price

  2. What is gas limit? - It’s the limit of how much gas you’re willing to spend on the given transaction

  3. What happens if we specify a gas limit that is too low? - it will be a failed transaction and the miner keep the transaction fee

  4. What happens if we specify a gas limit that is too high and therefore not consumed fully? - Since miners wants as much consumed gas as possible per block, a too high gas limit will not be prioritized

  5. What is a gwei? - its 1000000000 of a wei (the smallest unit of ether) And 0.000001 of ether

1 Like

1 Accumulate all activity in a smart contract or transaction

2 Is the maximum amount of gas one is willing to pay for the transaction

3 The transaction will not be executed

4 The miner define the gas limit for each block, excessing that the transaction will not be processed , the miner wants smooth and effective process

5 Gwei is 1000 miljon wei

1 Like