Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

Account State

Account state is the complete data record associated with a blockchain address, comprising fields like nonce, balance, storage root, and code hash that define its current status and capabilities.
Chainscore © 2026
definition
BLOCKCHAIN FUNDAMENTALS

What is Account State?

The complete, current data associated with a blockchain account, representing its assets, permissions, and history.

Account state is the complete, current data associated with a blockchain account at a given point in time, representing its assets, permissions, and historical context. This is a fundamental concept in stateful blockchains like Ethereum, where the entire network's state is the aggregate of all individual account states. The state is stored in a data structure called a Merkle Patricia Trie, which allows for efficient and verifiable cryptographic proofs of any account's status. When a transaction modifies an account—such as sending tokens or deploying a smart contract—it triggers a state transition, updating the global ledger.

The specific components of an account state vary by blockchain architecture. In the Ethereum Virtual Machine (EVM) ecosystem, an Externally Owned Account (EOA) state includes its nonce (transaction count), balance (ether holdings), storageRoot (hash of empty storage), and codeHash (hash of empty code). A Contract Account state includes these same fields, but its storageRoot points to the contract's persistent data, and its codeHash is the hash of its deployed bytecode. This distinction is critical for understanding how value and logic are managed on-chain.

Maintaining and accessing account state is resource-intensive. Full nodes store the entire state trie to validate new blocks, while archive nodes retain every historical state. Light clients and users rely on state proofs, like those provided by Ethereum's JSON-RPC eth_getProof, to verify an account's balance or storage without downloading the entire chain. The size and growth of the global state present a scalability challenge, leading to solutions like state expiry and stateless clients, which aim to reduce the hardware burden on node operators.

For developers, interacting with account state is a daily activity. Querying a balance uses eth_getBalance, while reading a smart contract's storage slot uses eth_getStorageAt. Updating state requires sending a signed transaction that is processed by the network's consensus rules. Understanding state is also key to security; a reentrancy attack, for example, exploits the ability to call a function before its state changes are finalized, allowing funds to be drained from an inconsistent intermediate state.

In summary, account state is the living record of a blockchain identity. It is the target of every transaction, the basis of all smart contract execution, and the dataset that defines ownership and program logic in decentralized systems. Its integrity, secured by cryptography and consensus, is what gives blockchains their authoritative record-keeping property.

key-features
BLOCKCHAIN FUNDAMENTALS

Key Features of Account State

The account state is the definitive record of an entity's status on a blockchain, encapsulating its assets, permissions, and data. It is the core data structure that smart contracts and consensus mechanisms read from and write to.

01

Nonce

A sequential counter that ensures transaction order and prevents replay attacks. For Externally Owned Accounts (EOAs), it's the number of transactions sent. For Contract Accounts, it's the number of contracts created by that account.

  • Purpose: Guarantees each transaction is unique and processed once.
  • Example: If your account nonce is 5, your next transaction must have a nonce of 5 to be valid.
02

Balance

The quantity of the native cryptocurrency (e.g., ETH, SOL, MATIC) held by the account, denominated in the smallest unit (wei, lamport, wei). This balance is used to pay for transaction fees (gas) and can be transferred to other accounts.

  • EOAs: Hold a spendable balance.
  • Contracts: Can also hold and receive native tokens.
03

Storage Root

A cryptographic hash (a Merkle Patricia Trie root) that represents the persistent data storage of a smart contract. This root hash commits to all key-value pairs in the contract's storage, allowing the entire state to be verified without storing all data on-chain.

  • Function: Enables efficient and verifiable state storage.
  • Location: Part of the global state trie.
04

Code Hash

The Keccak-256 hash of a smart contract's immutable bytecode. For Externally Owned Accounts (EOAs), this field is the hash of an empty string.

  • Contract Accounts: This hash permanently identifies the contract's executable logic.
  • Immutability: Once deployed, a contract's code hash cannot be changed, ensuring trustlessness.
05

State Mutability

