How to read an Ethereum transaction: nonce, value, gas and fees
On this page
Key points
- Fee = gas used x price per gas. The price per gas is the base fee plus the tip.
- The doc example: 21,000 gas at 10 + 2 gwei is 252,000 gwei, or 0.000252 ETH. It is an example, not a current fee.
- A transaction that pays only the base fee is valid but unlikely to be included.
- Wei is the smallest unit of ether. Gwei is a billion wei.
A block explorer shows a transaction as a list of fields. This guide explains them using the transaction and gas pages in the ethereum.org developer documentation.
What a transaction is
ethereum.org describes transactions as cryptographically signed instructions from accounts. They update the state of the network. The simplest one transfers ETH from one account to another. Only an externally-owned account (one managed by a person, not a contract) can start a transaction.
The fields
| Field | Meaning, per ethereum.org |
|---|---|
| from | Sender address. Must be an externally-owned account. |
| to | Receiving address. If it is an ordinary account the transaction moves value. If it is a contract account, the transaction runs the contract code. |
| signature | Created when the sender's private key signs the transaction; shows the sender authorized it. |
| nonce | A counter of the sender's transactions, increasing by one each time. |
| value | Amount of ETH to transfer, written in wei. 1 ETH is 1e18 wei. |
| input data | Optional arbitrary data, used for example when calling a contract. |
| gasLimit | The most gas units the transaction may use. |
| maxPriorityFeePerGas | The most the sender will pay per gas unit as a tip to the validator. |
| maxFeePerGas | The most the sender will pay per gas unit in total, including the base fee and the tip. |
How the fee is worked out
ethereum.org says the price per unit of gas has two parts. The base fee is set by the protocol, and you must pay at least that for the transaction to be valid. The priority fee is a tip that makes the transaction attractive to validators. A transaction that pays only the base fee is technically valid but unlikely to be included.
The fee formula is: units of gas used x (base fee + priority fee). The gas page's example: a plain ETH transfer uses 21,000 gas. With a base fee of 10 gwei and a 2 gwei tip, the fee is 21,000 x (10 + 2) = 252,000 gwei, which is 0.000252 ETH. These numbers come from the documentation's worked example and are not current fees.
Where the fee goes
According to the transactions page, the validator that includes the transaction keeps the tip (gas used x priority fee). The base fee (gas used x base fee) is burned, meaning it is removed from circulation.
Reading one on an explorer
- Find the from and to addresses. If the recipient is a contract, expect input data.
- Check the value. It may be zero for a contract call, because the transaction can be doing something other than sending ETH.
- Note the nonce. It tells you which of the sender's transactions this was.
- Look at gas used against the gas limit. The limit is a cap, and the fee is based on gas actually used.
- Split the fee into the burned base fee and the validator tip.
The "gas used is below the limit" and "value can be zero for a contract call" points follow from the field definitions above. Explorer layouts differ, so labels may not match exactly.