Blockchain in Action
Bina Ramamurthy
  • MEAP began May 2019
  • Publication in Fall 2020 (estimated)
  • ISBN 9781617296338
  • 375 pages (estimated)
  • printed in black & white

A great introduction to the topic from technical and business perspective.

Luis Moux
There’s a lot more to the blockchain than mining Bitcoin. This secure system for registering and verifying ownership and identity is perfect for supply chain logistics, health records, and other sensitive data management tasks. Blockchain in Action unlocks the full potential of this revolutionary technology, showing you how to build your own decentralized apps for secure applications including digital democracy, private auctions, and electronic record management.

About the Technology

A blockchain is a decentralized record, stored across numerous devices with no central control or authority. Copies of this shared database are constantly reconciled with one another, and records are cryptographically encoded to make them unchangeable. The result is a type of database that is at once transparent and publicly accessible, and where it is impossible to falsify or alter the historic data record. Initially hailed for cryptocurrencies such as Bitcoin, recent blockchain platforms such as Ethereum and Hyperledger are opening up new applications for immutable public and private digital records management.

About the book

Written by Bina Ramamurthy, award-winning creator of the blockchain Coursera online course, Blockchain in Action begins with the essential principles of blockchain and teaches you to create your own decentralized apps. From the start you’ll go hands-on with the Ethereum blockchain, designing and coding your first smart contract with the JavaScript-based Solidity language. This smart contract will become the foundation on which you will build advanced functionality, including trust validation, a web UI for better user access, and privacy and security features that enable deployment on a public blockchain network. By the time you’re finished, you’ll be fully prepared to build useful blockchain applications.
Table of Contents detailed table of contents

1 Blockchain basics

1.1 From Bitcoin to blockchain

1.1.1 Exploring a real blockchain

1.2 What is a blockchain?

1.2.1 Decentralized infrastructure

1.2.2 Distributed ledger technology

1.2.3 Disintermediation protocol

1.2.4 Trust enabler

1.3 Motivating scenarios

1.3.1 Automatic and consistent data collection

1.3.2 Timely information sharing

1.3.3 Verifiable compliance

1.3.4 Auditable actions for provenance

1.3.5 Guidance for governance

1.3.6 Attribution of actions

1.3.7 COVID 19 pandemic management

1.4 Wrapping it up

1.5 Summary

Part 1: Smart contracts

2 Smart contracts

2.1 The concept of a smart contract

2.1.1 Bitcoin transactions versus smart contract transactions

2.1.2 What does a smart contract do?

2.2 Design of a smart contract

2.2.1 A use case diagram for the counter

2.2.2 Data assets, peer participants, roles, rules, and transactions

2.2.3 From class diagram to contract diagram

2.3 Development of a smart contract code

2.3.1 Solidity language

2.3.2 Smart contract code for Counter

2.4 Deploying and testing the smart contract

2.4.1 The Remix IDE

2.4.2 Deployment and testing

2.4.3 Key takeaways

2.5 What makes a blockchain contract smart?

2.6 Decentralized airline system use case

2.6.1 ASK definition

2.6.2 Sequence of operations

2.7 Airlines smart contract

2.7.1 Peer participants, data assets, roles, rules, and transactions

2.7.2 Airlines smart contract code

2.7.3 ASK smart contract deployment and testing

2.8 Smart contract design considerations

2.9 Best practices

2.10 Summary

3 Techniques for trust and integrity

3.1 Essentials of trust and integrity

3.1.1 Trust

3.1.2 Integrity

3.2 Digital democracy problem

3.2.1 Designing a solution

3.2.2 Use case diagram

3.2.3 Incremental development of code

3.2.4 Users, assets, and transactions

3.2.5 Finite state machine diagram

3.2.6 Trust intermediation

3.2.7 Defining and using modifiers

3.2.8 Contract diagram including modifiers

3.2.9 Putting it all together

3.3 Testing

3.4 Using modifiers, require(), revert(), and assert()

3.4.1 assert() declarations

3.5 Best practices

3.6 Wrapping it up

3.7 Summary

4 From smart contracts to Dapps