Describes how an account's state can be modified. EOAs are mutable only by the holder's signed transactions. Contract Accounts have state mutated by:

  • Internal calls: From its own code.
  • External calls: From other contracts or EOAs via messages.
  • Key Constraint: Mutations must be validated by network consensus and are subject to gas fees.
06

Global State Trie

The master data structure that maps all account addresses to their respective account state objects. It is a cryptographically secured Merkle Patricia Trie, where the root hash serves as a single fingerprint for the entire network state at a given block.

  • Consensus Anchor: Block validators agree on the state root.
  • Light Client Proofs: Allows verification of specific account states without downloading the full chain.
how-it-works
BLOCKCHAIN FUNDAMENTALS

How Account State Works

An explanation of the account-based model, a fundamental data structure that tracks ownership and value on blockchains like Ethereum.

Account state is the complete, current data record associated with a specific address on an account-based blockchain. It is a key-value store that defines the address's identity, holdings, and capabilities at a given block height. For externally owned accounts (EOAs), this state includes the nonce, balance, storage root, and codeHash. For smart contract accounts, it additionally includes the contract's executable bytecode and any persistent data stored in its contract storage. This state is globally maintained by all full nodes in the network and is cryptographically committed to in the state root of each block.

The primary components of an account's state are defined by the blockchain's protocol. The nonce is a counter that increments with each transaction from an EOA or each contract creation, preventing replay attacks. The balance is the amount of native cryptocurrency (e.g., ETH) held by the address. The storage root is a Merkle-Patricia Trie root hash that commits to all data within a smart contract's storage. The codeHash is the Keccak-256 hash of a smart contract's immutable bytecode; for EOAs, this field is the hash of an empty string.

State transitions occur when a valid transaction is executed. A node's execution client processes the transaction against the current world state—the aggregate of all account states—applying the rules defined by the Ethereum Virtual Machine (EVM). This changes one or more account states, for example, by debiting a sender's balance, incrementing a nonce, updating contract storage, or creating a new contract. The resulting new world state is then computed, and its root hash is included in the next block header, providing a succinct cryptographic commitment to the entire network state.

Managing this ever-growing state data is a major scalability challenge, addressed by concepts like state rent (theoretical) and statelessness. The verkle tree upgrade proposed for Ethereum is a key evolution from Merkle-Patricia Tries, designed to enable efficient stateless clients. These clients could validate blocks without storing the entire state, requiring only a small proof (witness) of the specific account states touched by a transaction, dramatically reducing hardware requirements for node operators.

Understanding account state is crucial for developers interacting with smart contracts, as it dictates how data is persistently stored and retrieved. Operations like reading from storage variables in Solidity directly query the account's state trie. Analysts and block explorers reconstruct human-readable state information by querying a node's database, which is typically implemented as a key-value store (e.g., LevelDB) mapping account addresses to their serialized state data, known as the stateDB.

components-breakdown
BLOCKCHAIN GLOSSARY

Core Components of an Account State

An account state is a structured data object representing the current status of an externally owned account (EOA) or smart contract on a blockchain. Its components are critical for tracking assets, code, and transaction permissions.

01

Nonce

A nonce is a sequential counter that tracks the number of transactions sent from an Externally Owned Account (EOA). It prevents replay attacks by ensuring each transaction is unique and processed in order. For smart contracts, the nonce tracks the number of contracts created by that account.

  • EOA Nonce: Increments with each successful transaction.
  • Contract Nonce: Increments with each contract creation via CREATE or CREATE2.
02

Balance

The balance is the amount of the blockchain's native cryptocurrency (e.g., ETH, SOL, MATIC) held by the account, denominated in the smallest unit (wei, lamport, wei). It is a scalar value stored as a 256-bit unsigned integer on EVM chains.

  • EOA: Balance is spendable for transaction fees and value transfers.
  • Contract: Balance can receive funds and execute logic via call.value() or the receive/fallback functions.
03

Storage Root

The storage root is a Merkle-Patricia Trie root hash that cryptographically commits to all persistent data stored by a smart contract. It is a 256-bit hash (often 0x0 for EOAs) that points to a key-value store where contract state variables reside.

  • Key-Value Store: Maps 256-bit keys (storage slots) to 256-bit values.
  • State Proofs: The root enables efficient Merkle proofs for light clients to verify specific storage values without downloading the entire state.
