Mastering Ethereum. 2nd Edition - Helion

ISBN: 9781098168438
stron: 570, Format: ebook
Data wydania: 2025-10-06
Księgarnia: Helion
Cena książki: 203,15 zł (poprzednio: 236,22 zł)
Oszczędzasz: 14% (-33,07 zł)
As the first blockchain platform to introduce the concept of smart contracts, Ethereum is the gateway to a worldwide decentralized computing paradigm. With this practical guide, the authors provide everything you need to know to start building smart contracts and DApps on Ethereum and other virtual machine blockchains.
Through comprehensive coverage of Ethereum's internal workings, you'll understand not just the how but also the why of Ethereum's innovative technology. And practical deep dives into the architecture and operational mechanics will equip you with the knowledge and tools to explore further developments in Ethereum and the wider blockchain world.
- Run an Ethereum client, create and transmit basic transactions, and program smart contracts
- Learn the essentials of public key cryptography, hashes, and digital signatures
- Understand how "wallets" hold digital keys that control funds and smart contracts
- Learn security best practices, design patterns, and antipatterns with real-world examples
- Learn the essentials about DeFi and zero knowledge proofs
- Understand how the Consensus of Ethereum works and the challenges it presents
- Read and write basic Solidity and Vyper code
Osoby które kupowały "Mastering Ethereum. 2nd Edition", wybierały także:
- Dow 65,31 zł, (20,90 zł -68%)
- Bezpieczeństwo w ASP.NET Core. Kurs video. Podstawy kryptografii 199,00 zł, (89,55 zł -55%)
- Blockchain. Kurs video. Cyfrowa ewolucja w świecie finansów 119,00 zł, (53,55 zł -55%)
- Dow 67,00 zł, (33,50 zł -50%)
- Bezpieczeństwo systemów informatycznych. Zasady i praktyka. Wydanie IV. Tom 2 99,00 zł, (49,50 zł -50%)
Spis treści
Mastering Ethereum. 2nd Edition eBook -- spis treści
- Preface
- How to Use This Book
- Intended Audience
- Code Examples
- Ethereum Addresses and Transactions in this Book
- Conventions Used in This Book
- Using Code Examples
- OReilly Online Learning
- How to Contact Us
- Contacting Carlo
- Contacting Alessandro
- Contacting Niccol
- Acknowledgments by Carlo
- Acknowledgments by Alessandro
- Acknowledgments by Niccol
- Contributions
- 1. What Is Ethereum?
- Ethereum Compared to Bitcoin
- Components of a Blockchain
- The Birth of Ethereum
- Ethereums Stages of Development
- Ethereum: A General-Purpose Blockchain
- Ethereums Components
- Ethereum and Turing Completeness
- Turing Completeness as a Feature
- Implications of Turing Completeness
- From General-Purpose Blockchains to DApps
- Ethereums Development Culture
- Why Learn Ethereum?
- Conclusion
- 2. Ethereum Basics
- Ether Currency Units
- Choosing an Ethereum Wallet
- Control and Responsibility
- Getting Started with MetaMask
- Creating a Wallet
- Switching Networks
- Getting Some Test Ether
- Sending Ether from MetaMask
- Exploring the Transaction History of an Address
- Introducing the World Computer
- Externally Owned Accounts and Contracts
- A Simple Contract: A Test Ether Faucet
- Compiling the Faucet Contract
- Creating the Contract on the Blockchain
- Interacting with the Contract
- Viewing the Contract Address in a Block Explorer
- Funding the Contract
- Withdrawing from Our Contract
- Conclusion
- 3. Ethereum Nodes
- Ethereum Networks
- Should I Run a Full Node?
- Full Node Advantages and Disadvantages
- Public Testnet Advantages and Disadvantages
- Local Blockchain Simulation Advantages and Disadvantages
- Running an Ethereum Node
- Hardware Requirements for a Full Node
- Software Requirements for Building and Running a Client
- Preparation Phase
- Geth-Prysm
- Geth
- Cloning the repository
- Building Geth from source code
- Prysm
- Installing the binary
- Generating a JWT Secret
- Run the node
- Running the execution client
- Running the consensus client
- Geth
- Reth-Lighthouse
- Reth
- Cloning the repository
- Building Reth from source code
- Lighthouse
- Cloning the repository
- Building Lighthouse from source code
- Run the node
- Running the execution client
- Running the consensus client
- Reth
- The First Synchronization of Ethereum-Based Blockchains
- The JSON-RPC Interface
- Remote Ethereum Clients
- Mobile (Smartphone) Wallets
- Browser Wallets
- Hardware Wallets
- Conclusion
- Ethereum Networks
- 4. Cryptography
- Keys and Addresses
- PKC and Cryptocurrency
- Private Keys
- Public Keys
- Elliptic Curve Cryptography Explained
- Elliptic Curve Arithmetic Operations
- Generating a Public Key
- Elliptic Curve Libraries
- Cryptographic Hash Functions
- Ethereums Cryptographic Hash Function: Keccak-256
- Which Hash Function Am I Using?
- Ethereum Addresses
- Ethereum Address Formats
- Hex Encoding with Checksum in Capitalization (ERC-55)
- Detecting an Error in an ERC-55 Encoded Address
- Validators Cryptography
- Introduction
- Requirements
- BLS Digital Signatures
- How Does It Work?
- In Summary
- KZG Cryptography
- Introduction
- Polynomial Commitment Schemes
- Using Merkle Trees
- KZG Commitment
- The trusted setup
- The commitment
- KZG Proof
- Correctness
- Soundness
- KZG Properties
- Multiproofs
- In Summary
- Conclusion
- 5. Wallets
- Overview of Wallet Technologies
- Nondeterministic (Random) Wallets
- Deterministic (Seeded) Wallets
- Hierarchical Deterministic Wallets (BIP-32/BIP-44)
- Seeds and Mnemonic Codes (BIP-39)
- Wallet Best Practices
- Mnemonic Code Words (BIP-39)
- Generating mnemonic words
- From mnemonic to seed
- Optional Passphrase in BIP-39
- Working with Mnemonic Codes
- Mnemonic Code Words (BIP-39)
- Creating an HD Wallet from the Seed
- HD Wallets (BIP-32)
- Extended Public and Private Keys
- Hardened Child Key Derivation
- Index Numbers for Normal and Hardened Derivation
- HD Wallet Key Identifier (Path)
- Navigating the HD Wallet Tree Structure
- Security
- Improving on User Experience
- Account Abstraction
- ERC-4337
- EIP-2938
- RIP-7560
- EIP-5806
- EIP-3074
- EIP-5003
- EIP-7702
- The future of account abstraction
- Social Recovery
- ENS
- Account Abstraction
- Conclusion
- Overview of Wallet Technologies
- 6. Transactions
- The Structure of a Transaction
- Legacy Transactions
- EIP-2930 Transactions
- EIP-1559 Transactions
- EIP-4844 Transactions
- EIP-7702 Transactions
- The Transaction Nonce
- Keeping Track of Nonces
- Gaps in Nonces, Duplicate Nonces, and Confirmation
- Concurrency, Transaction Origination, and Nonces
- Transaction Gas
- EIP-1559: Base Fee and Priority Fee
- How to Know the Correct Gas Price
- Transaction Recipient
- Transaction Value and Data
- Transmitting Value to EOAs and Contracts
- Transmitting a Data Payload to an EOA or Contract
- Special Transaction: Contract Creation
- Digital Signatures
- The ECDSA
- How Digital Signatures Work
- Creating a digital signature
- Verifying the signature
- ECDSA Math
- Transaction Signing in Practice
- Raw Transaction Creation and Signing
- Deserializing the Transaction
- Raw Transaction Creation with EIP-155
- The Signature Prefix Value (v) and Public Key Recovery
- Separating Signing and Transmission (Offline Signing)
- Transaction Life Cycle
- Creating and Signing the Transaction
- Sending the Transaction to the Network
- Building the Block
- Finalizing the Transaction
- An Alternative Life Cycle
- MEV and Proposer and Builder Separation
- Private Mempools
- New Transaction Life Cycle
- Multiple-Signature Transactions
- Conclusion
- The Structure of a Transaction
- 7. Smart Contracts and Solidity
- What Is a Smart Contract?
- Life Cycle of a Smart Contract
- Introduction to Ethereum High-Level Languages
- Building a Smart Contract with Solidity
- Selecting a Version of Solidity
- Downloading and Installing Solidity
- Development Environment
- Writing a Simple Solidity Program
- Compiling with the Solidity Compiler (solc)
- The Ethereum Contract ABI
- Selecting a Solidity Compiler and Language Version
- Programming with Solidity
- Data Types
- Variables: Definition and Scope
- Predefined Global Variables and Functions
- Transaction/message call context
- Transaction context
- Block context
- Address object
- Built-in functions
- Contract Definition
- Functions
- Contract Constructor
- Function Modifiers
- Contract Inheritance
- Multiple Inheritance
- Error Handling
- Events
- Adding events
- Catching events
- Calling Other Contracts
- Creating a new instance
- Addressing an existing instance
- Raw call, delegatecall, and staticcall
- Gas Considerations
- Best Practices
- Estimating Gas Cost
- Conclusion
- 8. Smart Contracts and Vyper
- Vulnerabilities and Vyper
- Comparison to Solidity
- Modifiers
- Class Inheritance
- Inline Assembly
- Function Overloading
- Variable Typecasting
- Decorators
- Function and Variable Ordering
- Compilation
- Protecting Against Overflow Errors at the Compiler Level
- Reading and Writing Data
- Conclusion
- 9. Smart Contract Security
- Security Best Practices
- Security Risks and Antipatterns
- Reentrancy
- The vulnerability
- Preventative techniques
- Real-world example: The DAO attack
- Real-world example: Libertify
- DELEGATECALL
- The vulnerability
- Preventative techniques
- Real-world example: Parity multisig wallet (second hack)
- Entropy Illusion
- The vulnerability
- Preventative techniques
- Real-world example: Fomo3D
- Unchecked CALL Return Values
- The vulnerability
- Preventative techniques
- Real-world example: Etherpot and King of the Ether
- The ERC-20 case
- Race Conditions and Front-Running
- The vulnerability
- Preventative techniques
- Real-world example: AMM and minAmountOut
- Denial of Service
- The vulnerability
- Looping through externally manipulated mappings or arrays
- Progressing state based on external calls
- Unexpected issues
- Preventative techniques
- Real-world example: ZKsync Era Gemholic funds lock
- Floating Point and Precision
- The vulnerability
- Preventative techniques
- Real-world example: ERC-4626 inflation attack
- Price Manipulation
- The vulnerability
- Preventative techniques
- Prototype example: Reliance on AMM on-chain data
- Real-world example: Mango Markets
- Improper Input Validation
- The vulnerability
- Preventative techniques
- Prototype example: Arbitrary calls
- Signature Replay Attack
- The vulnerability
- Preventative techniques
- Real-world example: TCH token
- Smart Contracts Misconfiguration
- Real-world example: yUSDT
- Real-world example: Ronin Bridge
- Real-world example: Sonne Finance
- Preventative techniques
- Reentrancy
- Contract Libraries
- Additional Resources
- Conclusion
- 10. Tokens
- How Tokens Are Used
- Tokens and Fungibility
- Counterparty Risk
- Tokens and Intrinsicality
- Utility, Equity, or Cash Grab?
- Its a Duck!
- Tokens on Ethereum
- The ERC-20 Token Standard
- ERC-20 required functions and events
- ERC-20 optional functions
- The ERC-20 interface defined in Solidity
- ERC-20 data structures
- ERC-20 workflows: Transfer and approve and transferFrom
- ERC-2612: Gasless transfers with permit
- ERC-20 implementations
- Launching Our Own ERC-20 Token
- Interacting with METoken
- Sending ERC-20 tokens to contract addresses
- Demonstrating the approve and transferFrom workflow
- Issues with ERC-20 Tokens
- ERC-223: A proposed token contract interface standard
- ERC-777: The future that could have been
- Issues with ERC-777 tokens
- The future that could have been
- ERC-721: NFT Standard
- ERC-1155: Multitoken Standard
- The ERC-20 Token Standard
- Using Token Standards
- What Are Token Standards and What Is Their Purpose?
- Should You Use These Standards?
- Detecting Standards: EIP-165
- Security by Maturity
- Extensions to Token Interface Standards
- Conclusion
- 11. Oracles
- Why Oracles Are Needed
- Oracle Use Cases and Examples
- Oracle Design Patterns
- Immediate-Read
- Publish-Subscribe
- Request-Response
- Data Authentication
- Computation Oracles
- Decentralized Oracles
- Cross-Chain Messaging Protocols
- Conclusion
- 12. Decentralized Applications
- What Is a DApp?
- Backend (Smart Contract)
- Data Storage
- IPFS
- Merkle trees
- Frontend (Web User Interface)
- A Basic DApp Example
- Installation Requirements
- Creating the DApp
- Starting the Chain
- Deploying Your Contract
- Starting the Frontend
- Interacting with Your Contract
- Deploying to Vercel
- Further Decentralizing the DApp
- Decentralized Websites
- Limitations
- Deploying to IPFS
- From App to DApp
- Conclusion
- What Is a DApp?
- 13. Decentralized Finance
- DeFi Versus Traditional Finance
- DeFi Primitives
- Decentralized Exchanges
- Lending Markets
- Oracles
- Stablecoins
- Liquid Staking
- Real-World Assets
- Bridges and Omnichain Protocols
- (De)centralized Finance
- Risks and Challenges in DeFi
- Conclusion
- 14. The Ethereum Virtual Machine
- What Is the EVM?
- Comparison with Existing Technology
- What Are Other Blockchains Doing?
- The EVM Instruction Set (Bytecode Operations)
- Ethereum State
- Ethereum Stateless
- Merkle-Patricia Trie
- Merkle trees
- Merkle trees in Bitcoin
- Merkle-Patricia trie in Ethereum
- A Deep Dive into the Components of the EVM
- Stack
- Memory
- Storage
- Calldata
- Lets Put Everything Together with a Concrete Example
- Compiling Solidity to EVM Bytecode
- Contract Deployment Code
- Disassembling the Bytecode
- Installing Heimdall
- Disassembling the bytecode with Heimdall
- Turing Completeness and Gas
- What Is Gas?
- Gas Accounting During Execution
- Gas accounting considerations
- Gas accounting in the future of Ethereum
- Gas cost versus gas price
- Negative gas costs
- Block Gas Limit
- Who chooses the block gas limit?
- Why doesnt the block gas limit rise?
- Concrete Implementations
- The Biggest EVM Upgrade: EVM Object Format
- Jumpdest Analysis
- Adding and Deprecating Features
- Code and Data Separation
- Stack Too Deep
- EOF
- Improvements
- EOF in action
- The Future of the EVM
- Conclusion
- What Is the EVM?
- 15. Consensus
- Principles of Consensus
- Safety
- Finality
- Liveness
- Block Trees and Forking
- Consensus via Proof of Work
- Consensus via Proof of Stake
- PoS Terminology
- Nodes and Validators
- Blocks and Attestations
- LMD-GHOST
- Latest Message Driven
- Greediest Heaviest Observed Subtree
- Incentives
- Proposing blocks
- Creating attestations
- Casper FFG: The Finality Gadget
- Epochs and Checkpoints
- Justification and Finalization
- Sources and targets, links and conflicts
- Supermajority links
- Justification
- Finalization
- Slashing
- Fork Choice Rule
- The Casper Commandments
- Accountable Safety and Plausible Liveness
- Accountable safety and economic finality
- Plausible liveness
- A Practical Example: The Life Cycle of a Checkpoint
- First Round: Justification
- Second Round: Finalization
- Conflicting Justification
- Gasper: A Real Example
- Controversy and Competition
- Timing Games
- Centralization of Supermajority
- Conclusion
- Principles of Consensus
- 16. Scaling Ethereum
- The Problems of Ethereums Layer 1
- The Scalability Trilemma
- Gas Costs and Network Congestion
- State Growth and Storage Issues
- Block Propagation and MEV
- Solutions
- Scaling the L1
- Raising the gas limit
- The future of parallel execution in Ethereum
- State growth and expiry
- Proposer-builder separation
- Rollups
- Rollup stages
- Optimistic rollups
- Zero-knowledge rollups
- Scaling the L1
- Other Types of Scaling Solutions
- Validiums
- Sidechains
- Based Rollups
- Booster Rollups
- Native Rollups
- Danksharding
- Proto-Danksharding
- Stateless Ethereum
- Weak Statelessness
- Verkle Trees
- Strong Statelessness
- Conclusion
- The Problems of Ethereums Layer 1
- 17. Zero-Knowledge Proofs
- History
- Definition and Properties
- How Ethereum Uses Zero-Knowledge Proofs
- L2s Also Benefit from ZK
- A Small Example
- Lets Prove It
- Issues
- Zero Knowledge
- Prover Commitment
- Adding Randomness to the Commitment
- Conclusion? Or Not
- Fiat-Shamir Heuristic
- Conclusion?
- SNARK Versus STARK
- Zk-EVM and zk-VM
- Conclusion
- Index




