Learning Objectives – after this chapter you will be able to:
  • 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:

FieldMeaning
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.
balanceThe amount of ETH owned, stored in wei (1 ETH = 1018 wei).
codeHashThe 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.
storageRootThe 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
BasisEOAContract Account
Controlled byPrivate keyContract code
Creation costFreeCosts gas (deployment transaction)
Can start a transactionYesNo – only reacts to calls
Code & storageNoneYes
Key pairYesNo
ExampleA user’s wallet addressA 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)

Answer : An Ethereum account is an entity with an ETH balance that can send and receive transactions. It is identified by a 20-byte address and is either an Externally Owned Account (EOA) or a Contract Account.

Answer : An EOA is an account controlled by a private key held by a user. It has an ETH balance, no code, costs nothing to create and is the only type of account that can originate a transaction.

Answer : A Contract Account is controlled by its deployed EVM code rather than a private key. It has an address, balance, code and storage, and its code runs only when it receives a transaction or a message call.

Answer : nonce, balance, codeHash and storageRoot.

Answer : The nonce counts the transactions sent from the account. Each transaction must use the next nonce, which ensures transactions are processed in order and that the same signed transaction cannot be replayed.

Answer : For a contract account, the nonce counts the number of contracts that this contract has created.

Answer : In wei, the smallest denomination of Ether. 1 ETH equals 10^18 wei.

Answer : codeHash is the hash of the account’s EVM code. For a contract it identifies its bytecode; for an EOA it is the hash of empty code because EOAs have no code.

Answer : storageRoot is the root hash of a Merkle Patricia Trie that stores the account’s storage contents. It is empty for EOAs and changes as contracts write to storage.

Answer : No. A contract executes only when triggered by a transaction from an EOA or by a message call from another contract that was itself triggered by an EOA’s transaction. Every chain of execution starts with an EOA.

Answer : Creating an EOA only requires generating a key pair offline. Creating a contract requires a transaction that executes code and stores bytecode and storage on every node, which consumes network resources paid for with gas.

Answer : Whoever knows the private key can sign transactions for the account and move all of its assets. There is no central authority that can reverse such transfers.

Answer : The public key is derived from the private key using secp256k1 elliptic-curve multiplication, and the address is derived from the public key by Keccak-256 hashing and taking the last 20 bytes.

Answer : Account abstraction is the idea of making user accounts programmable like contracts, enabling features such as social recovery, multi-signature control, batching and gas sponsorship. ERC-4337 and EIP-7702 are two approaches on Ethereum.

Answer : An EOA: the address in a user’s MetaMask or hardware wallet. A contract account: the address of an ERC-20 token contract or a decentralized exchange contract.
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.

Q1. Which account type can ORIGINATE a transaction?

Show Answer

Correct Answer : B. Externally Owned Account
Only EOAs, controlled by private keys, can sign and start transactions.

Q2. Which of the following is NOT one of the four account fields?

Show Answer

Correct Answer : D. privateKey
The four fields are nonce, balance, codeHash and storageRoot; the private key is never stored on-chain.

Q3. The nonce of an EOA mainly helps to:

Show Answer

Correct Answer : A. Prevent replay of the same transaction
Each transaction uses the next nonce, so an old signed transaction cannot be processed again.

Q4. A Contract Account is controlled by:

Show Answer

Correct Answer : C. Its deployed code
Contract accounts have no key pair; their behaviour is defined by their code.

Q5. Account balances on Ethereum are stored in:

Show Answer

Correct Answer : D. wei
Balances are stored as integers in wei, the smallest unit.

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.

  1. ethereum.org. (n.d.). Ethereum accounts. Ethereum Developer Documentation. https://ethereum.org/en/developers/docs/accounts/
  2. Wood, G. Ethereum: A Secure Decentralised Generalised Transaction Ledger (Ethereum Yellow Paper). https://ethereum.github.io/yellowpaper/paper.pdf
  3. Ethereum Improvement Proposals. (2021). ERC-4337: Account Abstraction Using Alt Mempool. https://eips.ethereum.org/EIPS/eip-4337
  4. Ethereum Improvement Proposals. (2024). EIP-7702: Set Code for EOAs. https://eips.ethereum.org/EIPS/eip-7702
  5. ethereum.org. (n.d.). Merkle Patricia Trie. Ethereum Developer Documentation. https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/
  6. Antonopoulos, A. M., & Wood, G. (2018). Mastering Ethereum: Building Smart Contracts and DApps. O’Reilly Media.