Loading...
A transaction isn't magic. It's a signed message saying 'I, owner of this private key, want to send X to Y and burn this much gas.'
{
from: your address (derived from signature, not in the payload itself)
to: recipient address
value: amount of ETH in wei (1 ETH = 10^18 wei)
nonce: an integer, must equal your address's current transaction count
gasLimit: max gas units this tx is allowed to consume
maxFeePerGas: max gwei per gas you'll pay
maxPriorityFeePerGas: tip to the validator on top of the base fee
data: optional bytes (empty for plain transfer, function call data for contract)
signature: your private key signing all of the above
}ADD: 3 gasSSTORE (write to storage): 20,000 gas for a new slot, 5,000 for an updatetotal_fee_eth = gas_used × gas_price (where gas_price is in wei).Your address has a nonce (tx count). Each transaction must use the next nonce in sequence. This prevents replay attacks — if an attacker sees your signed tx and broadcasts it again, the nonce is already used, so the second broadcast reverts.
A Uniswap swap might consume 150,000 gas. At base fee 30 gwei and priority 2 gwei: (30 + 2) × 150,000 = 4,800,000 gwei = 0.0048 ETH per swap.
Compute the ETH cost of a swap given the inputs below.