Accounts

Understand the difference between an externally-owned account (EOA) and a contract account (CA).

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 hexadecimalWhile the decimal system represents numbers using 10 symbols, the hexadecimal uses 16 distinct symbols. The symbols "0 1 2 3 4 5 6 7 8 9" represent values from 0 to 9, and "A B C D E F" represent values from 10 to 15. string made up of 40 characters with a leading “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.

Get hands-on with 1200+ tech skills courses.