Ethereum accounts are foundational to interacting with the Ethereum blockchain. Whether you're sending ether (ETH), engaging with decentralized applications (dApps), or deploying smart contracts, understanding how Ethereum accounts work is essential. This guide explores the two main types of accounts, their structure, creation process, and key differences—offering a comprehensive overview for developers and users alike.
Understanding Ethereum Account Types
Ethereum supports two distinct account types, each serving a unique role in the network's functionality:
- Externally-Owned Account (EOA) – Controlled by private keys, typically managed by individuals.
- Contract Account – A smart contract deployed on the blockchain, governed entirely by its code.
Despite their differences, both account types share core capabilities:
- Receiving, holding, and transferring ETH and ERC-20 tokens.
- Interacting with other smart contracts.
- Participating in the decentralized ecosystem through transactions.
👉 Discover how to securely manage your Ethereum account today.
Key Differences Between EOAs and Contract Accounts
Externally-Owned Accounts (EOAs)
- Free to create: No cost is associated with generating an EOA.
- Transaction initiation: Only EOAs can originate transactions on the network.
- Limited transaction scope: Transfers between EOAs are restricted to value transfers (ETH or tokens).
- Cryptographic control: Each EOA relies on a public-private key pair. The private key signs transactions, proving ownership without revealing sensitive data.
Contract Accounts
- Creation cost: Deploying a contract consumes gas due to storage usage on the blockchain.
- Reactive behavior: Contracts cannot initiate transactions independently. They respond only when triggered by an incoming transaction—usually from an EOA.
- Programmable logic: When activated, contract code can execute complex operations such as token transfers, updating internal state, or even creating new contracts.
- No private keys: Unlike EOAs, contract accounts have no private keys. Access and control are determined solely by the logic embedded in the smart contract.
This distinction ensures security and predictability across the network: users maintain control over funds via EOAs, while automation and logic reside within contracts.
Anatomy of an Ethereum Account
Every Ethereum account contains four critical fields stored on-chain:
nonce
A sequential counter that tracks the number of transactions sent from an externally-owned account—or the number of contracts created by a contract account. Each transaction must use a unique nonce, preventing replay attacks where malicious actors rebroadcast signed transactions.
balance
The current amount of ETH held by the account, measured in wei. One ETH equals 10¹⁸ wei, enabling precise microtransactions.
codeHash
This field references the EVM (Ethereum Virtual Machine) code associated with the account:
- For contract accounts, it points to executable bytecode that runs when the contract receives a message call.
- For externally-owned accounts, this is the hash of an empty string since EOAs don’t contain executable code.
Importantly, codeHash is immutable after deployment—ensuring code integrity.
storageRoot
A 256-bit hash representing the root node of a Merkle Patricia Trie that encodes all data stored within the account. This structure allows efficient verification of stored values without exposing full dataset contents. By default, this field is empty for newly created accounts.
These components form the backbone of Ethereum’s state management system, ensuring consistency, security, and verifiability across millions of accounts.
How Externally-Owned Accounts Work: Public and Private Keys
An EOA is built around a cryptographic key pair:
- Private Key: A secret 64-character hexadecimal string used to sign transactions. Possession of this key grants full control over the associated funds.
- Public Key: Derived from the private key using the Elliptic Curve Digital Signature Algorithm (ECDSA). From this, the public address is generated.
To derive an Ethereum address:
- Generate the Keccak-256 hash of the public key.
- Take the last 20 bytes (40 hex characters).
- Prepend
0x, resulting in a standard 42-character address.
Example EOA address: 0x5e97870f263700f46aa00d967821199b9bc5a120
Your private key is your identity on Ethereum. You don't "hold" cryptocurrency—you hold the keys that prove ownership. The actual balances exist on Ethereum’s global ledger.
👉 Learn how to generate and secure your Ethereum keys safely.
Creating an Ethereum Account
Most wallet libraries automatically generate a secure private key when setting up a new account. Here's how it works:
- A random 256-bit private key is created (e.g.,
ffffffff...415f). - The key can be encrypted with a password and stored in a keystore file.
- Using ECDSA, the corresponding public key is derived.
- The public address is calculated as described above.
Tools like Clef, bundled with Geth (the Go implementation of Ethereum), simplify this process:
clef newaccount --keystoreThis command generates a new encrypted key pair and outputs:
INFO [10-28|16:19:09.156] Your new key was generated address=0x5e97870f...
WARN [10-28|16:19:09.306] Please backup your key file
WARN [10-28|16:19:09.306] Please remember your password!
Generated account 0x5e97870f...Critical reminder: Never share your private key. It cannot be recovered if lost, and anyone with access can drain your funds.
Contract Account Addresses
Like EOAs, contract accounts have 42-character hexadecimal addresses (e.g., 0x06012c8cf97bead5deae237070f9587f8e7a266d). However, they are not derived from a public key.
Instead, a contract’s address is deterministically calculated using:
- The creator’s EOA address.
- The nonce of the creating transaction (i.e., how many transactions the creator has sent prior).
This design prevents address conflicts and enables predictable deployment patterns.
Validator Keys in Proof-of-Stake Ethereum
With Ethereum’s transition to proof-of-stake (PoS), a new type of cryptographic key was introduced: BLS keys.
These keys identify validators who participate in block proposal and attestation processes. Key advantages include:
- Efficient aggregation of signatures, reducing network overhead.
- Lower minimum staking requirements (32 ETH per validator), made feasible by reduced consensus bandwidth needs.
BLS keys enhance scalability and decentralization by minimizing communication costs during consensus.
Wallets vs. Accounts: What’s the Difference?
It’s important to distinguish between accounts and wallets:
- An account is a cryptographic entity on the blockchain defined by an address and state.
- A wallet is a user-friendly interface—software or hardware—that manages private keys and facilitates interaction with accounts.
Wallets simplify actions like signing transactions, viewing balances, and connecting to dApps—but they do not "store" funds. Your assets live on-chain; your wallet merely provides access.
Frequently Asked Questions
Q: Can I recover my Ethereum account if I lose my private key?
A: No. Without the private key or seed phrase, access to the account and its funds is permanently lost. Always back up your keys securely.
Q: Are all Ethereum addresses 42 characters long?
A: Yes. All standard Ethereum addresses consist of “0x” followed by 40 hexadecimal characters, totaling 42 characters.
Q: Can a contract send ETH without receiving a transaction first?
A: No. Contract accounts can only act in response to incoming transactions from externally-owned accounts or other contracts.
Q: Is there a cost to create an EOA?
A: No. Generating an EOA locally is free. However, sending a transaction from it requires gas fees.
Q: How are contract addresses determined before deployment?
A: They’re computed using the deployer’s address and nonce, allowing developers to predict them in advance.
Q: Can one private key control multiple addresses?
A: No. Each private key corresponds to exactly one public address. However, deterministic wallets (HD wallets) can derive multiple key pairs from a single seed.
👉 Start exploring Ethereum development with secure tools and resources.
Final Thoughts
Understanding Ethereum accounts—both externally-owned and contract-based—is crucial for navigating the decentralized web. From secure key management to predictable contract behavior, these concepts underpin everything from simple payments to complex DeFi protocols. As Ethereum continues evolving, mastering account fundamentals empowers users and developers to build, transact, and innovate safely and effectively.
Keywords: Ethereum accounts, externally-owned account (EOA), contract account, private key, public key, blockchain security, smart contracts, cryptocurrency wallets.