Mastering Bitcoin

Total Page:16

File Type:pdf, Size:1020Kb

Mastering Bitcoin Mastering Bitcoin Andreas M. Antonopoulos Mastering Bitcoin by Andreas M. Antonopoulos Copyright © 2010 Andreas M. Antonopoulos LLC.. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safaribooksonline.com). For more information, contact our corporate/ institutional sales department: 800-998-9938 or [email protected]. Editors: Mike Loukides and Allyson MacDonald Indexer: FIXME FIXME Production Editor: Melanie Yarbrough Cover Designer: Karen Montgomery Copyeditor: FIXME FIXME Interior Designer: David Futato Proofreader: FIX ME! Illustrator: Rebecca Demarest December 2014: First Edition Revision History for the First Edition: 2014-04-07: Early release revision 1 2014-06-02: Early release revision 2 2014-06-27: Early release revision 3 2014-07-30: Early release revision 4 2014-09-16: Early release revision 5 2014-10-07: Early release revision 6 See http://oreilly.com/catalog/errata.csp?isbn=9781449374044 for release details. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. !!FILL THIS IN!! 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 every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. ISBN: 978-1-449-37404-4 [?] Table of Contents Preface. ix 1. Introduction. 1 What is Bitcoin? 1 History of Bitcoin 3 Bitcoin Uses, Users and Their Stories 4 Getting Started 6 Quick Start 7 Getting your first bitcoins 9 Sending and receiving bitcoins 10 2. How Bitcoin Works. 15 Transactions, Blocks, Mining, and the Blockchain 15 Bitcoin Overview 16 Buying a cup of coffee 16 Bitcoin Transactions 18 Common Transaction Forms 20 Constructing a Transaction 22 Getting the right inputs 22 Creating the outputs 24 Adding the transaction to the ledger 25 Bitcoin Mining 26 Mining transactions in blocks 28 Spending the transaction 29 3. The Bitcoin Client. 31 Bitcoin Core - The reference implementation 31 Running Bitcoin Core for the first time 32 Compiling Bitcoin Core from the source code 33 iii Using Bitcoin Core’s JSON-RPC API from the command line 39 Getting information on the Bitcoin Core client status 41 Wallet setup and encryption 41 Wallet backup, plain-text dump and restore 42 Wallet addresses and receiving transactions 43 Exploring and decoding transactions 45 Exploring blocks 48 Creating, signing and submitting transactions based on unspent outputs 50 Alternative clients, libraries and toolkits 56 Libbitcoin and sx tools 56 pycoin 57 btcd 58 4. Keys, Addresses, Wallets. 61 Introduction 61 Public key cryptography and crypto-currency 62 Private and Public Keys 63 Private Keys 63 Public Keys 65 Elliptic Curve Cryptography Explained 65 Generating a public key 68 Bitcoin Addresses 70 Base58 and Base58Check Encoding 72 Key Formats 76 Implementing Keys and Addresses in Python 81 Wallets 84 Non-Deterministic (Random) Wallets 85 Deterministic (Seeded) Wallets 86 Mnemonic Code Words 86 Hierarchical Deterministic Wallets (BIP0032/BIP0044) 88 Advanced Keys and Addresses 98 Encrypted Private Keys (BIP0038) 98 Pay To Script Hash (P2SH) and Multi-Sig Addresses 99 Vanity Addresses 100 Paper Wallets 105 5. Transactions. 111 Introduction 111 Transaction Lifecycle 111 Creating Transactions 112 Broadcasting Transactions to the Bitcoin Network 112 Propagating Transactions on the Bitcoin Network 113 iv | Table of Contents Transaction Structure 113 Transaction Outputs and Inputs 114 Transaction Outputs 115 Transaction Inputs 117 Transaction Fees 120 Adding Fees to Transactions 121 Transaction Chaining and Orphan Transactions 122 Transaction Scripts and Script Language 123 Script Construction (Lock + Unlock) 123 Scripting Language 125 Turing Incompleteness 127 Stateless Verification 128 Standard Transactions 128 Pay to Public Key Hash (P2PKH) 128 Pay-to-Public-Key 131 Multi-Signature 132 Data Output (OP_RETURN) 133 Pay to Script Hash (P2SH) 134 6. The Bitcoin Network. 139 Peer-to-Peer Network Architecture 139 Nodes Types and Roles 140 The Extended Bitcoin Network 142 Network Discovery 144 Full Nodes 147 Exchanging “Inventory” 148 Simplified Payment Verification (SPV) Nodes 150 Bloom Filters 154 Bloom Filters and Inventory Updates 159 Transaction Pools 160 Alert Messages 161 7. The Blockchain. 163 Introduction 163 Structure of a Block 164 Block Header 164 Block Identifiers - Block Header Hash and Block Height 165 The Genesis Block 166 Linking Blocks in the Blockchain 167 Merkle Trees 170 Merkle Trees and Simplified Payment Verification (SPV) 175 Table of Contents | v 8. Mining and Consensus. 177 Introduction 177 Bitcoin Economics and Currency Creation 178 De-centralized Consensus 181 Independent Verification of Transactions 182 Mining Nodes 183 Aggregating Transactions into Blocks 184 Transaction Age, Fees, and Priority 184 The Generation Transaction 186 Coinbase Reward and Fees 187 Structure of the Generation Transaction 188 Coinbase Data 189 Constructing the Block Header 191 Mining the Block 192 Proof-of-Work Algorithm 193 Difficulty Representation 198 Difficulty Target and Re-Targeting 199 Successfully Mining the Block 201 Validating a New Block 201 Assembling and Selecting Chains of Blocks 202 Blockchain Forks 204 Mining and the Hashing Race 209 The Extra Nonce Solution 210 Mining Pools 211 Consensus Attacks 214 9. Alternative Chains, Currencies, and Applications. 219 A taxonomy of alternative currencies and chains 220 Meta-Coin Platforms 220 Colored Coins 221 Mastercoin 222 Counterparty 222 Alt-coins 222 Evaluating an alt-coin 224 Monetary Parameter Alternatives: Litecoin, Dogecoin, Freicoin 224 Consensus Innovation: Peercoin, Myriad, Blackcoin, Vericoin, NXT 225 Dual-Purpose Mining Innovation: Primecoin, Curecoin, Gridcoin 227 Anonymity-Focused Alt-Coins: CryptoNote, Bytecoin, Monero, Zerocash/ Zerocoin, Darkcoin 228 Non-currency alt-chains 230 Namecoin 230 Bitmessage 232 vi | Table of Contents Ethereum 232 Future of Currencies 233 10. Bitcoin Security. 235 Security principles 235 Developing Bitcoin Systems Securely 236 The Root of Trust 237 User Security Best Practices 238 Physical Bitcoin Storage 239 Hardware Wallets 239 Balancing Risk (loss vs. theft) 239 Diversifying Risk 239 Multi-sig and Governance 240 Survivability 240 Conclusion 240 A. Appendix: Available commands with sx tools. 241 B. Appendix - pycoin, ku and tx.. 247 C. Appendix: Transaction Script Language Operators, Constants and Symbols. 255 D. Appendix - Bitcoin Improvement Proposals. 259 Table of Contents | vii Preface Writing the Bitcoin Book I first stumbled upon bitcoin in mid-2011. My immediate reaction was more or less “Pfft! Nerd money!” and I ignored it for another 6 months, failing to grasp its impor‐ tance. This is a reaction which I have seen repeated among many of the smartest people I know, which gives me some consolation. The second time I came across bitcoin in a mailing list discussion, I decided to read the white paper written by Satoshi Nakamoto, to study the authoritative source and see what it was all about. I still remember the moment I finished reading those 9 pages, when I realized that bitcoin was not simply a digital currency, but a network of trust that could also provide the basis for so much more than just currencies. That realization: “This isn’t money, it’s a de-centralized trust network,” started me on a four month journey to devour every scrap of information about bitcoin I could find. I became obsessed and enthralled, spending twelve or more hours each day glued to a screen, reading, writing, coding and learning as much as I could. I emerged from this state of fugue, more than 20 lbs lighter from lack of consistent meals, determined to dedicate myself to working on bitcoin. Two years later, after creating a number of small startups to explore various bitcoin- related services and products, I decided that it was time to write my first book. Bitcoin was the topic that had driven me into a frenzy of creativity, consumed my thoughts and was the most exciting technology I had encountered since the Internet. It was now time to share my passion about this amazing technology with a broader audience. Intended Audience This book is mostly intended for coders. If you can use a programming language, this book will teach you how cryptographic currencies work, how to use them and how to develop software that works with them. The first few chapters are also suitable as an in- depth introduction to bitcoin for non-coders - those trying to understand the inner workings of bitcoin and crypto-currencies. ix Why Are There Bugs On The Cover? The Leafcutter Ant is a species that exhibits highly complex behavior in a colony super- organism, but each individual ant operates on a set of simple rules driven by social interaction and the exchange of chemical scents (pheromones). Per Wikipedia: “Next to humans, leafcutter ants form the largest and most complex animal societies on Earth.” Leafcutter ants don’t actually eat leaves, but rather use them to farm a fungus, which is the central food source for the colony. Get that? These ants are farming! While ants form a caste-based society and have a queen for producing offspring, there is no central authority or leader in an ant colony. The highly intelligent and sophisticated behavior exhibited by a multi-million member colony is an emergent property from the interaction of the individuals in a social network. Nature demonstrates that de-centralized systems can be resilient and can produce emergent complexity and incredible sophistication without the need for a central au‐ thority, hierarchy or complex parts.
Recommended publications
  • Auditing Wallets in Cryptonote
    Auditing wallets in CryptoNote sowle <[email protected]> ​ ​ Zano project, https://zano.org ​ Cryptocurrency wallet auditing is the ability for a third party (the "auditor") to watch the transactions and to be able to calculate the correct balance without an ability to spend a coin. This article explores several possible implementations of expansion cryptocurrency protocol CryptoNote 2.0 [1] with such ability. In the original CryptoNote protocol auditing is only partially possible with the help of the tracking ​ ​ key, namely, an auditor is able to distinguish incoming transactions in the blockchain, but the full set of secret keys is required to filter out outgoing transactions. This article is intended for readers familiar with the general blockchain technology and “classic” cryptocurrencies, as well as with the basics of cryptography on elliptic curves. 1. Introduction What is CryptoNote? Surprisingly, most people interested in blockchain technology have never heard anything about CryptoNote, in spite of the fact that the technology has more than 300 forks, including Monero as the most famous. Back in 2014 in the cryptocurrency community there were mentions [2] about a project, titled Bytecoin. That project did not originate as a Bitcoin or other known project fork, having its own original codebase. It was very unusual at the time. Bytecoin general conception was to be an implementation of a privacy-technology named CryptoNote. There were two main privacy mechanisms: stealth-addresses and inputs` mixing-in with the ​ ​ help of ring signatures (at the time it was called "blockchain mixer"). Since Zcash existed only on paper / in theory at that time, CryptoNote became a competitive technology and has provoked much controversy in the cryptocurrency community.
    [Show full text]
  • The Internet and Drug Markets
    INSIGHTS EN ISSN THE INTERNET AND DRUG MARKETS 2314-9264 The internet and drug markets 21 The internet and drug markets EMCDDA project group Jane Mounteney, Alessandra Bo and Alberto Oteo 21 Legal notice This publication of the European Monitoring Centre for Drugs and Drug Addiction (EMCDDA) is protected by copyright. The EMCDDA accepts no responsibility or liability for any consequences arising from the use of the data contained in this document. The contents of this publication do not necessarily reflect the official opinions of the EMCDDA’s partners, any EU Member State or any agency or institution of the European Union. Europe Direct is a service to help you find answers to your questions about the European Union Freephone number (*): 00 800 6 7 8 9 10 11 (*) The information given is free, as are most calls (though some operators, phone boxes or hotels may charge you). More information on the European Union is available on the internet (http://europa.eu). Luxembourg: Publications Office of the European Union, 2016 ISBN: 978-92-9168-841-8 doi:10.2810/324608 © European Monitoring Centre for Drugs and Drug Addiction, 2016 Reproduction is authorised provided the source is acknowledged. This publication should be referenced as: European Monitoring Centre for Drugs and Drug Addiction (2016), The internet and drug markets, EMCDDA Insights 21, Publications Office of the European Union, Luxembourg. References to chapters in this publication should include, where relevant, references to the authors of each chapter, together with a reference to the wider publication. For example: Mounteney, J., Oteo, A. and Griffiths, P.
    [Show full text]
  • Cryptocurrencies Exploring the Application of Bitcoin As a New Payment Instrument
    Cryptocurrencies Exploring the Application of Bitcoin as a New Payment Instrument By Shinnecock Partners in association with Sophia Bak, Jimmy Yang, Peter Shea, and Neil Liu About the Authors Shinnecock Partners undertook this study of cryptocurrencies with the authors to understand this revolutionary payment system and related technology, explore its disruptive potential, and assess the merits of investing in it. Shinnecock Partners is a 25 year old investment boutique with an especial focus on niche investments offering higher returns with less risk than more traditional investments in long equities and bonds. Sophia Bak is an analyst intern at Shinnecock Partners. She is an MBA candidate at UCLA Anderson School of Management with a focus on Finance. Prior to Anderson, she spent five years at Mirae Asset Global Investments, working in equity research, global business strategy, and investment development. She holds a B.S. in Business Administration from Carnegie Mellon University with concentration in Computing and Information Technology. Jimmy Yang is a third-year undergraduate student at UCLA studying Business Economics and Accounting. Peter Shea is a third-year undergraduate student at UCLA studying Mathematics, Economics and Statistics. Neil Liu is a third-year undergraduate student at UCLA studying Applied Mathematics and Business Economics. Acknowledgements We are grateful to the individuals who shared their time and expertise with us. We want to thank John Villasenor, UCLA professor of Electrical Engineering and Public Policy, Brett Stapper and Brian Lowrance from Falcon Global Capital, and Tiffany Wan and Max Hoblitzell from Deloitte Consulting LLP. We also want to recognize Tracy Williams and Steven Kroll for their thoughtful feedback and support.
    [Show full text]
  • Virtual Currency
    Office of Legislative Research Research Report December 12, 2014 2014-R-0290 BITCOINS - VIRTUAL CURRENCY By: Michelle Kirby, Associate Analyst ISSUE BITCOINS The use of bitcoins as virtual currency, the laws that Bitcoin is a form of virtual or digital currency. It is govern it, and other states’ attempts to regulate it. not legal tender and is not backed by any This report updates OLR Report 2014-R-0050. government. Federal agencies such as SUMMARY the U.S. Treasury “Bitcoin” is a form of virtual or digital currency, that Department, the Government Accountability allows financial transactions to be conducted on a Office, the Internal network using computer codes. It is a form of Revenue Service, and the exchange that operates like a currency but does not Congressional Research Services have issued have all the attributes of real currency. guidance on how existing laws apply to virtual There are no federal or state laws that specifically currency activities. govern bitcoins. However, many existing laws apply to A proposed federal law certain virtual currency activities. calls for a five-year moratorium on bitcoin The U.S. Treasury Department’s Financial Crimes regulation. Enforcement Network (FinCEN) has provided guidance New York has proposed indicating that, under federal law, a virtual currency regulation that would, user is not a money transmitter and is therefore not among other things, subject to the registration, reporting, and require firms engaged in virtual currency to have a recordkeeping regulations for money services BitLicense. businesses (MSBs). However, virtual currency California has enacted a administrators and exchangers may be regulated as law that allows the use of money transmitters but should not be considered alternative currency.
    [Show full text]
  • Vulnerability of Blockchain Technologies to Quantum Attacks
    Vulnerability of Blockchain Technologies to Quantum Attacks Joseph J. Kearneya, Carlos A. Perez-Delgado a,∗ aSchool of Computing, University of Kent, Canterbury, Kent CT2 7NF United Kingdom Abstract Quantum computation represents a threat to many cryptographic protocols in operation today. It has been estimated that by 2035, there will exist a quantum computer capable of breaking the vital cryptographic scheme RSA2048. Blockchain technologies rely on cryptographic protocols for many of their essential sub- routines. Some of these protocols, but not all, are open to quantum attacks. Here we analyze the major blockchain-based cryptocurrencies deployed today—including Bitcoin, Ethereum, Litecoin and ZCash, and determine their risk exposure to quantum attacks. We finish with a comparative analysis of the studied cryptocurrencies and their underlying blockchain technologies and their relative levels of vulnerability to quantum attacks. Introduction exist to allow the legitimate owner to recover this account. Blockchain systems are unlike other cryptosys- tems in that they are not just meant to protect an By contrast, in a blockchain system, there is no information asset. A blockchain is a ledger, and as central authority to manage users’ access keys. The such it is the asset. owner of a resource is by definition the one hold- A blockchain is secured through the use of cryp- ing the private encryption keys. There are no of- tographic techniques. Notably, asymmetric encryp- fline backups. The blockchain, an always online tion schemes such as RSA or Elliptic Curve (EC) cryptographic system, is considered the resource— cryptography are used to generate private/public or at least the authoritative description of it.
    [Show full text]
  • The Nature of Decentralized Virtual Currencies: Benefits, Risks and Regulations
    MILE 14 Thesis | Fall 2014 The Nature of Decentralized Virtual Currencies: Benefits, Risks and Regulations. Paul du Plessis Supervisor: Prof. Dr. Kern Alexander 1 DECLARATION This master thesis has been written in partial fulfilment of the Master of International Law and Economics Programme at the World Trade Institute. The ideas and opinions expressed in this paper are made independently, represent my own views and are based on my own research. I confirm that this work is my own and has not been submitted for academic credit in any other subject or course. I have acknowledged all material and sources used in this paper. I understand that my thesis may be made available in the World Trade Institute library. 2 ABSTRACT Virtual currency schemes have proliferated in recent years and have become a focal point of media and regulators. The objective of this paper is to provide a description of the technical nature of Bitcoin and the reason for its existence. With an understanding of the basic workings of this new payment system, we can draw comparisons to fiat currency, analyze the associated risks and benefits, and effectively discusses the current regulatory framework. 3 TABLE OF CONTENTS Page 1. Introduction .............................................................................................. 4 2. The Evolution of Money .......................................................................... 6 2.1. Defining Money ................................................................................. 6 2.2. The Origin of Money ........................................................................
    [Show full text]
  • Banking Bitcoin-Related Businesses: a Primer for Managing BSA/AML Risks
    Banking Bitcoin-Related Businesses: A Primer for Managing BSA/AML Risks Douglas King Retail Payments Risk Forum Working Paper Federal Reserve Bank of Atlanta October 2015 Revised February 2016 Abstract: To date, much of the attention directed toward Bitcoin has focused on its use as a preferred payment method by criminal enterprises because it allows users to transact pseudonymously. But Bitcoin offers more than just pseudonymity. It is a fast, low-cost, and secure payment solution that can also be used for many legitimate purposes. As investment and interest in the Bitcoin ecosystem have grown since its 2009 start, new businesses have emerged seeking to advance Bitcoin as a mainstream payment solution. The pseudonymous nature of Bitcoin transactions heighten Bank Secrecy Act (BSA)/Anti-Money Laundering (AML) Act compliance risks, making it especially challenging for these new businesses to establish banking relationships. This paper examines the current regulatory environment for Bitcoin-related businesses as well as measures these businesses can adopt to mitigate the BSA/AML risks inherent in the Bitcoin protocol. It also presents a framework for financial institutions (FIs) to consider for managing the risks associated with banking these companies. This paper is not a replacement, update, or supplement to BSA/AML guidance requirements provided in November 2014 by the Federal Financial Institutions Examination Council (FFIEC). By making a commitment to BSA/AML compliance, Bitcoin-related businesses can both better position Bitcoin as a mainstream payment system and enhance the ability of FIs to successfully bank them. The paper is intended for informational purposes and the views expressed in this paper are those of the author and do not necessarily reflect those of the Federal Reserve Bank of Atlanta or the Federal Reserve System.
    [Show full text]
  • Creation and Resilience of Decentralized Brands: Bitcoin & The
    Creation and Resilience of Decentralized Brands: Bitcoin & the Blockchain Syeda Mariam Humayun A dissertation submitted to the Faculty of Graduate Studies in partial fulfillment of the requirements for the degree of Doctor of Philosophy Graduate Program in Administration Schulich School of Business York University Toronto, Ontario March 2019 © Syeda Mariam Humayun 2019 Abstract: This dissertation is based on a longitudinal ethnographic and netnographic study of the Bitcoin and broader Blockchain community. The data is drawn from 38 in-depth interviews and 200+ informal interviews, plus archival news media sources, netnography, and participant observation conducted in multiple cities: Toronto, Amsterdam, Berlin, Miami, New York, Prague, San Francisco, Cancun, Boston/Cambridge, and Tokyo. Participation at Bitcoin/Blockchain conferences included: Consensus Conference New York, North American Bitcoin Conference, Satoshi Roundtable Cancun, MIT Business of Blockchain, and Scaling Bitcoin Tokyo. The research fieldwork was conducted between 2014-2018. The dissertation is structured as three papers: - “Satoshi is Dead. Long Live Satoshi.” The Curious Case of Bitcoin: This paper focuses on the myth of anonymity and how by remaining anonymous, Satoshi Nakamoto, was able to leave his creation open to widespread adoption. - Tracing the United Nodes of Bitcoin: This paper examines the intersection of religiosity, technology, and money in the Bitcoin community. - Our Brand Is Crisis: Creation and Resilience of Decentralized Brands – Bitcoin & the Blockchain: Drawing on ecological resilience framework as a conceptual metaphor this paper maps how various stabilizing and destabilizing forces in the Bitcoin ecosystem helped in the evolution of a decentralized brand and promulgated more mainstreaming of the Bitcoin brand. ii Dedication: To my younger brother, Umer.
    [Show full text]
  • Hybrid Public/Anonymous Transactions on Monero, Cryptonote X-Cash
    Hybrid public/anonymous transactions on Monero, Cryptonote X-Cash Zach Hildreth October 7, 2019 Abstract This yellow paper details the technical concepts and implementation of hybrid transactions (also known as FlexPrivacy c ), a feature enabling public and private transactions on the X- Cash public blockchain. In the first part, the paper aims at detailing how the hybrid transactions operate from a user’s perspective with some real-world use cases. A parallel is made between the digital money system and the economic behaviors associated with the current FIAT system. Secondly, a deeper understanding of the technology is given, explaining the implication on a blockchain perspective, as well as the edge cases and their approaches. Lastly, the last part consists in an in-depth approach of the mathematical concepts and technical implementation of the hybrid transaction in the X-Cash blockchain. Contents 1 Public transactions in the ringCT 4 2 Privacy in the inputs 4 3 A brief understanding of cryptonote transactions 4 4 Creation of a public address 6 5 How stealth addresses/outputs are decoded 6 6 How public transactions are created 7 1 Summary of the public transaction feature The hybrid transaction feature allows users to send and receive public or private transactions on the X-Network Blockchain X-Cash, which is based on the CryptoNote protocol. This feature is implemented on a per transaction basis where users can directly switch the privacy type by choosing the setting before attempting to send a transaction. In a public transaction, the following additional information is made public: • Sender’s address • Receiver’s address • Amount sent • Change amount sent back to the sender’s address However, the public transaction does not compromise the sender’s or receiver’s wallet full bal- ances nor the real mixin (number of signatures in the ring signature that authorizes the transaction) that provided the X-Cash balance.
    [Show full text]
  • IB Case Study Vocabulary a Local Economy Driven by Blockchain (2020) Websites
    IB Case Study Vocabulary A local economy driven by blockchain (2020) Websites Merkle Tree: https://blockonomi.com/merkle-tree/ Blockchain: https://unwttng.com/what-is-a-blockchain Mining: https://www.buybitcoinworldwide.com/mining/ Attacks on Cryptocurrencies: https://blockgeeks.com/guides/hypothetical-attacks-on-cryptocurrencies/ Bitcoin Transaction Life Cycle: https://ducmanhphan.github.io/2018-12-18-Transaction-pool-in- blockchain/#transaction-pool 51 % attack - a potential attack on a blockchain network, where a single entity or organization can control the majority of the hash rate, potentially causing a network disruption. In such a scenario, the attacker would have enough mining power to intentionally exclude or modify the ordering of transactions. Block - records, which together form a blockchain. ... Blocks hold all the records of valid cryptocurrency transactions. They are hashed and encoded into a hash tree or Merkle tree. In the world of cryptocurrencies, blocks are like ledger pages while the whole record-keeping book is the blockchain. A block is a file that stores unalterable data related to the network. Blockchain - a data structure that holds transactional records and while ensuring security, transparency, and decentralization. You can also think of it as a chain or records stored in the forms of blocks which are controlled by no single authority. Block header – main way of identifying a block in a blockchain is via its block header hash. The block hash is responsible for block identification within a blockchain. In short, each block on the blockchain is identified by its block header hash. Each block is uniquely identified by a hash number that is obtained by double hashing the block header with the SHA256 algorithm.
    [Show full text]
  • Impossibility of Full Decentralization in Permissionless Blockchains
    Impossibility of Full Decentralization in Permissionless Blockchains Yujin Kwon*, Jian Liuy, Minjeong Kim*, Dawn Songy, Yongdae Kim* *KAIST {dbwls8724,mjkim9394,yongdaek}@kaist.ac.kr yUC Berkeley [email protected],[email protected] ABSTRACT between achieving good decentralization in the consensus protocol Bitcoin uses the proof-of-work (PoW) mechanism where nodes earn and not relying on a TTP exists. rewards in return for the use of their computing resources. Although this incentive system has attracted many participants, power has, CCS CONCEPTS at the same time, been significantly biased towards a few nodes, • Security and privacy → Economics of security and privacy; called mining pools. In addition, poor decentralization appears not Distributed systems security; only in PoW-based coins but also in coins that adopt proof-of-stake (PoS) and delegated proof-of-stake (DPoS) mechanisms. KEYWORDS In this paper, we address the issue of centralization in the consen- Blockchain; Consensus Protocol; Decentralization sus protocol. To this end, we first define ¹m; ε; δº-decentralization as a state satisfying that 1) there are at least m participants running 1 INTRODUCTION a node, and 2) the ratio between the total resource power of nodes Traditional currencies have a centralized structure, and thus there run by the richest and the δ-th percentile participants is less than exist several problems such as a single point of failure and corrup- or equal to 1 + ε. Therefore, when m is sufficiently large, and ε and tion. For example, the global financial crisis in 2008 was aggravated δ are 0, ¹m; ε; δº-decentralization represents full decentralization, by the flawed policies of banks that eventually led to many bank which is an ideal state.
    [Show full text]
  • Universal Leaky Random Oracle
    Universal Leaky Random Oracle Guangjun Fan1, Yongbin Zhou2, Dengguo Feng1 1 Trusted Computing and Information Assurance Laboratory,Institute of Software,Chinese Academy of Sciences,Beijing,China [email protected] , [email protected] 2 State Key Laboratory of Information Security,Institute of Information Engineering,Chinese Academy of Sciences,Beijing,China [email protected] Abstract. Yoneyama et al. introduces the Leaky Random Oracle Model at ProvSec2008 to capture the leakages from the hash list of a hash func- tion used by a cryptography construction due to various attacks caused by sloppy usages or implementations in the real world. However, an im- portant fact is that such attacks would leak not only the hash list, but also other secret states (e.g. the secret key) outside the hash list. There- fore, the Leaky Random Oracle Model is very limited in the sense that it considers the leakages from the hash list alone, instead of taking into con- sideration other possible leakages from secret states simultaneously. In this paper, we present an augmented model of the Leaky Random Oracle Model. In our new model, both the secret key and the hash list can be leaked. Furthermore, the secret key can be leaked continually during the whole lifecycle of the cryptography construction. Hence, our new model is more universal and stronger than the Leaky Random Oracle Model and some other leakage models (e.g. only computation leaks model and memory leakage model). As an application example, we also present a public key encryption scheme which is provably IND-CCA secure in our new model.
    [Show full text]