Table Of ContentBlockchain with Hyperledger
Fabric
Second Edition
Build decentralized applications using
Hyperledger Fabric 2
Nitin Gaur
Luc Desrosiers
Venkatraman Ramakrishna
Petr Novotny
Salman A. Baset
Anthony O'Dowd
BIRMINGHAM - MUMBAI
Blockchain with Hyperledger Fabric
Second Edition
Copyright © 2020 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 authors, 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.
Producer: Tushar Gupta
Acquisition Editor – Peer Reviews: Suresh Jain
Content Development Editor: Chris Nelson
Technical Editor: Gaurav Gavas
Project Editors: Carol Lewis, Radhika Atitkar
Copy Editor: Safis Editing
Proofreader: Safis Editing
Indexer: Manju Arasan
Presentation Designer: Sandip Tadge
First published: June 2018
Second Edition: November 2020
Production reference: 2191120
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-83921-875-0
www.packt.com
packt.com
Subscribe to our online digital library for full access to over 7,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
• Learn better with Skill Plans built especially for you
• Get a free eBook or video every month
• Fully searchable for easy access to vital information
• Copy and paste, print, and bookmark content
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.Packt.com
and as a print book customer, you are entitled to a discount on the eBook copy. Get
in touch with us at [email protected] for more details.
At www.Packt.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 authors
Nitin Gaur currently leads IBM Financial Sciences research practice, as a part
of IBM Research. In this role Nitin leads a team that aspires to play a pivotal role
in reshaping the future of the financial services industry with faculty, advanced
technology, and superior design in the field of financial sciences and financial
technology. In his previous role, Nitin served as founder and Director of IBM Digital
Asset Labs—serving to device industry standards and use cases, and working
towards making blockchain for enterprise a reality. In parallel, Nitin also served
as CTO of IBM World Wire—a cross-border payment solution utilizing digital
assets. Nitin also founded IBM Blockchain Labs, and led the effort in establishing
blockchain practice for enterprises. Prior to this role he worked in capacity of
CTO at IBM Mobile Payments and Enterprise Mobile Solutions. Nitin holds an
MS in Management Information Systems and MBA in Finance from University of
Maryland. He is also an IBM Distinguished Engineer and IBM Master Inventor,
with a rich patent portfolio.
Luc Desrosiers is an IBM Senior Certified IT Architect and the technical leader
of the IBM Cloud Pak Acceleration Team. He has worked for many years helping
clients and consortiums build blockchain solutions using IBM technologies.
I'd like to thank Mark Cudden for giving me valuable feedback on
Governance.
Venkatraman Ramakrishna is an IBM Researcher with 10 years of experience.
Following a B. Tech. from IIT Kharagpur and a PhD from UCLA, he worked in
Microsoft's Bing Infrastructure team before joining IBM Research—India.
Petr Novotny is a Research Staff Member and Master Inventor at IBM Research
with more than 15 years of experience in research and engineering of software
systems.
Salman A. Baset currently works at MongoDB, where he is responsible for the
strategy and execution of security and compliance for MongoDB's server and cloud.
His last role was CTO Security at IBM Blockchain solutions. In this role, he was
responsible for the security and compliance of various blockchain solutions, such
as IBM Food Trust and TradeLens. He drove implementation of GDPR for
blockchain-based solutions, and co-authored one of the IBM's point of view
publications. Moreover, his team built an identity management system for
blockchain solutions which is now used by Fortune 500 companies. He has also
worked at IBM Research and led teams that contributed to several IBM services and
products, such as IBM Container Service, IBM Vulnerability Advisor, and IBM Smart
Cloud Enterprise+ patch management system.
He is the recipient of the IEEE INFOCOM Test of Time award (2018), the SPEC
Presidential Award (2016), the You Scholars Award by the Marconi Society (2008),
and several IBM awards. He has authored over 40 papers and Internet standards,
and has over 25 issued patents. He is also an ACM distinguished speaker.
Anthony O'Dowd is a Distinguished Engineer at IBM, focusing on Blockchain.
He led IBM's contribution to the design and development of the new smart contract
and application SDKs found in Hyperledger Fabric v2. Anthony has also made
significant contributions to Hyperledger Fabric documentation and samples.
He is based in Europe, as part of a worldwide team with a remit to help users build
innovative digital solutions which benefit from Blockchain technology. Anthony has
a background in messaging, transaction processing, and integration; he has led the
development of key IBM middleware, including IBM MQ and the Message Broker/
Integration Bus.
About the reviewer
David Huffman has pretended to be a software engineer at IBM for over 8
years. He graduated from North Carolina State University in 2013 with a Masters
in Computer Engineering. David has been a member of the IBM Blockchain team
for over one week. He is 5 foot 6 and 1/32 inches short. David enjoys messing with
people, including in the creation of this bio.
Varad Ramamoorthy is currently the UI architect for the IBM Blockchain
Platform (IBP). Before IBP, he has worked on a number of products as UI architect,
including the IBM WebSphere Portal, IBM Business Process Management, and IBM
Business Monitor. He is passionate about end-user experience, making product
consumption easier.
Mihir Shah is one of the lead architects of the IBM Blockchain Platform. Mihir
graduated from North Carolina State University and has been with IBM for over
7 years. He has worked on hardware acceleration using FPGA, IoT, APIs, cloud
infrastructure and cloud architecture.
Paul Tippett is currently the Head of Operations for the IBM Blockchain Platform
offering in IBM Cloud. Previous assignments include the IBM Container Service and
Logging and Metrics Services, also in IBM Cloud. Outside of work Paul spends time
mountain biking, working out, and hanging out with his family.
Jason Yellick is an active maintainer of the Hyperledger Fabric project and has
contributed to its development since the project was first created. He specializes in
consensus and the ordering service, but has spent development time in most aspects
of the project, including chaincode lifecycle, channel configuration, and others. In
addition to development, Jason works with users who have deployed Fabric in the
field to resolve problems, and bring improvements and bug fixes back into the Fabric
codebase.
Table of Contents
Preface xvii
Chapter 1: Blockchain – An Enterprise and Industry Perspective 1
Our focus for the new edition 2
Defining the terms – what is blockchain? 3
Design considerations for blockchain solutions 5
Four core building blocks 6
Additional capabilities to consider 7
Fundamentals of the secure transaction processing protocol 8
Where blockchain technology has been and where it's going 10
The great divide 10
An economic model for blockchain delivery 11
Learning as we go 12
The promise of trust and accountability 13
Blockchain in the enterprise 13
What applications are a good fit? 14
Enterprise blockchain business evaluation considerations 16
A few thoughts on blockchain business models 16
Business growth and innovation 16
How do growth and innovation relate to a blockchain-powered network? 17
Considerations for evaluating the economic value of blockchain entities 18
Blockchain investment rubric 19
How does the enterprise view blockchain? 20
Integrating a blockchain infrastructure for the whole enterprise 21
Enterprise design principles 22
Business drivers and evolution 23
Ensuring the sustainability of blockchain-based business networks 24
Design principles that drive blockchain adoption 25
[ i ]
Table of Contents
Business considerations for choosing a blockchain framework 26
Technology considerations for choosing a blockchain framework 27
Identity management 28
Scalability 29
Enterprise security 29
Development tooling 29
Crypto-economic models 30
Decentralization with systemic governance 30
Enterprise support 30
Use case-driven pluggability choices 30
Shared ledger technology 31
Consensus 31
Crypto algorithms and encryption technology 32
Enterprise integration and designing for extensibility 32
Other considerations 34
Consensus, ACID properties, and CAP 34
Attestation – SSCs are signed and encrypted 35
Use of HSMs 36
Summary 36
References 37
Chapter 2: Exploring Hyperledger Fabric 39
Building on the foundations of open computing 40
Fundamentals of the Hyperledger project 41
The Linux Foundation 41
Hyperledger 41
Open source and open standards 41
Hyperledger frameworks, tools, and building blocks 44
Hyperledger distributed ledger frameworks 44
Hyperledger libraries 45
Hyperledger tools 46
The building blocks of blockchain solutions 46
Hyperledger Fabric component design 49
Principles of Hyperledger design 51
Hyperledger Fabric reference architecture 52
Hyperledger Fabric runtime architecture 54
Strengths and advantages of a componentized design 56
Hyperledger Fabric – the journey of a sample transaction 58
Actors and components in a Hyperledger Fabric network 61
Actors in a blockchain network 61
Components in a blockchain network 62
Developer interaction 64
[ ii ]
Table of Contents
CAP theorem 66
New features covered in this book 67
Summary 69
Chapter 3: Business Networks 71
A busy world of purposeful activity 73
Why a language for business networks? 73
Defining a business network 74
Introducing participants 75
Types of participant 75
Individual participants 76
Organizational participants 76
System or device participants 77
A participant is an agent 78
Participant identity 78
Introducing assets 79
Assets flow between participants 79
Tangible and intangible assets 80
The structure of assets 80
Ownership 82
A special kind of relationship 82
Ownership and asset tokenization 82
Asset life cycles 83
Describing a life cycle with transactions 84
Introducing transactions 85
Change and transactions 85
Transaction definition and instance 86
Implicit and explicit transactions 87
The importance of contracts 87
Signatures 88
Smart contract multi-party transactions 88
Digital transaction processing 89
Initiating transactions 89
Transaction history 89
Transaction streams 90
A network of networks 91
Current value and transaction history 91
A business network as a history of transactions 92
Regulators 93
Introducing events 93
A universal concept 94
Event notifications 94
[ iii ]