Dive into Bitcoin technology with this hands-on guide from one of the leading teachers on Bitcoin and Bitcoin programming. Author Jimmy Song shows Python programmers and developers how to program a Bitcoin library from scratch. You’ll learn how to work with the basics, including the math, blocks, network, and transactions behind this popular cryptocurrency and its blockchain payment system.
By the end of the book, you'll understand how this cryptocurrency works under the hood by coding all the components necessary for a Bitcoin library. Learn how to create transactions, get the data you need from peers, and send transactions over the network. Whether you’re exploring Bitcoin applications for your company or considering a new career path, this practical book will get you started.
• Parse, validate, and create bitcoin transactions
• Learn Script, the smart contract language behind Bitcoin
• Do exercises in each chapter to build a Bitcoin library from scratch
• Understand how proof-of-work secures the blockchain
• Program Bitcoin using Python 3
• Understand how simplified payment verification and light wallets work
• Work with public-key cryptography and cryptographic primitives
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A hands-on, code-first journey through Bitcoin's internals, teaching Python developers to build a working Bitcoin library from scratch—covering the math, cryptography, transactions, and network protocols that power the world's first cryptocurrency.
【Book Arc】
- **Opening (~0%–6%)**: Introduces the book's mission—building a Bitcoin library from scratch in Python—and sets up the mathematical foundation with finite fields, the algebraic structures that underpin all subsequent cryptography.
- **Early (~6%–25%)**: Dives into elliptic curves over finite fields, explaining point addition, scalar multiplication, and the mathematical groups that make public-key cryptography possible. This section builds the core primitives needed for Bitcoin's signing and verification.
- **Early (~25%–34%)**: Completes the cryptographic foundation by covering finite field arithmetic (addition, subtraction, multiplication, division, exponentiation) and introduces the secp256k1 curve—the specific elliptic curve Bitcoin uses. The discrete log problem is introduced as the source of cryptographic security.
- **Middle (~34%–47%)**: Moves from theory to practice with signing and verification, explaining how private keys generate public keys and how digital signatures prove ownership. Introduces serialization formats (SEC) for transmitting keys and signatures over the network.
- **Middle (~47%–53%)**: Transitions into transaction mechanics, covering how transactions are structured, hashed, and serialized—the building blocks for the ledger that Bitcoin maintains.
【Key Takeaways】
- **Finite fields are the algebraic bedrock of Bitcoin** (Early): Understanding modular arithmetic over prime fields is non-negotiable—every operation in Bitcoin's cryptography, from key generation to transaction signing, relies on these principles. The book builds these from first principles with Python classes.
- **Elliptic curve cryptography provides asymmetric security** (Early): The discrete log problem—easy to compute in one direction, computationally infeasible to reverse—is what makes Bitcoin's public/private key system secure. Scalar multiplication of a generator point creates public keys that cannot be reversed to find private keys.
- **Point addition over finite fields is the core operation** (Early): The same geometric formulas for adding points on elliptic curves over real numbers work over finite fields, enabling the creation of finite cyclic groups—the mathematical structure that generates all Bitcoin addresses.
- **The secp256k1 curve is Bitcoin's specific choice** (Early): This particular elliptic curve, with its specific parameters, is what Bitcoin uses for all its cryptographic operations. Understanding its properties (like p % 4 = 3 enabling efficient square roots) is essential for implementing key parsing and verification.
- **Digital signatures prove ownership without revealing secrets** (Middle): The archer analogy—proving skill by hitting a challenger-specified target—illustrates how ECDSA signatures work: they prove possession of a private key without exposing it. The Signature class with r and s values is the practical implementation.
- **Serialization formats enable network communication** (Middle): SEC (Standards for Efficient Cryptography) formats—both compressed and uncompressed—are how public keys are transmitted. The compressed format cleverly encodes the y-coordinate's parity to save space, requiring a square root calculation to recover the full point.
- **Transactions are the fundamental unit of value transfer** (Middle): The book transitions from pure cryptography to transaction mechanics, showing how transactions are hashed, serialized, and structured—the foundation for understanding how Bitcoin actually moves value between parties.
【Reading Tips】
- **Deep-read Chapters 1–3** (finite fields, elliptic curves, cryptography): These are the mathematical foundation. Don't skip the exercises—they're designed to build the Python classes you'll reuse throughout the book. The concepts build on each other, so mastery here pays dividends later.
- **Skim the preface and acknowledgments** (~16%–19%): These contain personal background and setup instructions but no technical content. Jump straight to the mathematical content if you're already comfortable with Python.
- **Pay special attention to the secp256k1 section** (~34%): This is where abstract math becomes Bitcoin-specific. Understanding why this particular curve is used and how its parameters enable efficient computation is crucial for the serialization and transaction chapters.
- **Work through the signing/verification chapter carefully** (~38%–44%): This is the conceptual heart of Bitcoin's security model. The archer analogy is helpful, but the actual code implementation—the Signature class and verify method—is what you'll need for real-world applications.
- **Treat the exercises as mandatory, not optional**: The book's pedagogical approach is "learn by building." Each chapter's exercises contribute to a working Bitcoin library, so skipping them means you'll lack the code foundation for later chapters.
【Coverage Limits】
The excerpts cover the book's mathematical foundations, cryptographic primitives, and early transaction mechanics (roughly the first half). Later chapters on Script, the Bitcoin network, and simplified payment verification are mentioned in the table of contents but not covered in detail in this guide.
sses was instrumental to my love of math and program‐ ming. My high school classmate Eric Silberstein gave me my first job out of college as a pro‐ grammer a...
ition. Point Addition | 29 Point Addition for When x ≠x 1 2 Now that we’ve covered the vertical line, let’s examine when the points are different. When we ha...
compressed and compressed. We’ll begin with the former, and look at the compressed format in the next section. Here is how the uncompressed SEC format for a ...
ALL is 1 and this has to be encoded in little-endian over 4 bytes, which makes the transaction look like Figure 8-28. Figure 8-28. Append the hash type (SIGH...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Programming Bitcoin Learn How to Program Bitcoin from Scratch (Jimmy Song)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Programming Bitcoin Learn How to Program Bitcoin from Scratch (Jimmy Song)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment