Fig. 4 Ethereum Ethereum

State Transition Function

Read in context →
Ethereum state transition function showing gas deduction value transfer and code execution
Ethereum state transition function showing gas deduction value transfer and code execution

Context

This figure appears in the 'Ethereum State Transition Function' section, which defines the precise algorithm by which a transaction transforms Ethereum's global state. Unlike Bitcoin's UTXO model, Ethereum's state is an account-based mapping from addresses to account objects containing balances, nonces, code hashes, and storage roots. The transition function must handle both simple value transfers between externally owned accounts and message calls that trigger smart contract execution.

What This Figure Shows

The diagram depicts the sequential steps of APPLY(S, TX) -> S': first, signature and nonce validation; then upfront gas deduction (STARTGAS × GASPRICE) from the sender's account; then the value transfer from sender to recipient; and finally, if the recipient is a contract account, EVM code execution consuming gas per operation. If execution completes normally, remaining gas is refunded to the sender and consumed gas is paid to the miner. If execution fails — due to an out-of-gas condition or an explicit revert — all state changes from the value transfer onward are rolled back, but the sender still pays for the gas consumed up to the point of failure, compensating the miner for the computation performed. The diagram makes explicit that gas deduction is irreversible while value transfer and storage modifications are conditionally reversible.

Significance

This is the central operational specification of the Ethereum Virtual Machine's interaction with global state. It establishes why gas must be pre-committed (preventing runaway computation), why failed transactions still incur fees (preventing DoS attacks), and how contract execution is sandboxed within a single atomic state transition. Every Ethereum transaction, whether a simple ETH transfer or a complex DeFi interaction, executes this function.

Related Glossary Terms

Other Figures from Ethereum