4.1 Dapp development using Truffle

4.1.1 The development process

4.1.2 Installing Truffle

4.1.3 Building the Dapp stack

4.2 Install Ganache test chain

4.3 Develop the smart contract

4.3.1 Create a project folder

4.3.2 Add smart contract and compile

4.3.3 Configure blockchain network

4.3.4 Deploy the smart contract

4.4 Develop and configure the web application

4.4.1 Develop the ballot-app

4.4.2 Launch the ballot-app

4.4.3 Install MetaMask wallet

4.4.4 Interact with Ballot-Dapp

4.4.5 Connect web client to smart contract

4.5 Wrapping up

4.6 Best practices

4.7 Summary

5 Security and privacy

5.1 Cryptography basics

5.1.1 Symmetric key cryptography

5.1.2 Asymmetric key cryptography

5.2 The relevance of public-key cryptography to blockchain

5.2.1 Generating Ethereum addresses

5.2.2 Transaction signing

5.2.3 Deploying smart contracts on Ropsten

5.2.4 The private key in mnemonic form

5.2.5 Populating a blockchain wallet

5.2.6 Deploying and transacting on Ropsten

5.3 Hashing basics

5.3.1 Digital signing of documents

5.3.2 Hashed data on distributed ledger

5.3.3 Hashes in Ethereum block header

5.3.4 Solidity hashing functions

5.4 Application of hashing

5.4.1 Blind auction design

5.4.2 Blind auction smart contract

5.4.3 Privacy and security aspects

5.4.4 Testing the BlindAuction contract

5.5 Wrapping it up

5.6 Best practices

5.7 Summary

Part 2: Decentralized applications

6 On-chain and off-chain data

6.1 On-chain data

6.2 Blind auction use case

6.2.1 On-chain event data

6.2.2 Blind auction with events

6.2.3 Testing with the web UI

6.2.4 Accessing on-chain data using the web3 API

6.3 Off-chain data: External data sources

6.4 ASK airline system

6.4.1 ASK concept

6.4.2 Airlines smart contract

6.4.3 ASK on-chain data

6.4.4 ASK off-chain data

6.4.5 ASK Dapp development process

6.4.6 ASK web user interface

6.4.7 Putting it all together

6.4.8 Interacting with ASK Dapp

6.5 Wrapping it up

6.6 Best practices

6.7 Summary

7 Web3 and a channel Dapp

7.1 Web3 API

7.1.1 Web3 in Dapp stack

7.1.2 Web3 packages

7.2 The channel concept

7.2.1 Micropayment channel

7.3 Micropayment channel use case: MPC

7.3.1 Traditional banking solution

7.3.2 Users and roles

7.3.3 On-chain and off-chain operations

7.3.4 MPC smart contract (MPC-contract)

7.3.5 MPC application development (MPC-app)

7.3.6 MPC Sequence diagram

7.3.7 Demonstration of MPC execution

7.3.8 Accessing the web3 provider

7.3.9 Extensions of MPC

7.3.10 The relevance of micropayment channel

7.3.11 Other web3 packages of interest

7.4 Wrapping it up

7.5 Best Practices

7.6 Summary

8 Going public with Infura

8.1 Nodes and networks

8.2 Infura blockchain infrastructure

8.3 Going public with Infura

8.3.1 Blockchain node as a service

8.4 End-to-end process for public deployment

8.4.1 Account generation and management

8.4.2 Choosing a network and importing accounts

8.4.3 Collecting Ether from faucets

8.4.4 Creating blockchain nodes on Infura

8.4.5 Installing HDWallet provider

8.4.6 Configuring and deploying the smart contract

8.4.7 Configuring and deploying the web application

8.5 Deploying BlindAuction Dapp on Infura

8.5.1 Setting up the blind auction environment

8.5.2 Configure and deploy the beneficiary account

8.5.3 Configure and deploy bidders

8.5.4 Interact with deployed blind auction Dapp

8.6 Deploying MPC Dapp on Infura

8.6.1 Setting up the MPC environment

8.6.2 Configure and deploy the organizer

8.6.3 Configure and deploy the worker

