0%

Book Description

A Developer's Guide to Blockchain Programming Fundamentals

Blockchain development is entering a period of explosive growth, as real applications gain traction throughout multiple industries and cryptocurrencies earn greater acceptance throughout the financial sector. Blockchain represents one of the most promising opportunities for developers to advance and succeed. Building Blockchain Apps is an accessible guide to today’s most advanced and robust blockchain programming models and architectures.

Building on his pioneering experience, Michael Juntao Yuan covers a wide range of blockchain application development paradigms. The book starts with a concise introduction to blockchain and smart contract technologies. It then guides you through application development on Ethereum-compatible smart contract platforms. Ethereum is the largest and most robust blockchain ecosystem in the world.

Coverage includes

  • Ethereum topics such as tools, application frameworks, internal data structures, external data interfaces, and future roadmap

  • An introduction to new blockchain data protocol based on ElasticSearch, which provides insights into the current state of smart contracts and enables new application designs

  • How to build an application-specific smart contract protocol by modifying and customizing the open source Ethereum Virtual Machine and its programming language tools

  • How to extend and support language features that are most suitable for particular kinds of smart contracts (e.g., smart contracts for e-commerce marketplaces) with the open source Lity project

  • How to customize and change the blockchain consensus layer beneath the application layer via the popular Tendermint and Cosmos SDK frameworks

  • A survey of cryptocurrency and financial topics from the developers’ point of view, providing an analytical framework for valuating cryptocurrencies and explaining the roles of crypto exchanges

Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.

Table of Contents

  1. Cover Page
  2. About This eBook
  3. Half Title Page
  4. Title Page
  5. Copyright Page
  6. Dedication Page
  7. Contents
  8. Foreword
  9. Acknowledgments
  10. About the Author
  11. Register Your Product
  12. Part I: Introduction
    1. 1. An Introduction to Blockchain
      1. The Blockchain
      2. The Collaborative Ledger
      3. Cryptocurrency
      4. Smart Contracts
      5. A Trustless Network
      6. New Ways of Collaborating
      7. The Fat Protocol
      8. In Code We Trust
      9. Conclusion
    2. 2. Reaching Consensus
      1. What Is Blockchain Consensus?
      2. Proof of Work (PoW)
      3. Proof of Stake (PoS)
      4. Delegated Proof of Stake (DPoS)
      5. Conclusion
    3. 3. Your First Blockchain App
      1. Smart Contract
      2. Front-End HTML
      3. JavaScript and web3.js
      4. In Action
      5. Share Your Dapp
      6. Conclusion
  13. Part II: An Introduction to Ethereum
    1. 4. Getting Started
      1. The BUIDL Way
      2. The Hard Way
      3. Conclusion
    2. 5. Concepts and Tools
      1. Ethereum Wallet and Basic Concepts
      2. Etherscan
      3. The TestRPC
      4. Interacting with Ethereum via GETH
      5. Interacting with Ethereum via web3
      6. Running an Ethereum Node
      7. Running a Private Ethereum Network
      8. Conclusion
    3. 6. Smart Contracts
      1. “Hello, World!” Again
      2. Learning Smart Contract Programming
      3. Building and Deploying the Smart Contract
      4. Calling Smart Contract Functions
      5. A New Language
      6. Conclusion
    4. 7. Decentralized Applications (Dapps)
      1. Dapp Stack
      2. Dapp Showcases
      3. Conclusion
    5. 8. Alternatives to Dapps
      1. JavaScript
      2. Python and Others
      3. Conclusion
  14. Part III: Ethereum in Depth
    1. 9. Inside Ethereum
      1. What Is Blockchain State?
      2. Ethereum State
      3. Trie (or Tree)
      4. Trie Structure in Ethereum
      5. Analyzing the Ethereum Database
      6. Conclusion
    2. 10. Blockchain Data Services
      1. Blockchain Explorers
      2. Harvesting Data
      3. Query Interface
      4. What’s Next?
      5. Conclusion
    3. 11. Smart Contract Search Engine
      1. Introduction to the Smart Contract Search Engine
      2. Getting Started with a Smart Contract Search Engine
      3. The FairPlay Dapp Example
      4. Use Cases
      5. Conclusion
    4. 12. Smart Contract Security and Best Practices
      1. Major Ethereum Smart Contract Hacks and Vulnerabilities
      2. Best Practices for Securing Smart Contracts
      3. Conclusion
    5. 13. The Future of Ethereum
      1. Ethereum 1.0
      2. Beyond Ethereum 1.0
      3. Ethereum 2.0
      4. Delivery Phases of Ethereum 2.0
      5. Post–Ethereum 2.0 Innovation
      6. Conclusion
  15. Part IV: Building Application Protocols
    1. 14. Extending the Ethereum Protocol
      1. Fully Compatible, Yet Faster
      2. Smart Enhancements to the EVM
      3. Safety First
      4. Conclusion
    2. 15. Extending Ethereum Tools
      1. Smart Contract Tools
      2. Dapp Tools
      3. Conclusion
    3. 16. Example Dapps
      1. Case Study 1: Valentines
      2. Case Study 2: WeBet
      3. Conclusion
    4. 17. Business Rules and Contracts
      1. An Example
      2. Rules Language
      3. More Business Examples
      4. Conclusion
    5. 18. Building an Application-Specific EVM
      1. Using libENI Functions
      2. Writing a libENI Function
      3. Deploying the libENI Function
      4. Conclusion
  16. Part V: Building Your Own Blockchain
    1. 19. Getting Started with Tendermint
      1. How It Works
      2. It Works as Follows
      3. Set Up a Node
      4. Set Up a Network
      5. Conclusion
    2. 20. The Business Logic
      1. The Protocol
      2. A Sample Application
      3. Java Implementation
      4. GO Implementation
      5. The Cosmos SDK
      6. Conclusion
    3. 21. Creating a Blockchain Client
      1. Overview of the Approach
      2. The Sample Application
      3. PHP
      4. Java
      5. Conclusion
  17. Part VI: Cryptoeconomics
    1. 22. The Cryptoeconomics of Token Design
      1. Network Utility Tokens
      2. Application Utility Tokens
      3. Security Tokens
      4. Token Valuation
      5. Advanced Topics
      6. Conclusion
    2. 23. Initial Coin Offerings
      1. A Brief History
      2. Utility of an ICO
      3. ICO vs. Traditional Equity Financing
      4. Evaluating an ICO Project
      5. ICO Participation Risk
      6. Conclusion
    3. 24. Cryptocurrency Exchanges
      1. Exchange Types
      2. Decentralization
      3. Products and Services
      4. Conclusion
  18. A. Getting Started with CyberMiles
    1. Deploy a Node
    2. Interactive Console on the Node
    3. Conclusion
  19. Index
  20. Credits
  21. Code Snippets
52.23.231.207