What is Account Model

Intermediate
5m

The Account Model is a primary bookkeeping model for shared ledgers (blockchains). Like the UTXO model, it is used for recording, storing, and executing on-chain transactions. The Account Model is used by Ethereum.

What is UTXO model? What's its feature? Please refer to the content: What is UTXO Model?

Mechanism of Account Model

The Account Model uses balance within accounts as accounting measures for transactions. This is the main difference between it and the UTXO model. 

The UTXO model uses the unspent portion of the cryptocurrency in a transaction as an accounting measure. The Account Model can be seen as a digital version of the traditional bank. In the model, digital assets are recorded as balances within accounts, like traditional bank accounts.

The Account Model is a computational model. When transactions happen, the system will trigger nodes to change the account balance, based on the user's transaction instruction. The system then computes the changes in balances within each account and records the new state of the balance.

In Ethereum, the state of accounts is not stored on the blockchain but computed and stored locally by the nodes. The blockchain only stores the transaction instructions.

Ethereum Network's Account Model

In Ethereum, there are two types of accounts: Externally Owned Account (EOA) and Contract Account. 

Externally Owned Account (EOA)

Private key controlled user accounts.

For example, users can create this type of account in the MetaMask wallet. Each EOA has a private key and an address and it can initiate transactions.

Contract Account

Smart Contract Code-controlled accounts.

Unlike EOA, Contract Account does not have a private key, it has a smart contract code. The account runs by its smart contract code. The code is recorded on-chain when the contract account was created and will be executed by EVM.

The Contract Account cannot initiate transactions like EOA, it can only call functions within other contracts to react to transaction instructions. In simple terms, transaction instructions will call functions within contracts to extract parameters (such as the number of $ETH amounts) to change the account balance to complete the transaction.

Anytime someone sends a transaction to a contract address it causes the contract to run in the EVM, with the transaction as its input. Transactions sent to contract addresses may have $ETH or data or both. If they contain $ETH, it is "deposited" to the contract balance. If they contain data, the data can specify a named function in the contract and call it, passing arguments to the function.

Account Model's Feature

In the Account Model, the result of a transaction depends on the state of balance. The account balance must be greater than the transaction outputs. Thus, transaction sequence verification and balance verification are important. Nodes within the Account Model will check the sender’s balance state (to see if it is greater or equal to the transferred output amount) when they receive transaction instructions.

Ethereum

What else do you want to learn?

Send

In This Article

delate
Use TokenInsight App All Crypto Insights Are In Your Hands
Open