Book Image

Blockchain Quick Start Guide

By : Xun (Brian) Wu, Weimin Sun
Book Image

Blockchain Quick Start Guide

By: Xun (Brian) Wu, Weimin Sun

Overview of this book

Blockchain is a technology that powers the development of decentralized applications.This technology allows the construction of a network with no single control that enables participants to make contributions to and receive benefits from the network directly. This book will give you a thorough overview of blockchain and explain how a blockchain works.You will begin by going through various blockchain consensus mechanisms and cryptographic hash functions. You will then learn the fundamentals of programming in Solidity – the defacto language for developing decentralize, applications in Ethereum. After that, you will set up an Ethereum development environment and develop, package, build, and test campaign-decentralized applications.The book also shows you how to set up Hyperledger composer tools, analyze business scenarios, design business models, and write a chain code. Finally, you will get a glimpse of how blockchain is actually used in different real-world domains. By the end of this guide, you will be comfortable working with basic blockchain frameworks, and develop secure, decentralized applications in a hassle-free manner.
Table of Contents (14 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Index

A

  • abstraction / Inheritance, abstract, and interface
  • access control list (ACL) file (.acl) / Access control list (ACL) file (.acl)
  • access modifiers
    • public / Access modifiers
    • private / Access modifiers
    • internal / Access modifiers
    • external / Access modifiers
  • accounts / Account
  • Active Directory (AD) / Certificate authority (CA)
  • addresses / The distributed ledger, blocks, transactions, addresses, and UTXO
  • Altcoins / Altcoins
  • anchor
    • updating / Updating the anchor

B

  • bank identifier code (BIC) / A peer-to-peer network
  • Binance
    • reference / A peer-to-peer network
  • BitAudit
    • reference / A blockchain solution
  • Bitcoin
    • about / Bitcoin
    • need for / Why Bitcoin
  • Bitcoin Cash / Altcoins
  • Bitcoin digital currency (BTC) / Bitcoin
  • Bitcoin protocol / Why Bitcoin
  • Bitcoin wallets / Private keys and Bitcoin wallets
  • blockchain
    • evolution / The evolution of blockchain
    • Blockchain 1.0 / The evolution of blockchain
    • Blockchain 2.0 / The evolution of blockchain
    • Blockchain 3.0 / The evolution of blockchain
    • Blockchain 4.0 / The evolution of blockchain
    • use case, selecting / How to choose a proper use case
  • blockchain use case, examples
    • about / Blockchain use case examples
    • payment and settlement services / Payment and settlement services
    • import and export finance / Import and export finance
    • immutable ledger / Immutable ledger
    • regulatory compliance and auditing / Regulatory compliance and auditing
    • identity theft detection / Identity theft detection
    • funds back-office operation / Funds back-office operation
    • collateral management / Collateral management
    • healthcare systems / Healthcare systems
    • real estate trading / Real estate trading and rental markets
    • rental markets / Real estate trading and rental markets
    • IP market / IP market
    • elections / Elections
    • HR and recruiting / HR and recruiting
    • public records / Public records
    • reduce contract disputes / Reduce contract disputes
    • sharing economy / Sharing economy
    • integration, with IoT / Integration with IoT
    • commercial and social relationships, facilitating / Facilitate commercial and social relationships
  • blocks / The distributed ledger, blocks, transactions, addresses, and UTXO
  • browser-based IDE
    • about / Browser-based IDE
    • Remix / Remix
    • EthFiddle /
  • business network archive
    • about / Business network archive
    • network model file (.cto) / Network model file (.cto)
    • script file (.js) / Script file (.js)
    • access control list (ACL) file (.acl) / Access control list (ACL) file (.acl)
    • query file (.qry) / Query file (.qry)
    • business models, designing / Designing business models
  • business transaction function
    • implementing / Implementing the business transaction function
    • testing / Testing in the playground
    • business network, deploying / Deploying a business network
    • integrating, with REST server / Integrating with REST server
    • Hyperledger Composer REST API, generating / Generating the Hyperledger Composer REST API
  • bytecode / Smart contracts
  • Byzantium / An overview of Ethereum

C

  • campaign decentralized application
    • writing / Writing a campaign decentralized application
    • web3 provider, selecting / Selecting a web3 provider
    • account information, loading / Loading account information
    • project information, loading / Loading project information
    • fund function, handling / Handling the fund function
    • checkGoalReached method, executing / checkGoalReached
  • Casper / Casper
  • Casper CBC / Casper
  • Casper FFG / Casper
  • certificate
    • generating / Generating the certificate
  • certificate authority (CA) / Certificate authority (CA)
  • chaincode
    • about / Chaincode
    • writing / Writing chaincode
    • development tool / Development tools
    • key concept / Chaincode key concept and APIs
    • APIs / Chaincode key concept and APIs
    • issuance claim, defining / Defining an issuance claim
    • initializing / Initializing the chaincode
    • invoking / Invoking the chaincode
    • AddCompany / AddCompany
    • ReportLost / ReportLost
    • RequestedInfo / RequestedInfo
    • SubmitClaim / SubmitClaim, ConfirmClaimSubmission, ApproveClaim
    • ConfirmClaimSubmission / SubmitClaim, ConfirmClaimSubmission, ApproveClaim
    • ApproveClaim / SubmitClaim, ConfirmClaimSubmission, ApproveClaim
    • query, using / Query
    • gethistory function, using / getHistory
    • installing / Installing chaincode
    • instantiating / Instantiating the chaincode
  • channel
    • about / Channel
    • creating / Creating a channel
    • joining / Joining channels
  • channel configuration transaction
    • generating / Generating a channel configuration transaction
  • ciphertext / Cryptography and hash functions
  • CoinMarketCap
    • reference / A peer-to-peer network, The consensus mechanism
  • command-line development management tools
    • about / Command-line development management tools
    • Truffle /
  • Composer-cli
    • composer archive create command / Composer-cli
    • composer archive list command / Composer-cli
    • composer card create command / Composer-cli
    • composer card delete command / Composer-cli
    • composer card list command / Composer-cli
    • composer network deploy command / Composer-cli
    • composer network list command / Composer-cli
    • composer network ping command / Composer-cli
  • Composer playground / Composer playground
  • composer REST server / Composer REST server
  • consensus algorithm / Other concepts
  • consensus mechanism
    • about / The consensus mechanism
    • forking / Forking
    • mining / Mining and difficulty level
    • difficulty level / Mining and difficulty level
    • hacking / Hacking – the 51% problem
    • private keys / Private keys and Bitcoin wallets
    • Bitcoin wallets / Private keys and Bitcoin wallets
    • Bitcoin, scripting / Bitcoin scripting
    • Altcoins / Altcoins
    • Ethereum / Ethereum
  • constructor / Constructor
  • core component model, Hyperledger Fabric
    • about / Core component model
    • peers / Peers
    • membership service provider (MSP) / Membership service provider (MSP)
    • certificate authority (CA) / Certificate authority (CA)
    • ordering service / Ordering service
  • create, read, update, delete (CRUD) / Composer REST server
  • crowdfunding / An overview of Ethereum
  • crowdfunding campaign use case / Case study – crowdfunding campaign
  • cryptography / Cryptography and hash functions

D

  • DAO / Other concepts
  • DApp, development tools
    • about / DApp development tools
    • Truffle / Truffle
    • Ganache / Ganache
  • Dash / Altcoins
  • data type / Data type
  • decentralized application (DApp)
    • about / Other concepts
    • overview / Decentralized application overview
    • web3.js / web3.js quick overview
    • provider / Provider
    • healthcare data sharing use case / DApp use case – healthcare data sharing
  • determinism / Oracle
  • development environment, Ethereum
    • setting up / Setting up an Ethereum development environment
    • Truffle, installing / Installing Truffle
    • Ganache, installing / Installing Ganache
  • development tool, chaincode
    • about / Development tools
    • LiteIDE / LiteIDE 
    • JetBrains Gogland / JetBrains Gogland
    • Visual Studio Code / Visual Studio Code
  • difficulty level / Mining and difficulty level
  • digital signature / Other concepts
  • distributed ledger / The distributed ledger, blocks, transactions, addresses, and UTXO
  • distributed ledger technology (DLT) / The evolution of blockchain
  • Docker-compose-base.yaml / Docker-compose-base.yaml
  • Docker composer configuration files
    • overview / Overview of Hyperledger Fabric Docker composer configuration files
  • double-spending problem / The consensus mechanism

E

  • e-wallet / A peer-to-peer network
  • encryption / Cryptography and hash functions, Other concepts
  • enrolment certificates (ECerts) / Certificate authority (CA)
  • enterprise blockchain
    • Hyperledger / Enterprise blockchain – Hyperledger
  • Enterprise Ethereum Alliance (EEA) / An overview of Ethereum
  • enum type / Enum type
  • Ethereum
    • about / Ethereum, Enterprise blockchain – Hyperledger
    • issues / Enterprise blockchain – Hyperledger, Other concepts
    • overview / An overview of Ethereum
    • reference / An overview of Ethereum
    • basic concepts / Ethereum basic concepts
    • Ether / Ether
    • ERC20 tokens / ERC20 tokens
    • smart contract / Smart contracts
    • Ethereum virtual machine (EVM) / Ethereum virtual machines
    • Ethereum gas / Ethereum gas
    • account / Account
    • Oracle / Oracle
    • performance / Performance
    • development environment, setting up / Setting up an Ethereum development environment
  • Ethereum (ETH) / Other concepts
  • Ethereum Classic (ETC) / Other concepts
  • Ethereum client / Ethereum virtual machines
  • Ethereum virtual machine (EVM) / Ethereum, Ethereum basic concepts
  • EthFiddle
    • about /
    • reference /
  • events / Events

F

  • fiat currency / A peer-to-peer network
  • financial institutions, business model
    • deficiencies / Why Bitcoin
  • forks / Forking
  • functions / Functions

G

  • Ganache
    • about / Ganache
    • features / Ganache
    • options / Ganache
    • installing / Installing Ganache
    • launching / Launching the Ganache environment
  • genealogy
    • analogy / The genealogy analogy
    • characteristics / The genealogy analogy
    • Bitcoin / Bitcoin
    • peer-to-peer network / A peer-to-peer network
    • cryptography / Cryptography and hash functions
    • hash functions / Cryptography and hash functions
    • transactions / The distributed ledger, blocks, transactions, addresses, and UTXO
    • distributed ledger / The distributed ledger, blocks, transactions, addresses, and UTXO
    • UTXO / The distributed ledger, blocks, transactions, addresses, and UTXO
    • addresses / The distributed ledger, blocks, transactions, addresses, and UTXO
    • blocks / The distributed ledger, blocks, transactions, addresses, and UTXO
  • genesis block / The genealogy analogy
  • global variables / Constant state variables, unit, and functions

H

  • hacking
    • 51% problem / Hacking – the 51% problem
  • hash functions / Cryptography and hash functions
  • healthcare data sharing use case
    • about / DApp use case – healthcare data sharing
    • business problem / The business problem
    • blockchain solution / A blockchain solution
    • data repository / A blockchain solution
    • blockchain platform, selecting / A blockchain solution
    • analytics component / A blockchain solution
    • data protection / A blockchain solution
    • backend component / A blockchain solution
    • frontend component / A blockchain solution
    • parties involved / A blockchain solution
    • architectural diagram / A blockchain solution
    • project funding / A blockchain solution
  • Homestead / An overview of Ethereum
  • Huopi
    • reference / A peer-to-peer network
  • Hyperledger
    • about / Enterprise blockchain – Hyperledger
    • Hyperledger Fabric (HF) / Enterprise blockchain – Hyperledger
    • Hyperledger Iroha / Enterprise blockchain – Hyperledger
    • Hyperledger Burrow / Enterprise blockchain – Hyperledger
    • Hyperledger Sawtooth / Enterprise blockchain – Hyperledger
    • Hyperledger Indy / Enterprise blockchain – Hyperledger
  • Hyperledger Composer
    • overview / Hyperledger Composer – a quick overview
    • Yeoman generator / Yeoman generator
    • composer REST server / Composer REST server
    • LoopBack connector / LoopBack connector
    • JavaScript SDK / JavaScript SDK
    • Composer playground / Composer playground
    • Composer-cli / Composer-cli
    • environment, setting up / Setting up a Hyperledger Composer environment
    • prerequisites, installing / Installation prerequisites
    • development environment, installing / Installing the development environment
  • Hyperledger Fabric
    • claim history, querying / Querying claim history
    • end to end test, executing / End-to-end test execution 
  • Hyperledger Fabric (HF)
    • key concepts / Key concepts in Hyperledger Fabric
    • ledger / Ledger
    • chaincode / Chaincode
    • channel / Channel
    • core component model / Core component model
    • basic transaction flow / Hyperledger Fabric basic transaction flow
    • insurance claim use case / Issuance claim
    • environment, setting up / Setting up a Hyperledger Fabric environment
    • prerequisites, installing / Installation prerequisites
    • installing / Installing Hyperledger Fabric
    • configuring / Configuring Hyperledger Fabric
    • certificate, generating / Generating the certificate
    • orderer genesis block, generating / Generating an orderer genesis block
    • channel configuration transaction, generating / Generating a channel configuration transaction
    • Docker composer configuration files, overview / Overview of Hyperledger Fabric Docker composer configuration files
    • project directory structure / Fabric project directory structure
    • Docker-compose-base.yaml / Docker-compose-base.yaml
    • peer-base.yaml / Peer-base.yaml
    • network, starting / Starting the Hyperledger Fabric network
    • channel, creating / Creating a channel
    • channels, joining / Joining channels
    • anchor, updating / Updating the anchor
    • chaincode, installing / Installing chaincode
    • chaincode, instantiating / Instantiating the chaincode
    • add broker, invoking / Invoking add broker
    • add insurer, invoking / Invoking add insurer
    • ReportLost, invoking / Invoking ReportLost
    • RequestedInfo, invoking / Invoking RequestedInfo
    • SubmitClaim, invoking / Invoking SubmitClaim
    • ConfirmClaimSubmission, invoking / Invoking ConfirmClaimSubmission
    • ApproveClaim, invoking / Invoking ApproveClaim
    • about / How to choose a proper use case
  • Hyperledger Fabric (HF) 1.0 / Enterprise blockchain – Hyperledger

I

  • IBM Bluemix
    • reference / Network model file (.cto)
    • about / Network model file (.cto)
  • inheritance / Inheritance, abstract, and interface
  • input parameters / Input parameters
  • insurance claim
    • use case / Issuance claim
  • insurance claim use case
    • business scenarios, analyzing / Analyzing business scenarios
  • interface / Inheritance, abstract, and interface

J

  • JavaScript SDK / JavaScript SDK
  • JetBrains Gogland / JetBrains Gogland

L

  • ledger / The genealogy analogy, Ledger
  • Litecoin / Altcoins
  • LiteIDE / LiteIDE 
  • LoopBack connector / LoopBack connector

M

  • mapping / Mapping
  • MD5 (message-digest algorithm 5) / Cryptography and hash functions
  • Membership Service Provider (MSP) / Core component model
  • membership service provider (MSP) / Enterprise blockchain – Hyperledger, Membership service provider (MSP)
  • Metropolis part 1 / An overview of Ethereum
  • Metropolis part 2 / An overview of Ethereum
  • miners / A peer-to-peer network
  • mining / The consensus mechanism, Mining and difficulty level
  • mining rig / The consensus mechanism
  • modifier / Modifiers
  • Monero / Altcoins

N

  • Namecoin / Altcoins
  • network model file (.cto) / Network model file (.cto)
  • network model file (.cto), elements
    • single namespace / Network model file (.cto)
    • resources - asset / Network model file (.cto)
    • resources - participant / Network model file (.cto)
    • resources - enum / Network model file (.cto)
    • resources - concept / Network model file (.cto)
    • resources - transactions / Network model file (.cto)
    • resources - events / Network model file (.cto)
    • import / Network model file (.cto)
  • node / A peer-to-peer network

O

  • object-oriented programming (OOP) / Inheritance, abstract, and interface
  • off-chain data / Other concepts
  • OKEx
    • reference / A peer-to-peer network
  • Oracle
    • about / Oracle
    • software oracles / Oracle
    • hardware oracles / Oracle
  • orderer genesis block
    • generating / Generating an orderer genesis block
  • ordering service / Ordering service
  • output parameters / Output parameters

P

  • 51% problem / Hacking – the 51% problem
  • Peer-base.yaml / Peer-base.yaml
  • peer-to-peer network / A peer-to-peer network
  • Peercoin / Altcoins
  • peers / Peers
  • performance, Ethereum
    • about / Performance
    • throughput / Throughput
    • Proof-of-Stake (PoS) / Proof-of-Stake (PoS)
    • Casper / Casper
    • Plasma / Plasma
    • sharding / Sharding
  • Plasma
    • about / Plasma
    • advantages / Plasma
  • PoW (Proof-of-Work) / The consensus mechanism
  • private blockchain / Other concepts
  • private keys / Private keys and Bitcoin wallets
  • process virtual machine / Ethereum virtual machines
  • Proof-of-Stake (PoS) / Other concepts, Proof-of-Stake (PoS)
  • Proof of Elapsed Time (PoET) / Enterprise blockchain – Hyperledger
  • provider / Provider
  • public/private keys / Other concepts

Q

  • query file (.qry) / Query file (.qry)

R

  • Remix
    • about / Remix
    • JavaScript VM / Remix
    • Injected Web3 / Remix
    • Web3 provider / Remix
    • reference / Remix
  • REST server
    • business transaction function, integrating / Integrating with REST server
  • Ripple / Why Bitcoin

S

  • script file (.js) / Script file (.js)
  • SHA-1 (secure hash algorithm) / Cryptography and hash functions
  • SHA-256 / Cryptography and hash functions
  • sharding / Sharding
  • smart contract, security
    • about / Smart contract security
    • keep simple / Keep contract simple and modular
    • keep modular / Keep contract simple and modular
    • checks-effects-interactions pattern, using / Use the checks-effects-interactions pattern
    • DoS, with block gas limit / DoS with block gas limit
    • errors, handling in external calls / Handle errors in external calls
  • smart contract patterns
    • about / Common smart contract patterns
    • access restriction / Access restriction
    • state machine / State machine
  • smart contracts
    • about / Smart contracts, Introduction to smart contracts
    • features / Smart contracts
    • solidity source file / Layout of a solidity source file
    • structure / Structure of a contract
    • state variables / State variables
    • data type / Data type
    • enum type / Enum type
    • struct type / Struct type
    • mapping / Mapping
    • functions / Functions, Constant state variables, unit, and functions
    • input parameters / Input parameters
    • access modifiers / Access modifiers
    • output parameters / Output parameters
    • modifiers / Modifiers
    • events / Events
    • constructor / Constructor
    • constant state variables / Constant state variables, unit, and functions
    • unit / Constant state variables, unit, and functions
    • interface / Inheritance, abstract, and interface
    • abstract / Inheritance, abstract, and interface
    • inheritance / Inheritance, abstract, and interface
    • deploying / Deploying a smart contract
  • solidity
    • about / What is solidity?
    • value types / Data type
    • ether units / Ether units
    • solidity time / Time units
  • solidity development environment, tools
    • about / Tools for solidity development environment
    • browser-based IDE / Browser-based IDE
    • command-line development management tools / Command-line development management tools
  • solidity source file
    • about / Layout of a solidity source file
    • pragma / Pragma
    • comments / Comments
    • import keyword / Import
    • path / Paths
    • relative paths / Relative paths
  • state variables / State variables
  • struct type / Struct type
  • SWIFT / A peer-to-peer network
  • system virtual machine / Ethereum virtual machines

T

  • testing / Other concepts
  • transaction certificates (TCerts) / Certificate authority (CA)
  • transactions / The distributed ledger, blocks, transactions, addresses, and UTXO
  • transactions per second (TPS) / Throughput, How to choose a proper use case
  • Truffle
    • about / Truffle
    • reference /
    • compile command / Truffle
    • console command / Truffle
    • create command / Truffle
    • debug command / Truffle
    • deploy/migration command / Truffle
    • develop command / Truffle
    • init command / Truffle
    • installing / Installing Truffle
    • project, creating / Creating a Truffle project

U

  • UTXO / The distributed ledger, blocks, transactions, addresses, and UTXO

V

  • virtual machine (VM) / Ethereum virtual machines
  • Visual Studio Code
    • about / Visual Studio Code
    • reference / Visual Studio Code

W

  • web3.js
    • overview / web3.js quick overview
  • web3.js API
    • web3-eth / web3.js quick overview
    • web3-shh / web3.js quick overview
    • web3-bzz / web3.js quick overview
    • web3-utils / web3.js quick overview

Y

  • Yeoman generator / Yeoman generator

Z

  • Zcash / Altcoins