Gas - Reading Assignment

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

Total Gas = Costs of all operations on the chain for your transaction.
Gas Limit x Gas Price = Ether

  1. What is gas limit?

The max. you want to spend per wei of gwei.

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

Transaction bounces, transaction costs are lost but funds stay.

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

We fill blocks that miners are not interested in and might ignore because blocks are not computational dense enough. unspent gas will be refunded.

  1. What is a gwei?

A gwei is 1000000000 wei. wei is the smallest part of ether (a bit comparable to a satoshi in Bitcoin,1 BTC = 1,000,000,00 Satoshi)

(1 ETH = 1,000,000,000,000,000,000 Wei)

1 Like
  1. How do we calculate the total gas cost for a transaction?
    Calculate each function that must be processed.

  2. What is gas limit?
    The maximum ammount of gas you are willing to spend on the transactions.

  3. What happens if we specify a gas limit that is too low?
    Will end in failed transactions, you’r gas is going to the miners.

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

  5. What is a gwei?
    1.000.000.000 wei and Wei is the smallest unit of ether

1 Like
  1. How do we calculate the total gas cost for a transaction?
  • By adding all of the Gas required to run each line of code in the transaction and converting that to ETH
  1. What is gas limit?
  • The maximum amount of Gas you are willing to pay to run a program
  1. What happens if we specify a gas limit that is too low?
  • We lose the amount of Gas that we tried to spend on it and the program will not be executed - so we won’t lose any other funds
  1. What happens if we specify a gas limit that is too high and therefore not consumed fully?
  • Any excess Gas is returned to the sender
  1. What is a gwei?
  • A denomination of ETH used to measure the Gas price
1 Like
  1. Every operation on the block cost gas, depending, how difficult it is. The cumulative sum of all operations in the block, is the total gas cost for the transaction.

  2. Gas limit is the maximum amount of gas, your willing to spend for your transaction.

  3. If the gas limit is to low, the transaction won´t get through and you´ll lose the transaction fee.

  4. If the gas limit is to high, it will be refunded. But if the gas limit is way to high, your transaction won´t be interested for miners, because you´ll probably extend the block gas limit.

  5. 1gwei = 1.000.000.000 wei. 1wei is the smallest unit of ether. Gas price is some amount of gwei.

1 Like
  1. Cost per operation within smart contract
  2. Maximum amount of gas you are willing to spend per smart contract
  3. It will result in a failed transaction, but the miner will keep the fees
  4. Extra, unspent gas will be refunded
  5. “wei” is the smallest unit of ether where “gwei” equals 1 billion “wei”
1 Like
  • How do we calculate the total gas cost for a transaction?
    The amount of gas depends on the amount of computation required to complete the transaction.

  • What is gas limit?
    Gas Limit is the maximum amount of gas allotted to the transaction.

  • What happens if we specify a gas limit that is too low?
    Insufficient gas in the Gas Limit will result in a failed transaction.

  • What happens if we specify a gas limit that is too high and therefore not consumed fully?
    only the consumed gas of the transaction is spent, unused is refunded

  • 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?

transaction complexity x current gas price

  1. What is gas limit?

it is the maximum amount of gas one is willing to spend on a transaction

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

If the gas limit is too low the transaction will not be processed. The miner receives payment for work done.

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

That which is not consumed is refunded

  1. What is a gwei?

gwei is a measurement of gas. it represents 1000000000 wei. Wei is smallest amount of ether possible.

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

Add up each line of code in the smart contract. Different amounts for different calculations.

  1. What is gas limit?

The most gas you are willing to spend on a tx

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

The transaction will not go through and we will lose our gas fee to the miner that tried to execute it

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

Unspent gas will be refunded, unless it’s too big, then it will be too big for the block or take up too much of a block, which means miners won’t want to pick it up since they only get paid on the actual cost of the computation done

  1. What is a gwei?

One billionth of an ETH

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 (max the user wants to pay, depending of transaction speed)

3
transaction will be cancelled, fee is lost but ETH funds never leave the wallet

4
You cannot exceed this amount if you wish for your transaction to be processed. Plus, 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. The extra gas will be refunded.

5
gas price is usually given in gwei. Wei is the smallest unit of ether, and gwei is 1000000000 wei. wei is the smallest existing unit go ETH

1 Like
  1. How do we calculate the total gas cost for a transaction?
    The total sum of all the individual operations denoted in the smart contract; each operations having pre-determined gas cost
  2. What is gas limit?
    the max amount of gas one is willing to spend on the transaction
  3. What happens if we specify a gas limit that is too low?
    A possibility of a transaction to stop prematurely due to insufficient gas.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    unspent gas is refunded
  5. What is a gwei?
    a unit of gwei is equivalent to 1,000,000,000 wei
