BITCOIN AND CRYPTOCURRENCY TECHNOLOGIES
BITCOIN AND CRYPTOCURRENCY TECHNOLOGIES
A Comprehensive Introduction
ARVIND NARAYANAN, JOSEPH BONNEAU, EDWARD FELTEN, ANDREW MILLER, AND STEVEN GOLDFEDER
PRINCETON UNIVERSITY PRESS
Princeton and Oxford
Copyright 2016 by Princeton University Press
Published by Princeton University Press, 41 William Street, Princeton, New Jersey 08540
In the United Kingdom: Princeton University Press, 6 Oxford Street, Woodstock, Oxfordshire
OX20 1TR
press.princeton.edu
Cover image: Courtesy of Shutterstock
All Rights Reserved
ISBN 978-0-691-17169-2
Library of Congress Cataloging-in-Publication Data
Names: Narayanan, Arvind, author.
Title: Bitcoin and cryptocurrency technologies : a comprehensive introduction / Arvind Narayanan, Joseph Bonneau, Edward Felten, Andrew Miller, and Steven Goldfeder.
Description: Princeton : Princeton University Press, [2016] | Includes bibliographical references and index.
Identifiers: LCCN 2016014802 | ISBN 9780691171692 (hardcover : alk. paper)
Subjects: LCSH: Bitcoin. | Electronic funds transfers. | Cryptography. | Money.
Classification: LCC HG1710 .N35 2016 | DDC 332.1/78dc23 LC record available at https://lccn.loc.gov/2016014802
British Library Cataloging-in-Publication Data is available
This book has been composed in Charis
Printed on acid-free paper.
Printed in the United States of America
1 3 5 7 9 10 8 6 4 2
Contents
Preface
Theres a lot of excitement about Bitcoin and cryptocurrencies. Optimists claim that Bitcoin will fundamentally alter payments, economics, and even politics around the world. Pessimists claim Bitcoin is inherently broken and will suffer an inevitable and spectacular collapse.
Underlying these differing views is significant confusion about what Bitcoin is and how it works. We wrote this book to help cut through the hype and get to the core of what makes Bitcoin unique. To really understand what is special about Bitcoin, we need to understand how it works at a technical level. Bitcoin truly is a new technology, and we can only get so far by explaining it through simple analogies to past technologies.
We assume that you have a basic understanding of computer sciencehow computers work, data structures and algorithms, and some programming experience. If youre an undergraduate or graduate student of computer science, a software developer, an entrepreneur, or a technology hobbyist, this textbook is for you.
In this book, we address the important questions about Bitcoin. How does Bitcoin work? What makes it different? How secure are your bitcoins? How anonymous are Bitcoin users? What applications can we build using Bitcoin as a platform? Can cryptocurrencies be regulated? If we were designing a new cryptocurrency today, what would we change? What might the future hold?
After reading this book, youll know everything you need to be able to separate fact from fiction when reading claims about Bitcoin and other cryptocurrencies. Youll have the conceptual foundations you need to engineer secure software that interacts with the Bitcoin network. And youll be able to integrate ideas from Bitcoin into your own projects.
The online supplementary materials for this book include a series of homework questions to help you understand each chapter at a deeper level. In addition, there is a series of programming assignments in which youll implement various components of Bitcoin in simplified models. Most of the material of this book is also available as a series of video lectures on Coursera. (A link to the supplementary materials can be found at http://press.princeton.edu/titles/10908.html.) You should also supplement your learning with information you can find online, including the Bitcoin wiki, forums, and research papers, and by interacting with your peers and the Bitcoin community.
Foreword
THE LONG ROAD TO BITCOIN
JEREMY CLARK
The path to Bitcoin is littered with the corpses of failed attempts. Ive compiled a list of about a hundred cryptographic payment systems, both e-cash- and credit-card-based technologies, that are notable in some way (). Some are academic proposals that have been widely cited, while others are actual systems that were deployed and tested. Of all the names on this list, theres probably only one that you recognizePayPal. And PayPal survived only because it quickly pivoted away from its original idea of cryptographic payments on handheld devices!
Theres a lot to learn from this history. Where do the ideas in Bitcoin come from? Why do some technologies survive while many others die? What does it take for complex technical innovations to be successfully commercialized? If nothing else, this story will give you an appreciation of how remarkable it is that we finally have a real, working payment mechanism thats native to the Internet.
TRADITIONAL FINANCIAL ARRANGEMENTS
If you imagine a world without governments or currency, one system that could still work for acquiring goods is barter. Suppose Alice wants a tool, and Bob wants medicine. If each of them happen to have what the other person needs, then they can swap and both satisfy their needs.
But suppose Alice has food that shes willing to trade for a tool, while Bob, who has a tool, doesnt have any need for food. He wants medicine instead. Alice and Bob cant trade with each other, but if theres a third person, Carol, who has medicine that shes willing to trade for food, then it becomes possible to arrange a three-way swap where everyone gets what they need.
The drawback, of course, is coordinationarranging a group of people, whose needs and wants align, in the same place at the same time. Two systems emerged to solve coordination: credit and cash. Historians, anthropologists, and economists debate which of the two developed first, but thats immaterial for our purposes.
TABLE 0.1. NOTABLE ELECTRONIC PAYMENT SYSTEMS AND PROPOSALS
In a credit-based system, Alice and Bob would be able to trade with each other in the example above. Bob would give Alice the tool, and Bob gets a favor thats owed to him. In other words, Alice has a debt that she needs to settle with Bob some time in the future. Alices material needs are now satisfied, but she has a debt that shed like to cancel, so thats her new want. If Alice encounters Carol in the future, Alice can trade her food for Carols medicine, then go back to Bob with the medicine and cancel the debt.
In contrast, in a cash-based system, Alice would buy the tool from Bob. Later, she might sell her food to Carol, and Carol can sell her medicine to Bob, completing the cycle. These trades can happen in any order, provided that the buyer in each transaction has cash on hand. In the end, of course, its as if no money ever changed hands.
Neither system is clearly superior. A cash-based system needs to be bootstrapped with some initial allocation of cash, without which no trades can occur. A credit-based system doesnt need bootstrapping, but the drawback is that anyone whos owed a debt is taking on some risk. Theres a chance that the other person never settles the debt.
Cash also allows us to be precise about how much something is worth. If youre bartering, its hard to say whether a tool is worth more than medicine or medicine is worth more than food. Cash lets us use numbers to talk about value. Thats why we use a blended system todayeven when were using credit, we measure debt in the amount of cash it would take to settle it.
These ideas come up in many contexts, especially in online systems, where users trade virtual goods of some kind. For example, peer-to-peer file-sharing networks must deal with the problem of freeloaders, that is, users who download files without sharing in turn. While swapping files might work, there is also the issue of coordination: finding the perfect person who has exactly the file you want and wants exactly the file you have. In projects like MojoNation and academic proposals like Karma, users are given some initial allocation of virtual cash that they must spend to receive a file and earn when they send a copy of a file to another user. A network of nodes (centralized for MojoNation and decentralized for Karma) keeps track of users balances, and MojoNation explored implementing an exchange service between their internal currency and traditional currency. While MojoNation did not survive long enough to implement such an exchange, it became the intellectual ancestor of some protocols used today: BitTorrent and Tahoe-LAFS.
Next page