8.7 Wrapping it up

8.8 Best practices

8.9 Summary

9 Tokenization of assets

9.1 Ethereum standards

9.1.1 Ethereum improvement proposal

9.1.2 ERC20 token standard

9.1.3 Fungible and non-fungible tokens

9.2 RES4: Non-fungible real estate token

9.2.1 Use case diagram

9.2.2 Contract diagram

9.2.3 RES4 ERC721 compliant token

9.2.4 RES4 Dapp

9.2.5 Interaction with RES4 Dapp

9.3 Wrapping it up

9.4 Best Practices

9.5 Summary

Part 3: Blockchain ecosystem

10 Testing smart contracts

10.1 Importance of testing smart contracts

10.1.1 Types of testing

10.1.2 Language choice for test programs

10.2 Testing counter smart contract

10.2.1 Writing counter test script

10.2.2 Positive and negative tests

10.2.3 Running the test script

10.3 Testing ballot smart contract

10.3.1 Writing the ballot test script

10.3.2 Executing the ballot test script

10.3.3 Describe() and it() test functions

10.4 Recap writing of test script

10.5 The blind auction test script

10.5.1 Analysis of describe() and it() code

10.5.2 Executing the blind auction test script

10.6 Wrapping it up

10.7 Best practices

10.8 Summary

11 A roadmap to Dapp development

11.1 Motivating scenario: Educational credentialing

11.2 The roadmap

11.3 Problem description

11.3.1 Context for the DCC application

11.4 Analysis and design

11.4.1 Operation flow and finite state machine

11.4.2 Contract diagram

11.5 Developing the smart contract

11.6 Local deployment

11.7 Automated testing using truffle

11.8 Developing the web application

11.9 Testing the DCC-Dapp

11.10 Public deployment

11.10.1 Deployment on Ropsten-Infura

11.10.2 Create web-client for distribution

11.11 Best practices

11.12 Summary

12 Blockchain: the road ahead

12.1 Decentralized identity

12.1.1 Self-managed identity

12.2 Consensus and integrity

12.2.1 Proof of work

12.2.2 Proof of stake

12.2.3 Byzantine fault-tolerant consensus

12.3 Scalability

12.3.1 Solutions

12.4 Privacy

12.4.1 Public, private and permissioned networks

12.5 Confidentiality

12.5.1 Open information

12.5.2 A solution

12.6 Security

12.6.1 Securing it with cryptocurrency

12.7 Accessing off-chain data (Oracles)

12.8 From foundations to practical systems

12.9 Blockchain, the road ahead

12.10 Best Practices

12.11 Wrapping it up

12.12 Summary

Appendixes

Appendix A: Appendix A: UML blockchain design models

A.1 Problem analysis and design

A.2 Behavioral diagrams

A.2.1 Use case diagrams

A.2.2 Finite state machine diagrams

A.3 Structural diagrams

A.3.1 Class diagrams

A.3.2 Classes and relationships

A.4 Interaction diagrams

A.5 Summary

Appendix B: Appendix B: Design Principles

What's inside

  • How blockchain differs from other distributed systems
  • Smart contract development with Ethereum and the Solidity language
  • Web UI for decentralized apps
  • Identity, privacy and security techniques
  • On-chain and off-chain data storage

About the reader

For intermediate programmers who know the basics of object-oriented languages and have a working knowledge of JavaScript.

About the author

Bina Ramamurthy holds a Ph.D. in fault-tolerant distributed systems, and has thirty years of experience teaching cryptography, peer-to-peer networking, and distributed systems. She is the instructor and content creator for the University of Buffalo four-course specialization on blockchain technology on the Coursera MOOC platform, and the recipient of the 2019 SUNY Chancellor’s Award for Teaching Excellence.

placing your order...

Don't refresh or navigate away from the page.
Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
print book $29.99 $44.99 pBook + eBook + liveBook
Additional shipping charges may apply
Blockchain in Action (print book) added to cart
continue shopping
go to cart

eBook $24.99 $35.99 3 formats + liveBook
Blockchain in Action (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.

FREE domestic shipping on three or more pBooks