- Distinguish Externally Owned Accounts (EOA) from Contract Accounts (CA).
- Name and explain the four fields of every Ethereum account.
- Explain the role of the nonce and of public/private keys.
- Describe account abstraction at a basic level.
What is an Ethereum Account?
An account is an entity on Ethereum that has an ETH balance and can send or receive transactions. Every account is identified by a 20-byte address (Chapter 10). There are two types of accounts.
Externally Owned Account (EOA)
- Controlled by a private key held by a person (usually inside a wallet) and identified by a unique address.
- Holds an ETH balance and has no associated code.
- Free to create – generating a key pair creates an account; nothing needs to be sent to the network.
- Used for holding, sending and receiving ETH and tokens, and for interacting with smart contracts (deploying contracts, calling functions).
- Only an EOA can start (originate) a transaction.
Contract Account (CA)
- Controlled by its contract code, not by a private key.
- Has a unique address but no public/private key pair.
- Acts as an autonomous agent: its code runs only when it receives a transaction from an EOA or a message call from another contract.
- Holds an ETH balance like an EOA, and also has persistent storage.
- Creating one costs gas because code and storage are written to the blockchain.
Ethereum Account Components
Every account in the Ethereum state has four fields:
| Field | Meaning |
|---|---|
| nonce | “Number used ONCE”. For an EOA, the number of transactions sent from the account; for a contract, the number of contracts it has created. It ensures each transaction is processed only once (prevents replay) and fixes their order. |
| balance | The amount of ETH owned, stored in wei (1 ETH = 1018 wei). |
| codeHash | The hash of the account’s EVM code. For a contract it points to its immutable bytecode; for an EOA it is the hash of empty code. |
| storageRoot | The root hash of a Merkle Patricia Trie holding the account’s storage. Empty by default; used by contracts. |
In addition: the address exists for both EOAs and CAs; a public and private key exist only for EOAs; code (immutable EVM bytecode) and storage are used only by contract accounts.
EOA vs Contract Account
| Basis | EOA | Contract Account |
|---|---|---|
| Controlled by | Private key | Contract code |
| Creation cost | Free | Costs gas (deployment transaction) |
| Can start a transaction | Yes | No – only reacts to calls |
| Code & storage | None | Yes |
| Key pair | Yes | No |
| Example | A user’s wallet address | A token or exchange contract |
Keys and Account Abstraction
- An EOA’s private key is a randomly chosen 256-bit number. The public key is derived from it using elliptic-curve cryptography (secp256k1), and the address is derived from the public key. The private key must never be shared – whoever has it controls the account.
- Account abstraction aims to give users the flexibility of contracts with the convenience of EOAs – for example social recovery, paying gas in tokens or batching actions. ERC-4337 provides smart-contract wallets without protocol changes, and EIP-7702 (Pectra upgrade, 2025) lets an EOA temporarily use contract code.
Key Takeaways
- EOAs are key-controlled and start transactions; contract accounts are code-controlled and react to calls.
- Every account has nonce, balance, codeHash and storageRoot.
- The nonce prevents replay and orders an EOA’s transactions.
Question / Answer (15 questions)
MCQ Test : Check Your Understanding (5 questions)
Select an option and press Check Answer, or answer all questions and press Submit Test to see your score. Each answer comes with an explanation.
Bibliography/References
The notes, questions and MCQs on this page are original explanations written for this course. The works listed below were consulted and are cited for attribution and further reading. Product names, logos and trademarks belong to their respective owners. Short quotations, where used, are marked and attributed.
- ethereum.org. (n.d.). Ethereum accounts. Ethereum Developer Documentation. https://ethereum.org/en/developers/docs/accounts/
- Wood, G. Ethereum: A Secure Decentralised Generalised Transaction Ledger (Ethereum Yellow Paper). https://ethereum.github.io/yellowpaper/paper.pdf
- Ethereum Improvement Proposals. (2021). ERC-4337: Account Abstraction Using Alt Mempool. https://eips.ethereum.org/EIPS/eip-4337
- Ethereum Improvement Proposals. (2024). EIP-7702: Set Code for EOAs. https://eips.ethereum.org/EIPS/eip-7702
- ethereum.org. (n.d.). Merkle Patricia Trie. Ethereum Developer Documentation. https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/
- Antonopoulos, A. M., & Wood, G. (2018). Mastering Ethereum: Building Smart Contracts and DApps. O’Reilly Media.