# Simple Summary of Chapter 2 This chapter introduces **Ethereum** and explains how it works beyond just being a cryptocurrency. --- ## Ethereum and Ether Ethereum is a **blockchain platform**, while **ether (ETH)** is the money used on that platform. Ether is used to pay for transactions and to run programs called **smart contracts**. The smallest unit of ether is **wei**, and all values in Ethereum are stored internally in wei. --- ## Wallets and Accounts To use Ethereum, you need a **wallet**. A wallet is an application that: - Stores your private keys - Lets you send and receive ether - Allows you to interact with smart contracts Examples of wallets include **MetaMask**, **Rabby**, and **Phantom**. You can switch wallets easily as long as you have your private keys or recovery phrase. --- ## Private Keys and Security Each Ethereum account is controlled by a **private key**. If you lose this key, you permanently lose access to your funds. **Important safety tips include:** - Never share your private key - Write down your recovery phrase on paper - Do small test transactions before sending large amounts - Use trusted wallets only --- ## Ethereum as a World Computer Ether exists primarily to pay for **smart contract execution**. - Smart contracts run on the **Ethereum Virtual Machine (EVM)** - The EVM is a global, replicated system running on every Ethereum node - The blockchain records the changing state of this world computer --- ## Types of Ethereum Accounts There are two main types of Ethereum accounts: ### Externally Owned Accounts (EOAs) - Controlled by private keys - Can initiate transactions ### Contract Accounts - Controlled by smart contract code - Do not have private keys - Can send and receive ether and react to transactions but cannot initiate them --- ## Writing a Smart Contract The chapter introduces **Solidity**, Ethereum’s primary smart contract language, through a simple **faucet contract** that: - Allows users to withdraw small amounts of ether - Accepts incoming ether - Demonstrates basic Solidity concepts such as functions, `require`, payable addresses, and fallback/receive functions The contract is intentionally flawed to highlight common mistakes and security considerations that will be addressed later. --- ## Deploying the Contract Using **Remix IDE** and **MetaMask**, the contract is: - Compiled into EVM bytecode - Deployed to the **Sepolia test network** - Funded with test ether - Interacted with by calling its `withdraw` function # CHAPTER 6 SUMMARY: Ethereum Transactions This chapter explains how **transactions** make Ethereum work. Ethereum does nothing on its own. **Every action on Ethereum starts with a transaction.** --- ## What Is a Transaction? A transaction is a **message sent from a user account to the Ethereum network**. It is used to: - Send ether (ETH) - Call a smart contract - Change data on the blockchain Once sent, a transaction is recorded permanently. --- ## Who Can Send Transactions? Only **Externally Owned Accounts (EOAs)** can send transactions. These are normal user accounts controlled by **private keys**, such as MetaMask wallets. Smart contracts **cannot start transactions by themselves**. --- ## What Is Inside a Transaction? A transaction contains: - Sender and receiver address - Amount of ether (optional) - Gas fee - Data (optional, for smart contracts) --- ## Gas and Transaction Fees Gas is the **fee paid to process transactions** on Ethereum. - Simple ETH transfer → low gas - Smart contract interaction → higher gas Part of the gas fee is burned, and part is paid to validators. --- ## Transaction Order (Nonce) Each transaction has a **nonce**, which is a number that: - Keeps transactions in the correct order - Prevents sending the same transaction twice --- ## Where Transactions Are Sent Transactions can be sent to: - **Another wallet** (to send ETH) - **A smart contract** (to run code) Sending ETH to a wrong address **cannot be reversed**. --- ## Tools Used Transactions are tested using: - Test networks like **Sepolia** - Developer tools to send and monitor transactions safely --- ## Key Takeaway **Transactions are the actions that make Ethereum work. Without transactions, Ethereum does nothing.**