Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

EOAs vs. Smart Contract Accounts

Hello! Welcome to the final lesson of our first module, "Ethereum & Smart Contract Fundamentals."

Introduction

In our previous lessons, we've explored the Ethereum Virtual Machine, the lifecycle of a transaction, and the EIP-1559 fee market. We've essentially covered the "what" and "how" of Ethereum's operations. Now, we'll focus on the "who"—the different types of accounts that participate in the network.

Every action on Ethereum, from sending ETH to interacting with a complex DeFi protocol, is initiated or handled by an account. Understanding the two fundamental types of accounts is crucial for grasping how the entire ecosystem functions.

Learning Outcome: By the end of this lesson, you will be able to differentiate between Externally Owned Accounts (EOAs) and Smart Contract Accounts.

This lesson concludes our foundational module and sets the stage for Module 2, where we will begin hands-on development.

1. The Two Faces of Ethereum Accounts

On Ethereum, an "account" is an entity with an ETH balance that can send transactions. However, not all accounts are created equal. They fall into two distinct categories:

  1. Externally Owned Accounts (EOAs): These are the accounts controlled by users like you and me.
  2. Smart Contract Accounts: These are accounts controlled by code deployed to the network.

Let's start with a video that provides a clear and concise overview of these two types.

Ethereum Accounts Explained: Smart Contract vs Externally Owned Account (EOA)

This video from NextGen Vision explains the core differences between EOAs and Smart Contract Accounts, their properties, and how they are controlled.

Please watch from 01:55 to 03:45. Focus on: The properties associated with an EOA (nonce, balance) and how it's controlled by a private key. The additional properties of a Smart Contract Account (storage hash, code hash) and how it's controlled by its code.

2. Deconstructing the Accounts

The video gave us a great starting point. Now, let's formalize those concepts. Given your experience as a developer, a useful analogy is to think of an EOA as a user with login credentials and a Smart Contract Account as a server-side application or API.

Externally Owned Accounts (EOA)

An EOA is controlled by a private key. This key is the "password" that proves ownership and grants the authority to sign and send transactions. This is where the name "Externally Owned" comes from—its control lies outside the Ethereum protocol itself, in the hands of whoever holds the key.

  • Properties:
    • Address: A unique public identifier, derived from the public key.
    • Nonce: A transaction counter. Each time an EOA sends a transaction, its nonce increases by one. This prevents replay attacks.
    • Balance: The amount of ETH owned by the account.
  • Key Capability: Initiating transactions. An EOA is the only entity that can start a transaction. Every transaction chain on Ethereum begins with a signature from an EOA's private key.
  • Creation: Generating a new EOA is free and happens off-chain. It's simply the process of creating a new public-private key pair. Wallets like MetaMask or hardware wallets like Ledger manage EOAs.

Smart Contract Accounts

A Smart Contract Account is not controlled by a private key. Instead, it is controlled by the code that was deployed with it to the Ethereum blockchain. This code is immutable and defines the rules for how the account can behave.

  • Properties:
    • Address: A unique public identifier, determined when the contract is deployed.
    • Nonce: Similar to an EOA nonce, but it increments only when the contract account itself creates another contract.
    • Balance: The amount of ETH held by the contract.
    • Code Hash: A hash of the EVM bytecode of the smart contract. This is the logic that governs the account.
    • Storage Hash: The root hash of a data structure (a Merkle Patricia Trie) that stores the contract's persistent data (its state).
  • Key Limitation: Cannot initiate transactions. A smart contract can only execute its code when it receives a transaction from an EOA (or a message call from another contract). It cannot "wake up" and start an action on its own.
  • Creation: Creating a Smart Contract Account requires sending a transaction from an EOA to the zero address (0x0...0) with the contract's bytecode. This deployment costs gas.

The image below visually represents the structural differences in the state of each account type.

This diagram shows the components of the 'Account State' for both an EOA and a Smart Contract Account. Note that the EOA is controlled by a private key, while the contract account has associated code and storage.

3. A Practical Example: Where Are Your Tokens?

A common point of confusion for new users is the idea of "holding" tokens like USDC or SHIB in their wallet. This provides a perfect example of the EOA-SCA relationship.

When you "own" 100 USDC, your EOA (e.g., your MetaMask account) does not actually contain that USDC. Instead:

  1. The USDC smart contract is a Smart Contract Account.
  2. Inside that contract's storage, there is a data structure, typically a mapping, that looks like this: mapping(address => uint256) public balances;.
  3. This mapping associates your EOA's address with the number 100.

Your EOA is just a key that can unlock the ability to modify that value in the USDC contract's storage. To send 10 USDC to a friend, your EOA initiates a transaction that calls the transfer() function on the USDC contract, which then updates its internal balances mapping.

Let's watch a short clip that explains this critical concept.

Ethereum Accounts Explained: Smart Contract vs Externally Owned Account (EOA)

Let's return to the NextGen Vision video to clarify the common misconception about token ownership.

Watch from 03:33 to 05:05. The speaker does an excellent job explaining that tokens reside within the smart contract, which merely references your EOA. This highlights the power and risk of smart contract code.

4. Side-by-Side Comparison

We've covered the conceptual differences, but a direct comparison can help solidify your understanding. The image and reading below provide a clear, tabular summary.

This table provides a high-level comparison of EOAs and Smart Contract Accounts, summarizing their control mechanism, ability to initiate transactions, and creation cost.

For a more detailed breakdown, the following guide from QuickNode is an excellent resource. It also includes a practical tip for developers: how to programmatically distinguish between an EOA and a contract.

What are Ethereum Accounts? | Quicknode Guides

This guide from QuickNode offers a concise yet detailed comparison of the two account types.

Please read the section titled 'Key Differences'. Pay close attention to the table, especially the last row, which explains how you can use eth_getCode to determine if an address belongs to an EOA or a smart contract. This is a useful technique in development.

5. The Future: Account Abstraction (ERC-4337)

The distinction between EOAs and Smart Contract Accounts has been fundamental to Ethereum since its inception. However, the limitation of EOAs (e.g., private key loss means total asset loss, no complex security) has led to a major ongoing upgrade: Account Abstraction.

The goal of Account Abstraction (formalized in ERC-4337) is to eventually allow all user accounts to be smart contract accounts. This would enable features like:

  • Social Recovery: Regain access to your account via trusted friends or services if you lose your key.
  • Multi-Factor Authentication: Require multiple signatures or devices to approve transactions.
  • Paying Gas in Other Tokens: Pay transaction fees in USDC instead of ETH.

This is a key part of making Ethereum more user-friendly and secure, and it's a topic we will explore in-depth in Module 8. For now, it's important to know that while the EOA/SCA distinction is critical today, the lines are intentionally being blurred to improve the user experience.

EOA vs. Smart Contract Account: What Is the Difference?

To get a sense of this evolution, let's look at a brief article that discusses the differences and also introduces the push towards smart contract wallets and Account Abstraction.

Read the sections 'What Is an Externally Owned Account?', 'What Is a Smart Contract Account?', and 'What Are the Differences Between EOAs and Smart Accounts?'. Notice how this article frames Smart Contract Accounts as enabling advanced features and mentions the community push towards them.

Conclusion

This lesson completes our journey through the fundamentals of Ethereum. You now have a solid conceptual model of the entire system: the EVM as the execution environment, transactions as state-change instructions, gas as the fuel, and now, EOAs and Smart Contract Accounts as the primary actors.

Key Takeaways:

  • Externally Owned Accounts (EOAs) are controlled by private keys, can initiate transactions, and have no associated code. Think of them as users.
  • Smart Contract Accounts are controlled by their code, cannot initiate transactions, and contain both logic (code) and state (storage). Think of them as applications.
  • Every transaction on Ethereum must originate from an EOA.
  • The future of Ethereum accounts lies in Account Abstraction, which aims to give all users the power and flexibility of smart contract accounts.

Next Steps:

With this foundational knowledge in place, you are now ready to start building. In our next lesson, we will kick off Module 2: Modern Development & Testing Toolchain by setting up a professional development environment using Hardhat and TypeScript.

Can't find a good explanation? Sign up and we'll make it for you

Sign up