04

Code Hash

The code hash is the Keccak-256 hash of a smart contract's immutable bytecode. For Externally Owned Accounts (EOAs), this field is the hash of an empty string (c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470).

  • Immutability: Once deployed, a contract's bytecode and thus its code hash cannot be changed.
  • Authentication: This hash uniquely identifies the contract's executable logic on-chain.
05

Account Abstraction Extensions

Modern chains supporting account abstraction extend the classic state model. Key extensions include:

  • Deployed Code: A boolean flag indicating if the account is a contract.
  • Version/Nonce Schema: Tracks different transaction types (e.g., 0x00 for EOA, 0x01 for AA).
  • Entry Point Reference: Links the account to a controlling smart contract wallet.
  • Paymaster Data: Allows sponsorship of transaction fees by a third party.
06

State Trie & World State

Individual account states are not stored in isolation; they are leaves in a global state Merkle-Patricia Trie. The root of this trie, the state root, is included in every block header, providing a cryptographic commitment to the entire network's world state at that block height.

  • State Root: A single hash representing all accounts and their states.
  • Sync Protocols: Clients use this structure for fast (snap sync) and light (light client) synchronization.
COMPARISON

Account State: EOA vs. Contract

A technical comparison of the two fundamental account types in Ethereum and EVM-compatible blockchains, defined by their state fields and capabilities.

Feature / State FieldExternally Owned Account (EOA)Contract Account

Account Type Identifier

Created from a private key

Created via contract deployment transaction

Code Hash

Keccak-256 hash of empty string (0xc5d246...)

Keccak-256 hash of the deployed bytecode

Nonce

Number of transactions sent from this address

Number of contracts created by this contract (if creator)

Balance

Wei (ETH) held by the address

Wei (ETH) held by the address

Storage Root

Empty (Merkle Patricia Trie root of empty state)

Root hash of the contract's storage Merkle Patricia Trie

Can Initiate Transactions

Can Execute Arbitrary Code

Has Associated Code/Bytecode

state-management
CORE CONCEPT

State Management & The State Trie

This section explains how blockchains like Ethereum persistently store and organize the current status of all network participants and smart contracts.

