Unless you’ve been living under a rock for the last couple of years, you’ve probably heard of Bitcoin—the game-changing digital currency used by millions worldwide But Bitcoin isn’t just another way to buy stuff It’s an anonymous, revolutionary, cryptographically secure currency that functions without the oversight of a central authority or government If you want to get into the Bitcoin game but find yourself a little confused, Bitcoin for the Befuddled may be just what you’re looking for Learn what Bitcoin is; how it works; and how to acquire, store, and spend bitcoins safely and securely F How to accept bitcoins as payment in your physical store or on your website F Advanced topics, including Bitcoin mining and Bitcoin programming With its non-technical language and patient, step-by-step approach to this fascinating currency, Bitcoin for the Befuddled is your ticket to getting started with Bitcoin Get out from under the rock and get in the Bitcoin game Just make sure not to lose your shirt You’ll also learn: F Bitcoin’s underlying cryptographic principles, and how bitcoins are created F The history of Bitcoin and its potential impact on trade and commerce F All about the blockchain, the public ledger of Bitcoin transactions F How to choose a bitcoin wallet that’s safe and easy to use $24.95 ($25.95 CDN) shelve in: Computers/eCommerce Bitcoin for the Befuddled Spend, Save, and Invest! Barski and Wilmer T H E F I N E ST I N G E E K E N T E RTA I N M E N T ™ w w w.nostarch.com Conrad Barski and Chris Wilmer Safety Area: All Text, Logos & Barcode should remain inside the Pink Dotted Lines Bleed Area: All Backgrounds should extend to, but not past, the Blue Dotted Lines Bitcoin for the Befuddled Bitcoin for the Befuddled by Co n r a d Ba r s k i a n d C h r i s W i lm e r San Francisco Bitcoin for the befuddled Copyright © 2015 by Conrad Barski and Chris Wilmer All rights reserved No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher Printed on demand in USA ISBN-10: 1-59327-573-0 ISBN-13: 978-1-59327-573-0 Publisher: William Pollock Production Editor: Serena Yang Cover Illustration: Conrad Barski Interior Design: Octopod Studios Developmental Editor: Tyler Ortman Technical Reviewer: Patrick Fuller Copyeditor: Anne Marie Walker Compositor: Alison Law Proofreader: Paula L Fleming Indexer: Nancy Guenther For information on distribution, translations, or bulk sales, please contact No Starch Press, Inc directly: No Starch Press, Inc 245 8th Street, San Francisco, CA 94103 phone: 415.863.9900; info@nostarch.com www.nostarch.com Library of Congress Control Number: 2014951031 No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc Other product and company names mentioned herein may be the trademarks of their respective owners Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The information in this book is distributed on an “As Is” basis, without warranty While every precaution has been taken in the preparation of this work, neither the authors nor No Starch Press, Inc shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it Nothing in this book is intended to offer legal or financial advice, and neither the authors nor the publisher are engaged in the business of rendering such advice If you’re looking for legal or financial advice, please run to the nearest qualified professional and don’t ask us Neither the authors nor the publisher will be liable for any loss or risk that you incur by using the information contained in this book About the Authors Conrad Barski has an M.D from the University of Miami and nearly 20 years of programming experience Barski is a cartoonist, programmer, and the author of Land of Lisp (No Starch Press) He’s been using Bitcoin since 2011 Chris Wilmer holds a Ph.D in chemical engineering from Northwestern University and is a professor at the University of Pittsburgh Wilmer’s first purchase with Bitcoin was a bag of honey caramels from a farm in Utah They were delicious Brief Contents Preface xv Chapter 1: What Is Bitcoin? Chapter 2: Bitcoin Basics Chapter 3: Storing Your Bitcoins Safely, Securely, and Conveniently 31 Chapter 4: Buying Bitcoins 49 Chapter 5: Lost at Sea: A Cryptographic Adventure 73 Chapter 6: Why Bitcoin Is a Big Deal 109 Chapter 7: The Cryptography Behind Bitcoin 129 Chapter 8: Bitcoin Mining 161 Chapter 8.5: The Strange World of Altcoins 181 Chapter 9: Understanding the Different Types of Bitcoin Wallets 185 Chapter 10: Bitcoin 2030 199 Appendix A: Hello Money! A Simple JavaScript Program 213 Appendix B: Bitcoin Programming with BitcoinJ 225 Index 241 Conte nt s in De ta il Preface xv Acknowledgments xvi What Is Bitcoin? Why Bitcoin Now? The Benefits of Using Bitcoin The Complexity and Confusion of Bitcoin What’s in This Book? Bitcoin Basics How Bitcoin Works in Simple Terms Bitcoin Units The Bitcoin Address The Private Key The Bitcoin Wallet Creating Your First Bitcoin Wallet with Electrum Acquiring Bitcoins in Your Wallet Spending Bitcoins with Your Wallet Bitcoin Addresses Generated by Your Bitcoin Wallet Program The Blockchain The Blockchain Lottery Blockchain Forking Transaction Confirmations, Double Spending , and Irreversibility Mining Bitcoins The Complexity of the Bitcoin System Storing Your Bitcoins Safely, Securely, and Conveniently Storing Your Private Key(s) Hot Storage vs Cold Storage Personal vs Hosted Wallets Safety, Security, and Convenience Storing Small Amounts of Bitcoins Online Hosted Wallet Services Online Personal Wallet Services Personal Hot Wallet 10 11 12 14 16 17 19 19 21 23 25 26 27 31 33 33 34 35 35 36 37 37 .. .Bitcoin for the Befuddled Bitcoin for the Befuddled by Co n r a d Ba r s k i a n d C h r i s W i lm e r San Francisco Bitcoin for the befuddled Copyright © 2015 by Conrad Barski and Chris... No Starch Press, Inc 245 8th Street, San Francisco, CA 94103 phone: 415.863.9900; info@nostarch.com www.nostarch.com Library of Congress Control Number: 2014951031 No Starch Press and the No Starch. .. Pollock, and others xvi Preface W h at Is Bi tcoin? In the simplest terms, Bitcoin is just another currency The term Bitcoin refers to the entire currency system, whereas bitcoins are the basic