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 to WeChat Moments
Programming Bitcoin Learn How to Program Bitcoin from Scratch (Jimmy Song)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
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
这本书面向会写 Python 的开发者,讲的是如何从零开始亲手实现一个比特币库,而不是停留在概念层面的泛泛介绍。作者 Jimmy Song 是比特币与比特币编程领域有经验的讲师,他以动手实践的方式,把比特币背后的数学、区块、网络和交易逐层拆开,让读者在写代码的过程中理解这套加密货币及其区块链支付系统究竟怎样运转。
读者可以抓住几条主要线索。第一条是数学基础,书中从椭圆曲线密码学讲起,这是比特币密钥与签名体系的根基,作者用代码把曲线上的运算一步步实现出来,包括那个被称为无穷远点的特殊零点。第二条是交易的构造与序列化,书中展示了如何把交易输入、输出、变长整数和锁定时间按顺序拼接成字节流,让读者看清一笔交易在底层到底是什么样子。第三条是网络层,通过解析网络信封、连接测试网节点并持续读取消息,读者能体会比特币节点之间如何通信,测试网默认端口是 18333。第四条是签名与密钥的进阶用法,书中提到可以把单个私钥拆分成多个私钥,并用交互式方法聚合签名,而无需重构出原始私钥,这让人理解多重签名与聚合签名背后的思路。此外,作者还谈到工作量证明的意义:希望找到一种只需做一次、无需与验证方来回交互、却仍能证明自己确实完成了工作的机制。
Digital LibraryAI Assistant
Hi — I can help you pick a book. Tell me a topic, language, or level, e.g. “a light English read”. If that's too broad, I'll ask one follow-up.
Loading comments...
Reply to Comment
Edit Comment