Gas

What is Gas?

In our everyday life, we pay for things we use, like electricity and water. These are measured in units like kilowatt-hours for electricity and cubic meters for water. Similarly, in a decentralized system like Asset Chain, there are charges for activities, and these are measured in "gas."

What is Gas?

Gas measures the computational effort needed to process a transaction. It's similar to how much fuel your car needs to drive a certain distance. The "gas used" for a transaction means how much gas was needed to process it.

Examples of Gas Usage:

  • Transferring RWA tokens: 21,000 gas per transaction

  • Swapping between two tokens: 200,000 gas

  • Buying an NFT: 600,000 gas

Just like you pay for every drop of fuel, you must pay for every unit of gas used in your transactions.

Gas Price:

The gas price is how much you pay for each unit of gas, usually given in "gwei," which is a tiny fraction of an RWA. For example, if a swap transaction takes 200,000 gas and the gas price is 30 gwei (0.00000003 RWA) per gas, you multiply these two numbers to get your transaction fee.

Here's a simple comparison: If your car needs 50 liters of gasoline and the price is 2 USD per liter, the total cost is 50 liters * 2 USD/liter = 100 USD.

Why Does Gas Price Change?

There's limited space in each block for transactions. The gas price depends on how busy the network is. On quiet days, the gas price is low. On busy days, it's high. You can pay a higher gas price to get your transaction processed faster. The amount of gas used doesn't change, but you choose to pay more per unit of gas.

Gas Limit:

Sometimes, you don't know exactly how much gas a transaction will need. The gas limit is the maximum amount of gas you're willing to pay for a transaction. If you set the gas limit too low, your transaction might get stuck, just like if you don't put enough fuel in your car, you'll get stranded.

Who Gets the Transaction Fee?

The transaction fee goes to validators. Validators are incentivized to process transactions and keep the Asset Chain running by staking RWA tokens. The transaction fee helps prevent spam, deter malicious attacks by making them expensive, and ensures fair use of network resources.

Last updated