Mastering Blockchain
Second Edition
Distributed ledger technology, decentralization, and smart
contracts explained
Imran Bashir
BIRMINGHAM - MUMBAI
Mastering Blockchain
Second Edition
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form
or by any means, without the prior written permission of the publisher, except in the case of brief quotations
embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented.
However, the information contained in this book is sold without warranty, either express or implied. Neither the
author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to
have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products
mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy
of this information.
Acquisition Editors: Ben Renow-Clarke, Suresh M Jain
Project Editor: Suzanne Coutinho
Content Development Editor: Alex Sorrentino
Technical Editor: Bhagyashree Rai
Indexer: Tejal Daruwale Soni
Graphics: Tom Scaria
Production Coordinator: Aparna Bhagat
First published: March 2017
Second edition: March 2018
Production reference: 1290318
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78883-904-4
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as
well as industry leading tools to help you plan your personal development and advance
your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos
from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a
print book customer, you are entitled to a discount on the eBook copy. Get in touch with us
at for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters, and receive exclusive discounts and offers on Packt books and
eBooks.
Contributors
About the author
Imran Bashir has an M.Sc. in Information Security from Royal Holloway, University of
London, and has a background in software development, solution architecture,
infrastructure management, and IT service management. He is also a member of the
Institute of Electrical and Electronics Engineers (IEEE) and the British Computer Society
(BCS).
Imran has sixteen years' of experience in the public and financial sectors. He worked on
large scale IT projects in the public sector before moving to the financial services industry.
Since then, he has worked in various technical roles for different financial companies in
Europe's financial capital, London. He is currently working for an investment bank in
London as Vice President in the Technology department.
I would like to thank the talented team at Packt, including Ben Renow-Clarke, Suzanne
Coutinho, Alex Sorrentino, Gary Schwartz, and Bhagyashree Rai, who provided prompt
guidance and valuable feedback throughout this project. I am also extremely thankful to the
reviewer, Pranav Burnwal, who provided constructive and very useful feedback that helped
me tremendously to improve the material in this book.
I thank my wife and children for putting up with my all-night and weekend-long writing
sessions.
Above all, I would like to thank my parents, whose blessings have made everything possible
for me.
About the reviewer
Pranav Burnwal has a background in Research and Development, and he has been working
with cutting-edge technologies for the past few years. The technologies he works on range
from blockchain, big data, analytics (log and data), cloud, to message queues, NoSQL, web
servers, and so on. He has worked across various domains ranging from BFSI, HLS, FMCG,
and automobiles to name a few.
Pranav is an active community member in multiple communities. He is the Regional Head
for Blockchain Education Network (BEN), a registered NGO and a worldwide network of
people of blockchain. He has also organized multiple meetups and a start-up weekend in
India.
Pranav has also been an active trainer in the blockchain space for an exciting period of three
years now, for an audience ranging from junior developers to senior VPs. This has also
given him insights into how people understand a new and complex technology, which
helped him frame this book in the best interest of the readers.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and
apply today. We have worked with thousands of developers and tech professionals, just
like you, to help them share their insight with the global tech community. You can make a
general application, apply for a specific hot topic that we are recruiting an author for, or
submit your own idea.
Table of Contents
Preface
1
Chapter 1: Blockchain 101
The growth of blockchain technology
Distributed systems
The history of blockchain and Bitcoin
Electronic cash
Blockchain
Blockchain defined
Peer-to-peer
Distributed ledger
Cryptographically-secure
Append-only
Updateable via consensus
Generic elements of a blockchain
How blockchain works
How blockchain accumulates blocks
Benefits and limitations of blockchain
Tiers of blockchain technology
Features of a blockchain
Types of blockchain
Distributed ledgers
Distributed Ledger Technology
Public blockchains
Private blockchains
Semiprivate blockchains
Sidechains
Permissioned ledger
Shared ledger
Fully private and proprietary blockchains
Tokenized blockchains
Tokenless blockchains
Consensus
Consensus mechanism
Types of consensus mechanisms
Consensus in blockchain
CAP theorem and blockchain
Summary
Chapter 2: Decentralization
Decentralization using blockchain
8
8
12
14
14
16
16
16
17
17
17
17
20
23
23
24
26
27
30
31
31
32
32
32
33
33
33
34
34
34
35
35
36
36
39
41
42
42
Table of Contents
Methods of decentralization
Disintermediation
Contest-driven decentralization
Routes to decentralization
How to decentralize
The decentralization framework example
Blockchain and full ecosystem decentralization
Storage
Communication
Computing power and decentralization
Smart contracts
Decentralized Organizations
Decentralized Autonomous Organizations
Decentralized Autonomous Corporations
Decentralized Autonomous Societies
Decentralized Applications (DApps)
Requirements of a Decentralized Application
Operations of a DApp
DApp examples
KYC-Chain
OpenBazaar
Lazooz
Platforms for decentralization
Ethereum
MaidSafe
Lisk
Summary
Chapter 3: Symmetric Cryptography
Working with the OpenSSL command line
Introduction
Mathematics
Set
Group
Field
A finite field
Order
An abelian group
Prime fields
Ring
A cyclic group
Modular arithmetic
Cryptography
Confidentiality
Integrity
Authentication
[ ii ]
44
45
45
47
48
49
49
50
51
52
53
54
54
55
55
56
56
56
57
57
57
57
57
58
58
58
59
60
60
61
62
62
62
62
63
63
63
63
63
63
64
64
65
65
65
Table of Contents
Entity authentication
Data origin authentication
Non-repudiation
Accountability
Cryptographic primitives
Symmetric cryptography
Stream ciphers
Block ciphers
Block encryption mode
Electronic Code Book
Cipher Block Chaining
Counter mode
Keystream generation mode
Message authentication mode
Cryptographic hash mode
Data Encryption Standard
Advanced Encryption Standard
How AES works
Summary
Chapter 4: Public Key Cryptography
Asymmetric cryptography
Integer factorization
Discrete logarithm
Elliptic curves
Public and private keys
RSA
Encryption and decryption using RSA
Elliptic Curve Cryptography
Mathematics behind ECC
Point addition
Point doubling
Discrete logarithm problem in ECC
RSA using OpenSSL
RSA public and private key pair
Private key
Public key
Exploring the public key
Encryption and decryption
Encryption
Decryption
ECC using OpenSSL
ECC private and public key pair
Private key
Private key generation
Hash functions
Compression of arbitrary messages into fixed-length digest
Easy to compute
Preimage resistance
Second preimage resistance
[ iii ]
66
66
67
67
68
69
69
70
71
72
72
73
73
73
74
74
74
75
79
80
80
83
83
83
84
84
86
86
86
87
90
93
95
95
95
96
98
98
98
99
99
99
100
100
103
103
103
103
104
Table of Contents
Collision resistance
Message Digest
Secure Hash Algorithms
Design of Secure Hash Algorithms
Design of SHA-256
Design of SHA-3 (Keccak)
OpenSSL example of hash functions
Message Authentication Codes
MACs using block ciphers
Hash-based MACs
Merkle trees
Patricia trees
Distributed Hash Tables
Digital signatures
RSA digital signature algorithm
Sign then encrypt
Encrypt then sign
Elliptic Curve Digital Signature Algorithm
How to generate a digital signature using OpenSSL
ECDSA using OpenSSL
Homomorphic encryption
Signcryption
Zero-Knowledge Proofs
Blind signatures
Encoding schemes
Financial markets and trading
Trading
Exchanges
Orders and order properties
Order management and routing systems
Components of a trade
The underlying instrument
General attributes
Economics
Sales
Counterparty
Trade life cycle
Order anticipators
Market manipulation
Summary
Chapter 5: Introducing Bitcoin
Bitcoin
104
105
105
106
106
108
109
109
109
110
111
111
112
113
113
114
115
115
117
118
120
121
121
122
122
123
123
124
124
124
125
125
125
125
126
126
126
127
127
128
129
132
134
135
136
143
144
145
Bitcoin definition
Bitcoin – a bird's-eye view
Sending a payment to someone
Digital keys and addresses
Private keys in Bitcoin
Public keys in Bitcoin
[ iv ]
Table of Contents
Addresses in Bitcoin
Base58Check encoding
Vanity addresses
Multisignature addresses
Transactions
The transaction life cycle
Transaction fee
Transaction pools
The transaction data structure
Metadata
Inputs
Outputs
Verification
The script language
Commonly used opcodes
Types of transactions
Coinbase transactions
Contracts
Transaction verification
Transaction malleability
Blockchain
The structure of a block
The structure of a block header
The genesis block
Mining
Tasks of the miners
Mining rewards
Proof of Work (PoW)
The mining algorithm
The hash rate
Mining systems
CPU
GPU
FPGA
ASICs
Mining pools
Summary
Chapter 6: Bitcoin Network and Payments
The Bitcoin network
Wallets
Non-deterministic wallets
Deterministic wallets
Hierarchical Deterministic wallets
Brain wallets
Paper wallets
Hardware wallets
[v]
146
148
148
149
150
150
151
152
152
153
154
154
155
155
155
156
159
159
160
161
161
161
162
164
167
168
168
169
169
172
172
173
173
173
174
175
178
179
179
189
190
190
190
191
191
191
Table of Contents
Online wallets
Mobile wallets
Bitcoin payments
Innovation in Bitcoin
Bitcoin Improvement Proposals (BIPs)
Advanced protocols
Segregated Witness (SegWit)
Bitcoin Cash
Bitcoin Unlimited
Bitcoin Gold
Bitcoin investment and buying and selling bitcoins
Summary
Chapter 7: Bitcoin Clients and APIs
Bitcoin installation
Types of Bitcoin Core clients
Bitcoind
Bitcoin-cli
Bitcoin-qt
Setting up a Bitcoin node
Setting up the source code
Setting up bitcoin.conf
Starting up a node in testnet
Starting up a node in regtest
Experimenting with Bitcoin-cli
Bitcoin programming and the command-line interface
Summary
Chapter 8: Alternative Coins
Theoretical foundations
Alternatives to Proof of Work
Proof of Storage
Proof of Stake (PoS)
Various stake types
Proof of coinage
Proof of Deposit (PoD)
Proof of Burn
Proof of Activity (PoA)
Nonoutsourceable puzzles
Difficulty adjustment and retargeting algorithms
Kimoto Gravity Well
Dark Gravity Wave
DigiShield
MIDAS
Bitcoin limitations
Privacy and anonymity
Mixing protocols
[ vi ]
192
192
193
195
196
196
197
198
198
199
200
202
203
203
204
204
205
205
206
207
207
208
208
209
211
212
213
216
217
220
220
220
220
221
221
221
221
222
223
224
224
225
225
225
226
Table of Contents
Third-party mixing protocols
Inherent anonymity
Extended protocols on top of Bitcoin
Colored coins
Counterparty
Development of altcoins
Consensus algorithms
Hashing algorithms
Difficulty adjustment algorithms
Inter-block time
Block rewards
Reward halving rate
Block size and transaction size
Interest rate
Coinage
Total supply of coins
Namecoin
Trading Namecoins
Obtaining Namecoins
Generating Namecoin records
Litecoin
Primecoin
Trading Primecoin
Mining guide
Zcash
Trading Zcash
Mining guide
Address generation
GPU mining
Downloading and compiling nheqminer
Initial Coin Offerings (ICOs)
ERC20 tokens
Summary
Chapter 9: Smart Contracts
History
Definition
Ricardian contracts
Smart contract templates
Oracles
Smart Oracles
Deploying smart contracts on a blockchain
The DAO
Summary
Chapter 10: Ethereum 101
Introduction
227
228
228
228
229
230
231
231
231
231
232
232
232
232
232
232
233
235
235
238
240
244
245
246
248
250
250
254
255
255
257
259
259
261
261
262
265
269
270
273
273
274
275
276
276
[ vii ]
Table of Contents
The yellow paper
Useful mathematical symbols
Ethereum blockchain
Ethereum – bird's eye view
The Ethereum network
Mainnet
Testnet
Private net
Components of the Ethereum ecosystem
Keys and addresses
Accounts
Types of accounts
Transactions and messages
Contract creation transaction
Message call transaction
Messages
Calls
Transaction validation and execution
The transaction substate
State storage in the Ethereum blockchain
The world state
The account state
Transaction receipts
Ether cryptocurrency / tokens (ETC and ETH)
The Ethereum Virtual Machine (EVM)
Execution environment
Machine state
The iterator function
Smart contracts
Native contracts
Summary
Chapter 11: Further Ethereum
Programming languages
Runtime bytecode
Opcodes and their meaning
Arithmetic operations
Logical operations
Cryptographic operations
Environmental information
Block information
Stack, memory, storage, and flow operations
Push operations
Duplication operations
Exchange operations
Logging operations
System operations
Blocks and blockchain
[ viii ]
277
278
279
280
284
284
285
285
286
287
287
288
289
292
293
294
295
296
296
296
297
297
298
300
301
303
304
305
306
307
309
310
311
312
312
312
313
314
314
315
316
316
317
317
318
318
319
Table of Contents
The genesis block
The block validation mechanism
Block finalization
Block difficulty
Gas
Fee schedule
Forks in the blockchain
Nodes and miners
The consensus mechanism
Ethash
CPU mining
GPU mining
Benchmarking
Mining rigs
Mining pools
Wallets and client software
Geth
Eth
Pyethapp
Parity
Light clients
Installation
Eth installation
Mist browser
Geth
The geth console
Funding the account with bitcoin
Parity installation
Creating accounts using the parity command line
APIs, tools, and DApps
Applications (DApps and DAOs) developed on Ethereum
Tools
Supporting protocols
Whisper
Swarm
Scalability, security, and other challenges
Trading and investment
Summary
Chapter 12: Ethereum Development Environment
Test networks
Setting up a private net
Network ID
The genesis file
Data directory
Flags and their meaning
Static nodes
Starting up the private network
Running Mist on private net
Deploying contracts using Mist
[ ix ]
321
322
323
323
325
326
327
327
328
330
331
332
333
334
335
336
336
336
336
336
336
337
337
337
340
341
342
343
347
347
347
348
348
348
349
350
350
351
352
353
354
355
355
357
357
358
358
364
367
Table of Contents
Block explorer for private net / local Ethereum block explorer
Summary
Chapter 13: Development Tools and Frameworks
Languages
Compilers
Solidity compiler (solc)
Installation on Linux
Installation on macOS
Integrated Development Environments (IDEs)
Remix
Tools and libraries
Node version 7
EthereumJS
Ganache
MetaMask
Truffle
Installation
Contract development and deployment
Writing
Testing
Solidity language
Types
Value types
Boolean
Integers
Address
Literals
Integer literals
String literals
Hexadecimal literals
Enums
Function types
Internal functions
External functions
Reference types
Arrays
Structs
Data location
Mappings
Global variables
Control structures
Events
Inheritance
Libraries
Functions
Layout of a Solidity source code file
Version pragma
Import
Comments
Summary
[x]
372
375
376
378
378
378
378
379
381
381
384
385
385
386
387
390
391
392
392
394
394
395
395
395
395
396
397
397
397
397
397
398
398
398
398
398
399
399
399
400
400
402
402
403
404
407
407
407
408
408
Table of Contents
Chapter 14: Introducing Web3
Web3
Contract deployment
POST requests
The HTML and JavaScript frontend
Installing web3.js
Example
Creating a web3 object
Checking availability by calling any web3 method
Contract functions
Development frameworks
Truffle
Initializing Truffle
Interaction with the contract
Another example
An example project – Proof of Idea
Oracles
Deployment on decentralized storage using IPFS
Installing IPFS
Distributed ledgers
Summary
Chapter 15: Hyperledger
Projects under Hyperledger
Fabric
Sawtooth Lake
Iroha
Burrow
Indy
Explorer
Cello
Composer
Quilt
Hyperledger as a protocol
The reference architecture
Requirements and design goals of Hyperledger Fabric
The modular approach
Privacy and confidentiality
Scalability
Deterministic transactions
Identity
Auditability
Interoperability
Portability
Rich data queries
Fabric
Hyperledger Fabric
Membership services
[ xi ]
409
409
410
417
418
419
420
422
422
423
426
426
426
435
438
441
454
456
457
460
460
461
461
462
462
463
463
464
464
464
465
465
465
466
468
468
468
469
469
469
469
470
470
470
470
471
472
Table of Contents
Blockchain services
Consensus services
Distributed ledger
The peer to peer protocol
Ledger storage
Chaincode services
Components of the fabric
Peers
Orderer nodes
Clients
Channels
World state database
Transactions
Membership Service Provider (MSP)
Smart contracts
Crypto service provider
Applications on blockchain
Chaincode implementation
The application model
Consensus in Hyperledger Fabric
The transaction life cycle in Hyperledger Fabric
Sawtooth Lake
PoET
Transaction families
Consensus in Sawtooth
The development environment – Sawtooth Lake
Corda
Architecture
State objects
Transactions
Consensus
Flows
Components
Nodes
The permissioning service
Network map service
Notary service
Oracle service
Transactions
Vaults
CorDapp
The development environment – Corda
Summary
Chapter 16: Alternative Blockchains
Blockchains
Kadena
Ripple
Transactions
Payments related
Order related
Account and security-related
[ xii ]
473
473
473
474
475
475
476
476
476
477
477
477
477
477
478
478
478
479
481
481
482
484
484
485
487
487
491
492
492
493
493
493
494
494
494
495
495
495
495
496
497
497
498
500
500
501
506
509
510
510
510
Table of Contents
Interledger
Application layer
Transport layer
Interledger layer
Ledger layer
Stellar
Rootstock
Sidechain
Drivechain
Quorum
Transaction manager
Crypto Enclave
QuorumChain
Network manager
Tezos
Storj
MaidSafe
BigchainDB
MultiChain
Tendermint
Tendermint Core
Tendermint Socket Protocol (TMSP)
Platforms and frameworks
Eris
Summary
Chapter 17: Blockchain – Outside of Currencies
Internet of Things
Physical object layer
Device layer
Network layer
Management layer
Application layer
IoT blockchain experiment
First node setup
Raspberry Pi node setup
Installing Node.js
Circuit
Government
Border control
Voting
Citizen identification (ID cards)
Miscellaneous
Health
Finance
Insurance
Post-trade settlement
Financial crime prevention
[ xiii ]
511
511
512
512
512
513
514
514
514
515
516
516
516
516
517
519
520
520
521
521
521
521
522
522
524
525
526
527
527
528
528
528
532
537
538
540
543
550
550
553
553
554
555
555
556
556
557
Table of Contents
Media
Summary
Chapter 18: Scalability and Other Challenges
Scalability
Network plane
Consensus plane
Storage plane
View plane
Block size increase
Block interval reduction
Invertible Bloom Lookup Tables
Sharding
State channels
Private blockchain
Proof of Stake
Sidechains
Subchains
Tree chains (trees)
Block propagation
Bitcoin-NG
Plasma
Privacy
Indistinguishability Obfuscation
Homomorphic encryption
Zero-Knowledge Proofs
State channels
Secure multiparty computation
Usage of hardware to provide confidentiality
CoinJoin
Confidential transactions
MimbleWimble
Security
Smart contract security
Formal verification and analysis
Oyente tool
Summary
Chapter 19: Current Landscape and What's Next
Emerging trends
Application-specific blockchains (ASBCs)
Enterprise-grade blockchains
Private blockchains
Start-ups
Strong research interest
Standardization
[ xiv ]
558
559
560
561
561
562
562
562
563
563
564
564
564
566
566
566
566
567
568
568
569
569
570
570
571
571
571
572
572
573
573
574
574
576
578
580
582
582
583
583
583
584
584
585
Table of Contents
Enhancements
Real-world implementations
Consortia
Answers to technical challenges
Convergence
Education of blockchain technology
Employment
Cryptoeconomics
Research in cryptography
New programming languages
Hardware research and development
Research in formal methods and security
Alternatives to blockchains
Interoperability efforts
Blockchain as a Service
Efforts to reduce electricity consumption
Other challenges
Regulation
Dark side
Blockchain research
Smart contracts
Centralization issues
Limitations in cryptographic functions
Consensus algorithms
Scalability
Code obfuscation
Notable projects
Zcash on Ethereum
CollCo
Cello
Qtum
Bitcoin-NG
Solidus
Hawk
Town-Crier
SETLCoin
TEEChan
Falcon
Bletchley
Casper
Miscellaneous tools
Solidity extension for Microsoft Visual Studio
MetaMask
Stratis
Embark
[ xv ]
586
587
587
588
588
588
589
589
589
590
590
591
591
591
592
592
592
592
594
595
595
595
596
596
596
597
597
597
597
598
598
598
598
599
599
599
599
600
600
600
601
601
601
601
602
Table of Contents
DAPPLE
Meteor
uPort
INFURA
Convergence with other industries
Future
Summary
Another Book You May Enjoy
Index
602
602
603
603
603
604
606
607
609
[ xvi ]
Preface
This book has one goal, to introduce theoretical and practical aspects of the blockchain
technology. This book contains all material that is necessary to become a blockchain
technical expert. Since the publication of the first edition of this book, a lot has changed and
progressed further with regards to blockchain; therefore, a need to update the book has
arisen.
The multitude of benefits envisaged by the implementation of blockchain technology has
sparked profound interest among researchers from academia and industry who are
tirelessly researching this technology. As a result, many consortia, working groups, projects,
and professional bodies have emerged, which are involved in the development and further
advancement of this technology. The second edition of this book will provide in-depth
insights into decentralization, smart contracts, and various blockchain platforms such as
Ethereum, Bitcoin, and Hyperledger Fabric. After reading this book, readers will be able to
develop a deep understanding of inner workings of the blockchain technology and will be
able to develop blockchain applications.
This book covers all topics relevant to the blockchain technology, including cryptography,
cryptocurrencies, Bitcoin, Ethereum, and various other platforms and tools used for
blockchain development. It is recommended that readers have a basic understanding of
computer science and basic programming experience to benefit fully from this book.
However, if that is not the case then still this book can be read easily, as relevant
background material is provided where necessary.
Who this book is for
This book is for anyone who wants to understand blockchain in depth. It can also be used as
a reference by developers who are developing applications for blockchain. Also, this book
can be used as a textbook for courses related to blockchain technology and
cryptocurrencies. It can also be used as a learning resource for various examinations and
certifications related to cryptocurrency and blockchain technology.
Preface
What this book covers
Chapter 1, Blockchain 101, introduces the basic concepts of distributed computing on which
blockchain technology is based. It also covers history, definitions, features, types, and
benefits of blockchains along with various consensus mechanisms that are at the core of the
blockchain technology.
Chapter 2, Decentralization, covers the concept of decentralization and its relationship with
blockchain technology. Various methods and platforms that can be used to decentralize a
process or a system have also been introduced.
Chapter 3, Symmetric Cryptography, introduces the theoretical foundations of symmetric
cryptography, which is necessary to understand that how various security services such as
confidentiality and integrity are provided.
Chapter 4, Public Key Cryptography, introduces concepts such as public and private keys,
digital signatures and hash functions with practical examples. Finally, an introduction to
financial markets is also included as there are many interesting use cases for blockchain
technology in the financial sector.
Chapter 5, Introducing Bitcoin, covers Bitcoin, the first and largest blockchain. It introduces
technical concepts related to bitcoin cryptocurrency in detail.
Chapter 6, Bitcoin Network and Payments, covers Bitcoin network, relevant protocols and
various Bitcoin wallets. Moreover, advanced protocols, Bitcoin trading and payments is also
introduced.
Chapter 7, Bitcoin Clients and APIs, introduces various Bitcoin clients and programming
APIs that can be used to build Bitcoin applications.
Chapter 8, Alternative Coins, introduces alternative cryptocurrencies that were introduced
after the invention of Bitcoin. It also presents examples of different altcoins, their properties,
and how they have been developed and implemented.
Chapter 9, Smart Contracts, provides an in-depth discussion on smart contracts. Topics such
as history, the definition of smart contracts, Ricardian contracts, Oracles, and the theoretical
aspects of smart contracts are presented in this chapter.
[2]
Preface
Chapter 10, Ethereum 101, introduces the design and architecture of the Ethereum
blockchain in detail. It covers various technical concepts related to the Ethereum blockchain
that explains the underlying principles, features, and components of this platform in depth.
Chapter 11, Further Ethereum, continues the introduction of Ethereum from pervious
chapter and covers topics related to Ethereum Virtual Machine, mining and supporting
protocols for Ethereum.
Chapter 12, Ethereum Development Environment, covers the topics related to setting up
private networks for Ethereum smart contract development and programming.
Chapter 13, Development Tools and Frameworks, provides a detailed practical introduction to
the Solidity programming language and different relevant tools and frameworks that are
used for Ethereum development.
Chapter 14, Introducing Web3, covers development of decentralized applications and smart
contracts using the Ethereum blockchain. A detailed introduction to Web3 API is provided
along with multiple practical examples and a final project.
Chapter 15, Hyperledger, presents a discussion about the Hyperledger project from the
Linux Foundation, which includes different blockchain projects introduced by its members.
Chapter 16, Alternative Blockchains, introduces alternative blockchain solutions and
platforms. It provides technical details and features of alternative blockchains and relevant
platforms.
Chapter 17, Blockchain – Outside of Currencies, provides a practical and detailed introduction
to applications of blockchain technology in fields others than cryptocurrencies, including
Internet of Things, government, media, and finance.
Chapter 18, Scalability and Other Challenges, is dedicated to a discussion of the challenges
faced by blockchain technology and how to address them.
Chapter 19, Current Landscape and What's Next, is aimed at providing information about the
current landscape, projects, and research efforts related to blockchain technology. Also,
some predictions based on the current state of blockchain technology have also been made.
[3]