Antonopoulos, Andreas M.

Mastering bitcoin : programming the open blockchain. / Andreas M. Antonopoulos, David A. Harding - 3rd ed. - New Delhi : O'Reilly Media, Inc. 2024. - xxvi, 372 pages : illustration ; 25 cm.

1. Introduction
History of Bitcoin
Getting Started
Choosing a Bitcoin Wallet
Quick Start
Recovery Codes
Bitcoin Addresses
Receiving Bitcoin
Getting Your First Bitcoin
Finding the Current Price of Bitcoin
Sending and Receiving Bitcoin
2. How Bitcoin Works
Bitcoin Overview
Buying from an Online Store
Bitcoin Transactions
Transaction Inputs and Outputs
Transaction Chains
Making Change
Coin Selection
Common Transaction Forms
Constructing a Transaction
Getting the Right Inputs
Creating the Outputs
Adding the Transaction to the Blockchain
Bitcoin Mining
Spending the Transaction
3. Bitcoin Core: The Reference Implementation
From Bitcoin to Bitcoin Core
Bitcoin Development Environment
Compiling Bitcoin Core from the Source Code
Selecting a Bitcoin Core Release
Configuring the Bitcoin Core Build
Building the Bitcoin Core Executables
Running a Bitcoin Core Node
Configuring the Bitcoin Core Node
Bitcoin Core API
Getting Information on Bitcoin Core’s Status
Exploring and Decoding Transactions
Exploring Blocks
Using Bitcoin Core’s Programmatic Interface
Alternative Clients, Libraries, and Toolkits
C/C++
JavaScript
Java
Python
Go
Rust
Scala
C#
4. Keys and Addresses
Public Key Cryptography
Private Keys
Elliptic Curve Cryptography Explained
Public Keys
Output and Input Scripts
IP Addresses: The Original Address for Bitcoin (P2PK)
Legacy Addresses for P2PKH
Base58check Encoding
Compressed Public Keys
Legacy Pay to Script Hash (P2SH)
Bech32 Addresses
Problems with Bech32 Addresses
Bech32m
Private Key Formats
Compressed Private Keys
Advanced Keys and Addresses
Vanity Addresses
Paper Wallets
5. Wallet Recovery
Independent Key Generation
Deterministic Key Generation
Public Child Key Derivation
Hierarchical Deterministic (HD) Key Generation (BIP32)
Seeds and Recovery Codes
Backing Up Nonkey Data
Backing Up Key Derivation Paths
A Wallet Technology Stack in Detail
BIP39 Recovery Codes
Creating an HD Wallet from the Seed
Using an Extended Public Key on a Web Store
6. Transactions
A Serialized Bitcoin Transaction
Version
Extended Marker and Flag
Inputs
Length of Transaction Input List
Outpoint
Input Script
Sequence
Outputs
Outputs Count
Amount
Output Scripts
Witness Structure
Circular Dependencies
Third-Party Transaction Malleability
Second-Party Transaction Malleability
Segregated Witness
Witness Structure Serialization
Lock Time
Coinbase Transactions
Weight and Vbytes
Legacy Serialization
7. Authorization and Authentication
Transaction Scripts and Script Language
Turing Incompleteness
Stateless Verification
Script Construction
Pay to Public Key Hash
Scripted Multisignatures
An Oddity in CHECKMULTISIG Execution
Pay to Script Hash
P2SH Addresses
Benefits of P2SH
Redeem Script and Validation
Data Recording Output (OP_RETURN)
Transaction Lock Time Limitations
Check Lock Time Verify (OP_CLTV)
Relative Timelocks
Relative Timelocks with OP_CSV
Scripts with Flow Control (Conditional Clauses)
Conditional Clauses with VERIFY Opcodes
Using Flow Control in Scripts
Complex Script Example
Segregated Witness Output and Transaction Examples
Upgrading to Segregated Witness
Merklized Alternative Script Trees (MAST)
Pay to Contract (P2C)
Scriptless Multisignatures and Threshold Signatures
Taproot
Tapscript
8. Digital Signatures
How Digital Signatures Work
Creating a Digital Signature
Verifying the Signature
Signature Hash Types (SIGHASH)
Schnorr Signatures
Serialization of Schnorr Signatures
Schnorr-based Scriptless Multisignatures
Schnorr-based Scriptless Threshold Signatures
ECDSA Signatures
ECDSA Algorithm
Serialization of ECDSA Signatures (DER)
The Importance of Randomness in Signatures
Segregated Witness’s New Signing Algorithm
9. Transaction Fees
Who Pays the Transaction Fee?
Fees and Fee Rates
Estimating Appropriate Fee Rates
Replace By Fee (RBF) Fee Bumping
Child Pays for Parent (CPFP) Fee Bumping
Package Relay
Transaction Pinning
CPFP Carve Out and Anchor Outputs
Adding Fees to Transactions
Timelock Defense Against Fee Sniping
10. The Bitcoin Network
Node Types and Roles
The Network
Compact Block Relay
Private Block Relay Networks
Network Discovery
Full Nodes
Exchanging “Inventory”
Lightweight Clients
Bloom Filters
How Bloom Filters Work
How Lightweight Clients Use Bloom Filters
Compact Block Filters
Golomb-Rice Coded Sets (GCS)
What Data to Include in a Block Filter
Downloading Block Filters from Multiple Peers
Reducing Bandwidth with Lossy Encoding
Using Compact Block Filters
Lightweight Clients and Privacy
Encrypted and Authenticated Connections
Mempools and Orphan Pools
11. The Blockchain
Structure of a Block
Block Header
Block Identifiers: Block Header Hash and Block Height
The Genesis Block
Linking Blocks in the Blockchain
Merkle Trees
Merkle Trees and Lightweight Clients
Bitcoin’s Test Blockchains
Testnet: Bitcoin’s Testing Playground
Signet: The Proof of Authority Testnet
Regtest: The Local Blockchain
Using Test Blockchains for Development
12. Mining and Consensus
Bitcoin Economics and Currency Creation
Decentralized Consensus
Independent Verification of Transactions
Mining Nodes
The Coinbase Transaction
Coinbase Reward and Fees
Structure of the Coinbase Transaction
Coinbase Data
Constructing the Block Header
Mining the Block
Proof-of-Work Algorithm
Target Representation
Retargeting to Adjust Difficulty
Median Time Past (MTP)
Successfully Mining the Block
Validating a New Block
Assembling and Selecting Chains of Blocks
Mining and the Hash Lottery
The Extra Nonce Solution
Mining Pools
Hashrate Attacks
Changing the Consensus Rules
Hard Forks
Soft Forks
Consensus Software Development
13. Bitcoin Security
Security Principles
Developing Bitcoin Systems Securely
The Root of Trust
User Security Best Practices
Physical Bitcoin Storage
Hardware Signing Devices
Ensuring Your Access
Diversifying Risk
Multisig and Governance
Survivability
14. Second-Layer Applications
Building Blocks (Primitives)
Applications from Building Blocks
Colored Coins
Single-Use Seals
Pay to Contract (P2C)
Client-Side Validation
RGB
Taproot Assets
Payment Channels and State Channels
State Channels—Basic Concepts and Terminology
Simple Payment Channel Example
Making Trustless Channels
Asymmetric Revocable Commitments
Hash Time Lock Contracts (HTLC)
Routed Payment Channels (Lightning Network)
Basic Lightning Network Example
Lightning Network Transport and Pathfinding
Lightning Network Benefits
A. The Bitcoin Whitepaper by Satoshi Nakamoto
Bitcoin - A Peer-to-Peer Electronic Cash System
Introduction
Transactions
Timestamp Server
Proof-of-Work
Network
Incentive
Reclaiming Disk Space
Simplified Payment Verification
Combining and Splitting Value
Privacy
Calculations
Conclusion
References
License
B. Errata to the Bitcoin Whitepaper
Abstract
Transactions
Proof of Work
Reclaiming Disk Space
Simplified Payment Verification
Privacy
Calculations
C. Bitcoin Improvement Proposals
Index
About the Authors

Join the technological revolution that's taking the financial world by storm. Mastering Bitcoin is your guide through the seemingly complex world of Bitcoin, providing the knowledge you need to participate in the internet of money. Whether you're building the next killer app, investing in a startup, or simply curious about the technology, this revised and expanded third edition provides essential detail to get you started.

Bitcoin, the first successful decentralized digital currency, has already spawned a multibillion-dollar global economy open to anyone with the knowledge and passion to participate. Mastering Bitcoin provides the knowledge. You supply the passion.

The third edition includes:

A broad introduction to Bitcoin and its underlying blockchain—ideal for nontechnical users, investors, and business executives
An explanation of Bitcoin's technical foundation and cryptographic currency for developers, engineers, and software and systems architects
Details of the Bitcoin decentralized network, peer-to-peer architecture, transaction lifecycle, and security principles
New developments such as Taproot, Tapscript, Schnorr signatures, and the Lightning Network
A deep dive into Bitcoin applications, including how to combine the building blocks offered by this platform into powerful new tools
User stories, analogies, examples, and code snippets illustrating key technical concepts

9781098150099


Money --Technological innovations
Electronic funds transfer
Management --Business studies

005.276 / ANT