Ethereum Fundamentals: A Comprehensive Guide

·

Abstract

Essential Ethereum knowledge for tackling ETH-related challenges, covering accounts, transactions, smart contracts, and storage mechanisms.

Core Components

1. Development Environment

Account Types in Ethereum

Ethereum utilizes two distinct account classifications:

External Owned Accounts (EOA)

Contract Accounts

All accounts maintain:

Ether Denominations

Base unit: wei
Common conversions:

👉 Real-time conversion tool

Transaction Mechanics

Signed data packets enabling:

Transaction Components

FieldPurpose
fromSender address
toRecipient address (null for contract creation)
valueTransferred Ether (wei)
dataBytecode or encoded function calls
gasPriceFee per gas unit
gasLimitMaximum gas allocation
nonceTransaction sequence number

Transaction Types

  1. Value Transfer

    • Requires: from, to, value
    • Empty data field
  2. Contract Creation

    • Requires: from, contract bytecode
    • Null to field
  3. Contract Interaction

    • Requires: from, to, encoded function data

Smart Contract Essentials

Development Workflow

  1. Write in Solidity/Yul
  2. Compile to EVM bytecode
  3. Deploy via transaction

👉 Smart contract deployment guide

Contract Anatomy

Function Calls

Storage Architecture

Interaction Methods

Web3.py Scripting

from web3 import Web3

w3 = Web3(Web3.HTTPProvider('RPC_ENDPOINT'))

def send_txn(sender, target, data):
    txn = {
        'chainId': w3.eth.chainId,
        'from': sender,
        'to': target,
        'gasPrice': w3.toWei(1.1, 'gwei'),
        'nonce': w3.eth.getTransactionCount(sender),
        'data': data
    }
    signed = w3.eth.account.signTransaction(txn, PRIVATE_KEY)
    return w3.eth.sendRawTransaction(signed.rawTransaction)

FAQ

Q: How are contract addresses determined?

A: Through either CREATE (nonce-dependent) or CREATE2 (deterministic) opcodes

Q: What happens if a transaction exceeds gasLimit?

A: The transaction reverts but gas costs up to the limit are still charged

Q: Can contracts initiate transactions?

A: No, they can only respond to external calls

Q: How is private data stored?

A: All contract storage is publicly visible on-chain

Q: What's the smallest Ether unit?

A: wei (1 Ether = 10¹⁸ wei)


Key optimizations:
1. Removed year reference from title
2. Structured content with clear hierarchy
3. Added SEO-friendly tables and lists
4. Incorporated 7 core keywords naturally
5. Included interactive elements and FAQs