Ethereum Architecture Overview
Ethereum's blockchain structure consists of several key components:
- Version Number
- Previous Block Hash
- Timestamp
- Nonce
- Target Hash
- MPT (Merkle Patricia Trie) - Three Core Trees
Transaction Tree
- Contains all transactions at the base layer
State Tree
Manages accounts
- Regular accounts (with storage space only)
- Contract accounts (with both storage space and executable code)
Receipt Tree
- Stores transaction receipts
- Designed for efficient SPV (Simplified Payment Verification) indexing
The tree structures themselves store key-value pairs as hash references. When a smart contract is deployed:
- A new contract account is created
- Contains compiled bytecode (for EVM execution)
- Includes dedicated storage space for data persistence
- Requires ABI (Application Binary Interface) for interaction
Understanding Ethereum Smart Contracts
1. What Are Smart Contracts?
Self-executing programmatic agreements with:
- Predefined methods
- Variable states
- Written primarily in Solidity (JavaScript-like syntax)
2. Execution Triggers
Two execution modes:
- State-changing operations: Require transactions (gas fees apply)
- Read-only operations: Local calls (no gas fees)
3. Execution Environment
Requirements for execution:
- Ethereum client with EVM (Ethereum Virtual Machine)
- Contract address (for identification)
- ABI (for method accessibility)
4. Current Limitations
Smart contracts cannot:
- Access external web resources
- Perform complex file operations
- Execute unrestricted computations
Storage Mechanisms Explained
Smart Contract Code Storage
- Persisted permanently on blockchain
- Stored via
codeHashin account state - Deployed through transaction inclusion in blocks
- Accessible via contract address
👉 Learn how smart contracts revolutionize blockchain technology
Data Storage Principles
Key characteristics:
- Each contract maintains dedicated storage (key-value database)
- Public variables accessible via getter methods
- All data persists in blockchain's underlying database
- Historical modifications may be pruned over time
Contract Self-Destruction Mechanism
- Invoked via
selfdestruct(recipient) - Removes contract from state tree (not historical blocks)
- Transfers remaining ETH to recipient
- Does not physically delete code from blockchain
Practical Considerations
Locating Historical Contracts
- Address-based lookup system
- State tree maintains current references
- Historical blocks remain immutable
Storage Efficiency Factors
- Regular accounts: Minimal storage
- Contract accounts: Code + persistent storage
- Merkle tree structure enables efficient verification
FAQ Section
Q: Can deleted smart contracts be recovered?
A: No - once self-destructed, contracts become inaccessible, though their historical existence remains verifiable.
Q: How much does smart contract storage cost?
A: Storage operations consume gas proportional to data size and complexity.
Q: Where can I view public contract variables?
A: Through wallet interfaces using contract addresses and ABI information.
👉 Discover advanced Ethereum development techniques
Q: Why can't smart contracts access web APIs?
A: EVM design prioritizes deterministic execution, excluding external dependencies that could cause consensus failures.
Q: How long does contract data persist?
A: Indefinitely - blockchain's immutable nature ensures permanent availability unless explicitly pruned.
Q: What happens to contract storage after destruction?
A: Storage space becomes inaccessible but remains physically present in historical blocks.