1 Like
  1. Total gas cost is the cumulative sum of all operations for the transaction.
  2. The gas limit is the MAXIMUM amount of gas you are willing to spend on the transaction.
  3. The transaction processes until the limit is met. If it’s too low, the transaction stops (get rolled back / not committed) and the user does not get the spent gas back.
  4. When the gas limit is too high, only the consumed gas of the transaction is spent. The unused gas is refunded.
  5. A gwei is the measurement for gas used on the Ethereum network.
1 Like

1 The cumulative sum of all the operations is the total gas cost for the transaction.
2 This corresponds the the MAXIMUM amount of gas you are willing to spend on the transaction
3 Transaction fill fail to be send true the network and you will lose gas for the transaction.
4 The gas witch left will be returned.
5 Gwei is the smallest measure unit of ETH.

1 Like

How do we calculate the total cost of gas for a transaction?
It is calculated with the maximum price of gas by the price of gas between the value of the Gwei (1000000000 Wei)

What is the gas limit?
It is the maximum gas you can spend on a transaction in the Ethereum network. This value can be increased or decreased by miners.

What happens if we specify a gas limit that is too low?
The transaction is not executed, the balance is not altered, but the used Gas is not recovered.

What happens if we specify a gas limit that is too high and therefore not completely consumed?
It is not recommended since the blocks have a maximum of gas to use and this could saturate the block. Additionally, it is not profitable for the miners since only the gas used counts for the commission payment.

What is a Gwei?
A Gwei equals 1 000 000 000 Wei

1 Like
  1. We calculate the total gas cost for a transaction by adding gas needed for each step in the transaction.
  2. Gas limit is the maximum amount to be allotted to a transaction.
  3. When we specify a gas limit that is too low, the transaction will not be completed nor will the blockchain be updated.
  4. When we specify a gas limit that is too high, allocated but unused funds will be refunded.
  5. A gwei is typically how gas is priced. Wei is the smallest unit of ether and gwei is 1000000000 wei.
1 Like
  1. The total gas cost for a transaction is calculated by adding the cost of each operation of the smart contract performing the transaction. And the cost of each operation is listed on a price list.

  2. Gas limit is the maximum price we agree to pay for each transfer of Ethers or each transaction performed by a smart contract. For example 21000 gas is enough for simple transfers.

  3. If we specify a gas limit too low, the transaction will fail (it will not be performed at all) and the fees will be kept by the miner.

  4. If we specify a gas limit too high, the part not consumed fully will be refunded to us automatically. But miners don’t accept too high gas limits because it fills up (too much) the block gas limit and at the same time it doesn’t pay enough fees for them.

  5. A gwei is 1000000000 wei. A wei is the smallest unit of ether.

1 Like
  1. How do we calculate the total gas cost for a transaction?
  • All transactions, from simple transfers to ICO smart contracts, require some amount of operations to perform.
  • Each of these operations has an associated cost in gas .
  1. What is gas limit?
  • This corresponds the 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?
  • The actual blocks also have a gas limit that specifies the maximum amount of gas all transactions in the block can consume.
  • You cannot exceed this amount if you wish for your transaction to be processed.
  1. What is a gwei?
  • Wei is the smallest unit of ether, and wei is simply 1000000000 gwei.
  • Gas Price is measured in ether where by again smallest unit of ether is wei
1 Like
  1. All transactions, from simple transfers to ICO smart contracts, require some amount of operations to perform. Each of these operations has an associated cost in gas. The cumulative sum of all the operations is the total gas cost for the transaction.
  2. This corresponds the the maximum amount of gas you are willing to spend on the transaction.
  3. The transaction fail and you lost your gas to the miner. (not fair!) It’s an ask and bid system.
  4. Returned to the sender.
  5. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.
1 Like
  1. Cost of a transaction with gas is a menu based system which is pre determined and costs differ with values to transactions

  2. The gas limit is the maximum amount you can specify when deploying a contract, ie a block can use

  3. If we specify a gas limit too low for our contract, the miners will not pick it to be placed in the block, our contract will not be processed so not deployed

  4. When we specify a gas limit over and above our contract, the contract will be processed and the excess returned

  5. The ‘gwei’ is a value of gas this equates to 1,000,000,000 ‘wei’ which is the smallest value of ether

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

  2. The gas limit is the maximum you are willing to pay for a transaction.

  3. If we specify a gas limit that is too low, the transaction fails, the miner keeps the fee, and the unspent gas is automatically refunded.

  4. If your gas limit is too high, it may not get included in the next block because it may be greater than the amount of gas allowed by the block. Unspent gas is automatically refunded.

  5. A gwei is 1,000,000,000 wei, which is the smallest unit for gas price.

1 Like

Gas - Reading Assignment

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

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

2. What is gas limit?

  • it is 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?

  • the transaction will result in a fail
  • running out of Gas (Gas fees are kept by the miner)

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

  • the remaining gas will get back to the transaction sender

5. What is a gwei?

  • wei is the smallest unit of ether
    *gwei is 1 * 10^9 wei
1 Like