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.
account = get_account(address) if account.is_eoa(): account.sign_transaction(tx) else: account.execute_contract(tx)
| Step | Action | Account Type | Condition | Result |
|---|---|---|---|---|
| 1 | Retrieve account by address | Unknown | N/A | Account object loaded |
| 2 | Check if account is EOA | EOA | account.is_eoa() == True | Proceed to sign transaction |
| 3 | Sign transaction | EOA | Can sign | Transaction signed by private key |
| 4 | Send transaction | EOA | Signed tx ready | Transaction sent to network |
| 5 | End process | EOA | N/A | Process complete |
| 1 | Retrieve account by address | Unknown | N/A | Account object loaded |
| 2 | Check if account is EOA | Contract | account.is_eoa() == False | Proceed to execute contract |
| 3 | Execute contract code | Contract | Has code | Contract logic runs with tx data |
| 4 | Return execution result | Contract | Execution done | Output or state changes returned |
| 5 | End process | Contract | N/A | Process complete |
| Variable | Start | After Step 2 | After Step 3 | After Step 4 | Final |
|---|---|---|---|---|---|
| account | None | Account object loaded | Account type identified | N/A | N/A |
| account_type | Unknown | EOA or Contract | N/A | N/A | N/A |
| transaction | Unsigned | Unsigned | Signed (EOA) or Executed (Contract) | Sent (EOA) or Result returned (Contract) | Complete |
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.