Accounts
Learn about Ethereum accounts by exploring their two main types: externally-owned accounts (EOA) and contract accounts (CA). Understand how EOAs are controlled by private keys and manage transactions with nonces, while contract accounts host immutable smart contracts. This lesson helps you grasp address formation, account attributes, and the security role of nonces in maintaining transaction order and preventing replay attacks.
An account on Ethereum is defined by two features:
It has an Ether balance.
It can interact with deployed smart contracts.
There are two types of Ethereum accounts—Externally-owned accounts (EOA) and Contract accounts (CA).
Account data model
An Ethereum account is identified by an address. An address is a 0x” (i.e. 0x08001f350afCbF4eccA29ef5f805739b2E3EC8aC).
Both account types have in common the ability to hold/receive/send Ethers and send transactions to the network. Their data model is the same and is composed of four attributes:
nonce: A counter number (not to be confused with the block nonce).balance: The number of Wei owned by the account.codeHash: A reference to EVM code tied to the account (only for CA).storageRoot: A reference to the storage content tied to the account (only for CA).
These four attributes exist in both accounts, but the last two are only relevant in the case of CA.
The account address refers to the account state that is stored inside the Ethereum world state. The address constitutes the key through which to retrieve the account state.
...