Blockchain Quick Reference

Book description

Understand the Blockchain revolution and get to grips with Ethereum, Hyperledger Fabric, and Corda.

Key Features

  • Resolve common challenges and problems faced in the Blockchain domain
  • Study architecture, concepts, terminologies, and Dapps
  • Make smart choices using Blockchain for personal and business investments

Book Description

Blockchain Quick Reference takes you through the electrifying world of blockchain technology and is designed for those who want to polish their existing knowledge regarding the various pillars of the blockchain ecosystem.

This book is your go-to guide, teaching you how to apply principles and ideas for making your life and business better. You will cover the architecture, Initial Coin Offerings (ICOs), tokens, smart contracts, and terminologies of the blockchain technology, before studying how they work. All you need is a curious mind to get started with blockchain technology. Once you have grasped the basics, you will explore components of Ethereum, such as ether tokens, transactions, and smart contracts, in order to build simple Dapps. You will then move on to learning why Solidity is used specifically for Ethereum-based projects, followed by exploring different types of blockchain with easy-to-follow examples. All this will help you tackle challenges and problems.

By the end of this book, you will not only have solved current and future problems relating to blockchain technology but will also be able to build efficient decentralized applications.

What you will learn

  • Understand how blockchain architecture components work
  • Acquaint yourself with cryptography and the mechanics behind blockchain
  • Apply consensus protocol to determine the business sustainability
  • Understand what ICOs and crypto-mining are and how they work
  • Create cryptocurrency wallets and coins for transaction mechanisms
  • Understand the use of Ethereum for smart contract and DApp development

Who this book is for

