0
0
Blockchain / Solidityprogramming~10 mins

Accounts (EOA vs contract accounts) in Blockchain / Solidity - Visual Side-by-Side Comparison

Choose your learning style9 modes available
Concept Flow - Accounts (EOA vs contract accounts)
Start
Check Account Type
EOA
Has Private Key
Can Sign Tx
Send Tx
End
The flow checks if an account is an EOA or a contract account, then shows their key differences in behavior.
Execution Sample
Blockchain / Solidity
account = get_account(address)
if account.is_eoa():
    account.sign_transaction(tx)
else:
    account.execute_contract(tx)
This code checks the account type and either signs a transaction (EOA) or executes contract code (contract account).
Execution Table
StepActionAccount TypeConditionResult
1Retrieve account by addressUnknownN/AAccount object loaded
2Check if account is EOAEOAaccount.is_eoa() == TrueProceed to sign transaction
3Sign transactionEOACan signTransaction signed by private key
4Send transactionEOASigned tx readyTransaction sent to network
5End processEOAN/AProcess complete
1Retrieve account by addressUnknownN/AAccount object loaded
2Check if account is EOAContractaccount.is_eoa() == FalseProceed to execute contract
3Execute contract codeContractHas codeContract logic runs with tx data
4Return execution resultContractExecution doneOutput or state changes returned
5End processContractN/AProcess complete
💡 Execution stops after transaction is signed and sent for EOA, or after contract code execution completes for contract accounts.
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
accountNoneAccount object loadedAccount type identifiedN/AN/A
account_typeUnknownEOA or ContractN/AN/AN/A
transactionUnsignedUnsignedSigned (EOA) or Executed (Contract)Sent (EOA) or Result returned (Contract)Complete
Key Moments - 3 Insights
Why can't contract accounts sign transactions like EOAs?
Contract accounts do not have private keys (see execution_table step 2 and 3 for EOAs), so they cannot sign transactions. Instead, they execute code when called.
What happens when a transaction is sent to a contract account?
The contract code runs with the transaction data (execution_table step 3 for contract accounts), producing outputs or state changes instead of signing.
How does the system know if an account is EOA or contract?
By checking if the account has code deployed (execution_table step 2). If code exists, it's a contract account; otherwise, it's an EOA.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the account type identified at step 2 when account.is_eoa() returns False?
AContract Account
BExternally Owned Account (EOA)
CUnknown Account
DMiner Account
💡 Hint
Refer to execution_table row where account.is_eoa() == False at step 2
At which step does the transaction get signed for an EOA in the execution_table?
AStep 2
BStep 4
CStep 3
DStep 5
💡 Hint
Look at the action 'Sign transaction' for EOA in execution_table
If a contract account had no code deployed, how would the execution_table change at step 3?
AIt would execute contract code as usual
BIt would fail or do nothing because no code exists
CIt would sign the transaction instead
DIt would become an EOA automatically
💡 Hint
Check key_moments about how contract accounts require code to execute
Concept Snapshot
Accounts in blockchain are either EOAs or contract accounts.
EOAs have private keys and sign transactions.
Contract accounts have code and execute logic on transactions.
System checks code presence to distinguish account type.
EOAs send signed transactions; contracts run code and update state.
Full Transcript
This visual execution shows how blockchain accounts work. First, the system loads an account by address. Then it checks if the account is an Externally Owned Account (EOA) or a contract account by seeing if code exists. EOAs have private keys and sign transactions before sending them to the network. Contract accounts do not have private keys; instead, they execute their code when a transaction is sent to them. The execution table traces these steps for both account types, showing how variables like account type and transaction state change. Key moments clarify why contract accounts cannot sign transactions and how the system distinguishes account types. The quiz tests understanding of these steps and concepts. This helps beginners see the difference between EOAs and contract accounts clearly and follow the transaction flow visually.