Mastering Bitcoin

Andreas M. Antonopoulos

Carla Thornton

Rebecca Demarest

WordCo Indexing Services

Karen Montgomery

David Futato

Printed in the United States of America.


O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles ( For more information, contact our corporate/institutional sales department: 800-998-9938 or .

The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Mastering Bitcoin, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps.

While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.

Revision History
First release
Second release

Praise for Mastering Bitcoin


“When I talk about bitcoin to general audiences, I am sometimes asked but how does it really work? Now I have a great answer for that question, because anybody who reads Mastering Bitcoin will have a deep understanding of how it works and will be well-equipped to write the next generation of amazing cryptocurrency applications.”

  -- Gavin Andresen Chief Scientist Bitcoin Foundation

“Bitcoin and blockchain technologies are becoming fundamental building blocks for the next generation internet. Silicon Valley’s best and brightest are working on it. Andreas' book will help you join the software revolution in the world of finance.”

  -- Naval Ravikant Cofounder AngelList

Mastering Bitcoin is the best technical reference available on bitcoin today. And bitcoin is likely to be seen in retrospect as the most important technology of this decade. As such, this book is an absolute must-have for any developer, especially those interested in building applications with the bitcoin protocol. Highly recommended.”

  -- Balaji S. Srinivasan (@balajis) General Partner

“The invention of the Bitcoin Blockchain represents an entirely new platform to build upon, one that will enable an ecosystem as wide and diverse as the Internet itself. As one of the preeminent thought leaders, Andreas Antonopoulos is the perfect choice to write this book.”

  -- Roger Ver Bitcoin Entrepreneur and Investor
Table of Contents