Blockchain Quick Reference is for you if you are a developer who wants to get well-versed with blockchain and its associated concepts and terminologies. You will explore the working mechanism of a decentralized application with the help of examples. Business leaders and blockchain enthusiasts will also find this book useful, as it will help you effectively address challenges and make better personal and business investments.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Blockchain Quick Reference
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Foreword
  5. Contributors
    1. About the authors
    2. About the reviewers
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  7. Blockchain 101
    1. Processing a financial transaction
    2. Ledger
    3. Concept of a trustless system
    4. Introducing blockchain
      1. General elements of blockchain
        1. Peer-to-peer network
        2. Block
        3. Block header
        4. Addresses
        5. Wallets
        6. Transaction
        7. Nodes
      2. What does blockchain solve?
      3. Types of blockchains
        1. Public blockchain
        2. Semi-private blockchain
        3. Private blockchain
        4. Consortium blockchain
      4. Byzantine generals problem
      5. Consensus
      6. Blockchain in a nutshell
        1. Benefits
          1. Banking records
          2. Medical records
          3. Government records
          4. Creative and copyright records
          5. University degree records
        2. Challenges
          1. Complexity
          2. Network scalability
          3. Speed and cost
          4. Double spending 
    5. Summary
  8. Components and Structure of Blockchain
    1. Blocks
    2. The chain between blocks
    3. Hashing and signatures
    4. Digital signatures
      1. What are digital keys?
    5. Example block data
      1. Example Ethereum block
      2. Bitcoin block
      3. Global state
      4. Block time and block size
    6. Blockchain miners
    7. Blockchain validators
    8. Smart contracts
    9. Blockchain speed
      1. How to calculate blockchain throughput
      2. Comparisons with traditional networks
    10. Summary
  9. Decentralization Versus Distributed Systems
    1. Distributed systems
      1. Resiliency
        1. Fault tolerance and failure isolation
    2. Consensus and coordination
    3. Backups
      1. Consistency
      2. Peer-to-peer systems
      3. Decentralized systems
      4. Principles of decentralized systems
        1. Open access
        2. Non-hierarchical
        3. Ecosystem diversity
        4. Transparency
        5. Downsides
          1. Speed
          2. Censorship resistance
          3. Chaos and non-determinism
    4. Summary
  10. Cryptography and Mechanics Behind Blockchain
    1. Principles of security
    2. Historical perspective – classical cryptography
    3. Types of cryptography
      1. Symmetric cryptography
      2. Asymmetric (public-key) cryptography
      3. Signatures
      4. Hashing
        1. The avalanche effect
        2. Collisions
        3. Hashing a block
        4. Hashing outside PoW
    4. Summary
  11. Bitcoin
    1. The history of Bitcoin
    2. Why Bitcoin is volatile
    3. Keys and addresses
      1. Currency units
      2. Vanity addresses
      3. Base58 check encoding
    4. Transactions
      1. Types
        1. Pay-to-Public-Key Hash
        2. Pay-to-Script Hash
    5. Blocks
      1. Genesis block
    6. Bitcoin network
      1. Types of nodes
        1. Full node
        2. Lightweight nodes
        3. Other nodes
      2. Network discovery
        1. Finding peers
          1. DNS seeds
          2. Static IPs
    7. Wallets
      1. Types
        1. Deterministic wallet
          1.  Deterministic wallets
          2. HD wallets
        2. Non-deterministic wallet
    8. Summary
  12. Altcoins
    1. Introducing Altcoins
      1. Tokens
        1. Ethereum
        2. Omni Layer
        3. NEO
        4. Waves
        5. Counterparty
    2. Alternative currency
      1. Monetary alternatives
      2. Consensus alternatives
      3. Litecoin
      4. Ether
      5. Ripple
      6. Bitcoin Cash
    3. Acquiring cryptocurrency 
      1. Mining of cryptocurrency
        1. Bitcoin mining
          1. Mining difficulty
          2. Mining pools
        2. Altcoin mining
      2. Cryptocurrency exchanges
      3. Cryptocurrency wallets
    4. Summary
  13. Achieving Consensus
    1. Practical Byzantine fault tolerance algorithm 
      1. Byzantine faults
      2. How PBFT works
    2. Proof of Work
      1. How the PoW problem works in Bitcoin
    3. Proof of Stake
      1. The nothing-at-stake attack
      2. Variations
        1. Delegated Proof of Stake
      3. Tendermint consensus
    4. Proof of Authority
      1. Establishing authority
    5. Proof of Elapsed time
    6. Summary
    7. References
  14. Advanced Blockchain Concepts
    1. Blockchain and banks
      1. Unbanked – going pure crypto
        1. Fixing pegs
        2. Buying options
        3. Why regulated exchanges?
        4. Unbanked and unincorporated?
        5. The DAO
        6. Decentralizing an organization
        7. Putting a corporation on a blockchain
        8. Cutting out the middle man
        9. Providing capital
      2. Social purpose – blockchain as leveler
        1. Banking the unbanked
      3. Silk road LLC – privacy and ethics
      4. Tracking all the things
      5. Defeating some privacy issues with zero-knowledge proofs
      6. Unwrapping the concept of zero-knowledge proofs
    2. Summary
  15. Cryptocurrency Wallets
    1. Introduction to cryptocurrency wallets
      1. Transactions in cryptocurrency wallets
      2. Types of cryptocurrency wallets
        1. Currency support
        2. Tenancy 
          1. Software wallets
          2. Hardware wallets
          3. Paper wallets
          4. Brain wallet
        3. Usage frequency
        4. Key derivation
          1. Non-deterministic wallet
          2. Deterministic wallets
          3. Hierarchical deterministic wallets
          4. Mnemonic codes
          5. Key generation process in HD wallets
          6. Child key derivation 
          7. Private key generation
          8. Extended keys 
    2. Summary
  16. Alternate Blockchains
    1. Various uses of blockchain
      1. Government
      2. Healthcare
      3. Medical research
      4. Supply chain
      5. Copyright
      6. Fine art
      7. Shipping
      8. Energy
      9. Computation and data storage
      10. Identification and social security
      11. Enterprise
    2. Ripple
      1. Transactions
    3. Stellar 
    4. Tendermint
    5. Monax
    6. Summary
  17. Hyperledger and Enterprise Blockchains
    1. History of Hyperledger
    2. Hyperledger projects
      1. Hyperledger Burrow
      2. Hyperledger Sawtooth
        1. Sawtooth architecture
          1. Transaction families
          2. Transactions and batches
          3. The key pieces
      3. Hyperledger Fabric
        1. Architecture choices and features
          1. Organizational focus
          2. Private channels
          3. Assets
          4. Smart contracts
        2. Advantages of Fabric
      4. Hyperledger Iroha
      5. Hyperledger Indy
    3. Tools in Hyperledger
      1. Hyperledger Caliper
      2. Hyperledger Composer
      3. Hyperledger Cello
      4. Hyperledger Explorer
      5. Hyperledger Quilt
      6. Relationships between the tools
      7. Which Hyperledger project should you use?
      8. Using Hyperledger
    4. Summary
  18. Ethereum 101
    1. Introducing Ethereum
    2. Components of Ethereum
      1. Ethereum accounts
      2. Ethereum network
        1. Ethereum public MainNet
      3. Ethereum clients
        1. Geth
          1. Installing Geth
          2. Managing accounts
      4. Ethereum gas
      5. Ethereum virtual machine
        1. Execution environment
      6. Ethereum block
        1. Block header
        2. Ommers or uncles
      7. Messages
      8. Ethash
    3. Ether
      1. Procuring ether
        1. Trading
    4. Summary
  19. Solidity 101
    1. Basics of Solidity
      1. The basics of working on Solidity
        1. Using the compiler
    2. Programming in Solidity
      1. Laying out a Solidity file
        1. Importing files
        2. Commenting
          1. Tags
      2. Structure of a contract
        1. State variables
        2. Functions
        3. Function modifiers
        4. Events
      3. Types
        1. Value types
          1. Boolean
          2. Integers
          3. Address
          4. Array value type
          5. Literal
          6. Enums
          7. Function
          8. Function Modifiers
        2. Reference types
          1. Structs
          2. Data location
        3. Mapping
      4. Units and global variables
    3. Summary
  20. Smart Contracts
    1. Why smart contracts?
      1. Automating processes and resolutions between parties
        1. Real-world example
      2. Increased transparency
        1. Ending centralized data
      3. Increased fairness
    2. Smart contract approaches
      1. Example Ethereum smart contracts
        1. The promises
        2. Security considerations
        3. Dealing with threats in smart contracts
    3. Limitations of smart contracts
      1. Data quality and mistakes
      2. Legal validity
      3. Stability of meaning
    4. Summary
      1. References
  21. Ethereum Development
    1. Introduction
    2. Preparing for smart contract development
      1. Remix
      2. Geth and Mist
      3. MetaMask
      4. Token standard
        1. Methods in ERC20
      5. Web3
      6. Truffle framework
        1. Ganache
    3. Working on a smart contract
    4. Summary
  22. Ethereum Accounts and Ether Tokens
    1. Introducing Ethereum accounts
      1. Ethereum state transition function
      2. Genesis block
      3. Transaction receipts
        1. Elements
          1. Post-transaction state
          2. Gas used
          3. Set of logs
          4. The bloom filter
        2. Structure
      4. Transaction sub state
        1. Suicide set
        2. Log series
        3. Refund balance
      5. Messages
      6. Calls
    2. Ethereum block validation
      1. Uncles validation
      2. Block difficulty
      3. Block finalization
    3. Disadvantages of Ethereum-based tokens
    4. Summary
  23. Decentralized Applications
    1. What makes an application decentralized
      1. Defining a decentralized application
      2. Decentralized apps and blockchain
        1. Using blockchain does not make an application decentralized
    2. Major decentralized blockchain applications
      1. IPFS
        1. Typical web communications
        2. Peer-to-peer file transfer
        3. Value to blockchain projects
      2. Aragon
      3. district0x
        1. What is a district?
      4. Ethereum name service
      5. Civic/uPort
      6. Gnosis
      7. Steemit
      8. CryptoKitties
    3. Summary
      1. References
  24. Mining
    1. Cryptocurrency mining
      1. The mining process
    2. Algorithms 
    3. Mining hardware
      1. CPU-based mining
      2. GPU-based mining
      3. FPGA-based mining
      4. ASIC-based mining
    4. Miner types
      1. Cloud mining
      2. Hardware mining
        1. Mining rigs
    5. Mining pools
      1. Pay-per-share – PPS
      2. Proportional – PROP
      3. Pay-per-last-N-shares – PPLNS
      4. The double geometric method – DGM
      5. Shared maximum pay per share – SMPPS
      6. Equalized shared maximum pay per share – ESMPPS
      7. Recent shared maximum pay per share – RSMPPS
      8. Capped pay per share with recent backpay – CPPSRB
      9. Bitcoin pooled mining – BPM
      10. Pay on target – POT
      11. SCORE
      12. Popular pools
    6. Mining software
    7. Summary
  25. ICO 101
    1. The current state of the ICO market
      1. Increasing volume of ICOs
    2. Typical aspects of an ICO campaign
      1. Whitepaper
      2. Private placement
      3. Pre-sale
        1. Good pre-sale practices
      4. Public sale
        1. Capped sale
        2. Uncapped sale
        3. Dutch auction
      5. Influencer marketing
      6. PR campaigns
      7. Content marketing
      8. ICO reviewers
      9. Smart contract and prototype development
        1. Code audits
      10. Bounty campaigns
      11. Airdrops
      12. Road shows
    3. Issues with ICOs and blockchain projects
      1. Proof of product-market fit and traction
        1. Low barrier to entry
      2. Does a project really need the blockchain?
      3. Misleading token practices
        1. Legality
          1. Utility versus Security
          2. Other considerations
      4. Sustainability
      5. Advantages of ICOs
        1. Liquidity
        2. Lack of gatekeepers
        3. Minimal investment sizes
      6. Notable scams 
        1. Onecoin
        2. Pincoin and iFan
        3. Bitconnect
      7. Other problems
        1. Major hacks
          1. The DAO
          2. Parity
      8. Securing an ICO
        1. SSH key locked servers
        2. DNS security
        3. Intrusion detection
        4. Purchase related domains
        5. Monitor social channels
        6. Multi-signature wallets
        7. Code audits
      9. Conclusion
      10. References
  26. Creating Your Own Currency
    1. Understanding types of cryptocurrency
      1. Tokens based on existing blockchains
      2. Creating a new blockchain from scratch
      3. A forked blockchain with one's own genesis block
        1. Litecoin's development
        2. The process
    2. Creating one's own cryptocurrency
      1. Setting up Litecoin
        1. Platform selection
          1. Preparation
          2. Dependency installation
          3. Build instructions
      2. Setting up our own coin
        1. Port selection
        2. The setting of block-related parameters
        3. Amount limit
        4. The coinbase maturity number
        5. Genesis block creation
        6. Wallet address
        7. Checkpoints
        8. Creatives and graphics
      3. Summing up 
    3. Summary
  27. Scalability and Other Challenges
    1. Scalability and decentralization
    2. Blockchains in business
    3. Usability
      1. Lack of protection
    4. 51% attacks
    5. Network forks
    6. Catastrophic bugs
    7. Lack of interoperability
    8. Low availability of blockchain skills
    9. Privacy
    10. Energy consumption
    11. Summary
    12. References
  28. Future of Blockchain
    1. Ongoing fragmentation and specialization
      1. Video games
      2. Real estate
      3. Logistics
      4. Licensing
      5. Industry consortiums
      6. A large number of total-loss projects
    2. Legal and regulatory evolution
      1. Security token offerings
      2. Aggregate and insurance products
    3. Technological stabilization
      1. Ethereum and Hyperledger 
      2. Service consolidation and product offerings
      3. Cross-chain communication
    4. Intersecting with AI and IoT
      1. Blockchain-intersecting AI
      2. Blockchain-intersecting IoT
    5. Summary
  29. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Blockchain Quick Reference
  • Author(s): Brenn Hill, Samanyu Chopra, Paul Valencourt
  • Release date: August 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781788995788