What are Ethereum accounts? Types, addresses, wallets and security explained
Ethereum has two kinds of account: key-controlled EOAs and code-controlled contracts. What each stores, how an address is derived, and how to keep one safe.
On this page
- EOAs vs contract accounts
- What an Ethereum account stores: nonce, balance, codeHash, storageRoot
- How an Ethereum address is derived
- Wallets vs accounts
- Smart accounts: ERC-4337 and EIP-7702
- Look up an account's balances and activity with an API
- Ethereum account security
- Frequently asked questions
- Next steps
An Ethereum account is an entity with an ETH balance that can send transactions or be called by them. There are two kinds: an externally owned account (EOA), controlled by whoever holds its private key, and a contract account, controlled by the code deployed at its address. Both are identified by a 20-byte address, and both carry the same four fields in Ethereum's state: a nonce, a balance, a code hash and a storage root. A wallet is not an account: it is the software or device that holds your keys and signs for one or more accounts.
This guide explains each part with code you can run: what an account stores, how an address comes from a private key, how wallets manage many accounts, what smart accounts (ERC-4337) and EIP-7702 change, and how to keep an account safe.
EOAs vs contract accounts
The ethereum.org accounts documentation defines the two types. The practical differences:
| Externally owned account (EOA) | Contract account | |
|---|---|---|
| Controlled by | Whoever holds the private key | Its code; there is no private key |
| Address comes from | The public key of a key pair | The deployer and its nonce, or a salt (CREATE2) |
| Code | None, unless it delegates to a contract (EIP-7702) | The contract's bytecode, fixed at deployment |
| Can start a transaction | Yes | No; it runs only when a transaction or contract calls it |
| Costs to create | Nothing: generate a key pair offline | Gas for the deployment |
Every transaction starts from an EOA (or, under ERC-4337, from a bundler's EOA on a smart account's behalf). A contract can call other contracts and send ETH, but only inside a transaction someone else started. How a contract's address is computed, and how to tell a contract from a wallet by its code, is covered in What is an Ethereum contract address?.
What an Ethereum account stores: nonce, balance, codeHash, storageRoot
Ethereum's world state maps each address to four fields, defined formally in the Yellow Paper:
- nonce: for an EOA, the number of transactions it has sent; for a contract, one more than the number of contracts it has created (contract nonces start at 1 under EIP-161). Each transaction must use the next nonce, so a signed transaction can't be replayed. Since Pectra, each EIP-7702 authorization an account signs that is applied also increments its nonce.
- balance: the account's ETH, in wei (10^18 wei = 1 ETH). Tokens are not here: an ERC-20 balance is an entry in the token contract's storage.
- codeHash: the keccak256 hash of the account's code. For an EOA it is the hash of empty code,
0xc5d2…a470. For an EOA that delegates under EIP-7702 it is the hash of the 23-byte delegation indicator. - storageRoot: the root hash of a Merkle Patricia trie holding the account's storage. An account with no storage has the empty-trie root,
0x56e8…b421.
You can read all four from any node with eth_getProof (EIP-1186), which also returns a Merkle proof for them. This script uses viem:
import { createPublicClient, formatEther, http, keccak256 } from "viem";import { mainnet } from "viem/chains"; const client = createPublicClient({ chain: mainnet, transport: http(process.env.RPC_URL) }); // The four fields Ethereum stores for an account, read with eth_getProof (EIP-1186).async function accountState(address) { const { nonce, balance, codeHash, storageHash } = await client.getProof({ address, storageKeys: [] }); const code = await client.getCode({ address }); let kind = "EOA"; if (code?.startsWith("0xef0100")) kind = `EOA delegating to 0x${code.slice(8)} (EIP-7702)`; else if (code) kind = "contract"; return { kind, nonce, balance: `${formatEther(balance)} ETH`, codeHash, storageRoot: storageHash };} console.log("empty codeHash:", keccak256("0x"));console.log(await accountState("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")); // vitalik.ethconsole.log(await accountState("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")); // USDCRun on 20 November 2026, it printed:
empty codeHash: 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470{ kind: 'EOA delegating to 0x5a7fc11397e9a8ad41bf10bf13f22b0a63f96f6d (EIP-7702)', nonce: 5970, balance: '5.798969845714210716 ETH', codeHash: '0xd8ef78646344da0ceb69cbcdb306939b3ba0514174fa28b6c6fa189953ff226d', storageRoot: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'}{ kind: 'contract', nonce: 1, balance: '0 ETH', codeHash: '0xd80d4b7c890cb9d6a4893e6b52bc34b56b25335cb13716e0d1d31383e6b41505', storageRoot: '0x65ba9b4a92529860db3d5e2d725381f83bdf8604b853bd9c32c7b9661e0439fa'}vitalik.eth is an EOA that has delegated to a contract under EIP-7702, so it has code but no storage of its own (the empty-trie root). USDC is a contract: nonce 1 because it has created no contracts, no ETH, and its token balances live in its storage trie, so its storageRoot changes with every transfer.
How an Ethereum address is derived
An EOA's address is computed from its private key in three steps, none of which touches the network:
- Private key. A random 256-bit number, any value from 1 up to the order of the secp256k1 curve.
- Public key. The private key multiplied by the secp256k1 generator point: a point (x, y), 64 bytes. It can't be reversed to get the private key.
- Address. The keccak256 hash of those 64 bytes, keeping the last 20 bytes, written as
0xplus 40 hex characters. Ethereum's keccak256 is the original Keccak, not NIST's SHA3-256, which pads differently and gives different hashes.
Addresses are case-insensitive, so EIP-55 uses letter case as a checksum: hash the lowercase hex address with keccak256, then uppercase each letter whose matching hex digit in the hash is 8 or more. A wallet that checks it catches almost every typo; the EIP puts the chance that a mistyped address still passes at 0.0247%.
This script does all of it with noble-curves and noble-hashes, then compares the result with viem's own derivation. The key is account #0 of the test mnemonic that Hardhat and Anvil ship with, so it is public:
import { secp256k1 } from "@noble/curves/secp256k1.js";import { keccak_256 } from "@noble/hashes/sha3.js";import { bytesToHex, hexToBytes } from "@noble/hashes/utils.js";import { privateKeyToAddress } from "viem/accounts"; // Anvil and Hardhat's default account #0. Its key is public: never send real funds to it.const privateKey = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; // 1. Public key: uncompressed (0x04 ‖ x ‖ y, 65 bytes).const publicKey = secp256k1.getPublicKey(hexToBytes(privateKey), false); // 2. Address: keccak256 of the 64-byte x ‖ y (drop the 0x04 prefix), keep the last 20 bytes.const address = bytesToHex(keccak_256(publicKey.slice(1)).slice(-20)); // 3. EIP-55: uppercase each letter whose nibble in keccak256(lowercase hex address) is 8 or more.function toChecksumAddress(hex) { const lower = hex.toLowerCase().replace(/^0x/, ""); const hash = bytesToHex(keccak_256(new TextEncoder().encode(lower))); let out = "0x"; for (let i = 0; i < lower.length; i++) { out += parseInt(hash[i], 16) >= 8 ? lower[i].toUpperCase() : lower[i]; } return out;} console.log("address:", "0x" + address);console.log("EIP-55: ", toChecksumAddress(address));console.log("viem: ", privateKeyToAddress(`0x${privateKey}`));It prints:
address: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266EIP-55: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266viem: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266Install the libraries with npm install viem @noble/curves @noble/hashes. In your own code, use the library function (privateKeyToAddress, getAddress for checksums) rather than a hand-rolled one; the long form is here to show what it does.
Wallets vs accounts
A wallet is the software or hardware that stores keys, shows balances and signs transactions; the account is the address and its state onchain. One wallet usually manages many accounts, and the same account can be used from different wallets if you import its key or seed phrase.
A web3 wallet holds keys, not assets. Your ETH, tokens and NFTs are records onchain: the ETH in the account's own balance field, each ERC-20 balance in its token contract's storage, each NFT's owner in its collection's contract. Lose the wallet app and the assets stay where they are; restore the seed phrase in any other wallet and they all reappear. What a wallet app shows you is read from the chain, usually through a node or a data API: the account's token balances and their value, the NFTs it owns and its transaction history. The section on looking up an account with an API maps each of those views to the endpoint that serves it.
Most wallets derive every account from one seed phrase of 12 or 24 words (BIP-39). The phrase becomes a master key, and each account's private key comes from it by a derivation path (BIP-32, BIP-44). Ethereum's standard path is m/44'/60'/0'/0/i, where 60 is Ether's coin type in SLIP-44 and i counts up from 0 for each new account. What is a deterministic (HD) wallet? explains the derivation in depth.
This prints the first three accounts of the public test mnemonic:
import { mnemonicToAccount } from "viem/accounts"; // The public test mnemonic Hardhat and Anvil use. Never use it for real funds.const mnemonic = "test test test test test test test test test test test junk"; for (const addressIndex of [0, 1, 2]) { const account = mnemonicToAccount(mnemonic, { addressIndex }); console.log(`m/44'/60'/0'/0/${addressIndex}`, account.address);}m/44'/60'/0'/0/0 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266m/44'/60'/0'/0/1 0x70997970C51812dc3A010C7d01b50e0d17dc79C8m/44'/60'/0'/0/2 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BCIndex 0 gives the same address as the private key in the previous section. Two consequences matter in practice:
- The seed phrase is every account at once. Anyone who has it can derive every key the wallet ever made.
- An EOA has the same address on every EVM chain, because the address comes only from the key. Its state is separate on each chain: a different balance and nonce on Ethereum, Base or Arbitrum. A contract's address is only the same on two chains if it was deployed the same way on both.
Smart accounts: ERC-4337 and EIP-7702
A plain EOA has one key and fixed rules: lose the key and the account is gone, and every action needs ETH for gas and its own signature. Smart accounts put the rules in code instead.
ERC-4337 makes the account a contract, without changing the protocol. The owner signs a UserOperation instead of a transaction; a bundler submits UserOperations to the EntryPoint contract, which checks each one against its account's own validation code, and a paymaster can pay the gas. Because the account is a contract, it can use passkeys or several signers, batch calls, set spending limits and offer recovery. Its address is usually computed with CREATE2 before it exists, and the first UserOperation deploys it. The ERC is now Final. Top ERC-4337 account abstraction SDKs compares the SDKs that build these accounts and shows how to read their UserOperations onchain.
EIP-7702 lets an existing EOA run contract code at its own address. It went live on Ethereum mainnet with the Pectra upgrade on 7 May 2025. A new transaction type (0x04) carries signed authorizations, each [chain_id, address, nonce, y_parity, r, s]; for each one, the account's code is set to 0xef0100 followed by the contract address it delegates to. Calls to the account then run that contract's code in the account's context, with its balance and storage. The delegation lasts until the owner signs a new one, and delegating to the zero address clears it. An authorization with chain_id 0 is valid on every chain.
The two work together: a 7702-delegated EOA can point at an ERC-4337-compatible smart account implementation and keep its address and history. What 7702 does not do is retire the private key. The key can still sign ordinary transactions or a new delegation, so it remains the account's single point of failure.
Look up an account's balances and activity with an API
A node answers about one field on one chain at a time. To see what an account holds and has done across chains, a data API is quicker. The GoldRush Foundational API, which GoldRush's crypto wallet API is built on, does it in three calls:
- Address activity (
/address/{address}/activity/): every chain the address has been active on, with first and last seen dates. It costs 0.5 per call. - Native token balance (
balances_native): the account's balance in the chain's native token, with a price. It costs 0.5 per call. - Transaction summary (
transactions_summary): the account's transaction count and its first and last transaction. It costs 1 per call; addingwith-gas=true, which also returns how many transactions the address sent and the fees it paid, costs extra, as the reference lists.
import { formatUnits } from "viem"; const API = "https://api.covalenthq.com/v1";const headers = { Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}`,}; async function get(path) { const res = await fetch(`${API}${path}`, { headers }); if (!res.ok) throw new Error(`${res.status} ${await res.text()}`); const { data } = await res.json(); return data;} // What an account holds and has done: the chains it's active on, then its native balance and history on one chain.async function lookupAccount(address, chain = "eth-mainnet") { const [activity, native, summary] = await Promise.all([ get(`/address/${address}/activity/`), get(`/${chain}/address/${address}/balances_native/`), get(`/${chain}/address/${address}/transactions_summary/?with-gas=true`), ]); const coin = native.items[0]; const history = summary.items[0]; return { activeOn: activity.items.map((c) => c.name), balance: `${formatUnits(BigInt(coin.balance), coin.contract_decimals)} ${coin.contract_ticker_symbol}`, transactions: history.total_count, sent: history.gas_summary?.total_sent_count, firstSeen: history.earliest_transaction?.block_signed_at, lastSeen: history.latest_transaction?.block_signed_at, };} console.log(await lookupAccount("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"));transactionsandsentdiffer.total_countcounts every transaction the address appears in, including ones it received;total_sent_countcounts the ones it sent. For a plain EOA, transactions sent should match its nonce, apart from any EIP-7702 authorizations, which raise the nonce without a transaction of their own.- Names work too. Each endpoint resolves an ENS name such as
vitalik.ethin place of the address. - Other chains. Change
eth-mainnetto any chain from the activity list, such asbase-mainnet, to read the same address's state there.
The same API serves each view a wallet app shows:
| What the wallet shows | GoldRush endpoint | Cost |
|---|---|---|
| Token list with balances and prices | Token balances for an address (balances_v2) |
1 per call |
| NFTs the account owns | NFT wallet API (balances_nft) |
1 per call |
| Transfers of a token in and out | ERC-20 token transfers (transfers_v2) |
0.05 per item |
| Which chains the account is active on | Address activity (/address/{address}/activity/) |
0.5 per call |
transfers_v2 takes the token's contract address, so it returns one token's transfers per call. For balances on several chains in one call, use multichain balances. How to build a multi-chain crypto portfolio tracker puts these calls together into a working wallet dashboard, and GoldRush's wallet API page covers the whole set for wallet and portfolio apps.
Ethereum account security
For an EOA, the private key or seed phrase is the account: anyone who has it can move everything, and there is no reset. Most losses come from a handful of mistakes.
- Keep the seed phrase offline and private. Write it down, store it somewhere safe, and never type it into a website, a chat or a "support" form. No legitimate service asks for it. A hardware wallet keeps the keys off your computer and shows what you're signing on its own screen.
- Never use a key that has been exposed. Bots watch every key that has ever been published and sweep whatever reaches it. The Anvil account #0 key used above shows it: on 20 November 2026 that address on Ethereum mainnet had a nonce of 11,713, a balance of 0 ETH and an EIP-7702 delegation set by someone holding the key.
- Read what you sign, not just what you send. An ERC-20
approvelets a contract spend your tokens until you revoke it, and an off-chain permit signature (EIP-2612) can grant the same without a transaction. Review and revoke old approvals; GoldRush's token approvals endpoint lists a wallet's approvals by spender for 2 per call. - Treat an EIP-7702 authorization as handing over the account. The delegated code runs with the account's full balance, so delegating to a malicious contract can drain it, and an authorization with
chain_id0 applies on every chain. Only sign one through your wallet's own smart-account feature. - Check addresses in full. Lookalike addresses share their first and last characters with real ones, and address poisoning plants them in your transaction history. Copy recipients from a trusted source and compare every character; staying safe with contract addresses covers the token side.
- Separate accounts by risk. Keep long-term holdings in an account that never connects to new apps, and use a different one for trying them. With a smart account, add the recovery and spending limits a plain EOA can't have.
ethereum.org's security guide covers scams and wallet safety for end users in more detail.
Frequently asked questions
What is an Ethereum account?
An entity on Ethereum with an address and an ETH balance that can send transactions or be called by them. It is either an externally owned account (EOA), controlled by a private key, or a contract account, controlled by its code. Each account's state holds four fields: nonce, balance, codeHash and storageRoot.
What is the difference between an EOA and a contract account?
An EOA is controlled by whoever holds its private key, costs nothing to create and can start transactions. A contract account has no private key: it is controlled by the code deployed at its address, costs gas to deploy and runs only when a transaction or another contract calls it. Since Pectra, an EOA can also run contract code by delegating to it under EIP-7702.
How is an Ethereum address generated?
From the private key: multiply it by the secp256k1 generator point to get the 64-byte public key, hash that with keccak256 and keep the last 20 bytes. Writing it as 0x plus 40 hex characters, with EIP-55 mixed case as a checksum, gives the address wallets show.
Is a wallet the same as an Ethereum account?
No. The account is the address and its state onchain. The wallet (a web3 wallet, in app terms) is the app or device that holds the keys and signs for it; it holds keys, not assets, and the balances, NFTs and history it displays are read from the chain. One wallet can manage many accounts, usually all derived from a single seed phrase, and the same account can be opened in another wallet by importing that phrase or key.
What is EIP-7702?
An Ethereum upgrade, live on mainnet since the Pectra upgrade on 7 May 2025, that lets an EOA delegate to a smart contract. The account's code is set to 0xef0100 followed by the contract's address, and calls to the account run that code. The account keeps its address, and its private key keeps full control.
Does my Ethereum address work on other chains?
An EOA's address is the same on every EVM chain, such as Base, Arbitrum or Polygon, because it comes only from the key. Its balance, nonce and history are separate on each chain. Contract addresses usually differ between chains unless the contract was deployed deterministically.
Next steps
- What is an Ethereum contract address?: how contract addresses are created, found and checked.
- Top ERC-4337 account abstraction SDKs: the SDKs that build smart accounts, with EntryPoint and EIP-7702 support.
- Crypto wallet API: balances, transaction history and portfolio value for any wallet across chains.
- GoldRush Foundational API: every GoldRush endpoint for balances, transactions, NFTs and more, with credit costs.
- ethereum.org accounts documentation: the protocol reference for accounts and their state.