The SSTORE
opcode has differential pricing depending on what the original, current, and new storage values are (see EIP-2200 for the full details). In short, the idea is that setting a zero value to a non-zero value (e.g. 0 to 42) costs significantly more than setting a non-zero value to another non-zero value (e.g. 42 to 1337).
However, all standard ETH transfers cost the same, namely, 21,000 gas. Why?
Why don't ETH transfers cost more when the recipient's balance is zero (compared to when it is not zero)?
For example, why not something like ~5k extra?
Sender | Recipient | Recipient's Balance | Gas Cost |
---|---|---|---|
Alice | Bob | 4.2 ETH | 21,000 |
Alice | Charlie | 0 ETH | 26,000 |