Why does a failed transaction still incur fee?

May 05, 2023

It is important to note that every transaction that takes place on the TRON network consumes resources.

TRON's resource model consists of two crucial components: Energy and Bandwidth. Bandwidth is used to gauge the size of transaction bytes that are stored in the blockchain's database. The larger the transaction, the more Bandwidth it will consume. On the other hand, Energy measures the amount of computation required by the TRON Virtual Machine (TVM) to execute specific tasks. Since all transactions executed through smart contracts use computation, each transaction incurs a corresponding fee.

Bandwidth

Bandwidth is required for all types of transactions on the TRON network. Transactions are transmitted and stored in the network in the form of byte arrays, with each byte requiring a unit of Bandwidth. Therefore, the total amount of Bandwidth consumed is directly proportional to the number of bytes contained in the transaction.

In the case of insufficient Bandwidth, TRX will then be burned to pay for the Bandwidth required. Currently, each unit of Bandwidth costs 0.001 TRX.

Energy

Smart contracts consume a specific amount of Energy when executing an instruction. The amount needed varies from one contract to another depending on the level of complexity. The total amount of Energy consumed is calculated based on the aggregated number of instructions performed in the smart contracts.

In the case of insufficient Energy, TRX will then be burned to pay for the Energy required. Currently, each unit of Energy costs 0.00028 TRX.

Now, back to the question we raised in the beginning. In the context of TRON's resource system, it is important to note that when a user initiates a transaction, the resources required to execute that transaction are consumed during the process, even if the transaction fails to execute successfully. If the available resources at the time of the transaction are insufficient, the system will burn TRX to cover the resource fee. This mechanism explains why transaction fee is deducted even when the transaction fails.

Last updated