The "Account Model" is used to record, store, and execute on-chain transactions. Ethereum uses this model, while Bitcoin uses a different model - the UTXO model.
How the Account Model Works#
The account model uses the balance within an account as the accounting unit for transactions, while the UTXO model uses the unspent portion of cryptocurrency in transactions as the accounting measure.
The account model can be seen as a digital version of traditional banks, where digital assets are recorded as balances within accounts, similar to traditional bank accounts. When a transaction occurs, the system triggers a change in the account balance based on the user's transaction instructions. The system then calculates the changes in balance for each account and records the latest balance status.
Account Models in the Ethereum Network#
In Ethereum, there are two types of accounts: Externally Owned Accounts (EOA) and Contract Accounts (CA).
Externally Owned Accounts (EOA)
These are user accounts controlled by private keys. Users can create such accounts in wallets like MetaMask. Each "EOA" has a private key and an address, allowing it to directly initiate transactions.
Contract Accounts (CA)
These are accounts controlled by smart contract code. Unlike EOAs, contract accounts do not have private keys; instead, they have smart contract code. The account is operated by its smart contract code, which is recorded on the chain when the contract account is created and executed by the EVM.
Characteristics of the Account Model#
In the account model, the outcome of a transaction depends on the balance state. The account balance must be greater than the transaction output. Therefore, transaction order verification and balance validation are crucial for networks using the account model. Nodes in the account model network check the sender's balance state upon receiving transaction instructions (to see if it is greater than or equal to the amount being transferred).