Account state is the complete, current data associated with a specific address on a blockchain, representing its identity, holdings, and contract code. In Ethereum, this data structure comprises four primary fields: the nonce (a transaction or contract creation counter), the account's ether balance, the storage root (a hash pointer to the contract's data), and the codeHash (a hash of the contract's immutable bytecode). For externally owned accounts (EOAs), the last two fields are empty. This state is not stored in individual blocks but is continuously updated and maintained by network nodes, forming the global ledger's present view.

The collective account state of the entire network is organized within a Merkle Patricia Trie, specifically the state trie. This cryptographic data structure allows for efficient and verifiable storage. Each node in this massive trie represents an account, keyed by its 20-byte address. The root hash of this trie, known as the stateRoot, is included in every block header. This creates a powerful guarantee: any change to a single account's state will produce a completely different stateRoot, enabling any participant to cryptographically prove the current state of any account using a Merkle proof without needing the entire dataset.

State management is fundamental to blockchain functionality. When a transaction is executed—such as a transfer of ether or a smart contract call—it triggers a state transition. The network's execution layer processes the transaction against the current state trie, updating account balances, modifying contract storage, or deploying new contracts. The resulting new state is computed, its root is hashed, and this new stateRoot is sealed into the new block. This mechanism ensures deterministic and consensus-driven evolution of the ledger, where the stateRoot in the latest block serves as a single, authoritative fingerprint for the entire system state at that point in time.

ecosystem-usage
ECOSYSTEM IMPLEMENTATION

Account State

The Account State is the complete, current representation of an account's data on a blockchain, including its balance, nonce, code, and storage. This section details how different ecosystems implement and manage this core data structure.

01

Ethereum's World State Trie

In Ethereum, the global account state is stored in a Merkle Patricia Trie, where each leaf node is a key-value pair mapping an address to its account state object. This structure contains:

  • Nonce: Number of transactions sent.
  • Balance: Ether held.
  • Storage Root: Hash of the account's storage trie.
  • Code Hash: Hash of the contract's bytecode (empty for EOAs). This trie's root hash is included in the block header, cryptographically committing to the entire state.
02

Solana's Account Model

Solana treats everything as an account, a generic data container with:

  • Lamports: The account's balance in fractional native tokens.
  • Owner: The program address that can modify the account.
  • Executable: Boolean flag indicating if it's a program (smart contract).
  • Data: A byte array for the account's state or program code.
  • Rent: Accounts must maintain a minimum balance to persist on-chain, or they are purged. State is stored in a global, versioned Accounts Database.
03

UTXO Model (Bitcoin, Cardano)

The Unspent Transaction Output (UTXO) model does not have a persistent account state. Instead, the network state is the set of all unspent outputs. A user's "balance" is the sum of UTXOs locked to their address. Key characteristics:

  • Stateless Validation: Nodes validate transactions by checking the existence and spending conditions of referenced UTXOs.
  • Privacy: No single address aggregates all funds.
  • Parallelism: Independent UTXOs can be processed concurrently. This contrasts with the account-based model used by Ethereum.
04

State Pruning & Archival Nodes

Maintaining the full historical account state is resource-intensive. Ecosystems implement state pruning to manage growth:

  • Pruning: Old state data (e.g., storage slots from deleted contracts) is discarded, keeping only recent state roots.
  • Archival Nodes: Special nodes retain the complete history, serving state queries for any past block.
  • State Sync: New nodes can sync via snapshots (a recent state dump) instead of replaying all transactions, drastically reducing sync time.
05

Account Abstraction (ERC-4337)

Account Abstraction decouples transaction validation and execution logic from the core protocol, enabling smart contract wallets. It introduces a new UserOperation object and a global EntryPoint contract. This changes account state management by:

  • Allowing arbitrary logic for signature validation and gas payment.
  • Enabling session keys and social recovery.
  • Moving complexity off-chain to Bundlers, which submit batches of UserOperations to the EntryPoint.
06

State Proofs & Light Clients

Light clients, which don't store the full state, need to verify account state (e.g., a balance) without trusting a full node. This is achieved via state proofs:

  • Merkle Proof: A path from the leaf (account data) to the root hash in the state trie.
  • Verification: The client hashes the proof with the leaf data; if it matches the trusted block header's state root, the data is valid.
  • Use Cases: Enables trust-minimized wallets and cross-chain bridges to verify state from another chain.
ACCOUNT STATE

Technical Deep Dive

Account state refers to the complete, current data associated with a blockchain address, including its balance, nonce, and smart contract storage. It is the fundamental unit of a blockchain's world state, which is a global mapping of addresses to their respective state data, updated with every new block.

Account state is the complete, current data record associated with a specific blockchain address, representing its financial and operational status at a given block height. For an Externally Owned Account (EOA), this includes its nonce (transaction count), balance (native token amount), and storage root. For a Contract Account, it additionally includes the contract's code hash and a storage trie root that cryptographically commits to all its internal variable data. This state is stored in a global data structure called the world state, typically implemented as a Merkle Patricia Trie, allowing for efficient and verifiable proofs of an account's status.

ACCOUNT STATE

Frequently Asked Questions

Account state defines the current data and status of an entity on a blockchain, such as a user's wallet or a smart contract. These questions address its core components, management, and technical implications.

Account state is the complete, current snapshot of data associated with a specific blockchain address, representing its balance, storage, and execution context. For an Externally Owned Account (EOA), this includes its nonce and native token balance. For a smart contract account, the state expands to include the contract's storage variables, deployed code hash, and balance. This state is stored in a global Merkle Patricia Trie, where the root hash of this data structure (the state root) is cryptographically committed to in every block, ensuring its integrity and enabling efficient light client verification.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
Account State: Definition & Components in Blockchain | ChainScore Glossary