Distributed Computing to Blockchain: Architecture, Technology, and Applications 9780323961462

Distributed Computing to Blockchain: Architecture, Technology, and Applications provides researchers, computer scientist

1,451 216 37MB

English Pages 478 Year 2023

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Distributed Computing to Blockchain: Architecture, Technology, and Applications
 9780323961462

Table of contents :
Front Cover
Distributed Computing to Blockchain: Architecture, Technology, and Applications
Copyright
Contents
Contributors
Preface
Section A: Evolution of Distributed Systems
Section B: Blockchain Architecture and Security
Section C: Distributed Computing
Acknowledgments
Section A: Evolution of distributed systems
Chapter 1: Decentralized web, distributed ledgers, and build-up to blockchain
1. Introduction
1.1. The journey so far Web 1.0 - Web 2.0 - Web 3.0
2. Distributed ledgers (DLTs)
2.1. All distributed ledgers are not blockchain
2.2. Tangle
2.3. Hashgraphs
3. Blockchains
3.1. Blockchain: Historical background
3.2. What is a blockchain?
3.3. Blockchain structure
3.4. Blockchain transactions
3.5. Proof of work: Consensus
4. Types of blockchains
4.1. Permissionless blockchains
4.2. Permissioned blockchains
4.3. Consortium blockchains
4.4. Hybrid blockchains
5. Blockchain use cases
5.1. Blockchain 1.0
5.2. Blockchain 2.0
5.3. Blockchain 3.0
6. Limitations and challenges
7. Conclusion
References
Chapter 2: Decentralized everything: Practical use of blockchain technology in future applications
1. Introduction
1.1. Blockchain technology
1.2. Blockchain vs distributed ledger technology
1.3. Evolution of blockchain technology
Phase-I: Transactions (Blockchain 1.0)
Phase-II: Contracts (Blockchain 2.0)
Phase-III: Applications (Blockchain 3.0)
Phase-IV: Blockchain for Industry 4.0 applications (Blockchain 4.0)
2. Related work
2.1. History of Blockchain technology
3. Motivation
4. Connecting the world together
5. Services provided to end users-Application wise
6. Blockchain technology use cases and a way forward
7. Challenges in Blockchain technology
7.1. Storage capacity and scalability
7.2. Security: Weaknesses and threats
7.3. Anonymity and data privacy
7.4. Smart contracts
7.5. Legal issues
7.6. Consensus
8. Future applications with Blockchain technology
9. Problems faced in (by) decentralizing applications
10. Future research directions/a way forward towards decentralized applications
11. Conclusion
Appendix
References
Chapter 3: Distributed computing to blockchain: Architecture, technology, and applications
1. Introduction
2. Recent related works
2.1. Analysis of the application status of blockchain
2.2. Application and development trend of distributed computing in blockchain
3. Security of the distributed network model based on blockchain
3.1. Demand analysis of blockchain technology applied to distributed system
3.2. Analysis of the task allocation of blockchain technology
3.3. Privacy security analysis of blockchain-based distributed computing network model
3.4. Simulation evaluation
4. Results and discussion
4.1. Comparative analysis of system performance of models
4.2. Analysis of security performance of data transmission of each model
5. Conclusion
References
Chapter 4: Types of blockchain
1. Introduction
2. Literature review
3. Background study
3.1. Blockchain technology
3.2. Blockchain features
3.3. Challenges of blockchain
4. Blockchain technology and its history
5. Differentiating blockchain on network and operational parameters
5.1. Types of blockchain dependent on network access
Public blockchain
Benefits of public blockchain
Private blockchain
Disadvantages of a private blockchain
Consortium/federated blockchain
Benefits of consortium blockchain
Disadvantages of blockchain consortium
Use cases of consortium blockchain
Hybrid blockchain
Advantages of hybrid blockchain
Challenges of hybrid blockchain
Use cases of hybrid blockchain
5.2. Types of blockchain dependent on members
Permissionless blockchains
Attributes of permissionless blockchains
Benefits of permissionless blockchains
Disadvantages of permissionless blockchains
Use cases of permissionless blockchain
Permissioned blockchains
Attributes of permissioned blockchains
Benefits of permissioned blockchain
Disadvantages of permissioned blockchain
Use instances of permissioned blockchain
6. Comparison of various blockchain types
7. Future work
8. Conclusion
References
Chapter 5: Blockchain types: A characteristic view
1. Introduction
2. Blockchain
2.1. Blockchain technology: A peer-to-peer network of nodes
2.2. Blockchain technology: Asymmetric key cryptography and hashing
2.3. Characteristics of blockchain
2.4. Advantages and disadvantages of blockchain
3. General classification of blockchain
3.1. Public blockchain
Advantages
3.2. Private blockchain
Advantages and disadvantages of private blockchain
3.3. Consortium blockchain
Advantages of consortium blockchain
Consortium blockchain technology versus private blockchain technology: The comparison
3.4. Hybrid blockchain
Advantages of hybrid blockchain
Consortium blockchain technology versus hybrid blockchain technology: The comparison
Diverse use cases for hybrid blockchain
3.5. Public blockchain versus private blockchain versus consortium blockchain: The comparison
3.6. Applications
4. Other classification of blockchain
4.1. Public permissionless blockchain network
4.2. Public permissioned blockchain network
4.3. Private permissionless blockchain network
Holochain
4.4. Private permissioned blockchain network
5. Consensus mechanisms
5.1. Proof of work
5.2. Proof of stake
5.3. Proof of capacity
6. Conclusion
References
Chapter 6: DApps: Decentralized applications for blockchains
1. Introduction
1.1. Distributed versus decentralized systems
2. Decentralized applications (DApps)
2.1. Centralized apps versus decentralized apps: Design paradigm
2.2. Ethereum
2.3. Ethereum building blocks
Smart contracts
Solidity for Ethereum smart contracts
3. Building DApps
3.1. DApps: A functional flow
3.2. Increasing read efficiency for DApps: The graph
3.3. Scalability of DApps: Driving throughput of transactions per second
3.4. DApps: Development frameworks
Truffle: Beginners DApp framework
Hardhat DApp framework: An overview
4. Conclusion
References
Chapter 7: Analyzing information flow in solidity smart contracts
1. Introduction
2. Related work
3. Background
3.1. Blockchain technology [1]
3.2. Solidity smart contracts [4, 5]
3.3. Language-based information flow security [10, 11]
3.4. Data-flow analysis [43]
4. Solidity language: Syntax and semantics
4.1. Solidity syntax
4.2. Concrete semantics
Semantic domains
Environments and states
Semantics
(1) Expressions
(2) Local variable declaration
(3) Assignment statement
(4) Sequence
(5) Conditional
(6) Iteration
(7) State variable declaration
(8) Constructor
(9) Function
(10) Smart contract
5. Formal dependency analysis of solidity smart contracts
5.1. Abstract domain: Pos [45-47]
5.2. Abstract semantics
(1) Assignment statement
(2) Sequence
(3) Conditional
(4) Iteration
(5) Constructor
(6) Function
(7) Smart contract
6. Confidentiality and integrity properties verification
7. Refining analysis by combining numerical abstract domains
7.1. Relational and nonrelational abstract domains
Intervals [50, 52]
Octagons [55]
Polyhedra [53, 56]
7.2. The reduced product
8. Conclusion
References
Chapter 8: Formal verification and code generation for solidity smart contracts
1. Introduction
2. Related work
3. Background
3.1. Event-B modeling framework
Modeling actions over states
Refinement
Rodin
Applications
3.2. Solidity
Solidity types, special functions, and variables
Function modifiers
4. Formal framework for Solidity smart contracts
5. EB2Sol: Event-B to Solidity
5.1. Preprocessing and generated POs
5.2. Translation of Event-B to Solidity
Context models
Machine models
6. Case study
6.1. Informal description of smart purchase
6.2. Formal development
Context model
Machine model
Model validation and analysis
6.3. Code generation in Solidity
7. Discussion
7.1. Benefits
Progressive development of smart contracts
Improving smart contract error detection
Minimizing smart contract development cost
7.2. Limitations
Need careful analysis in modeling and implementation
Need powerful theorem provers for smart contracts
No standard in the generated smart contracts
8. Conclusions
References
Chapter 9: Blockchain consensus algorithms: Past, present, and future trends
1. Introduction
2. Proof-based consensus algorithms
2.1. Proof of work (PoW)
2.2. Proof of stake (PoS)
2.3. Proof of elapsed time (PoET)
2.4. Proof of weight (PoWeight)
2.5. Proof of burn (PoB)
2.6. Proof of capacity (PoC)
2.7. Proof of importance (PoI)
2.8. Proof of activity (PoA)
3. Voting-based consensus algorithms
3.1. Delegated proof of stake
3.2. Paxos
3.3. Practical byzantine fault tolerance (PBFT)
3.4. Delegated byzantine fault tolerance (DBFT)
3.5. Istanbul byzantine fault tolerance (IBFT)
3.6. BFT-SMaRT protocol
3.7. Verifiable byzantine fault tolerance (VBFT)
3.8. Tendermint consensus
3.9. Raft algorithm
3.10. Ripple protocol consensus algorithm (RPCA)
4. DAG-based consensus algorithms
4.1. Tangle
4.2. Hashgraph
5. Comparative evaluation and future trends of consensus algorithms
6. Conclusions
References
Chapter 10: A systematic study on the development of decentralized application (dApp)
1. Introduction
1.1. Background
DApp features
Benefits of dApp
Examples of dApp
DApp types
Working principle of App vs. dApp
1.2. Problem statement
1.3. DApp development steps
DApp development tools
1.4. DApp development result and discussion
Results
2. Implication
3. Conclusion
References
Chapter 11: AI, IoT, blockchain, and cloud computing: The necessity of the future
1. Introduction: AI+IoT+blockchain+cloud computing
2. Background of AI, IoT, blockchain and cloud computing
3. Application scenarios in the near future
3.1. The integration of IoT devices into CPS
3.2. The role of IoT devices in Industry 4.0
3.3. Co-operative robotics: The integration of AI and IoT
3.4. Smart city applications: The connection of billions of things
3.5. Smart grid and other energy domains
3.6. Machine learning
3.7. 5G and beyond 6G enabling technologies
3.8. Transportation
3.9. Smart agriculture
3.10. Weather forecasting
3.11. Cyber security
3.12. Smart healthcare system: The connection of IoNT and IoMT
4. Summary of major works
5. Research gaps in each applications
6. Future research directions toward the integration of AI-IoT-blockchain-based cloud systems
7. Conclusions
References
Chapter 12: Functional analysis of blockchain consensus algorithms
1. Introduction
1.1. Immutability
How is immutability achieved
1.2. Censorship resistance
1.3. Peer-to-peer (P2P) network
P2P network in blockchain
2. Consensus
2.1. Consensus taxonomy
Structural properties
Block and reward properties
Security properties
Performance properties
3. Proof of work (PoW)
3.1. Compute-bound PoW
3.2. Memory-bound PoW
3.3. Chained PoW
3.4. Why PoW
3.5. Limitations of PoW
4. Proof of stake (PoS)
4.1. Various properties of PoS
4.2. Types of PoS
Chained PoS
BFT PoS
DPoS
4.3. PoSs limitations
5. Proof of contribution
5.1. Consensus mechanism in PoC
5.2. The consensus process
Receiving transactions
Judging the block generation threshold
Generating the new block
Receiving and verifying the new block
Determining the bookkeeping node
6. Blockchain to IP protection
7. Proof of service power in cloud manufacturing
7.1. Consensus mechanism for proof of service power
7.2. Calculation method of service power
8. A lightweight blockchain consensus mechanism
9. PBFT
9.1. Voting-based primary node election strategy
10. Summary
References
Section B: Blockchain architecture and security
Chapter 13: Blockchain and forensics
1. Introduction
2. Wallets
3. Why wallets for forensics?
4. Wallet import format (WIF)
5. Information inside blocks of blockchain
6. Lets check the genesis block
7. Reading from a genesis.dat file
8. Deriving bitcoin address from a block
9. Understanding mempool
10. Information from addresses
11. Opensource tools in cryptocurrency blockchain forensics
12. Information about an address
13. Summary recommendations for investigators
14. Conclusion
References
Chapter 14: Cryptography in blockchain
1. Introduction
2. Set/group/field/order/prime fields
3. Cryptography
4. Role and function of cryptography
5. Symmetric and asymmetric cryptography
5.1. Symmetric cryptography
5.2. Data encryption standard
5.3. Advanced encryption standard (AES)
5.4. Checking on a Linux terminal: AES
5.5. Asymmetric cryptography
6. Elliptic curve cryptography (ECC)
6.1. How the public-private keys generate in ECC?
6.2. Checking on a Linux terminal: ECC
7. Digital signatures
8. Hash functions
8.1. Hash characteristics
8.2. Popular hash functions in blockchains
9. Deriving a bitcoin blockchain address
10. Future blockchain systems
11. Conclusion
References
Chapter 15: Ethereum blockchain platform
1. Introduction
2. Ethereum
2.1. Advantages and disadvantages
2.2. Ether
2.3. Examples of real applications of Ethereum
3. Fundamental concepts
3.1. Consensus algorithm
3.2. Smart contracts
3.3. DApps
3.4. DApps vs. smart contracts
4. Tools
5. Simulating a real environment with Ethereum
6. Ethereums future
6.1. Ethereum 1.0 vs. Ethereum 2.0
6.2. Problems solved with Ethereum 2.0
6.3. Implementation phases
6.4. Ethereum 2.0 impact
7. Conclusions
References
Chapter 16: Hyperledger Fabric blockchain platform
1. Introduction
2. Hyperledger Fabric
3. Use cases
3.1. Trade financing and business
3.2. Education
3.3. Supply chain
4. Tutorials
4.1. Test network
4.2. Fabric CA operations guide
5. Conclusions
References
Chapter 17: An in-depth look at blockchain technology: Architecture and security concerns
1. Introduction
1.1. Background
2. Problem statement
2.1. Blockchain technology
Blockchain components
Blocks
Creation of blocks
Prerequisites for Ethereum
Account creation
Creation of Genesis file
Data directory instantiation
Starting of Ethereum private network
Prerequisites for Node.js
Block creation
Genesis block
2.2. Byzantine general problem
Consensus
Chain validation
Chain replacement
Mining
Mining system
CPU
GPU
ASICs
Proof of work
2.3. Digital assets
Cryptocurrency
Token
Types of token
Initial coin offering/initial token offering (ICO/ITO)
Smart contract
Development environment for smart contract
Programming language
2.4. Blockchain security
Data structure level security
Decentralized identifier
Transaction level security
3. Implication
References
Chapter 18: Blockchain-based IoT security solutions
1. Introduction
2. Internet of Things (IoT)
2.1. REST: Internet of Things
2.2. CoAP (constrained application protocol)
2.3. CoAP messages model
2.4. CoAP exhibits the following structural vulnerabilities
2.5. MQTT (constrained application protocol)
2.6. Need for blockchain in IoT solutions
3. Blockchain
3.1. Properties of blockchain
3.2. Components of a blockchain architecture
3.3. Blockchain security
3.4. Cryptographic protocols and primitives
Elliptic curve cryptography
ECDSA
Zero-knowledge proofs
Random oracle model
Group signature
Ring signatures
3.5. IoT and its integration with blockchain
3.6. IoT blockchain platform architecture
IoT blockchain platform conceptual architecture
Application layer
Internet of Things (IoT) server
Cloud data storage
User client
Protocols of communication
Internet of Things (IoT) and blockchain security
Data authentication and integrity
Authentication, authorization, and privacy
Secure communications
4. Conclusion
References
Further reading
Chapter 19: Cryptoeconomics
1. Introduction
1.1. Evolution of blockchain
1.2. Concepts related to cryptography and economics
1.3. Financial market structures and blockchain
2. Initial coin offering (ICO)
3. Future of blockchain
References
Section C: Distributed computing
Chapter 20: Distributed databases and distributed operating systems for blockchain
1. Introduction
2. Distributed system
3. Distributed database system
3.1. Rules of distributed database system
4. Distributed ledger technology (DLT) being part of distributed systems
4.1. Understanding distributed ledgers
4.2. Advantages of distributed ledgers
Practical application of distributed ledgers
5. Blockchain and distributed system
5.1. Difference between distributed database and blockchain
5.2. Drawbacks of distributed computing in blockchain environment
6. Distributed operating system and blockchain
6.1. Distributed operating system for blockchain
6.2. Hyperledger fabric
Architecture of fabric
Working principle of fabric
Transaction flow in fabric
Endorsement policy
Security in fabric
Shortcoming of existing fabric architecture
Difference between fabric and parallel database system
7. Conclusion
References
Chapter 21: Demystifying blockchain adoption in financial sector-A critical analysis
1. Background
1.1. Existing perspective on blockchain
1.2. Blockchain implementation in financial services
2. Methodology
3. Acceptability of blockchain in FinTech-Google search intensity (SVI)
3.1. SVI of financial technology
3.2. SVI of blockchain technology
3.3. Compared SVIs of financial and blockchain technology
4. Finance sector with and without blockchain technology
5. Adaptability and usage of blockchain technology in financial services
5.1. Global payments and remittances
5.2. Mortgage claims and processing
5.3. Trade finance
5.4. Insurance claims
5.5. Regulatory compliance
6. Benefits of integrating blockchain technology and financial services
7. Risks and challenges of incorporating blockchain technology in financial services
8. Critically demystifying blockchain adoption in financial sector
9. Future agenda
10. Conclusion
References
Further reading
Chapter 22: e-Governance and blockchain-based data supply chain for used cars
1. Introduction
2. Literature review
3. Research process
3.1. Targeting application area
3.2. Essential questions
3.3. Research method
4. Implementation of field validation
4.1. Business case
4.2. Two-level smart contract
4.3. Process design
4.4. Consortium blockchain platform
4.5. Layered architecture
5. Lessons learned and challenges
6. Conclusion
References
Chapter 23: Emerging trends of blockchain in bioinformatics: A revolution in health care
1. Introduction
2. Blockchain
2.1. Role of blockchain in life sciences
2.2. Blockchain in COVID-19
3. Bioinformatics
3.1. Bioinformatics and biological databases
3.2. Potential role of blockchain technology in bioinformatics
4. Genomic big data
4.1. Challenges in genomics
4.2. Potential of blockchain technologies in genomics
4.3. Storing and analyzing a genome on a blockchain
4.4. Next-generation bioinformatics using blockchain technology
5. Blockchain applications in bioinformatics
6. Blockchain in the health-care industry
7. Blockchain technology changing traditional methods of applied research in bioinformatics
8. Blockchain: A critical analysis of challenges and opportunities
9. Future of blockchain
References
Chapter 24: Blockchains potential to rescue sports: A social media perspective
1. Introduction
2. Theoretical background
3. Methodology
3.1. Data collection
3.2. Algorithmic evaluation
4. Results
4.1. Sentiment analysis
5. Discussion
5.1. Theoretical implications
5.2. Practical implications
5.3. Limitations and future scope of research
6. Concluding remarks
References
Chapter 25: Design and development of a mobile application for level monitoring of oxygen cylinders using block chain tec ...
1. Introduction
2. Literature review
2.1. International status
2.2. National status
3. Importance of the proposed work
3.1. Gaps identified
3.2. Novelty
4. Objectives
5. Methodology
6. Development and discussions
7. Conclusion
References
Chapter 26: A futuristic approach to decentralize and authenticate workplace safety records leveraging on blockchain dist ...
1. Introduction
2. Fundamental principles of blockchain technology
3. Workplace safety and health issues
4. Workplace safety records
5. Leveraging on blockchain network for managing workplace safety records
6. Limitations
7. Conclusion
References
Chapter 27: Designing business models through blockchain: A process of value creation
1. Introduction
2. What is blockchain technology?
3. Business models
3.1. Blockchain-based business models
3.2. Smart contracts
3.3. Business value
3.4. Partner value and permissioned blockchain
4. User value through blockchain
5. Blockchain-based business models-Industry use cases
5.1. Challenges and limitations in blockchain-based business models
6. Discussion and critical analysis
7. Conclusion
References
Index
Back Cover

Citation preview

Distributed Computing to Blockchain

This page intentionally left blank

Distributed Computing to Blockchain Architecture, Technology, and Applications

Edited by Rajiv Pandey Amity Institute of Information Technology, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India

Sam Goundar School of Science, Engineering and Technology, RMIT University, Hanoi, Vietnam

Shahnaz Fatima Amity Institute of Information Technology, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India

Academic Press is an imprint of Elsevier 125 London Wall, London EC2Y 5AS, United Kingdom 525 B Street, Suite 1650, San Diego, CA 92101, United States 50 Hampshire Street, 5th Floor, Cambridge, MA 02139, United States The Boulevard, Langford Lane, Kidlington, Oxford OX5 1GB, United Kingdom Copyright © 2023 Elsevier Inc. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or any information storage and retrieval system, without permission in writing from the publisher. Details on how to seek permission, further information about the Publisher’s permissions policies and our arrangements with organizations such as the Copyright Clearance Center and the Copyright Licensing Agency, can be found at our website: www.elsevier.com/permissions. This book and the individual contributions contained in it are protected under copyright by the Publisher (other than as may be noted herein). Notices Knowledge and best practice in this field are constantly changing. As new research and experience broaden our understanding, changes in research methods, professional practices, or medical treatment may become necessary. Practitioners and researchers must always rely on their own experience and knowledge in evaluating and using any information, methods, compounds, or experiments described herein. In using such information or methods they should be mindful of their own safety and the safety of others, including parties for whom they have a professional responsibility. To the fullest extent of the law, neither the Publisher nor the authors, contributors, or editors, assume any liability for any injury and/or damage to persons or property as a matter of products liability, negligence or otherwise, or from any use or operation of any methods, products, instructions, or ideas contained in the material herein. ISBN 978-0-323-96146-2 For information on all Academic Press publications visit our website at https://www.elsevier.com/books-and-journals

Publisher: Mara Conner Acquisitions Editor: Chris Katsaropoulos Editorial Project Manager: John Leonard Production Project Manager: Punithavathy Govindaradjane Cover Designer: Mark Rogers Typeset by STRAIVE, India

Contents Contributors Preface Acknowledgments

xiii xv xix

2. Decentralized everything: Practical use of blockchain technology in future applications Amit Kumar Tyagi 1.

Section A Evolution of distributed systems 1. Decentralized web, distributed ledgers, and build-up to blockchain Harjot Singh 1. Introduction 1.1 The journey so far Web 1.0 -> Web 2.0 -> Web 3.0 2. Distributed ledgers (DLTs) 2.1 All distributed ledgers are not blockchain 2.2 Tangle 2.3 Hashgraphs 3. Blockchains 3.1 Blockchain: Historical background 3.2 What is a blockchain? 3.3 Blockchain structure 3.4 Blockchain transactions 3.5 Proof of work: Consensus 4. Types of blockchains 4.1 Permissionless blockchains 4.2 Permissioned blockchains 4.3 Consortium blockchains 4.4 Hybrid blockchains 5. Blockchain use cases 5.1 Blockchain 1.0 5.2 Blockchain 2.0 5.3 Blockchain 3.0 6. Limitations and challenges 7. Conclusion References

3 3 6 6 7 7 8 8 9 9 9 9 10 10 11 12 13 13 14 15 15 16 17 17

Introduction 1.1 Blockchain technology 1.2 Blockchain vs distributed ledger technology 1.3 Evolution of blockchain technology 2. Related work 2.1 History of Blockchain technology 3. Motivation 4. Connecting the world together 5. Services provided to end users— Application wise 6. Blockchain technology use cases and a way forward 7. Challenges in Blockchain technology 7.1 Storage capacity and scalability 7.2 Security: Weaknesses and threats 7.3 Anonymity and data privacy 7.4 Smart contracts 7.5 Legal issues 7.6 Consensus 8. Future applications with Blockchain technology 9. Problems faced in (by) decentralizing applications 10. Future research directions/a way forward towards decentralized applications 11. Conclusion Appendix Competing interests Authors contribution Acknowledgments References

19 19 20 20 21 21 23 23 23 26 29 29 29 30 31 32 33 33 33 34 34 34 36 36 37 37

v

vi

Contents

3. Distributed computing to blockchain: Architecture, technology, and applications

5. Blockchain types: A characteristic view Rajat Verma and Namrata Dhanda

Zhihan Lv, Jingyi Wu, Dongliang Chen, and Annn Jia Gander 1. Introduction 2. Recent related works 2.1 Analysis of the application status of blockchain 2.2 Application and development trend of distributed computing in blockchain 3. Security of the distributed network model based on blockchain 3.1 Demand analysis of blockchain technology applied to distributed system 3.2 Analysis of the task allocation of blockchain technology 3.3 Privacy security analysis of blockchain-based distributed computing network model 3.4 Simulation evaluation 4. Results and discussion 4.1 Comparative analysis of system performance of models 4.2 Analysis of security performance of data transmission of each model 5. Conclusion Acknowledgment References

39 40 40 40 41 41 41 47 48 49 49 51 53 53 53

4. Types of blockchain Sana Zeba, Preetam Suman, and Kanishka Tyagi 1. Introduction 2. Literature review 3. Background study 3.1 Blockchain technology 3.2 Blockchain features 3.3 Challenges of blockchain 4. Blockchain technology and its history 5. Differentiating blockchain on network and operational parameters 5.1 Types of blockchain dependent on network access 5.2 Types of blockchain dependent on members 6. Comparison of various blockchain types 7. Future work 8. Conclusion References

55 55 56 56 57 58 60 61 61 64 66 67 67 67

1. Introduction 2. Blockchain 2.1 Blockchain technology: A peer-topeer network of nodes 2.2 Blockchain technology: Asymmetric key cryptography and hashing 2.3 Characteristics of blockchain 2.4 Advantages and disadvantages of blockchain 3. General classification of blockchain 3.1 Public blockchain 3.2 Private blockchain 3.3 Consortium blockchain 3.4 Hybrid blockchain 3.5 Public blockchain versus private blockchain versus consortium blockchain: The comparison 3.6 Applications 4. Other classification of blockchain 4.1 Public permissionless blockchain network 4.2 Public permissioned blockchain network 4.3 Private permissionless blockchain network 4.4 Private permissioned blockchain network 5. Consensus mechanisms 5.1 Proof of work 5.2 Proof of stake 5.3 Proof of capacity 6. Conclusion References

69 70 70 71 71 72 72 73 73 74 75 76 76 77 77 78 78 78 79 79 79 79 80 80

6. DApps: Decentralized applications for blockchains Harjot Singh 1. Introduction 1.1 Distributed versus decentralized systems 2. Decentralized applications (DApps) 2.1 Centralized apps versus decentralized apps: Design paradigm 2.2 Ethereum 2.3 Ethereum building blocks 3. Building DApps 3.1 DApps: A functional flow 3.2 Increasing read efficiency for DApps: The graph

87 87 89 89 90 93 95 95 98

Contents vii

3.3 Scalability of DApps: Driving throughput of transactions per second 3.4 DApps: Development frameworks 4. Conclusion References

99 101 104 104

7. Analyzing information flow in solidity smart contracts Raju Halder, Md. Imran Alam, Akshay M. Fajge, Neeraj Kumar Singh, and Agostino Cortesi 1. Introduction 2. Related work 3. Background 3.1 Blockchain technology 3.2 Solidity smart contracts 3.3 Language-based information flow security 3.4 Data-flow analysis 4. Solidity language: Syntax and semantics 4.1 Solidity syntax 4.2 Concrete semantics 5. Formal dependency analysis of solidity smart contracts 5.1 Abstract domain: Pos 5.2 Abstract semantics 6. Confidentiality and integrity properties verification 7. Refining analysis by combining numerical abstract domains 7.1 Relational and nonrelational abstract domains 7.2 The reduced product 8. Conclusion Acknowledgment References

105 106 107 107 107 108 109 111 111 111 114 115 115 116 118 118 120 121 121 121

8. Formal verification and code generation for solidity smart contracts Neeraj Kumar Singh, Akshay M. Fajge, Raju Halder, and Md. Imran Alam 1. Introduction 2. Related work 3. Background 3.1 Event-B modeling framework 3.2 Solidity 4. Formal framework for Solidity smart contracts

125 126 126 126 129 130

5. EB2Sol: Event-B to Solidity 5.1 Preprocessing and generated POs 5.2 Translation of Event-B to Solidity 6. Case study 6.1 Informal description of smart purchase 6.2 Formal development 6.3 Code generation in Solidity 7. Discussion 7.1 Benefits 7.2 Limitations 8. Conclusions References

132 132 133 136 136 137 139 141 141 141 142 142

9. Blockchain consensus algorithms: Past, present, and future trends Nasim Nezhadsistani, Seyed Mojtaba Hosseini Bamakan, and Naghmeh Sadat Moayedian 1. Introduction 2. Proof-based consensus algorithms 2.1 Proof of work (PoW) 2.2 Proof of stake (PoS) 2.3 Proof of elapsed time (PoET) 2.4 Proof of weight (PoWeight) 2.5 Proof of burn (PoB) 2.6 Proof of capacity (PoC) 2.7 Proof of importance (PoI) 2.8 Proof of activity (PoA) 3. Voting-based consensus algorithms 3.1 Delegated proof of stake 3.2 Paxos 3.3 Practical byzantine fault tolerance (PBFT) 3.4 Delegated byzantine fault tolerance (DBFT) 3.5 Istanbul byzantine fault tolerance (IBFT) 3.6 BFT-SMaRT protocol 3.7 Verifiable byzantine fault tolerance (VBFT) 3.8 Tendermint consensus 3.9 Raft algorithm 3.10 Ripple protocol consensus algorithm (RPCA) 4. DAG-based consensus algorithms 4.1 Tangle 4.2 Hashgraph 5. Comparative evaluation and future trends of consensus algorithms 6. Conclusions References

145 146 146 148 149 150 150 151 152 152 154 154 154 155 158 159 161 162 163 164 165 166 166 167 167 170 170

viii

Contents

10. A systematic study on the development of decentralized application (dApp)

12. Functional analysis of blockchain consensus algorithms Rajiv Pandey, Mohd Sarfaraz Faiyaz, Gurudev Singh, and Zafar Uddin

Ananya Banerjee 1. Introduction 1.1 Background 1.2 Problem statement 1.3 DApp development steps 1.4 DApp development result and discussion 2. Implication 3. Conclusion References

173 173 179 179 180 185 187 187

11. AI, IoT, blockchain, and cloud computing: The necessity of the future Meghna Manoj Nair and Amit Kumar Tyagi 1. Introduction: AI + IoT + blockchain + cloud computing 2. Background of AI, IoT, blockchain and cloud computing 3. Application scenarios in the near future 3.1 The integration of IoT devices into CPS 3.2 The role of IoT devices in Industry 4.0 3.3 Co-operative robotics: The integration of AI and IoT 3.4 Smart city applications: The connection of billions of things 3.5 Smart grid and other energy domains 3.6 Machine learning 3.7 5G and beyond 6G enabling technologies 3.8 Transportation 3.9 Smart agriculture 3.10 Weather forecasting 3.11 Cyber security 3.12 Smart healthcare system: The connection of IoNT and IoMT 4. Summary of major works 5. Research gaps in each applications 6. Future research directions toward the integration of AI-IoT-blockchain-based cloud systems 7. Conclusions Acknowledgment Conflict of interest References

189 190 190 192 193 193 194 195 195 196 196 197 198 199 200 201 203 204 205 205 205 205

1.

Introduction 1.1 Immutability 1.2 Censorship resistance 1.3 Peer-to-peer (P2P) network 2. Consensus 2.1 Consensus taxonomy 3. Proof of work (PoW) 3.1 Compute-bound PoW 3.2 Memory-bound PoW 3.3 Chained PoW 3.4 Why PoW 3.5 Limitations of PoW 4. Proof of stake (PoS) 4.1 Various properties of PoS 4.2 Types of PoS 4.3 PoS’s limitations 5. Proof of contribution 5.1 Consensus mechanism in PoC 5.2 The consensus process 6. Blockchain to IP protection 7. Proof of service power in cloud manufacturing 7.1 Consensus mechanism for proof of service power 7.2 Calculation method of service power 8. A lightweight blockchain consensus mechanism 9. PBFT 9.1 Voting-based primary node election strategy 10. Summary References

207 208 209 209 210 211 215 216 217 217 217 218 219 219 220 221 222 223 224 224 225 226 227 228 229 229 230 231

Section B Blockchain architecture and security 13. Blockchain and forensics Anupam Tiwari 1. 2. 3. 4. 5.

Introduction Wallets Why wallets for forensics? Wallet import format (WIF) Information inside blocks of blockchain

237 237 239 240 241

Contents

6. 7. 8.

Let’s check the genesis block Reading from a genesis.dat file Deriving bitcoin address from a block 9. Understanding mempool 10. Information from addresses 11. Opensource tools in cryptocurrency blockchain forensics 12. Information about an address 13. Summary recommendations for investigators 14. Conclusion References

241 242 244 245 246 247 248 248 250 250

14. Cryptography in blockchain Anupam Tiwari 1. 2. 3. 4. 5.

Introduction Set/group/field/order/prime fields Cryptography Role and function of cryptography Symmetric and asymmetric cryptography 5.1 Symmetric cryptography 5.2 Data encryption standard 5.3 Advanced encryption standard (AES) 5.4 Checking on a Linux terminal: AES 5.5 Asymmetric cryptography 6. Elliptic curve cryptography (ECC) 6.1 How the public-private keys generate in ECC? 6.2 Checking on a Linux terminal: ECC 7. Digital signatures 8. Hash functions 8.1 Hash characteristics 8.2 Popular hash functions in blockchains 9. Deriving a bitcoin blockchain address 10. Future blockchain systems 11. Conclusion References

251 251 251 252 252 252 253 253 254 254 255 256 259 259 260 260 262 263 264 264 264

15. Ethereum blockchain platform Jesu´s Rosa-Bilbao and Juan Boubeta-Puig 1. Introduction 2. Ethereum 2.1 Advantages and disadvantages 2.2 Ether 2.3 Examples of real applications of Ethereum

267 267 268 268 269

3. Fundamental concepts 3.1 Consensus algorithm 3.2 Smart contracts 3.3 DApps 3.4 DApps vs. smart contracts 4. Tools 5. Simulating a real environment with Ethereum 6. Ethereum’s future 6.1 Ethereum 1.0 vs. Ethereum 2.0 6.2 Problems solved with Ethereum 2.0 6.3 Implementation phases 6.4 Ethereum 2.0 impact 7. Conclusions Acknowledgments References

ix

269 269 270 270 270 270 271 279 280 280 280 281 281 281 281

16. Hyperledger Fabric blockchain platform Marı´a J. Peregrina-P erez, Jesu´s LagaresGala´n, and Juan Boubeta-Puig 1. Introduction 2. Hyperledger Fabric 3. Use cases 3.1 Trade financing and business 3.2 Education 3.3 Supply chain 4. Tutorials 4.1 Test network 4.2 Fabric CA operations guide 5. Conclusions Acknowledgments References

283 283 284 284 284 284 284 285 288 294 294 295

17. An in-depth look at blockchain technology: Architecture and security concerns Ananya Banerjee 1. Introduction 1.1 Background 2. Problem statement 2.1 Blockchain technology 2.2 Byzantine general problem 2.3 Digital assets Smart contract 2.4 Blockchain security 3. Implication References

297 297 299 299 311 317 319 322 324 324

x Contents

18. Blockchain-based IoT security solutions Sandeep Srivastava, Brijesh Kumar Chaurasia, and Deepak Singh 1. Introduction 2. Internet of Things (IoT) 2.1 REST: Internet of Things 2.2 CoAP (constrained application protocol) 2.3 CoAP messages model 2.4 CoAP exhibits the following structural vulnerabilities 2.5 MQTT (constrained application protocol) 2.6 Need for blockchain in IoT solutions 3. Blockchain 3.1 Properties of blockchain 3.2 Components of a blockchain architecture 3.3 Blockchain security 3.4 Cryptographic protocols and primitives 3.5 IoT and its integration with blockchain 3.6 IoT blockchain platform architecture 4. Conclusion References Further reading

327 327 328 328 329 329 330 331 331 331

333 333

356 357 357 357 358 358 360 360 360 361 364 364

21. Demystifying blockchain adoption in financial sector—A critical analysis Shruti Singh and Anindita Chakraborty

336 338 338 339

1.

2. 3.

Malobika Bose and Naela Jamal Rushdi 341 341 343 349 350 351 352

4. 5.

Section C Distributed computing 20. Distributed databases and distributed operating systems for blockchain

6. 7.

Deepa Pavithran, Charles Shibu, Munavwar Shaikh, and Enrico Angeles 1. Introduction 2. Distributed system

356

332 333

19. Cryptoeconomics 1. Introduction 1.1 Evolution of blockchain 1.2 Concepts related to cryptography and economics 1.3 Financial market structures and blockchain 2. Initial coin offering (ICO) 3. Future of blockchain References

3. Distributed database system 3.1 Rules of distributed database system 4. Distributed ledger technology (DLT) being part of distributed systems 4.1 Understanding distributed ledgers 4.2 Advantages of distributed ledgers 5. Blockchain and distributed system 5.1 Difference between distributed database and blockchain 5.2 Drawbacks of distributed computing in blockchain environment 6. Distributed operating system and blockchain 6.1 Distributed operating system for blockchain 6.2 Hyperledger fabric 7. Conclusion References

355 355

8.

Background 1.1 Existing perspective on blockchain 1.2 Blockchain implementation in financial services Methodology Acceptability of blockchain in FinTech— Google search intensity (SVI) 3.1 SVI of financial technology 3.2 SVI of blockchain technology 3.3 Compared SVI’s of financial and blockchain technology Finance sector with and without blockchain technology Adaptability and usage of blockchain technology in financial services 5.1 Global payments and remittances 5.2 Mortgage claims and processing 5.3 Trade finance 5.4 Insurance claims 5.5 Regulatory compliance Benefits of integrating blockchain technology and financial services Risks and challenges of incorporating blockchain technology in financial services Critically demystifying blockchain adoption in financial sector

367 367 368 369 369 369 370 370 370 370 371 371 372 372 372 372 373 373

Contents

9. Future agenda 10. Conclusion References Further reading

373 374 374 375

22. e-Governance and blockchain-based data supply chain for used cars Gwang Seok Kim and Sam Goundar 1. Introduction 2. Literature review 3. Research process 3.1 Targeting application area 3.2 Essential questions 3.3 Research method 4. Implementation of field validation 4.1 Business case 4.2 Two-level smart contract 4.3 Process design 4.4 Consortium blockchain platform 4.5 Layered architecture 5. Lessons learned and challenges 6. Conclusion References

377 378 379 379 380 381 382 382 382 383 383 384 385 386 386

23. Emerging trends of blockchain in bioinformatics: A revolution in health care Arpita Balakrishnan, Poonam Jaglan, Saksham Selly, Veronica Kumar, and Neetu Jabalia 1. Introduction 2. Blockchain 2.1 Role of blockchain in life sciences 2.2 Blockchain in COVID-19 3. Bioinformatics 3.1 Bioinformatics and biological databases 3.2 Potential role of blockchain technology in bioinformatics 4. Genomic big data 4.1 Challenges in genomics 4.2 Potential of blockchain technologies in genomics 4.3 Storing and analyzing a genome on a blockchain 4.4 Next-generation bioinformatics using blockchain technology

389 390 390 391 392 392 393 394 394 395 395 396

5. Blockchain applications in bioinformatics 6. Blockchain in the health-care industry 7. Blockchain technology changing traditional methods of applied research in bioinformatics 8. Blockchain: A critical analysis of challenges and opportunities 9. Future of blockchain References

xi

396 397 398 399 399 401

24. Blockchain’s potential to rescue sports: A social media perspective Jitendra Yadav, Madhvendra Misra, Nripendra P. Rana, Kuldeep Singh, and Sam Goundar 1. Introduction 2. Theoretical background 3. Methodology 3.1 Data collection 3.2 Algorithmic evaluation 4. Results 4.1 Sentiment analysis 5. Discussion 5.1 Theoretical implications 5.2 Practical implications 5.3 Limitations and future scope of research 6. Concluding remarks References

405 406 407 407 407 407 407 410 411 412 412 412 412

25. Design and development of a mobile application for level monitoring of oxygen cylinders using block chain technology K. Sujatha, T. Kavitha, N.P.G. Bhavani, C. Tamilselvi, K. Senthil Kumar, U. Jayalatsumi, V. Srividhya, and B. Rengammal Sankari 1. Introduction 2. Literature review 2.1 International status 2.2 National status 3. Importance of the proposed work 3.1 Gaps identified 3.2 Novelty

415 416 416 417 417 417 417

xii Contents

4. Objectives 5. Methodology 6. Development and discussions 7. Conclusion References

418 418 419 424 424

27. Designing business models through blockchain: A process of value creation Arvind Deshmukh and Neelam Saxena 1. Introduction 2. What is blockchain technology? 3. Business models 3.1 Blockchain-based business models 3.2 Smart contracts 3.3 Business value 3.4 Partner value and permissioned blockchain 4. User value through blockchain 5. Blockchain-based business models—Industry use cases 5.1 Challenges and limitations in blockchain-based business models 6. Discussion and critical analysis 7. Conclusion References

26. A futuristic approach to decentralize and authenticate workplace safety records leveraging on blockchain distributed ledger network Chiang Liang Kok and Kavitha Palaniappan 1. Introduction 2. Fundamental principles of blockchain technology 3. Workplace safety and health issues 4. Workplace safety records 5. Leveraging on blockchain network for managing workplace safety records 6. Limitations 7. Conclusion References

425 425 426 427 428 430 430 430

Index

433 433 434 436 436 436 437 437 438 439 440 441 441

445

Contributors Numbers in parentheses indicate the pages on which the authors’ contributions begin

Md. Imran Alam (105, 125), Indian Institute of Technology Patna, Patna, Bihar, India; Universita` Ca’ Foscari Venezia, Venezia, Italy Enrico Angeles (355), Abu Dhabi Polytechnic, Abu Dhabi, United Arab Emirates Arpita Balakrishnan (389), Amity Institute of Virology and Immunology, Amity University Uttar Pradesh, Noida, Uttar Pradesh, India Seyed Mojtaba Hosseini Bamakan (145), Department of Management Sciences, Yazd University, Yazd, Iran Ananya Banerjee (173, 297), Department of Computer Science, Kalyani Government Engineering College, Kalyani, West Bengal, India N.P.G. Bhavani (415), Department of ECE, Saveetha School of Engineering, SIMATS, Chennai, Tamil Nadu, India Malobika Bose (341), Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India Juan Boubeta-Puig (267, 283), UCASE Software Engineering Research Group, Department of Computer Science and Engineering, University of Cadiz, Ca´diz, Spain Anindita Chakraborty (367), Institute of Management Studies, Banaras Hindu University, Varanasi, Uttar Pradesh, India Brijesh Kumar Chaurasia (327), Department of Computer Science, Indian Institute of Information Technology, Lucknow, Uttar Pradesh, India Dongliang Chen (39), College of Computer Science and Technology, Qingdao University, Qingdao, China Agostino Cortesi (105), Universita` Ca’ Foscari Venezia, Venezia, Italy Arvind Deshmukh (433), Amity Business School, Amity University Uttar Pradesh, Noida, Uttar Pradesh, India Namrata Dhanda (69), Department of Computer Science & Engineering, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India

Mohd Sarfaraz Faiyaz (207), Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India Akshay M. Fajge (105, 125), Indian Institute of Technology Patna, Patna, Bihar, India Annn Jia Gander (39), Department of Applied IT, The University of Gothenburg, Gothenburg, Sweden Sam Goundar (377, 405), School of Science, Engineering and Technology, RMIT University, Hanoi, Vietnam Raju Halder (105, 125), Indian Institute of Technology Patna, Patna, Bihar, India Neetu Jabalia (389), Amity Institute of Biotechnology, Amity University Uttar Pradesh, Noida, Uttar Pradesh, India Poonam Jaglan (389), Amity Institute of Virology and Immunology, Amity University Uttar Pradesh, Noida, Uttar Pradesh, India U. Jayalatsumi (415), Department of ECE, Dr. MGR Educational and Research Institute, Chennai, Tamil Nadu, India T. Kavitha (415), Department of Civil Engineering, Dr. MGR Educational and Research Institute, Chennai, Tamil Nadu, India Gwang Seok Kim (377), Department of Information and Industrial Engineering, Yonsei University, Seoul, South Korea Chiang Liang Kok (425), Newcastle Australia Institute of Higher Education (A Wholly-Owned Entity of the University of Newcastle, Australia), Singapore, Singapore Veronica Kumar (389), Amity Institute of Biotechnology, Amity University Uttar Pradesh, Noida, Uttar Pradesh, India Jesu´s Lagares-Gala´n (283), School of Engineering, University of Cadiz, Ca´diz, Spain Zhihan Lv (39), Department of Game Design, Faculty of Arts, Uppsala University, Uppsala, Sweden Madhvendra Misra (405), Indian Institute of Information Technology, Allahabad, Uttar Pradesh, India xiii

xiv

Contributors

Naghmeh Sadat Moayedian (145), Department of Electrical and Computer Engineering, Isfahan University of Technology, Isfahan, Iran Meghna Manoj Nair (189), School of Computing Science and Engineering, Vellore Institute of Technology, Chennai, Tamil Nadu, India Nasim Nezhadsistani (145), Department of Electrical and Computer Engineering, Isfahan University of Technology, Isfahan, Iran Kavitha Palaniappan (425), Duke-NUS Medical School, Singapore, Singapore Rajiv Pandey (207), Amity Institute of Information Technology, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India Deepa Pavithran (355), Abu Dhabi Polytechnic, Abu Dhabi, United Arab Emirates Marı´a J. Peregrina-Perez (283), School of Engineering, University of Cadiz, Ca´diz, Spain

Harjot Singh (3, 87), Decision Tree Analytics, Gurugram, Haryana, India Kuldeep Singh (405), Faculty of Management Studies, JAIN (Deemed to be University), Bangalore, Karnataka, India Neeraj Kumar Singh (105, 125), INPT-ENSEEIHT/IRIT, University of Toulouse, Toulouse, France Shruti Singh (367), Institute of Management Studies, Banaras Hindu University, Varanasi, Uttar Pradesh, India Sandeep Srivastava (327), Department of Computer Science, Indian Institute of Information Technology, Lucknow, Uttar Pradesh, India V. Srividhya (415), EEE Department, Meenakshi College of Engineering, Chennai, Tamil Nadu, India K. Sujatha (415), EEE Department, Dr. MGR Educational and Research Institute, Chennai, Tamil Nadu, India

Nripendra P. Rana (405), College of Business and Economics, Qatar University, Doha, Qatar

Preetam Suman (55), School of Computing Science and Engineering, Vellore Institute of Technology, Bhopal, Madhya Pradesh, India

B. Rengammal Sankari (415), EEE Department, Dr. MGR Educational and Research Institute, Chennai, Tamil Nadu, India

C. Tamilselvi (415), Department of IT, Dr. MGR Educational and Research Institute, Chennai, Tamil Nadu, India

Jesu´s Rosa-Bilbao (267), UCASE Software Engineering Research Group, Department of Computer Science and Engineering, University of Cadiz, Ca´diz, Spain

Anupam Tiwari (237, 251), Computer Science Department, GD Goenka University, Gurugram, Haryana, India

Naela Jamal Rushdi (341), IILM Academy of Higher Learning, Lucknow, Uttar Pradesh, India

Amit Kumar Tyagi (19, 189), Department of Fashion Technology, National Institute of Fashion Technology, New Delhi, Delhi, India

Neelam Saxena (433), Amity Center of Entrepreneurship Development, Noida, Uttar Pradesh, India Saksham Selly (389), Amity Institute of Biotechnology, Amity University Uttar Pradesh, Noida, Uttar Pradesh, India K. Senthil Kumar (415), Department of IT; Department of ECE, Dr. MGR Educational and Research Institute, Chennai, Tamil Nadu, India Munavwar Shaikh (355), Abu Dhabi Polytechnic, Abu Dhabi, United Arab Emirates Charles Shibu (355), Abu Dhabi Polytechnic, Abu Dhabi, United Arab Emirates Deepak Singh (327), Department of Computer Science, Indian Institute of Information Technology, Lucknow, Uttar Pradesh, India Gurudev Singh (207), Amity Institute of Information Technology, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India

Kanishka Tyagi (55), Aptiv Corporation, San Francisco, CA, United States Zafar Uddin (207), Amity Institute of Information Technology, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India Rajat Verma (69), Department of Computer Science & Engineering, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India Jingyi Wu (39), College of Computer Science and Technology, Qingdao University, Qingdao, China Jitendra Yadav (405), Department of Marketing & Strategy, IBS Hyderabad, A Constituent of IFHE (Deemed to be) University, Hyderabad, India Sana Zeba (55), Department of Computer Engineering, Jamia Millia Islamia University, New Delhi, Delhi, India

Preface Distributed computing is an activity that takes place in a geographically dispersed computing ecosystem. A fundamental difficulty in distributed systems is providing a nondistributed view of a distributed system to a user in order to construct a distributed file mechanism that allows the client programmer to disregard the physical placement of their data. Most distributed computation models are process models, which present computational activity as the concurrent process execution. Blockchain is now a topic of substantial impact that academia, practitioners, and those working in the IT industry need to contemplate, study, research, publish, innovate, exploit, and adopt. Blockchain technologies are being claimed to be as disruptive as the Internet. A white paper titled “Bitcoin: A Peer-to-Peer Electronic Cash System” was published in 2008, written by Satoshi Nakamoto (a pseudonym), the white paper set everything into motion. This paper detailed how an electronic cash transaction can take place between peers without the need for a third party (financial institution). Digital signatures and cryptography can be used to secure the financial transaction, and peers on the Bitcoin network running on blockchain technology can verify, validate, and authorize the transaction to eliminate the “double spend” problem. A blockchain is a ledger that computer network nodes may access and use. Blockchain, like a database, keeps information electronically, in a digital form. Blockchain plays a vital part in cryptocurrency systems such as Bitcoin, where a secure and decentralized record of transactions is maintained. Original blockchain maintains the precision and safety of a data record and provides confidence without the requirement for a trusted third party. There are significant differences in the structure of data in a standard database and in a blockchain. Blockchain mostly uses the elements and concepts of distributed systems. Blockchain can be referred to as a distributed system, where every computation that takes place can be described as distributed system computing. This book contains 27 chapters, divided into three sections. The first section includes 12 chapters, which focus on basic key topics such as distributed systems and architecture, distributed ledger, and decentralized web, and supplies a detailed interpretation of algorithms for consensus in blockchains. The second section provides information related to blockchain architecture and security including cryptography. Seven chapters on blockchain forensics, hyperledger fabric blockchain platforms, and blockchain-based Internet of Things (IoT) security solutions add value to this section. The third section is devoted to distributed computing and consists of eight chapters.

Section A: Evolution of Distributed Systems Section A opens with Chapter 1 by Harjot Singh, titled “Decentralized Web, Distributed Ledgers, and Build-up to Blockchain.” The chapter gives an overview of decentralization, distributed ledgers, blockchain structure, and types of blockchain. Chapter 2, “Decentralized Everything: Practical Use of Blockchain Technology in Future Applications,” authored by Amit Kumar Tyagi, offers deeper insights into various domains and aspects of technology in which blockchain can be incorporated for further enhancement. This chapter predominantly discusses popular applications like the decentralized web. In order to provide details regarding distributive ledger technology, the author selected 100 articles (highly cited) and filtered them based on requirement/application, and provides here a summary of the top 50 articles. This chapter provides a detailed review of decentralized applications, including Dapps (Blockchain 4.0) and decentralized web (DWeb), and other future integration of blockchain in other applications and blockchain-IoT integration. Chapter 3, by Zhihan Lv, Jingyi Wu, Dongliang Chen, and Annn Jia Gander, is titled “Distributed Computing to Blockchain: Architecture, Technology, and Applications.” This chapter explores the correlation between distributed computing and blockchain technology, and investigates in depth the architecture and application of blockchain technology. The authors further suggest a distributed deep-learning network model based on blockchain technology. Chapter 4 is authored by Sana Zeba, Preetam Suman, and Kanishka Tyagi, and titled “Types of Blockchain.” It explores the contribution of blockchain across domains, including finance, healthcare, web-based companies, and so on. xv

xvi

Preface

Consolidating it with other emerging advancements will bring us all new technology solutions. This chapter addresses various types of blockchain and their importance. Chapter 5, “Blockchain Types: A Characteristic View,” by Rajat Verma and Namrata Dhanda, discusses various types of blockchain available and highlights their various advantages and disadvantages. The chapter further explores aspects of blockchain, particularly mining and diverse consensus algorithms. Chapter 6, “Dapps: Decentralized Applications for Blockchains” is written by Harjot Singh. It deliberates on the paradigm shift in application development from centralized to distributed, and gives an overview of Ethereum. Chapter 7 is contributed by Raju Halder, Md. Imran Alam, Akshay M. Fajge, Neeraj Kumar Singh, and Agostino Cortesi, and is titled “Analyzing Information Flow in Solidity Smart Contracts.” The chapter applies traditional language-based information-flow analysis to the case of Ethereum Solidity smart contracts in order to identify possible undesirable information flow in the contract codes that may cause software vulnerabilities. The chapter provides concrete semantics of solidity language. Chapter 8, “Formal Verification and Code Generation for Solidity Smart Contracts,” is authored by Neeraj Kumar Singh, Akshay M. Fajge, Raju Halder, and Md. Imran Alam. This chapter discusses formal verification for smart contracts. Chapter 9, “Blockchain consensus algorithms: Past, Present, and Future Trends,” is written by Nasim Nezhadsistani, Seyed Mojtaba Hosseini Bamakan, and Naghmeh Sadat Moayedian. Render an insight on consensus algorithms. The chapter presents a survey of the state of the art of blockchain consensus algorithms that have been studied and used in well-known applications. Chapter 10 is titled “A Systematic Study on the Development of Decentralized Application (dApp).” Contributed by Ananya Banerjee, the chapter ventures into Dapps, and discusses why decentralized applications are considerably more powerful than centralized applications in aspects such as cost, security, ownership, transparency, immutability, consistency, integrity, and availability. Chapter 11, “AI, IoT, Blockchain, and Cloud Computing: The Necessity of the Future,” is authored by Meghna Manoj Nair and Amit Kumar Tyagi. It explores how blockchain, the IoT, and artificial intelligence (AI) can utilize and incorporate cloud computing systems for enhanced performance and optimal results. The last chapter of Section A, Chapter 12, is “Functional Analysis of Blockchain Consensus Algorithms.” Contributed by Rajiv Pandey, Mohd Sarfaraz Faiyaz, Gurudev Singh, and Zafar Uddin, this chapter provides a detailed interpretation of algorithms for blockchain consensus. The authors also discuss the necessity for a lightweight blockchain for resourceconstrained devices and an enhanced Practical Byzantine Fault Tolerance blockchain consensus mechanism based on a reward and punishment scheme.

Section B: Blockchain Architecture and Security Section B explores topics related to blockchain architecture and security with an emphasis on blockchain architecture used in secure systems, cryptography, hyperledger, and cryptoeconomics. Chapter 13, “Blockchain and Forensics,” is written by Anupam Tiwari. It provides a detailed overview of blockchain forensics and an understanding of blockchain mechanics from the perspective of an investigation and forensics expert. Chapter 14, “Cryptography in Blockchain,” again by Anupam Tiwari, further extends the role of cryptography in blockchain and discusses the cryptography mechanics prevalent in the Bitcoin blockchain. Chapter 15, “Ethereum Blockchain Platform,” is provided by Jesu´s Rosa-Bilbao and Juan Boubeta-Puig. The authors dive into comprehensive learning about Ethereum, one of the well-known open-source platforms for decentralized applications. Chapter 16 is titled “Hyperledger Fabric Blockchain Platform” and is contributed by Marı´a J. Peregrina-Perez, Jesu´s Lagares-Gala´n, and Juan Boubeta-Puig. It explores hyperledger fabric and its permissioned architecture, which can be suitable for application domains such as business, healthcare, and manufacturing. In this chapter, the authors provide comprehensive information about hyperledger fabric and its modularity and versatility for several use cases. Chapter 17, “An In-depth Look at Blockchain Technology: Architecture and Security Concerns,” by Ananya Banerjee, highlights blockchain architecture and security concerns including decentralization, mining, consensus, and smart contracts. Chapter 18 is titled “Blockchain-Based IoT Security Solutions” and is authored by Sandeep Srivastava, Brijesh Kumar Chaurasia, and Deepak Singh. It explores blockchain technology for authentication, privacy, and nonrepudiation, through a window on issues of security of IoT. This chapter presents a security solution for all types of blockchain technology. Chapter 19, “Cryptoeconomics,” authored by Malobika Bose and Naela Jamal Rushdi, gives an overview of the historical background, evolution, and understanding of the basics behind the concept of cryptoeconomics. The chapter provides readers with an understanding of the concept and process of initial coin offerings.

Preface

xvii

Section C: Distributed Computing Section C focuses on distributed computing and consists of eight chapters. Chapter 20, “Distributed Databases and Distributed Operating systems for Blockchain,” is authored by Deepa Pavithran, Charles Shibu, Munavwar Shaikh, and Enrico Angeles. It states that blockchain is a decentralized linked data structure that provides transparency, data availability, and data integrity in an untrusted network. The chapter discusses distributed databases, distributed operating systems, and blockchain. Chapter 21, “Demystifying Blockchain Adoption in Financial Sector—A Critical Analysis,” by Shruti Singh and Anindita Chakraborty, describes blockchain adoption in the financial sector. The authors set out significant usages and scopes in addition to the difficulties and problems that need to be addressed for the successful integration of the components of the blockchain. Chapter 22 is titled “e-Governance and Blockchain-Based Data Supply Chain for Used Cars,” and is written by Gwang Seok Kim and Sam Goundar. It examines whether blockchain can enable the expansion of the used car business from business-to-business (B2B) to business-to-consumer (B2C), and the possibility of field validation for original equipment manufacturer (OEMs). Chapter 23, “Emerging Trends of Blockchain in Bioinformatics: A Revolution in Health care,” is authored by Arpita Balakrishnan, Poonam Jaglan, Saksham Selly, Veronica Kumar, and Neetu Jabalia. It presents a fundamental concept underlying blockchain and bioinformatics, and delves into the impact of blockchain on genomics big data and applications of blockchain in bioinformatics. The last section of the chapter encompasses blockchain trends changing traditional methods of research in bioinformatics. Chapter 24, “Blockchain’s Potential to Rescue Sports: A Social Media Perspective,” by Jitendra Yadav, Madhvendra Misra, Nripendra P. Rana, Kuldeep Singh, and Sam Goundar, focuses on the decentralization, safety, trustworthiness, and traceability features of the data collecting system offered by blockchain technology, which are very well suited to developments in the sports industry. Chapter 25 is contributed by K. Sujatha, T. Kavitha, N.P.G. Bhavani, C. Tamilselvi, K. Senthil Kumar, U. Jayalatsumi, V. Srividhya, and B. Rengammal Sankari, and is titled “Design and Development of a Mobile Application for Level Monitoring of Oxygen Cylinders Using Block Chain Technology.” The authors propose an online remote smartphone app for oxygen-dependent COVID-19 patients that can remotely measure and monitor the level of oxygen inside cylinders by integrating the pressure sensor and load cell. Chapter 26, “A Futuristic Approach to Decentralize and Authenticate Workplace Safety Records Leveraging on Blockchain Distributed Ledger Network,” is written by Chiang Liang Kok and Kavitha Palaniappan. It proposes an approach to leverage on secure blockchain distributed ledger networks to decentralize workplace safety records and allow the data to be accessed more securely and effectively only by the relevant authorities. The last chapter of this book is Chapter 27, “Designing Business Models Through Blockchain: A Process of Value Creation,” contributed by Arvind Deshmukh and Neelam Saxena. This chapter explores the value creation process in various business models through the integration of blockchain technology. The chapter also discusses the implications, challenges, and benefits of incorporating blockchain in business applications.

This page intentionally left blank

Acknowledgments We are proud to present this book, Distributed Computing to Blockchain: Architecture, Technology, and Applications. We humbly thank all the authors who submitted their chapters to make this volume a success. Without their expertise and tireless efforts, this book would not have reached publication. We are also grateful to all the reviewers who peer-reviewed the chapters in this book. For any new book, assembling the editorial team takes a lot of time and effort. Getting people with specialist knowledge to volunteer is difficult, especially when they have full-time jobs. Selecting the right people with appropriate skills and expertise in different areas of distributed computing, blockchain, big data, the Internet of Things, technological convergence, and other technologies converging with computing and blockchain is a significant challenge, but one that was overcome by all involved. We believe that everyone will enjoy reading this book and that it will inspire and encourage readers to start their research (if they have not already done so) into the convergence of artificial intelligence and blockchain, and its integration with other technologies. Once again, we congratulate and thank everyone involved in the writing, review, editorial work, and publication of this book. Rajiv Pandey Sam Goundar Shahnaz Fatima

xix

This page intentionally left blank

Section A

Evolution of distributed systems

This page intentionally left blank

Chapter 1

Decentralized web, distributed ledgers, and build-up to blockchain Harjot Singh Decision Tree Analytics, Gurugram, Haryana, India

We have elected to put our money and faith in a mathematical framework that is free of politics and human error. As stated by Tyler Winkelvoss, Rower & Entrepreneur (https://www.cnbc.com/id/100635418 on 11 April 2013)

1. Introduction When Tim Berners Lee founded the W3C in the early 1990s, he himself probably would not have imagined the shape of the behemoth that he had created. It was a paradigm shift from the days of ARPANET (Advanced Research Projects Agency Network) setup in 1969 which was intended for peer-to-peer communication. Tim Berners Lee while answering young people on the official w3.org website made it look really simple—“I just had to take the hypertext idea and connect it to the TCP and DNS ideas and—ta-da!—the World Wide Web” [1]. This was the beginning of the World Wide Web as we see it today. From humble beginnings, the Internet has become a necessity in everyday life rather than an experimental venture. However, the shape that this giant has taken leaves a lot to be desired from the perspective of those propagating “Freedom of the Internet,” “Net Neutrality,” and “Freedom of Expression.” The biggest reason cited is that typically people do not own their data today. It is stored, analyzed, and used by big conglomerates like Google and Facebook. Every time a user interacts on the net, copies of his/her data are created and travel across the web, and the more such copies, the more one loses control of his/her data. This is not just an inefficient manner of execution but also a privacy concern. Almost three decades into the development and the internet is still hinged on the client–server architecture. Let’s walk through this journey quickly.

1.1 The journey so far Web 1.0 -> Web 2.0 -> Web 3.0 Web 1.0 (The Static Web) was a hypermesh of interconnected static servers with users hopping between them primarily using the hyperlinks. The content creation was limited to the person(s) hosting the site and interaction with any user was very minimal. Majority of the sites revolved around hosting public profiles of individuals or as notice boards for information. Current-day examples of similar sites would be those hosting law books or user manuals. The content was primarily driven by those who hosted the website, and the user was a passive surfer. It was akin to a modern-day television broadcaster showing the various programs on different channels, except that the broadcaster was replaced by the person(s) hosting the website and one had to use a hyperlink/url rather than a channel number. The mainstream server-side technology was Common Gateway Interface with sites coded in vanilla HTML. Web 2.0 (The Interactive Web) was an evolutionary step for its time with greater emphasis on user interaction. Websites turned dynamic and generation of content was now a two-way street with the users being an active member of the ecosystem rather than being a passive receiver of the information/content. Developers graduated from using synchronous calls to AJAX, HTML5, and JavaScript. On the server-side Java, PHP, etc. gained ground. Websites grew exponentially and social networking sites bloomed. User interaction became critical and information flow was more regulated using APIs. Despite the technological leaps, the primary architecture still remained the client-server model, with centralized servers storing, analyzing, utilizing, and controlling not only their own but also the user’s data. To make the protocols over the internet efficient and scalable, stateless protocols such as TCP/IP and UDP were chosen for their simplicity in implementation. This caused the overall state of the transactions on the web to be stateless and resulted in scenarios, wherein one had Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00004-8 Copyright © 2023 Elsevier Inc. All rights reserved.

3

4 SECTION

A Evolution of distributed systems

FIG. 1 Web 1.0 vs. Web 2.0.

to invariably rely on third-party entities to establish trust. Banks had to rely on a VISA or Master Card to trust the dealing parties involved. Storage could have gone between centralized and decentralized, but for some reason, it went the centralized way. Data got aggregated in hands of a few large entities whose primary objectives were in most instances defined by the top line in their income sheets and how the shareholders felt rather than user experience. Fig. 1 shares a brief difference between Web 1.0 and 2.0 from an architectural and dataflow standpoint. The users’ data slowly became the product by itself and led to the growth of giants like Google and Facebook. A centralized repository became the source of truth and user data became a goldmine to study demographics, move opinions, and shape election outcomes. Facebook has been often accused of being the tool to mobilize and manipulate public opinions prior to major elections in many countries, including the United States itself. Prediction algorithms can now predict user behavior with a fair degree of accuracy just by analyzing the browsing patterns of users. All the caveats are stored and obfuscated under the T&Cs of the sites and a normal user forgoes all his rights simply by clicking “I Agree.” There is no denying that Facebook, Google, Amazon, Alibaba, etc. are providing valuable facilities around the world, but the way they are controlling, analyzing, and consolidating control over the way we communicate, interact, purchase, and express is unprecedented. Such control surpasses that enjoyed by the largest kingdoms in history. Decentralization: This word singularly can be attributed to the genesis of the thought process for Web 3.0, though it is taking a much larger shape now. To quote Tim Berners Lee once again, he had in 2006 stated, “People keep asking what Web 3.0 is. I think maybe when you’ve got an overlay of scalable vector graphics—everything rippling and folding and looking misty—on Web 2.0 and access to a semantic Web integrated across a huge space of data, you’ll have access to an unbelievable data resource….” The semantic web would analyze data based on what a word means and how it is understood by the human mind (contextual) rather than by a simple pattern or word match. Natural language processing algorithms using AL and ML would process data faster to provide more relevant and quicker results. Search now is more aligned to the way humans think and analyze. The information will be more connected using the metadata and provide contextual results. Multiple applications would be using singular data rather than multiple copies in silos to speak across applications. Web 3.0 would democratize the ability to look at facts the way they are rather than through the financial binoculars of large business conglomerates.

Decentralized web, distributed ledgers, and build-up to blockchain Chapter

1

5

FIG. 2 Web 3.0.

The creators of the Web had envisaged Web 3.0 to be a Semantic web, but over time Web 3.0 has developed into much more than that. Fig. 2 tries to express the paradigm shift in the way the resources are configured and utilized in Web 3.0. Storage, compute, application, and network resources are all distributed while being shared. The data are stored over a storage network which itself utilizes the underlying distributed network. The distributed ledger technology (DLT) ensures the fidelity of the data while storing identical copies of the transactions over all the nodes in the network (information layer). The compute required is shared across decentralized servers, ensuring optimum utilization of the compute (compute layer). Finally, the applications built above the distributed infrastructure, referred to as DApps, utilize the underlying resources to provide seamless experience to the end users (interaction layer) [2]. The Browser “Brave” is a classical example of a DApp providing services similar to modern-day browsers such as Chrome and Edge. Web 3.0 is said to be based on three keywords “Open,” “Trustless,” and “Permissionless.” Web 3.0 can be characterized by the following five characteristics [3,4]: l

l

l

l

l

Semantic Web: Traditionally search has been based on algorithms which have been focused on keyword search, tagging, etc. The semantic web would entail the ability to think like a human. Search would be focused on understanding not just the meaning but the context too. Artificial Intelligence: Web 3.0 would utilize Natural Language Processing and the search results would not just be more relevant but also delivered faster. 3D Graphics: This would provide a more immersive effect and graduate from just 2D images or visuals. The intent would be to provide a realistic feel to the entire experience. Advancements in virtual reality headsets are also contributing to this. Mark Zuckerberg is already talking about the metaverse. Connectivity: The semantic metadata makes the data more connected and hence more accessible. Data will be connected more in the way people perceive and connect with data. Ubiquity: Multiple applications will be able to access singular data rather than replicating multiple copies for each application. Data will be accessible easily both in time and space.

6 SECTION

A Evolution of distributed systems

Facet

Web 1.0

Web 2.0

Web 3.0

User Interface

Client (installed on user device)

Web

Mulple Devices

Content

Stac, Unidireconal & Read-only

Dynamic, Bidireconal & Read Write

Dynamic, Muldireconal & Singular

Interacve & Iterave

Engaged & Invested

Use Case

Primarily Organizaonal announcements (Like Noce Boards)

Community focused with emphasis on social networking

Emphasis on Individual's Data and its Protecon, with authencated and legimate access.

Mode of Interacon

Web Forms

Web Applicaons

Dapps

Communicaon Primarily Mode Broadcast

Content search Data Organized in Content search Content Search more context Directories / relies heavily on paradigm oriented using AI Folders keywords / tags /ML Metrics for User No of Page Views Cost per Click Interacon

User Engagement (me spent, clicks on specific secons etc)

Primary technologies

HTML

Server (Java, PHP) & Client SPARQL, RDF,RDFS, side (Javascript, OWL Angular, React) scripng

Interacvness

Missing

Responsive

Adapve & Predicve

Response Mechanism

Page reload / Refresh

AJAX / Paral / Asynchronous loads

Cached Content

Behaviour of Data Transfer

Pull / Polling

Push to client / Predicve / Asynchronous Synchronous

FIG. 3 Comparison of Web 1.0, Web 2.0, and Web 3.0.

Satoshi Nakamoto’s path-breaking paper in 2008 combined the three characteristics (“Open,” “Trustless,” and “Permissionless”) in a single use case, the Bitcoin, and changed the way trust was established in the virtual world. It made it possible to set up a mechanism where individuals could trust and transact other over the net, without the need of a third party, which were the banks in most of the cases. For most part of this chapter, we would look and discuss the underlying technology that this anonymous individual(s) utilized to build Bitcoin and how he/they were able to establish trust in the financial transactions without the need of a third party. Fig. 3 summarizes the basic characteristics differentiating the different generations of the Web.

2.

Distributed ledgers (DLTs)

2.1 All distributed ledgers are not blockchain The distributed ledgers are the south pole for centralized databases. Unlike the traditional paradigm, DLTs do not have a central database administrator. A distributed ledger also referred to as replicated journal technology is a consensus of replicated, shared, and synchronized data which is normally spread across multiple geographically dispersed sites (nodes). DLT ledgers are normally spread across several nodes on a peer-to-peer network, wherein identical copies of the database are replicated and kept synced. New transactions initiated by nodes are first replicated across nodes and then settled by a

Decentralized web, distributed ledgers, and build-up to blockchain Chapter

1

7

consensus mechanism. Once settled nodes update themselves with the approved copy of the ledger [5]. A DLT obviates the single point of failure in central databases as multiple copies of the same ledger are available across nodes, from where any node can recreate the current version in case of a crash. Typical use cases of DLT see processing of financial data, authentication, and validation of transactions similar to recording in a paper-based ledger. However, what is different is that the entire process involves use of cryptography for ensuring non-repudiation, settlement, and ensuring that the data are not tampered with. Cryptography ensures a digital lock on the DLT transactions which works like a unique signature on an authenticated document. DLTs ensure visibility of transactions to all the nodes, so any node can independently verify the transactions. This helps build trust in the mechanism. With the growth and large-scale adoption of the blockchains, a growing number of people are using the terms DLT and blockchain interchangeably. To the uninformed, this would make perfect sense. The critical difference is that blockchain is one implementation of distributed ledgers, even though at the surface it may sound incredibly similar. While blockchains are implemented as discrete blocks of data chained together as a sequence using hashes, DLTs typically do not need such a chain. DLTs are basically blockchains without the block and the chain [6]. DLT implementations also differ in their consensus mechanisms over blockchains. Tangle and Hashgraph (typically referred to as “Directed Acyclic Graphs”) are two popular implementations of DLTs gaining immense adoption. Both these implementations do not mandate that all nodes in the network are synchronized with each other 100% of the time. As the name suggests, these implementations are built around the notion of acyclicity and no assumptions are made on the time at which information reaches the nodes on the network [7].

2.2 Tangle Tangle differs in the way the blocks are handled, the way the consensus mechanism works and is not incentivized for transaction settlement. Typically, consensus is replaced by a mechanism wherein initiator of any transaction is mandated to approve any two pending transactions before his initiated transaction can get approved. The effort spent in validating/ approving a pending transaction can be thought of as the fee to settle the initiated transactions. By making the transaction settlement dependent on the consensus mechanism, Tangle manages to ensure that invested users ensure correctness of their validations for correct settlement of their own transactions. The validation of the random transactions can be thought as the equivalent of proof of work (PoW). This mechanism enhances efficiency and improves settlement times for transactions. This also helps enhance scalability as reduced settlement times encourage adoption for real-time applications. IOTA’s Tangle is an open, feeless, and scalable distributed ledger, designed to support frictionless data and value transfer [8]. Iota claims to be achieving speeds of up to 800 transactions per minute. Fig. 4 gives a visual depiction of the difference in sequence of transaction settlement in blockchain vs. Tangle. While blockchain implements sequential settlement, Tangle follows a more random approach and hence is able to increase settlement throughput.

2.3 Hashgraphs Hashgraphs are another implementation of DLTs and use a different consensus mechanism referred to as “Gossip.” Aligning with how humans perceive events and gossip about the same by asking questions like “What,” “When,” “Where,”

FIG. 4 Blockchain vs. Hashgraph (transaction settlement funnel).

8 SECTION

A Evolution of distributed systems

FIG. 5 Hashgraph vs. blockchain.

“How,” nodes in the Hashgraph ask these questions for initiated transactions. Nodes are obliged to share all their information further with randomly selected multiple nodes. The receiving nodes collate information from other nodes and further add their own inputs. This information superset is then further made available to the next set of randomly selected nodes till such time all nodes are made aware of the original information. The transactions are timestamped and information from previous receivers is also passed further making the subsequent passes more informative. Hashgraph thus not only utilizes gossip but gossip about gossip to speed up transaction settlement and to ensure early consensus [7]. This consensus mechanism is referred to as “virtual voting.” Obligatory sharing of data by nodes of the Hashgraph ensures that individual decisions are also visible to all, thereby enhancing transparency and in turn builds up trust. Most implementations of Hashgraph are by private entities with private DLT implementations. Hashgraphs have been known to be capable of settling up to 250,000 transactions per second. Hashgraphs by design are tolerant to Asynchronous Byzantine Fault [9]. What this implies is that malicious nodes will not be able to prevent or tamper with the final consensus on a transaction as long as two-thirds of the total number of nodes are legitimate. Hashgraphs have the advantage of being cheaper in implementation and efficiency as they do away with resource-intensive proof of work. However, Hashgraph suffers from limitations of being patented [9]. Hedera Hashgraph is the only authorized ledger for Hashgraph. Though Dapps can be built on top of Hashgraph, but it needs approval from Hedera. Hashgrpah natively uses HBAR as its cryptocurrency. Fig. 5 depicts visually the difference in modus operandi for transaction settlement in Hashgraph versus blockchains.

3.

Blockchains

3.1 Blockchain: Historical background The earliest known contribution to what we refer to as blockchain today was made by Cryptographer David Chaum in 1982 when he first proposed a protocol similar to the blockchain in his dissertation “Computer Systems Established, Maintained, and Trusted by Mutually Suspicious Groups” [10]. Stuart Haber and W. Scott Stornetta in 1991 further built on cryptographically secured chain of blocks. Their work primarily aimed to accomplish a use case where document timestamps could not be tampered with. They in 1992 further enhanced their system to incorporate Merkel trees, so as to enable collection of multiple documents in a single block [11]. The end of the last century saw the development of many electronic currencies like the E-cash, E-gold, WebMoney, and Liberty Reserve but almost all faded into oblivion. It was however not till 2008 when Satoshi Nakamoto published his revolutionary white paper, that the floodgates for blockchain and related applications were opened. Satoshi solved the proverbial issue of trust in electronic transactions. Some say that the 2008 economic crisis was the trigger for the paper by Satoshi, when the banking system failed to secure the hard-earned money of the common man. Traditionally anything electronic was verified by a third party. The Master Cards and Visa owe their genesis to solving the problem of trust in electronic transactions and Satoshi was able to build a system which would eliminate the need of the aforesaid entities.

Decentralized web, distributed ledgers, and build-up to blockchain Chapter

1

9

3.2 What is a blockchain? A blockchain is an immutable, shared, programmable, time-stamped, and secure digital ledger of transactions, which is replicated and distributed across a peer-to-peer network. It consists of a set of transactions collated together in a block, and each new transaction is distributed over the network and added to each participant’s ledger. This decentralized database managed over a distributed network is also referred to as DLT. Blockchain is a type of DLT capable of recording transactions using immutable cryptographic signatures referred to as a hash. Immutability refers to the property of the blockchain wherein any transaction once committed cannot be altered. This is ensured by advanced cryptography and any alterations to the transactions can be easily identified. This immutability singularly is responsible for building trust without the need for a third-party validation. The distributed nature of the blockchain inherently protects the blockchain from network attacks. Transactions once floated on the blockchain network are validated through a consensus mechanism and only then are added to an existing sequential chain of hash-linked blocks. This nature of the chain gives this DLT the name blockchain. Even a single bit change in any of the linked blocks will cause the chain to be broken and will be rejected by the network. Advanced cryptology ensures that tampers to the digital hashes are easily detected and identified.

3.3 Blockchain structure Most beginners end up confusing blockchain with the Bitcoin and unarguably so due to the hype around the Bitcoin. Bitcoin seemingly is a more familiar term with the general masses than blockchain. Blockchain is the underlying technology driving Bitcoin. One can think of blockchain as an equivalent of an operating system (think Windows on a computer) and Bitcoin as one of the applications running on top of it (think Microsoft Word). Though a very rudimentary comparison, but it’s the closest that one can correlate to the commonly known examples. One can visualize blockchain as a contiguous chain of blocks of data (Fig. 6). Each of the subsequent blocks is linked to each other through the hash of the previous block. If even one of the hashes of any of the subsequent block is tampered (by a malicious attack or any bit is altered by a user), then the hash link is broken, and the tamper is immediately evident. Hashing irreversibly encrypts a block’s information and produces a fixed-length output using SHA-256 (Secure Hash Algorithm 256) which is easy to validate.

3.4 Blockchain transactions Blockchains have a finite set of steps to settle the transactions. There are six major steps (refer Fig. 7) followed for each transaction, which ensures that the transaction is immutably, securely, and transparently captured. A transaction may be initiated by an individual (peer). The requested transaction is cryptographically signed using the private key of the individual. This ensures that the data are encrypted, identifies the individual (non-repudiation), and also enables the peer nodes to decrypt the transaction details by using the public key of the initiator. This transaction is then broadcasted over a peer-to-peer network using the various nodes in the chain. This ensures that a wide audience is aware of the transaction-enhancing transparency. The transaction block is then validated and added to a block. The nodes in the network are then intimated of the transaction, who then solve complex equations (mining) to confirm the validity of the transaction. This consensus mechanism is referred to as proof of work. Once the block is validated, it is then added to the block [12]. A number of such validated transactions add up to form a block, which is then assigned a hash, and while calculating this hash, the hash of the previous block is added as an input. With addition of more such subsequent validated blocks, the chain keeps growing and becomes more secure and harder to tamper with.

3.5 Proof of work: Consensus PoW is one of the most commonly heard consensus mechanisms used in blockchains. The basic principle of this mechanism is that it enables easy verification of the tangible amount of computational effort that has been expended for a particular task

FIG. 6 Schematic representation of a blockchain.

10

SECTION

A Evolution of distributed systems

FIG. 7 Transaction settlement and block creation in a blockchain.

such as solving complex equations. Popularized by Bitcoin miners, this consensus mechanism ensured quick validations of moderately hard calculations. The goal of PoW is to prevent double spending. The intent behind making PoW as the barometer for adding blocks to a blockchain was to ensure that anyone spending compute and resources to add/validate a block gets automatically invested in the fidelity of the chain and is given some incentive/reward (e.g., Bitcoins). This would ensure that only genuine nodes participate in the chain. There are host of other mechanisms such as proof of stake, etc. which differ in implementation, but the overall intent is to get nodes to invest resources to get them committed and invested in the chain. Additionally, blockchain ensures protection from tampering through its distributed architecture. In a blockchain, each node contains an identical copy of the ledger and a block once created on the blockchain’s distributed network is sent to all the users on the network. It’s obligatory on the nodes to verify a block and check for any tampering and only post that it is added to the chain. The nodes on the network thus create a consensus on whether to add a block or not. Thus, to ensure that a malicious block is accepted into the chain, one needs to tamper with all the blocks in the chain, expend compute to redo the PoW for each block, and also at the same time take more than 51% ownership/control of the blockchain network. Gathering resources to do all three activities is extremely difficult and hence the blockchain structurally protects itself against any kind of malicious attack.

4.

Types of blockchains

Based on the use case and level of access/control, the blockchains can be broadly divided into two different categories, viz., permissioned and permissionless. Permissioned blockchains can be further categorized into three types, viz., private, consortium, and hybrid based on the level of access control [13].

4.1 Permissionless blockchains Permissionless blockchains also referred to as public blockchains guarantee equal rights to all nodes of the network. It is nonrestrictive in a manner that anyone with an internet connection can connect to the chain to become an authorized node.

Decentralized web, distributed ledgers, and build-up to blockchain Chapter

1

11

FIG. 8 Permissionless blockchain.

Any node of a public blockchain has visibility of all the transactions, past and present. Thus, all transactions though anonymous are visible to all the nodes (Fig. 8). All the nodes are permitted to verify incoming transactions or carry out POW and mine. By nature, permissionless nodes tend to be relatively secure due to the involvement of a large number of participating nodes for validating the transactions but at the same time suffer from long transaction processing times due to the larger number of nodes. Presently most use cases of public blockchain revolve around mining and transacting cryptocurrencies. Bitcoin, LiteCoin, Dogecoin, and Ethereum are a few such examples. Typically, public blockchains benefit from their public and distributed nature. Being public enhances the level of trust as it is open to scrutiny. Participants feel incentivized to ensure fidelity of the chain and to build it further. The different nodes act as a check on the other nodes. At the same time, public blockchains suffer from scalability issues as the number of nodes increase. Increased number of nodes results in increased settlement time making the chain slower. Lastly, the consensus mechanisms need a lot to be desired in terms of efficiency. PoW being used by Bitcoin is energy intensive. Though there are different mechanisms being put in place to make the public blockchains faster, but a lot still needs to be achieved in that direction.

4.2 Permissioned blockchains Permissioned blockchains on the other edge of the spectrum are a closed chain with restricted permissions for the nodes. Depending upon the level of restrictions imposed, these can be further divided into private, consortium, and hybrid blockchains. Permissioned blockchains allow specific nodes to access the blockchain network and are normally implemented for specific needs by organization(s). A private blockchain (Fig. 9) by definition is managed and permissioned and privately owned by an organization/entity. Nodes do not have identical rights and normally a central authority determines as to who can be a node and what that node can do. Public access to these chains is restricted. The access, permissions, and control are defined and delegated by a central authority. Some of the best use cases revolve around asset management, identity management, and supply chain management. Most leading implementations are using Hyperledger, which is an umbrella project for open-source blockchains and relevant resources under the aegis of the Linux Foundation. Some of the leading financial and technological companies such as IBM, Cisco, Hitachi, Red Hat, ABM Amro, and ANZ Bank have been the early contributors or supporters of the Hyperledger project. Corda, Hyperledger Fabric, and Hyperledger Sawtooth are few examples of private blockchains. Private blockchains suffer from the drawback of fraud as the consensus is in the hand of a single central authority and corrupting of this authority will affect the fidelity of the transactions. It is largely difficult to build trust in a private blockchain as the final call is with the central authority.

12

SECTION

A Evolution of distributed systems

FIG. 9 Private blockchain.

4.3 Consortium blockchains To overcome the disadvantages of a private blockchain, organizations evolved to implement a consortium blockchain (Fig. 10), which are governed by a group of organizations rather than a single node/entity. Consortium blockchains are an evolved version of private blockchains enjoying a relatively greater degree of decentralization and a consequently higher degree of security. Consensus mechanism in this type of blockchain is controlled by specific preset nodes. Consortium blockchains have two types of nodes, validators and members. Validators as the name suggests are involved not just in validating the transactions but also in initiating or receiving the transactions. The members on the other hand are restricted to initiating or receiving the transactions. Typical implementations of such blockchains are seen in banks and government organizations. Consortium blockchains provide greater flexibility and customization options. Due to limited numbers of validating nodes involved in the consensus speed and scalability, both don’t suffer. On the downside, these implementations are lot less transparent or anonymous. Well-known implementations for such type of blockchains have been created by R3 (typically for financial services) and CargoSmart (for the shipping industry). Marco Polo, Energy Web Foundation, and IBM Food Trust are two examples of consortium blockchains.

FIG. 10 Consortium blockchain.

Decentralized web, distributed ledgers, and build-up to blockchain Chapter

1

13

FIG. 11 Hybrid blockchain.

4.4 Hybrid blockchains The hybrid implementation (Fig. 11) involves control by a single entity with an oversight which is public in nature. It combines the public and private blockchain features into a single implementation. Data are typically bucketed for public or private access. Selected sections/records are available for public access and scrutiny, while the rest are kept confidential and private. As an example, in a typical asset management blockchain, the details on the asset can be made public while the associated financials (cost, current value, etc.) can be made private in a hybrid implementation. Typical implementations see the verification of a transaction restricted to the private part of the blockchain but with option for public verification too. Availability to the public section causes an increased hashing and greater nodes are available for verifying the transaction. This consequently builds trust as this also improves transparency in the blockchain. XinFin’s hybrid blockchain and dragonchain are two such implementation examples of hybrid blockchains. Hybrid blockchain implementations offer greater flexibility with option to expose just the desirable/optimum amount of data for public access. Business rules can be defined and implemented with ease. It offers greater privacy despite being connected publicly and offers good scalability while ensuring transparency. The only drawbacks are that these implementations lack any incentive for the participating public nodes and are often difficult to upgrade. Real-estate companies are amongst the best bets for hybrid implementations, wherein only relevant data can be publicly exposed. Similar implementations are also rapidly growing in the retail market. A synopsis of the comparison of the blockchain types is in Fig. 12. The content has been adapted from multiple websites and sources.

5. Blockchain use cases To understand the genesis and evolution of the blockchain and its subsequent use cases, it is essential to get a little perspective. Mankind has experimented with various instruments of trust down the ages starting with stamps to punched coins to printed currencies, letters of credits, and so on and so forth with the simple intent to generate trust between the transacting parties, but invariably this trust was backed by a third party. The punched coins were backed by the might of the kings, the currencies backed by the federal reserves, and the letters of credits backed by the banks issuing them. There has rarely been a trust instrument which has been self-sufficient standing alone. Technology helped make transactions swifter and reliable, but it always needed the crutches of a third party to generate the trust in the transaction, however big or small. The MasterCards, the Visas of the world, singularly owe their existence to fill this void: TRUST. Coupled with those enumerated above, cash had its limitations in terms of local acceptability. Settlement times were often long if overseas and were dependent on a third party.

14

SECTION

Se r

A Evolution of distributed systems

Face t

Public

Consotium Private Permissioned read / write with Permissioned read / write mulple actors but with single actor

1

Level of access

Open access for read / write

2

Trust

Trust free

3

Parcipant identity Anonymous

4

Transacon Long, typically 10 min and increases Short Typically 10-100 msec selement rate & Short, Typically 100 msec range ranges with addion of new nodes window

5

Consensus Mechanism

Proof of Work (Bitcoin) , Proof of Stake (Ethereum) - Typically large enerby consumpon. - Prone to 51 % aack. - No finality

Trusted

Truste d

Ide ntifie d & Trusted

Idenfied & trusted.

Vong or Mul party consensus - Ligher & Faster. - Low energy consumpon - Enable finality

Vong or Mul party consensus - Ligher & Faster. - Low energy consumpon - Enable finality

FIG. 12 Public vs. consortium vs. private blockchain.

5.1 Blockchain 1.0 Though there were flutters here and there since the early 1990s on the use and adoption of the DLT, it was not until 2008 when the anonymous person/persons known as Satoshi Nakamoto managed to generate considerable interest in the DLT blockchain. To be honest, it was the use case Bitcoin which actually generated the interest at a massive scale in 2009. Cryptocurrencies were the talk of every related discussion board, forum, webpage, seminar webinars, etc. Cryptocurrencies ruled the Blockchain 1.0 era. Distributed nature of the underlying technology where anyone could view and validate all the transactions helped build trust and transparency. Nakamoto was able to create a digital currency that could be exchanged between peers without the need for a central authority. It solved the double spending problem and was able to validate the transactions at the same time while eliminating the requirement of a trusted third party all at the same time. This period also saw a large number of other cryptocurrencies emerge and implement other variations. Litecoin, Namecoin, Swiftcoin, and other such currencies cropped up. The rise in the Bitcoin valuation further triggered more and more people to build competing cryptocurrencies. At the time of penning down this chapter, there are 6899 different cryptocurrencies listed on https://coinmarketcap.com/. At the moment, most people seem to be investing into cryptos more from an investment purpose, but it will be some time before we see any actual day-to-day transactions moving to these cryptos on scale so as to replace the actual currencies. Future of most cryptos is volatile at best and the susceptibility to large market swings is keeping the cautious investors away. A few advocates against cryptocurrencies have also cautioned against the use of such currencies by nefarious individuals and groups as it would be almost impossible to identify the originator of the transactions (Fig. 13).

FIG. 13 Evolution of blockchains.

Decentralized web, distributed ledgers, and build-up to blockchain Chapter

1

15

5.2 Blockchain 2.0 Innovation knows no bounds and blockchain applications evolved. Some implementations of blockchain saw the development of smart contracts. However, it was not until the Ethereum blockchain under Vitalik Buterin (one of the cofounders of Ethereum) that smart contracts became mainstream. Ethereum was open-source, blockchain-based application which provided scripting to its users, and it was this aspect which opened endless options for the users. One could script smart contracts using Ethereum for a small fee (Ethers). While Vitalik wanted to build a better Bitcoin, he also opened up new possibilities for smart contracts in the process. A smart contract is a piece of code which is self-executing and self-triggered once the conditions set in the contract are met. The parties to the contract remain anonymous to each other. This code and the agreement are themselves placed on a distributed blockchain network. Once on the DLT, it’s impossible to alter the contract. The trigger for the smart contract is coded within the same lines and does not need a third-party/person/repository to execute it. Typically, some executing conditions such as a time period or a deadline are set as triggers (though there are other possibilities) for executing the smart contracts. This makes the entire process transparent as well as predictable. Fig. 14 shows a block-level flow of a smart contract. The biggest difference in a smart contract from a regular contract is that in addition to defining the rules, it has the capability to execute them also. Ethereum and Ontology are two such blockchains providing smart contracts at scale. The conditionalities of the smart contract are coded into the system similar to an if-then-else statement and any attempt to alter any condition triggers and alert to both the parties. The added benefits of transparency due to the underlying blockchain ensure that transactions are visible and can be validated. Smart contracts open endless possibilities in financial services, trading, supply chain management, IOT, real estate, insurance claim-related activities, etc. Growing use of the Blockchain 2.0 is being done in DAOs (distributed autonomous organizations) which leverages smart contracts to provide equal rights to all individuals in an organization to take part in the decision-making. DAOs provide transparency in the financial records of an organization making them visible to all the shareholders/employees, etc. Smart contracts provide total transparency as the transactions are available for validation on a DLT. Any changes/tampering events are immediately informed to the parties involved. It reduces the scope for miscommunication as everything is clearly spelt out and can be trusted to be executed automatically without the need of a third party.

5.3 Blockchain 3.0 As an evolutionary next step to build on the existing framework and trying to overcome the inefficiencies and deficiencies, developers built more applications. These applications were built decentralized from the ground up leaving the traditional client–server architecture aside. This growing list of applications which had their backend code running on the decentralized peer-to-peer networks was referred to as Decentralized Apps or DApps for short. This revolutionary shift in building applications over and for the distributed networks triggered the onset of Blockchain 3.0.

FIG. 14 Smart contracts: workflow.

16

SECTION

A Evolution of distributed systems

Networks based on Direct Acyclic Graph or DAG for short are driving the Blockchain 3.0 DApps. NEO (previously known as AntShares), Hashgraph, and IOTA are some of the Blockchain 3.0 applications leveraging DAG. DAG-based blockchains intend to remove the so-called miners from the transaction settlement process to rapidly enhance the number of transactions that can be handled per second. Compared to 6–7 transactions that can be handled on Bitcoin blockchain, DAG-based blockchains are capable of settling up to 200,000–250,000 transactions per minute which opens up the possibilities for a vast variety of real-world, real-time applications. While there have been major improvements, still a lot is left to be desired in terms of scalability and performance. Microsoft has been a leading early adopter of blockchain, but it will be some time before we can find a clear global leader in this domain. We would discuss DApps in greater detail in Chapter 6.

6.

Limitations and challenges

While blockchains provide a number of benefits, but on the flip side, they have certain limitations which often weigh in on the use case and the final implementation, especially for real-time applications. The prominent limitations amongst those are listed below to help one decide on the applicability for a particular use case [14–17]: l l l l

Scalability Complexity and versions Inherent inefficiencies Security

Scalability: The predominant reason that the initial blockchains haven’t found mass adoption was because of the time they took to settle the transactions. Typically, Bitcoin could process seven transactions compared to 65,000–70,000 done by Visa/MasterCard per minute. While there has been improvement in the daily transactions on the Bitcoin blockchain, yet the number is significantly lower. As of January 2021, the highest number of transactions reported on the Bitcoin blockchain was still just touching 300 per minute. PoW, though secure and transparent, takes time and energy to settle transactions, thus obviating real-time settlements. Entrepreneurs like Elon Musk have expressed their concerns on the amount of energy being consumed by the Bitcoin miners. The back and forth needed for reaching consensus between the nodes can consume not just time but also resources. The slow rate of transaction settlement has led to scalability issues as production environment financial settlements need to be much faster. Blockchains by design tend to get slower with addition of new nodes, whereas centralized financial systems tend to be faster as they do not need to intimate the peer nodes. One approach finding greater adoption is taking the settlement of transactions off the blockchain and use the blockchain only for storing the transactions. Complexity and Versions: Blockchain is a complex technology. Its adoption needs trained technical manpower and that is scarce. Though a number of financial institutions have started adopting blockchains, the adoption is more of a hybrid approach and finds piecemeal implementations. Blockchain applications are hard to duplicate across different use cases and that add a challenge for mass adoption. The bigger challenge is the way the blockchains have been forked and most are not backward compatible, thus most organizations are skeptical on challenges related to upgradation-associated problems. Inherent inefficiencies: Blockchains are inherently inefficient because of the way the transactions are settled. As the data volume grows, the inefficiencies get compounded. Transactions only get appended and not updated so a typical blockchain implementation only grows. In addition, these transactions need to be replicated across nodes and need to be in sync, which by itself is an inefficient mechanism from a resource utilization standpoint. Security: Despite all the inherent safety mechanisms, blockchains are not completely secure and are susceptible to hacks. Ethereum’s DAO experienced a 51% attack in 2016, which led to a loss of approximately 50 million dollars. This caused the Ethereum community to initiate a hard fork and split from the original chain. A 51% attack is caused when more than 50% of the nodes on the blockchain collude to settle malicious transactions. They may even define a fresh history of the chain. Such kind of attacks hit at the very foundation on which the blockchains are setup and work. The settling nodes can themselves be bombarded with the traditional distributed denial-of-service attacks and the distributed network can itself be choked causing delays in settlement times and thus affecting the performance of the entire chain. Blockchains are heavily dependent on encryption, which in term are relying on the probability that enough compute is not available to break the encryption. However, advancements in Quantum computing are posing a serious threat to the blockchain implementations and it is prophesied that in the very near future Quantum computers will be able to walk past the traditional encryption algorithms in moments. While the community is working on post-quantum encryption algorithms, but even when the new algorithms get production ready, it will be a huge effort to move the Public Key infrastructure to the new algorithms.

Decentralized web, distributed ledgers, and build-up to blockchain Chapter

1

17

7. Conclusion With humble and insignificant beginnings, the internet has grown and has had two major design changes over the past four decades or so. Though still not in mass adoption, the decentralized web is likely to grow in the years to come as data security and privacy take the front seat. The rapidly changing design landscape is causing more and more developers and applications to understand and utilize the underlying power of blockchains. Reduced transaction settlement times have resulted in DLTs being adopted for a varied and growing number of applications in the real world. The inherent benefits of immutability, transparency, and trust without depending on a third party have got the financial institutions excited and a growing number of organizations are adopting blockchain vide a varied array of use cases. DLTs and blockchain are here to stay and find more and more mainstream applications.

References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

https://history-computer.com/the-world-wide-web-of-tim-berners-lee/. https://www2.deloitte.com/us/en/insights/topics/digital-transformation/web-3-0-technologies-in-business.html. https://www.expert.ai/blog/web-3-0/. https://permission.io/blog/web-3-0/. https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/492972/gs-16-1-distributed-ledger-technology. pdf. https://www.marcopolonetwork.com/articles/distributed-ledger-technology/. https://papers.ssrn.com/sol3/papers.cfm?abstract_id¼3144241. https://www.iota.org/get-started/what-is-iota. https://semidotinfotech.com/blog/hashgraph-vs-blockchain-making-blockchain-obsolete/. https://nakamotoinstitute.org/static/docs/computer-systems-by-mutually-suspicious-groups.pdf. https://www.forbes.com/sites/vipinbharathan/2020/06/01/the-blockchain-was-born-20-years-before-bitcoin/?sh¼3f7b25b75d71. https://101blockchains.com/blockchain-for-beginners/. https://www.foley.com/en/insights/publications/2021/08/types-of-blockchain-public-private-between. https://www.javatpoint.com/limitation-of-blockchain-technology. https://101blockchains.com/disadvantages-of-blockchain/. https://en.wikipedia.org/wiki/Post-quantum_cryptography. https://inc42.com/features/what-are-the-major-limitations-challenges-in-blockchain/.

This page intentionally left blank

Chapter 2

Decentralized everything: Practical use of blockchain technology in future applications Amit Kumar Tyagi Department of Fashion Technology, National Institute of Fashion Technology, New Delhi, Delhi, India

1. Introduction The supporters and protagonists of decentralized web (DWeb), also known as DWeb, urge for an efficient communication system without depending solely on enormous establishments and institutions who try to extentuate our data for their profit, providing an upper hand for governmental surveillance [1]. These supporters have also acquired numerous projects and apps that are commencing their operation and funding, leaving behind their social momentum. Throwing light on the revelation of Snowden and the Cambridge Analytica scandal, spy work and the privacy of the citizens have been of prime importance. Dweb focuses on the redecentralization of things, which implies that we do not rely on the intermediate medium of channel for our connection. Instead of which, users form an integral part of the network and gain complete control over their data and communicate with others directly through it. Dweb provides a number of choices for its clients to choose from, the major one being: the same service which is decentralized and controlled efficiently. It guarantees supervision and privacy, and moreover, things aren’t bound to disappear all at once just because one person decides to do so. Chines/any other form of governing body would definitely find it hard to block access to a certain site as the information is collected and gathered from a number of places on the Dweb. The protocols and norms used here utilize links which are capable of detecting information and details which have their foundation based on contextual matter, and this is what allows and enables websites and other files to be saved and transferred from one place to another in a variety of formats. Blockchain methodology is one of the most secure and encoded technique, which ensures a decentralized form of digital ledger processes, capable of detecting and tracing ownership in a safe and sound manner without the involvement of trust [2]. Dweb now requires the assistance of technological advancements and cryptocurrency with respect to transfer of data, data storage, and registration of user names which are unique. For example, Protocol Labs initiated Filecoin in August and were able enough to raise $205 m for their creation. The aim is to ensure a profitable environment for forming decentralized data storage network by launching open markets in data storage. Utilizing the remaining capacity available, others’ data can be easily stored there to earn Filecoins. All these deals are maintained and recorded on Blockchain.

1.1 Blockchain technology Blockchain [3] is an emerging technology which is attracted by both financial and academics. Blockchain is a collection of blocks which are linked to each other. Each block contains the previous block’s cryptographic hash value and encrypted transaction. Because of the cryptographic hash value in each block, we cannot modify or delete the data from the block. If any block is modified, all the blocks have to generate new hash values. This immutability is the main principle of Blockchain. Blockchain is a peer-to-peer network which is the main reason to have more applications towards Blockchain. Blockchain is decentralized, so there is no one to control the process which leads to more number of scams on the Blockchain technology, i.e., bitcoin is the first Blockchain application; here due to decentralized authority many duplicates came into existence like aircoins, which brought bad reputations to the Blockchain. As Blockchain is decentralized, there is no chance of hacking the transaction, i.e., the data is not stored in a single database, but it is replicated publicly. So, that is easy to verify and it is immutable. It can be hosted by many computers simultaneously. It is accessed by multiple persons on the internet. Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00010-3 Copyright © 2023 Elsevier Inc. All rights reserved.

19

20

SECTION

A Evolution of distributed systems

Types of Social Structures

Decentralized Peer-to-Peer

Centralized Command & Control

FIG. 1 Difference between decentralized peer to peer and centralized peer.

Fig. 1 shows the difference between decentralized peer to peer and centralized command and control network. Eliminating the need for a centralized node reduces the probability of fraud or biasness about a person (for a specific task). Blockchain innovations, known as Bitcoin’s base, have developed rapidly in various fields and have led to a new economy. Recently, a wide range of Blockchain-based applications and services have emerged. Most developers are still unable to deploy, manage, and track their applications in a simple and efficient way and thus cannot guarantee the reliability and safety of the software. There are many explanations, but the most important is that Blockchain technology itself is complex. When developers build business code, they cannot take precautions to cope with potential failures and are unaware of the effects of the dynamic underlying system.

1.2 Blockchain vs distributed ledger technology A dispatched record holder is a database which has its control completely distributed across numerous computers and nodes. This involves every single node maintaining the record such that, in the case of any modifications in data, the records will be updated. Every single node has the same power, and this makes its functioning easy and simple. As and when every node upgrades its record, the corresponding nodes validate its presence. In fact, Blockchain is indeed a dispatched form of the record holder. We usually consider distributed ledger technology (DLT) as the master of Blockchain [4]. However, as time passes, it has turned out to be extremely popular and useful. Each time a new addition is made, the copies of the ledger are autonomously updated. For safety reasons, transactions are encoded before it’s integrated with the records. Blockchain does not require a central authority to manage operations similar to DLT.

1.3 Evolution of blockchain technology There are several phases as Blockchain 1.0 to Blockchain 4.0 exists for connecting many applications via its distributed and decentralized nature feature. Each evolution for Blockchain Technology [5] can be discussed below as:

Phase-I: Transactions (Blockchain 1.0) Bitcoin was first developed in 2008 as a Blockchain technology application. As an online peer-to-peer network, Satoshi Nakamoto outlined this in his white paper. Nakamoto created the Genesis block (first block of the Blockchain) which mined other blocks, linked to one of the largest Blockchains that hold different information and transactions. Bitcoin, Blockchain application, hit airwaves; several applications have all been applied; all designed to exploit the digital ledger technology’s principles and capacities.

Phase-II: Contracts (Blockchain 2.0) Vitalik Buterin is among the growing list of developing companies that felt Bitcoin had not reached it, as one of the first contributors to Bitcoin codebases was leveraging the full capacity of Blockchain technology. Despite the drawback of Bitcoin, Buterin began to work on what he thought was a decentralized Blockchain capable of performing different functions apart from being a peer-to-peer network. Ethereum was born in 2013 as a new Blockchain for the public with additional functions compared to Bitcoin, a development which was a pivotal moment in the history of Blockchain. Buterin has distinguished Ethereum from Bitcoin Blockchain by allowing the recording of other goods as well as agreements. The new feature extended Ethereum functionality to include the creation of decentralized software, from cryptocurrency. Officially,

Decentralized everything Chapter

2

21

launched in 2013, Ethereum Blockchain has grown in its capacity to support intelligent contracts used to perform various functions and has become one of the main implementations of Blockchain technology.

Phase-III: Applications (Blockchain 3.0) In addition to creating new features to exploit Blockchain technologies, new projects have attempted to address some shortcomings in Bitcoin and Ethereum. Several new Blockchain implementations include NEO (formerly Antshares, an opensource decentralized blockchain decentralized application platform founded in 2014 by Da HongFei and Erik Zhang), which was introduced as the first open-source, decentralized network and Blockchain in China. Including IOTA (an open-source distributed ledger and cryptocurrency designed for the Internet of things [IoT]) and NEO, the other Blockchain platforms of the second generation are also wobbling in the industry. Monero Zcash and Dash Blockchains were developed to resolve some safety and scalability issues related to early Blockchain applications. Digital Assets + Digital Identity + Smart Contract ¼ Smart Economy:

Phase-IV: Blockchain for Industry 4.0 applications (Blockchain 4.0) Blockchain 4.0 means Blockchain for Industry (4.0). Blockchain 4.0 is making Blockchain 3.0 usable in real-life commercial usage. Some real-life scenarios are for supply chain and approval workflows, safe and secure IoT data collection, payments and financial transactions, and fitness and health management. Organization of the work: Section 2 provides the history and evolution of technology from centralize to decentralize via discussing a timeline. Further, Section 3 discusses our motivation behind writing the chapter related to the emerging area. Section 4 discusses “how all people (around the world) can be connected through decentralized applications (Dapps) in an efficient manner”. Further, Section 5 discusses various services provided to end users to use Dapps, i.e., sector wise. Section 6 discusses one popular use case with Blockchain by considering a real word example. Then, several challenges towards Blockchain technology are discussed in Section 7. Later, Section 8 discusses many possible applications with integration of Blockchain technology, like Blockchain–IoT integration, etc. In Section 9, we discuss several problems faced in Dapps or integration of Blockchain with other applications. Section 10 discusses several future research directions towards Dapps. In last, Section 11 concludes this work in brief.

2. Related work Blockchain Technology, a DLT, has been used and taken into consideration by many businesses or applications or sectors to provide trust, immutability, transparency, and reliability to end users. However, still Blockchain has a major problem of storage, and some double spending, 51% attacks, eclipse attack, etc. These attacks are difficult to take place with this technology, but not impossible. Before explaining such issues and problems, we discuss the history of this technology in a sequenced manner.

2.1 History of Blockchain technology The idea behind Blockchain technology was started in 1991 by research scientists Stuart Haber and W. Scott stornetta. They implemented a computationally practical solution for time-stamping digital documents so that they could not be backed up or tampered. The implemented system used cryptographically secured blocks of chain to store time-stamp documents [6]. In 1992, Merkle trees were integrated into the design to make it more effective by allowing the collection of several document certificates into one block. In 2004, the license for this technology was canceled. In 2004, Hal Finney, a computer scientist and cryptographic activist, introduced a system called RPoW (Reusable Proof of Work). RPoW receives a nonexchangeable hash cash-based proof of work (PoW) token, and it generates RSA (an oldest public-key cryptosystem that is widely used for secure data transmission. The acronym "RSA" comes from the surnames of Ron Rivest, Adi Shamir and Leonard Adleman)-signed token that could then be transferred from person to person. RPoW stores the registered tokens on a trusted server to avoid the double spending problem, and it allows people overall the world to verify the correctness and integrity in real time. It was the first step in the history of Bitcoin (cryptocurrencies). Fig. 2 shows the complete history of the evolution of Blockchain (year-wise). In 2008, Satoshi Nakamoto [9] invented Bitcoin. It is a cryptocurrency, and it is known as a decentralized peer-to-peer electronic cash system. In cryptography mail list, it was posted by Satoshi Nakamoto. It works based on the hash cash PoW algorithm. Instead of using RPoW, to avoid the double spending problem, we can use Bitcoin; it provides decentralized peer-to-peer protocol for verifying the correctness of all transactions. Bitcoins are “mined” by individual miners for a

22

SECTION

A Evolution of distributed systems

1990s

2011-12

2013-14

2015-2016

2017-2020

The concept of distributed computing has been around since 1990

The deployment of cryptocurrency in applications related to cash

Financial markets and applications using blockchain beyond cash transactions

Permissioned blockchain network solutions

Implementation of application starts

Origin

Satoshi Nakamoto created bitcoin and introduced the concept of a blockchain to create a conceptualized ledger maintained by anonymons consensus

2009

Transaction

Contracts

Application

Implementation of Application

Currency transfer and digital payment systems

Evolution of smart contracts

Market evolution sub-development and exploration across industries

2012-13

2014-2015

2016-2017

FIG. 2 History of blockchain technology [7,8].

reward using the proof-of-work system and then verified by the network’s decentralized nodes. Bitcoin came into existence on January 3rd, 2009, when Satoshi Nakamoto [9] mined the first Bitcoin block, which had a reward of 50 bitcoins. In the world, the first bitcoin transaction was done on January 12th, 2009. Santoshi Nakamoto is the first sender of bitcoin; he transferred 10 bitcoins to Hal Finney (first recipient of bitcoins). The first application of Blockchain is bitcoin. For the first time, it is possible to transfer money without any trusted third party. Note that there are various positive and negative theories about BitCoin exist outside (in public), which readers can find in Refs. [10–12]. In 2013, Vitalik Buterin, Bitcoin Magazine co-founder and programmer stated that for building Dapps, Bitcoin needed a scripting language. This statement was not agreed upon in the community, So, Vitalik started developing a new Blockchainbased distributed computing platform, Ethereum (global, open-source platform), which had scripting features called smart contracts. Smart contracts are used for exchanging shares, property documents, or anything of value among unknown people in conflict-free transparent manner. It avoids trusted third party (services of middleman). Smart contracts are the executable logic that runs on Blockchain network. Key properties of smart contracts: autonomous (the creator doesn’t have to participate after deploying contract) and decentralized (it does not have a central server). The first application of smart contracts for electronic transactions was proposed by nick Szabo. In particular programming languages, smart contracts are written, compiled, and converted into byte code by Ethereum Virtual Machine (EVM). Developers are also able to code applications that run inside Ethereum Blockchain. These types of applications are called as DApps, for example, gambling, financial exchanges. Ether is the cryptocurrency of Ethereum. It can be used to pay online payments when executing smart contracts. Ether can be transferred between accounts. Issues raised in previous technology are: l l l l l

Intermediators for verifying and charging a fee Possibility of leaking of information Lower trust in a network Not having transparency Theft and illegal sharing of intellectual property

But after introducing the concept of Blockchain since 2008, all entries want to work through a decentralized ledger, which are immutable and irreversible. It avoids all raised issues in previous technology in a single step. Hence, this section discusses the evolution of Blockchain since 1990. Also, it explains how Blockchain is changing today’s applications with its use in many useful applications like healthcare, logistics, finance, retail, etc. Now, the next section will discuss our motivation behind writing this chapter.

Decentralized everything Chapter

2

23

3. Motivation In previous years, we have mitigated several issues like fraud, cheating, and authentication, leaking of personal information, etc., which have affected human being lives and businesses a lot. Also, trust is a major component for occurring of an attack on a system. In previous days, systems were centralized and building trust in Trusted Authority or centralized node was mandatory (need of the system), but today scenario has completely changed. Today, we use Blockchain to remove fraud; bogus people exist in a network. Using this technology, we can save money and time in many applications like voting, parking, healthcare, supply chain management, or logistics, etc. These applications can be improved using Blockchain 2.0 concept, i.e., smart contract, i.e., a digitally signed computed program (which executes automatically). Using Blockchain or smart contract builds trust and preserves privacy of people. Further, we need to provide a complete description of future applications which may arise or exist in a decentralized form. Also, we want to help society or government organizations via protecting their data using this technology.

4. Connecting the world together We cannot presume Blockchain to be the solution to all problems and issues because it has been proven and observed that no unique tool of technology can ever do so. However, when being adopted and executed on an extremely large scale, they seem to withstand the obstacles and issues put forth by the sermonisers of Silicon Valley who seem to have their faith lost in artificial intelligence (AI). First of all, all the financial accumulation with respect to data by Silicon Valley, which was apprehended for Web 2.0, can be redirected and rephased towards Web 3.0. Second, the emerging technique of decentralization from a social perspective put forth by Blockchain has the audacity to redemocratize the activities and interactive involvements of humans. Third, considering the fact that the power of Blockchain isn’t vested in the hands of a centralized authority and instead is controlled by the users and clients proves to be helpful as they themselves are involved in formulating rules and protocols as per their consensus making it resistant to censorship and other fatalities. Furthermore, all technologies making use of Blockchain involve decentralized synchronization and arrangement of human spurs, which include top-down, command-and-control structures that could take care of earlier. Decentralization involves the distribution of functions and powers instead of them being controlled by one, single, central authority. In this type of framework, it becomes extremely difficult to identify a central person. The World Wide Web was initially a centralized source of networking. On the contrary, Bitcoin and Ehtereum involve decentralized frameworks as they implement Blockchain technologies. The major challenge is in bringing over synchronization amid groups of human interactions, making them productive and civilized. The main aim of implementing Blockchain is to remove the powers usually vested in the hands of a single central person and distribute it among many, i.e., major cities, governmental bodies, huge companies, etc. It can be easily observed that decentralization is also challenged socially in our community. All mundane life has been subjected to a hierarchical form of governing, commands, and controls. Though this may prove to be a powerful solution to the majority of the issues arising, the transition to a decentralized social modular structure makes it more flexible and relaxed. Hence, Fig. 3 shows that how Blockchain connects each and every component in the form of a cycle (circular) [13]. Blockchain in a decentralized network provides several services to end users like reliability, trustee operation, decentralized control, distributive storage, fault tolerance, immutability, data integrity, data authentication, no-double spending, log management, auditability, and autonomous operation. Now, these services are discussed by introduction of some applications in the next section in detail.

5. Services provided to end users—Application wise We all are familiar with the fact that Blockchain is a digitalized database which is spread across an extremely wide and open network, comprised of cross-linked blocks which include a number of records possessing details about their transactions. In fact, Blockchain is a public ledger or record keeper such that it keeps expanding its chain and size with the add-on of every new block. The total number of transactions which are processed in a particular block completely depends on the size and capacity of each node. However, once a process or a transaction is an integral part of a Blockchain, no further changes or modifications or alterations can be made to it. Transaction processes are likely to take place in an unsupervised or decentralized environment, which results in improving efficiency. Each time an update takes place, the very same update propagates throughout the entire database/network. The network nodes are completely involved in the certification of transactions with the help of consensus algorithms [14]. Distributed consensus mechanism, digital signature, and cryptographic hash (see Fig. 4) are few of the technologies extensively exploited by Blockchain [15]. The main reason as to why

24

SECTION

A Evolution of distributed systems

Reliability Trustfree Operation

Autonomous Operation

Decentralized Control

Auditability

Log Management

Distributed Storage

No Doublespending

Fault Tolerance

Data Authentication

Immutability Data Integrity

FIG. 3 Blockchain for Internet of Things applications.

these techniques have been in use is solely because of their reliable, consistent, anonymous, and decentralized perspective. Blockchain has a variety of implementations including those of crypto-currency, digital assets, smart contracts, IoT, financial services, etc. Moreover, several services are provided through decentralized technology or distributive ledger technology which are reliability, trustee operation, decentralized control, distributive storage, fault tolerance, immutability, data integrity, data authentication, no-double spending, log management, auditability, and autonomous operation. Now, each and every service provided by Blockchain technology can be discussed here in brief as follows: (a) Reliability: Blockchain is considered reliable because all active nodes maintain full copies of the Blockchain ledger. Therefore, if one node goes offline, all other participants in the network still have the ledger readily accessible. (b) Trustee operation: As part of the process of adding information, that information shall be publicly announced, providing a complete, transparent history capable of public scrutiny. This does not suggest that the Blockchain is not private—integrity can still be preserved around the protection of financial information—but it’s done differently.

Decentralized everything Chapter

2

25

Shared and Distributed

Decentralized, Peer-to-peer Communication

Consensus Based Update

Immutable and Transparent Log

Sequential and Time-stamped

Irreversible and Auditable

Minimized Third Party Interfaceand Dependency

Cryptographically Secured, Digital Ledger FIG. 4 Blockchain characteristics.

(c) Decentralized control: Blockchain has no central location to store any of its knowledge. Instead, the Blockchain is copied and distributed over a computer network. Whenever a new block is added to the Blockchain, each network computer updates its Blockchain to represent the shift. (d) Distributive storage: The information is packaged into blocks, which connect to other blocks of similar information to form a chain. It is this act of linking blocks into a chain that makes the information that is stored on a Blockchain so credible. (e) Fault tolerance: Blockchain gives us an extreme level of tolerance to faults. It operates at its core on a peer-to-peer model of the network, in which each node is considered equal to the other. (f) Immutability: A Blockchain is built to be immutable; once a piece of information goes in there, we can rely on it never to alter. One can assume the Blockchain data is real, having been checked by multiple network participants. (g) Data integrity: Merkle Tree guarantees data integrity in Blockchain. In the form of a Merkle tree, each block stores all the transaction data that it has. In this data structure, hashes of infant nodes are merged into the header of the parent node. (h) Data authentication: Blockchain uses a decentralized approach where the chain is completely open to the public, and there is no encryption of confidential data. Peer-to-peer authentication is offered via a Blockchain mechanism to the user of the cloud database. (i) No-double spending: Bitcoin relies on a universal ledger, called a Blockchain, to manage the double spending problem. The Blockchain provides a way for all nodes to be aware of every transaction to prove that no attempts to double spend have occurred. (j) Log management: The components of Blockchain include log consistency and redundancy, while the portion of the Blockchain client is responsible for saving logs on the behalf of an information system. (k) Auditability: Blockchain helps users to make judgments based on all past transactions, not just some random samples. This is through the confidence the auditors will provide to the public about the outcome of the audit. (l) Autonomous operation: Blockchain networks are quite secure and automated because of the fact that they run on decentralized mechanisms, peer-peer nodes, ledger records for transactions, self-controlled data ownership, etc. Smart Contract is the best example of this feature. Keeping aside all the details spoken about Blockchain, up until now, Blockchain-as-a-Service (BaaS) is a third-party development based on cloud networks and is extremely productive for establishments, which cater to the creation of Blockchain

26

SECTION

A Evolution of distributed systems

applications. Baas has its roots developed from software-as-a-service (SaaS) and works in similar methods. It helps the users to come up with cloud-based solutions for the purpose of building, hosting, and operating on the Blockchain apps developed by them. The current portion discusses different services which are given to clients through ledger technologies. The following portion will elucidate a variety of uses and possible research options as per Blockchain technologies.

6.

Blockchain technology use cases and a way forward

A number of use cases will be discussed in this section with Blockchain catering to healthcare, banking, accounts, production, etc. The decentralized and trust-less form of Blockchain methods have led to better and novel opportunities and chances which profit the businesses by catering to more transparency, better security, and easy tracking policies. We will now talk about Blockchain technology-based use cases in a number of fields. The use of Blockchain technology can be categorized as follows: (a) In healthcare The urge for improved patient-centered services with better accuracy and precision are the driving factors for digital healthcare and quick and easy access to medical data. The spark of development technologically in health began with the introduction of AI, accelerating towards Blockchain technology [16]. A few of the major cases where Blockchain is likely to improvise in the field of digitalized health care: l l

l

Easy and effortless access and transfer of data with a reduction in transaction prices. Crossing all obstacles and challenges of the master–patient index using cryptography to enhance the integrity of data with safer modes and methods Readiness of smart contracts which allow transactions without using intermediates or third parties.

On the whole, enhanced sharing of data amid healthcare providers includes better chances of precise analysis, effective treatment methods, and enhanced ability of medical organizations to portray and deliver affordable care. Blockchain permits a plethora of stakeholders in the medical sector to share and distribute access authorities to networks without sacrificing the security of data and consistency, by enabling data tracking. Blockchain is being very often forced and manipulated to revamp the collective exchange of significant research and important healthcare data, thus permitting major stakeholders like clinical researchers, doctors, etc., to acquire safer, easier, and quicker access to medical details in the electronic form. Numerous medical tech vendors are making use of medical data and image management cloud-based services, i.e., which can be combined with HIE (Health Information Exchange) modules. Moreover, influencing other health institutions to purchase it, sell and exchange values without the interference of an intermediary or a third wheel are facilitated by Blockchain along with complete transparency and flexibility. It’s a fact that Blockchain would guarantee an evolved future in the fields of healthcare and medicine. (b) Supply chain management The most globally implementable perspective of Blockchain technology is its key feature to allow security and transparency while supervising transactions (Fig. 5). Blockchain allows transactions to be recorded and maintained in a decentralized manner, i.e., decreasing the delay of time, overhead expenses, and human errors [17]. The main areas which Capgemini predicts to see Blockchain being developed to the largest extend are: digital marketplaces, tracking the supply of chain arguments, tracking the quality of components, etc. The most generic implementation of Blockchain for the determination of business issues is supply chain usage because of the deficiency of vehicle location tracing or in linkage with the clients moving through the supply chain. To sum it up, manufacturing sectors have a majority of the at-scale dispositions of Blockchain up until today. l

l

Amalgamating IoT and Blockchain at the container level in supply chains will definitely increase the validation, transparency and contextual necessities while decreasing the fabrications. The absence of a clear Return of Investment (ROI), immature technology, and governing challenges are the major obstacles Pacesetter-class manufacturers are likely to pass through in getting Blockchain start-ups recognized into production and development.

Hence, we can see that Blockchain is more useful in supply chain management to reduce frauds and delivery of the item on time (i.e., auditable) to end users [17,18]. (c) In manufacturing industry

Decentralized everything Chapter

High

Tracking provenance

Digital Marketplaces

Contracts management

Tracking critical parameters

Digital thread

Tracking asset maintenance

Trade financing

Tracking components quality

Inventory and pilferage tracking

Tracking production

2

27

Prevention of counterfeits Adoption

Payments to suppliers

Tracking asset conditions

Regulatory Compliance

Edge computing

Sharing Operations data

Customer warranties

Loyalty programs

Tracking return goods

Contract labor procurement

Tracking recalled parts

Trade promotion

Carbon credits

Enabling pricing transparency

Low High

Complexity

Low

Procurement Production and maintenance Distribution and logistics Sales and marketing Entire value chain

FIG. 5 Use case of blockchain in supply chain management.

The fact that Blockchain involves DLT, which is capable of maintaining and storing all the data exchanges and transactions, results in easy data tracking. Furthermore, after the data has been stored, modification or alteration of data is impossible [19]. The unique features of Blockchain include: l l l

l

l

Immutability: The resilience to modify the data once it has been appended to DLT/Blockchain. Easy traceability: Tracking of data becomes easier and more affordable. Decentralization: Blockchain implements a completely decentralized network rather than maintaining it in the central server. Data security and transparency: These form two other important and striking features of Blockchain. Due to the data being stored cryptographically, modification of data by unauthorized people would be a near impossible task. Moreover, all of the data stored is completely accessible and visible to all the people in the network, making it an unavoidable feature of future technological demands. A novel catalytic agent of industry-wide tri-functionality

The application of Blockchain with respect to industrial processing is more efficient when compared to the combination of Blockchain with IoT and 3D printing, ensuring a smarter and more unique way of development. (d) In transportation/vehicular ad-hoc network Using Blockchain, we can provide trust among users and preserve the privacy of users in vehicular ad-hoc network. Also, in intelligent autonomous systems or connected vehicles or connected autonomous electric vehicles, hybrid electric vehicles (with driver), we can use Blockchain technology for securing communication (data at rest/data in motion via creating blocks) which is stored on the cloud side [20]. Using Blockchain technology, we could capture the vehicle’s location (using

28

SECTION

A Evolution of distributed systems

smart contract), trace the vehicle’s position (via passing secured information in blocks), and record information or cab riding ratings (using fault-tolerant services), phenomenon from IoT objects committed to the components or vehicle. Hence, with its decentralized and trustless nature, Blockchain technology can lead to new opportunities in Autonomous vehicles and benefit businesses of automobiles/intelligent transportation systems (or others) through greater transparency, enhanced security, and easier traceability. (e) In banking and finance The financial services and banking fields have already been exposed to better benefits from Blockchain. In simpler terms, disruptive technology is an online platform for ledger services that store a few of the permissioned sections which contain unalterable data which are easily accessible by the verified members without any physical interruption [21]. Blockchain technology and DLT could disintermediate key facilities that are provided by the banks, and they include: l

l

l

l

l

l

Payments: By developing a decentralized recorder for payment transactions, Blockchain technology could actually help smoothen quicker payments at a lower fee than that of the bank. Clearance and Settlement Systems: Operational costs can actually be cut down with the help of distributed ledgers, bringing us closer to transactions that are real-time amid financial establishments. Fundraising: Novel models of funding which are capable of accessing capital from typical capital-providing facilities and firms are put forth by Initial Coin Offerings (ICOs). Securities: Traditional safety practices like stocks, bonds, and other assets are embedded with public Blockchains, making them more efficient, interlinked, and smarter. Loans and Credit: By eradicating the requirement for gatekeepers in the financial industry, Blockchain methodologies have the capability of making it safe and sound to lend money along with reduced interest rates. Trade Finance: By replacement of bulky and heavy bills of lading process in the finance market, Blockchain technology can produce more transparency, security, and trust amid global trade partners.

Apart from this, Blockchain can reduce frauds, bogus users/customers, etc., from large systems. (f) In Information Project named “Storj” utilizes decentralization to improve cloud storage security and encrypt your personal files using cryptography. This means that we are in full control of your data and that we are the only ones who can access it. Apart from this, any Government (of a nation) can use Blockchain technology [22]. l l l

Building trust with citizens Protecting sensitive data Reducing costs and improving efficiency

(g) In voting Blockchain is not only limited to the exchange of cryptocurrencies. We have seen many applications of Blockchain (as discussed above); it can help the government with transparent (and maximum percentage) voting (through its distributed and decentralized nature). There have been debates regarding the lack of transparency and trust in the voting system [23]. General elections have many issues such as lack of transparency, hacking of political party’s emails, auditability of votes, accessibility, and security of votes. Blockchain solves all these problems with its unique features. In many countries like Sierra Leone, Russia, Blockchain is adopted in an election for reduce bogus voters (or fake citizens) or reduce corruption. (h) Others The development and growth of 5G wireless networks and Blockchain helps to restructure and remodel healthcare digitally. With its unparalleled data transaction speed and strength, this technique is often seen as the stepping stone to innovative creations, as it helps in the accommodation of enhancements made in AI, Machine Learning, etc. With the evolution of this technical ecosystem, Blockchain guarantees considerable improvisations in captivating the record details of patients. The possible applications of Blockchain with IoT and finding gaps in Blockchain-IoT combination can be inferred from Tables A.1 and A.2. It’s important to observe that the major data breach accidents are increasing the opportunities for using Blockchain in different sectors, like that as healthcare. Thus, this section talks about Blockchain technology in a plethora of applications. Now, the next section will provide essential information, i.e., challenges faced with Blockchain technology today and in near future.

Decentralized everything Chapter

2

29

7. Challenges in Blockchain technology The main idea behind Blockchain is very constructive but still there exist a great number of challenges in its implementation [24]. Some of its challenges are specified below:

7.1 Storage capacity and scalability Among all the other sections, scaling and storage capacity have turned out to be the most questioned area of block chain. The chain keeps on growing on a regular basis. The growth rate of the Blockchain is 1 MB per block every 10 min in Bitcoin, whereas their copies are stored among the nodes of the network. A node that fully validates the transactions as well as the block, which are also known as full nodes, is considered to be the storage cells of the full chain. As the chain size increases, the need for more and more resources increases which indeed reduces the system’s scale of capacity. Additively, if a chain is oversized, it has some negative impact on the performance, like synchronization time for the fresh users is increased. Transaction validation is one of the prime features of the distributed consumer’s protocol because the nodes belonging to the Blockchain network are supposed to validate each and every transaction of each and every block. The modulation of the computational power is done with the help of the number of transactions in a block and the time in between them, and the transaction confirmation time is directly dependent on this. The scalability of the Blockchain network is directly affected by the consensus protocol. Considering all the past limitations of the trust model of Bitcoin and its scalability, Bitcoin NG has come up with a new proposal of Byzantine fault-tolerant Blockchain protocol, which was put forward to improve the consensus latency as compared to Bitcoin. Litecoin and Bitcoin are moreover technically identical, but there is some advancement and improvement like, faster transaction confirmation times and improved and efficient storage. The credit for this efficiency goes to the reduction time of the Blockchain generation and the proved work, which basically relies on a scrypt which is a memory-intensive password-based key derivation function. Then come into action GHOST majorly focuses on improving the scalability of Bitcoin by performing a few new changes to its chain selection rule. A set of off-chain solutions is given where the basic idea is to perform transactions off the chain, increasing the bandwidth and the probability of losing the data at the same time. One other solution proposed for this scalability problem is the reduction in the propagation delay in the Bitcoin protocol, though one of its limitations is that it may lead to the compromising of the network security. BigchainDB insists on incrementing the Blockchain characteristics to big data distributed database instead of increasing the scalability of the block chain. BigchainDB produces a combination of high-throughput, low-latency characteristics of big data distributed databases along with immutability and decentralized Blockchain system. Adding on mode to the solutions to this problem, one highly recognized solution is the development of Inter Planetary File System (IPFS). This protocol is designed in a way that it stores decentralized and shared files and enables a P2P distribution file system so that the web could be made safer, faster, and more transparent. It majorly focuses on increasing the efficiency of the web and elimination of duplicity and tracking the version history of each and every file.

7.2 Security: Weaknesses and threats Quite a significant number of vulnerabilities and security threats were known when the complete analysis of Bitcoin was done. Among all the threats, the most important one which popped up and required special attention was the majority attack or the 51% attack. If the Blockchain participant is successful in controlling 51% of the mining power, it would be possible that this attack may exist. In such a situation, it is highly recommended to control the network’s consensus. The integrity of Bitcoin is at stake with the rapid evolution of the mining pools (GHash.io4 almost reaching 51% of the Bitcoin mining power in 2014) that has indeed increased the chances of this attack. Also, it is witnessed that the chances of reaching a major division of the mining power can be laid forward by bribery, as per discussed by a few authors. In order to reduce such problems, the solo mining incentive or P2P mining is considered one of the executable options. Apart from this, there exist many unknown consensus mechanisms for Blockchain as well, which are subjected to majority attacks, the consensus conducted among a limited number of users holding a major field for such attacks. If the same coin is spent twice, then it turns out to be a double-spend attack. The most preferred depth of the Blockchain starts from 5 or 6 in order to consider the confirmation of a certain block where the transaction is stored. The average time it takes is in the range of 20–40 min. As the confirmation time depends on many significant factors, there is a large variance that occurs in the confirmation time. In cases of fast payments, such waits are not appreciable which thus leads to double-spend attacks in such cases. The most significant attacks like denial of service (DoS), man in the middle (MitM), or sybil also has high chances of interfering in network operations. Due to the strong dependency of P2P protocols and IoT infrastructures on

30

SECTION

A Evolution of distributed systems

communications, they are also prone to such kinds of attacks. There is also an eclipse attack known, where attackers initially monopolize node connections, isolating it from the rest of the main network, and thus altering the view of the network for the same node. In order to improve the conditions of the previously laid protocols, the part of the cryptocurrency community usually supports code updates as well as the need for optimization required in Blockchain networks. Such improvements are given the name of hard or soft forks in basic Blockchain terminologies. The backward compatibility with previous blocks is recognizable with the help of updating software protocols, and such updates are provided by soft forks, which require the upgradation of majority miners to the new software. It is even possible to reject the upgraded functionality to keep up with the old rules, whereas hard forks tend to bring a radical change to the protocol, avoiding compatibility with the prior blocks and transactions. However, no old versions are accepted and all the nodes are upgraded to the latest update. Two different forks of the network are created when the hard fork is divided into communities. Just like SegWit2x, many hard forks can be canceled if no sufficient consensus is built. A few examples of division of these forks are Ethereum and Ethereum Classic; and Bitcoin, Bitcoin Cash, and Bitcoin Gold. Both the hard forks have progressed as much as their original forks in the market and now are giving a tough competition to their original forks. The continuity of the fork depends on versions chosen by nodes and users. Therefore, there is a possibility of hard forks diving themselves into two major different blockchains, which are completely different and thus can cause a risk to Blockchain users. Beyond the controversy regarding the real values of virtual currencies, another major problem of virtual currencies is the loss of coins. These coins can only be accessed through the wallet key; if in any case it is forgotten, there is no other mechanism through which one can access the coins. According to the estimations, it is predicted that 30% of the coins are not to be found. The computing power of Quantum computing tends to break the security measures of digital signatures, which could turn out to be a great threat to Bitcoin. With the advancement in technologies, new bugs as well as security breaches are discovered every now and then. Since the Blockchain data is immutable, these improvements can compromise public Blockchains with the help of encrypted data.

7.3 Anonymity and data privacy The basic protocol design of Bitcoin is not enforced with privacy directly. Basically, Bitcoin is known for its transparency. From the very first transaction itself, there can be kept a track of each and every transaction in Bitcoin; it can be checked, audited as well as traced. This kind of transparency acts as a major building block in order to gain the trust of customers. But this transparency may lead to a devastating effect on the privacy of the user. Irrespective of no direct contact between the wallets and the individuals, the user’s anonymity is put at stake even after all the privileged mechanisms that Bitcoin provides, like providing pseudonyms and the use of multiple wallets. Hence, now efforts are being made to get along the transparency as well as user’s anonymity together in apt proportions. Not only open virtual currencies but there are many other areas of public Blockchain as well which demand much more privacy in the chain, more precisely if we say the areas handling the sensitive data are more prone to privacy attacks and thus require a higher level of privacy to ensure safety. Zerocoin [25] and Zerocash are some of the extensions of Bitcoin which were put into action in order to ensure anonymity problems faced by Bitcoin [26]. They have completely anonymous transactions; the sender, the receiver, and all the other information are also hidden in these extensions. One more advancement to ensure privacy is Monero, which revolves around the concept of using a ring of signatures so as to make transactions untraceable; any individual or computer is unable to trace back easily. Adding on to the solutions of privacy problems, transaction mixing services or tumblers have been put into action to protect the anonymity of the user. The main motive behind these services is to break transactions into smaller payments and is obscured to be scheduled as a fee. Such services are known to be more prone to theft. Similarly, there exists CoinJoin, which was proposed to maintain the anonymity of Bitcoin. It proved to be a coin-mixing approach. The ideology behind this is that the users invest as a joint account so that transaction inputs can no longer be assumed from the same wallet. But there are chances that it lacks the required anonymity based on the implementations because of the previous negotiations required between the users, which are gained by mixing servers. This approach survived in the market by becoming a backbone of a new approach called dark wallet, which sustains the anonymity of Bitcoin by using a browser plugin. Dash turned out to be the first cryptocurrency that indeed supported both anonymity and privacy. A few more approaches are listed: l l l

l

MixCoin—In order to increase security, it adds cryptographic accountability mechanisms and randomized mixing fees. CoinShuffle—An extended version with adding modifications to the CoinJoin in order to ensure privacy. CoinSwap—It includes the transaction mechanism where the inclusion of the intermediaries that receive coins is done, and the payment is made using unconnected coins. Blindcoin—This indeed increases the anonymity of mixing servers.

Decentralized everything Chapter

2

31

The basic idea it uses is to maintain a deregulated Bitcoin, and hence generally encounter accusations of encouraging illicit activities, like illegal products on Darknet or money laundering. Encryption of data is one of the techniques which can be used to uplift privacy issues. Hawk stores are capable of encrypted transactions. The basic working of the Hawk compiler includes translating the generic codes written by programmers to cryptographic primitives, which can protect the information anonymity in transactions. Then, we see the development of the Enigma project, along with encryption; it also focuses on splitting data into unrecognizable parts and distributing them through the network, so that no node ever gets to access the data. The store data references are stored using the decentralized off-chain distributed hash table, which is accessible through the Blockchain. There are different approaches through which the privacy in private Blockchains can be handled; few are like providing authentication and authorization. It is witnessed that not only public Blockchain but even private Blockchain participants demand for privacy and security of their data. In order to sustain this kind of privacy issues, Quorum was introduced, which is a private permissioned Blockchain and is based on Ethereum; it basically uses cryptography and segmentation to limit the visibility of sensitive data and increase privacy, respectively. Multichain can be put into action by limiting the visibility with the user’s permission and by introducing a set of controls that allow transactions and further allow the users to mine. There is one other approach which is based on Ethereum, known as Rockchain, which follows a data-centric approach, public calculations are performed on private data, and data privacy can indeed help in obtaining accumulative results. This approach creates a distributed file system that helps the users to manage data privacy through smart contracts. In order to focus on enterprise environments, Hyperledger Fabric provides a distributed and scalable ledger. In order to maintain their privacy, users are allowed to control and restrict access to the shared information in the network; such identity control services and access control lists with the help of private channels are provided by Hyperledger Fabric, so as to ensure that Blockchain networks have obtained privacy control. This mechanism is of great use to ensure that the members accessing this network know each other through their public identities and still the information that is present in this network is not open. One of the other mechanisms which can be used to deal with data privacy is to keep the sensitive data far away from the chain, i.e., to store the sensitive data outside the chain; this is also known as off-chain solution. This approach can be very useful if the data is in bulk because it is not so feasible to store large amounts of data inside the Blockchain. Even the fields of healthcare tend to witness larger use of this approach because this approach practically supports the protection of very sensitive information. The anchored data can be stored with the help of public Blockchain so that the proof to verify the integrity and time stamps of data is available. Even when the data is stored with all the necessary precautions, users can still take the help of Blockchain to verify the data without actually relying on the authorities by checking the Blockchain. These off-chain sources are expected to be fault tolerant and should avoid the introduction of bottlenecks or single points of failure. To store the key-value pairs that access, control, and store the data, a well-known DHT is propped using a Kademlia by some authors. A pointer and a hash which is the major requirement to validate the obtained data are stored in a chain. Data in the chain acts as a link to private data, whereas the hash remains unaltered; the hash is used to verify the obtained information. It is kept into prime consideration that only the authorized parties are allowed to access the information, and this is done using access control mechanisms for off-chain sources. Thus, the Blockchain can help external sources to provide the necessary information in a secure and verified way.

7.4 Smart contracts What does a smart contract mean? In 1993, Nick Szabo came up with a definition of smart contract, which says “it is a computerized transaction protocol that executes the terms of a contract”. The smart contract enables a way to enforce or self-execution of contractual clauses, which proves to be one of the prime features of smart contract. This was technologically unviable until Blockchain came into existence. Bloc chain turned out to be the most important discovery in order to lead forward the concept of smart contracts. The smart contract has provided a good pace for Blockchain to lead in the market; this coupling together has formed what is known as the second generation of Blockchain, generally called Blockchain2.0. There is a new way that promises to change the scenario of current business with the combination of automatically executed contracts without centralized control in a trusted environment. The basic process is that the Blockchain is the storage unit for the smart code, where each contract is designated with a unique address. In order to carry out some operation, the user is sent a transaction to that address. The Blockchain consensus protocol tackles the correct execution of the contract. Smart Contract has witnessed an enormous number of advantages like reduced costs, greater speed, efficiency, precision, and transparency, which makes it one of the most approached mechanisms used in a variety of areas for numerous applications. The basic scripting language offered by Bitcoin marks insufficiency, which can be overcome by a better level of Blockchain platforms integrated with the smart contract functionality. Ethereum has been a lot in use either directly or as a backbone of some other approaches. Ethereum allows the definition of

32

SECTION

A Evolution of distributed systems

smart contracts and Dapps with the help of a built-in Turing complete programming language. EVM code is the platform which is used to write the codes of Ethereum contracts, which is indeed a low-level and stack-based bytecode language. Smart contracts relate to finance generally tend to require access to data about real-world states and events on a higher frequency. This is the time when Oracles are used, in order to supply such data. Such entities hold a major and crucial acknowledgment for the successful integration of smart contracts within the real world, but on the contrary, it also increases the complexity because the authentication, security, and trust in oracles are to be provided. Cost plays a major factor in the advantages of smart contracts. They are more vulnerable to a series of attacks which can further lead to many more challenges which require existing techniques to be solved. A major issue like delegating contract execution to computers can lead to the introduction of a few technical problems like hacking, bugs, viruses, or communication failures. Just because the system is immutable and irreversible, bugs in contract coding can be more critical. The basic requirement for safe adoption by clients and providers is that the mechanism should provide verified and guaranteed operation of smart contracts. In years to come, the main area which would need focus is the formal validation of the contract logic and its correctness. Real-life contracts generally witness clauses or conditions which cannot be categorized as quantifiable. When we summarize this, it is seen that there is still a vast cope left to model the conditions of the contracts in smart contracts to ensure representation of the contracts in a presentable and quantifiable fashion. Apart from all this, major implementations are to be done to uplift the front end of this.

7.5 Legal issues One of the most attractive as well as the most dangerous peculiarities of Bitcoin is the absence of a certain central authority, the nonexisting minting entity, and in addition the total dearth of censorship in Bitcoin. Because of the acquisitions of using the network for fraudulent purposes, it is known for promoting and facilitating illegal conduct. Bitcoin, being the first decentralized cryptocurrency has led to a lot of dispute. On one side, it is predicted to collapse as it is claimed as a fraud, whereas at the same time, others estimate its value to reach 100,000 dollars in the coming 10 years. It has been warned about its volatility risk but has by the European Central Bank, but at the same time, its potential is appreciated as a financial innovation. Many countries have come up with new laws and governing rules in order to control the regulation of the use of virtual currencies because there is a lack of proper governance regarding this. If by any chance it faces any downfall or experiences any uncertainty, it would be because of this reason. The ultimate call of whether or not the currency becomes a legal tender will be in the hands of the government and banks. If legal complications with respect to currencies are not considered as an area of concern, then they can have a direct and negative drawback on Blockchain applications in the field of managing currencies. The recently emerging applications of Blockchain are highly private and permissioned. These Blockchains provide written permissions to the predefined peer or set of peers. Authentication and authorization are the benefits that can be obtained, like key recovery or transaction redemption and can also turn out to be a significant contribution in simplifying the privacy problem and reducing transaction latency. If authorities handled the insurance coverage for Bitcoin responsibly, then there would be no need of interesting markets that have arisen due to this. The government looks forward to a regulated and controlled use of this Blockchain technology in various applications, and the development of such Blockchains is regulated by the threat caused due to mining pools controlling the network along with the other vulnerabilities. This somehow shows that the trustless network has the possibility of returning to a third-party trust network. It has the potential to create bottlenecks if the solutions included centralized entities. The features of Blockchains and distributed databases are approximately closer. The only possibility of ensuring the participant’s confidence in this technology could be attained by the direct involvement of the government of large companies. As of now, personal information is distributed among the government, universities, companies, etc. The area for the spreading of information is very vast, and accessing also utilizes quite a large amount of time, even when their point of answering is the same authority. This initiates the construction of obstacles as well as distrust in the services which might have guaranteed information. If we consider this point in time, it is believed that a trustworthy and global service could be a disruptive move. Each country already has its own rules and defined regulations. Alastria is one initiative which has the main goal of involving multiple entities in the development of a national regulated Blockchain, which is a part of public notaries, universities, and private companies. The main aim is to provide each and every participant a public and legal wallet. Companies are also invited to be a part of this network. A wallet may thus involve the digital proof of all the possessions of the participant like company they have worked in, college degrees, and many more. Many services could be accessed through this information. Let us take for any example an interview scenario, where mark sheets and college degrees play a vital role, and all these can be accessed through personal wallets in a legal format. This information tends to be reliable and verifiable. These are the fields that are the keys in order to extend Blockchain at different levels. Additively, it is also capable of facilitating administrative transactions of the populations in order to extract information, ensure data transfer, reduction of corrupt information, and a seamless integration between

Decentralized everything Chapter

2

33

companies, governments, and universities. Conclusively, it is also necessary to gain highly private information, so that privacy and security can go along with the initiatives in a proper fashion.

7.6 Consensus The consensus mechanism’s prime responsibility is to maintain the integrity of the information that the Blockchain have, parallel to the act of defecting against double-spend attacks so that it can ensure an essential part of the Blockchain technology. What it strives for is a consensus in a distributed network with no central authority and the involvement of participants with no mutual trust. The miners are allowed to solve a computationally intensive and easily verifiable task to create a new block basically, and this idea can basically be succeeded in Bitcoin with the help of consensus based on the PoW. Once the solution is found, the solution is further published and the new block is added to the chain. Now the new block is circulated across the network, and later, the other participants perform the verification and append it to the local copy of the blockchain. The chain is a fact tree because it has the capability to occur in different parts of the network simultaneously. The Blockchain consists of several validated branches which exist simultaneously. When the appending occurs, it should be ensured that the longest chain is the valid one, i.e., the branch with the most accumulated work. This allows the quick achievement of the consensus.

8. Future applications with Blockchain technology In a world wherein assets, data, trust, and identity revolve around the digitally operable structure from all corners of the world, our outer and inner selves could completely change. This profit supports crypto-currencies along with industrial necessities to store large amounts of data. Moreover, it is also capable in supporting and uplifting financial, public, and socialistic activities including land record management, asset supervision, educational backgrounds, and related services [27]. A few of the industries which deploy Blockchain technology to improve their functioning are banking, cyber-security, academics, marketing and advertising, medical field, IoT, etc. Summaries of various applications related to these facilities are listed in Tables A.1 and A.2 (refer Appendix). A few major implementations are mentioned in Tables A.1–A.3 (please refer Appendix). Here, some abbreviations are used as: ADEPT—autonomous decentralized peer-to-peer telemetry system, SCM—supply chain management. In general, Blockchain technology is applicable for the following conditions, (a) (b) (c) (d)

Digitization of assets to provide data-driven business models. Digitization of processes and transactions among business partners. Provision of immutable records of transactions and assets. Provision of decentralized, permanent, and secure data storage.

Hence, this section discusses various future applications in Blockchain Technology. Now, next section will discuss several faced in Dapps in near future.

9. Problems faced in (by) decentralizing applications The Internet Archive, the nonprofit organization that archives the web through snapshots of web pages and other media, has made a first attempt to decentralize its website by bringing together many of the technologies. However, in the absence of online intermediaries who practice and execute their central power, there are possibilities of digital harassments. For example, the very same technique used for safeguarding the clients in DWeb might also be the weapon used by online harassers, criminals, and abusers. If DWeb permits people to maintain their files in a completely encrypted form, there are chances that they misuse it by storing pictures which they should not be. DWeb is likely to face a variety of problems: l

l

l

The first and foremost issue which they would have to tackle is the task of developing a DWeb as everything isn’t in place after which comes the task of getting more people to utilize it. “Right now, humanity lives at Facebook”, says Mitchell Baker, chairwoman of the Mozilla Foundation. It’s a striking app that has everything that everyone wants, and yet, it’s not existent. This is not highly surprising, nor is it a failure, adds Baker. Another area of focus must be on the core advantages of DWeb, i.e., those tasks which the centralized systems aren’t capable of performing says Juan Benet, founder of Protocol Labs. One of the major ones being speed. As per the completely different framework and architecture of DWeb when compared to other webpages, DWeb needs to be fast and smooth. Further, massive issues pertaining to governance need to be eradicated, but how does DWeb integrate and function together when there’s no one in charge? How do we ensure that it does not return back to the state of centralized web? It’s expected to sum up, fine-tune, and help us elucidate and monitor the complicated and messed up real world.

34

SECTION

A Evolution of distributed systems

Many digital tools and their capacity for computation is their role in enhancing coordination, or the ability of humans to communicate, transact, and investigate productively, together. By distributing power and value across global systems, the exchange of information and value can become more efficient, equitable, open, and more collaborative. There are quite a few hurdles associated with Blockchain networks [28] (also discussed in Section 7), and Table A.3 is a great way to analyze the reach gaps in Blockchain-IoTs integration implementation. There’s a need for large amounts of storage of data and information along with the validation and authentication process which is involved. Only a handful of the processes/transactions are performed every second, and this is due to the restricted block size leading to delay in transactions and increased costs. If the size of the block would have been greater, it would further lead to propagation delays. However, it’s possible to develop unreal blocks with the help of network nodes which are true in the reverse order. The high rate of generating blocks can be easily accommodated by enabling higher power consumption which leads to legit blocks. Another key challenge is the consumption of energy, and it’s approximated that Bitcoin transactions require around 80,000 times more energy when compared to that of credit card processes. Note that Blockchain will face different Blockchain adoption challenges before it is integrated into society. These include scalability, the time needed to verify transactions, leaking of privacy, criminal’s connection, and the cost of transactions and security. Note that there are plenty of proof points that are gaining traction every day, but still Blockchains are not ready for adapting in some applications. Hence, Table A.3 provides several research gaps in integration of Blockchain—IoT [28]. Note that for integration of Blockchain and AI, readers can refer [29–31]. Also, readers can refer AI-IoT-Blockchain scope of building smart environments like Smart home [32], Smart cities [33–35]. Also, few possible uses of Blockchain (including serious concerns) in near future have been discussed in [26,36–42]. Hence, this section discusses several problems faced in near future in Dapps. Now, the next work will conclude this work in brief with including some future remarks.

10.

Future research directions/a way forward towards decentralized applications

As discussed in Section 9, IoT—Blockchain integration will have serious concerns like security and privacy. Further, we have seen in [36,43] that these issues are common in almost all applications. We can individually provide a solution to each application, i.e., provide reliable, secure service through Blockchain. Authors in [7] have tried to provide reliable and affordable schemes to patients or healthcare officials to protect electronic healthcare records (EHRs) or data of patient. In near future, many of the top most platforms which instill innovation and creativity are Hyperledger, R3, and Ethereum and are at the base of the Blockchain process “pyramid”. Numerous horizontal and vertical sources are being portrayed by a number of IT vendors like that of IBM, Microsoft, Oracle, SAP, etc. They have been developing these software on the basis of three major open-source platforms. Succeeding this, middleware devices form the central layer of the pyramid. Modified and personally designed solutions for various vertical forms of Blockchain are being issues from different establishments like KPMG, Accenture, Cognizant, etc. These are the sources that form the top most layer of the pyramid. Blockchain technology is at the next budding and embryonic level, and it’s anticipated that these institutions will expand their currently used the IT system with Blockchain-related sources to analyze its operation and enhance internal business procedures and techniques. However, it is going to take time for the industries to escalate the benefits of this technique and the likely value it would bring. In last, readers can refer [32,37–39,44] to know more about Blockchain and its uses.

11.

Conclusion

Today we are working towards providing equality to each and every person (in future). For providing equality, trust is a major component, and faith needs to be maintained among each and every peer/user. On another side, Blockchain is helping world in creating a better world, i.e., decentralized network, i.e., providing service to end user sin transparent and reliable manner. We strongly believe that decentralized Blockchain sources and networks would upgrade the existing societal level by bringing up newer ways and perspectives to look at the world. We are coming up with a scalable, productive, and effortless Blockchain environment for safe and sound online facilities. For example, with the help of safe Blockchain implemented voting devices, we can ensure a reliable method of voting for the government. By storing data on a Blockchain, voting can be made transparent, completely anonymous, and protected against the possibility of tampering. This journey to a decentralized future is really amazing and will change millions of lives (also businesses) forever.

Appendix See Tables A.1–A.3.

TABLE A.1 Main characteristics of Blockchain-based IoT applications/Blockchain-IoT integration. Applications Characteristics

ADEPT

Smart cities

Why is Blockchain used?

Take advantage of smart contracts and network consensus

For improved reliability and better fault tolerance

What Blockchain platform is used?

Ethereum

How is TX validation done?

Firmware update

Smart home

VANETS

To ensure data integrity, data authentication, and nonrepudiation during firmware verification

For distributed trust and a common platform for controlled access to IoT devices and their data

For decentralized control

Not mentioned

Proprietary Blockchain platform with PoW consensus

Proprietary

As in Ethereum

Not mentioned

Not mentioned

What conventional issues are resolved?

Trust in a centralized authority/ entity, single point of failure, user and data privacy issues, errors induced through human interactions

Difficulty in sharing data received from heterogeneous devices

What Blockchain issues are resolved?

Data privacy, user privacy, ID management, user-defined access control for data, and scalability

None

IoT eBusiness

SCM

Slock.it

Enigma

To achieve a transparent selfmanaged and selfregulating system based on smart contracts

Due to its unforgeability

Due to its decentralized control and ability to execute smart contracts

For decentralized control

Ethereum

Ethereum

IBM Blockchain platform

Ethereum

Proprietary

Not mentioned

Not mentioned

Not mentioned

Not mentioned

Not mentioned

Not mentioned

Mitigating the effects of cyberattacks, avoids network congestion issues

It provides controlled access to IoT data and also ensures data confidentiality, integrity, and availability, along with protection against DDoS attacks

Centralized control and privacy issues

Centralized control and issues in transparent data sharing/ services

Vulnerabilities of a centralized database

Centralized control and human intervention for access control and manual handing over of the products

Data privacy during sharing and distributed computation

Scalability (related to Blockchain size)

Computational intensiveness, latency in TX confirmation and energy consumption by forgoing the use of PoW in block mining

Not mentioned

Not mentioned

Not mentioned

Scalability by reducing the number of TXs to be mined in a block

Scalability, by storing actual data on the off-chain DHT

36

SECTION

A Evolution of distributed systems

TABLE A.2 Blockchain applications and services. Category

Applications

Financial records/ models

Public and private equities, bonds, commodities, spending and trading records, mortgage and loan records, microfinance, crowd-funding, voting rights, and microcharity

Public records

Birth, death, and marriage certificates, passport, vehicle registration, voter registration, criminal records, permits for business, buildings and guns, business ownership records, regulatory records, court records

Private records

Contracts, signatures, wills, trusts and escrows

Semi-public records

Medical records, accounting records, HR records, degrees, certificates, business transaction records

Physical asset keys

Home, hotel, car, locker, safety deposit etc.

Intangibles

Coupons, vouchers, movie tickets, patents, copyrights, trademarks, licenses for software, videogames, movies, and books

Others

Data records like sports score, weather records, spam control, SIM cards, weapon unlock codes

TABLE A.3 Research gap analysis in Blockchain—Internet of Things integration. Challenges

Applications ADEPT

Smart cities

Firmware update

Smart home

VANETs

IoT-Business

SCM

Slock. it

Enigma

IoT-centric consensus protocol

No

No

No

No

No

No

No

No

No

IoT-focused TX validation rules

No

No

No

No

No

No

No

No

No

Scalability

Yes

No

Yes

Yes

No

No

No

Yes

No

Secure device integration

No

No

No

No

No

No

No

No

No

Protection against device compromise

No

No

No

Yes

No

No

No

No

No

Software firmware update

No

No

Yes

No

No

No

No

No

No

Data security

Yes

No

Yes

Yes

No

No

No



Yes

Privacypreserving computation

No

No

No

No

No

No

No

No

No

Competing interests I, the author declare that I have no competing interests.

Authors contribution Amit Kumar Tyagi has analyzed and drafted this manuscript; he has also approved the final manuscript for final publication.

Decentralized everything Chapter

2

37

Acknowledgments This research is funded by the Anumit Academy’s Research and Innovation Network (AARIN), India. The author would like to thank AARIN India, an education foundation body and a research network for supporting the project through its financial assistance.

References [1] B. Rakowski, A. Boodman, L.L.C. Google, Decentralised Web Annotation, 2010. U.S. Patent 7,734,610. [2] B. Pon, Blockchain Will Usher in the Era of Decentralised Computing, LSE Business Review, 2016. [3] Z. Zheng, S. Xie, H. Dai, X. Chen, H. Wang, An overview of blockchain technology: architecture, consensus, and future trends, in: 2017 IEEE International Congress on Big Data (BigData Congress), IEEE, 2017, June, pp. 557–564. [4] H. Kakavand, N. Kost De Sevres, B. Chilton, The Blockchain Revolution: An Analysis of Regulation and Technology Related to Distributed Ledger Technologies, 2017. Available at SSRN 2849251. [5] M. Dabbagh, M. Sookhak, N.S. Safa, The evolution of blockchain: a bibliometric study, IEEE Access 7 (2019) 19212–19221. [6] K. Hegadekatti, Blockchain Technology—An Instrument of Economic Evolution?, 2017. Available at SSRN 2943960. [7] A.K. Tyagi, S.U. Aswathy, G. Aghila, N. Sreenath, AARIN: affordable, accurate, reliable and INnovative mechanism to protect a medical cyberphysical system using Blockchain technology, IJIN 2 (2021) 175–183. [8] Website link. https://101blockchains.com/history-of-blockchain-timeline/. [9] S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, 2008. https://bitcoin.org/bitcoin.pdf. [10] D. Yermack, Is bitcoin a real currency? An economic appraisal, in: Handbook of Digital Currency, Elsevier, 2015, pp. 31–43. [11] L. Wang, Y. Liu, Exploring miner evolution in bitcoin network, in: International Conference on Passive and Active Network Measurement, Springer, 2015, pp. 290–302. [12] Bitcoin’s quirky genesis block turns eight years old today—bitcoin news. https://news.bitcoin.com/bitcoins-quirky-genesis-block-turns-eight-yearsold-today/. [13] M. Samaniego, R. Deters, Blockchain as a service for IoT, in: 2016 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData), IEEE, 2016, December, pp. 433–436. [14] A. Stanciu, Blockchain based distributed control system for edge computing, in: 2017 21st International Conference on Control Systems and Computer Science (CSCS), IEEE, 2017, May, pp. 667–671. [15] H. Wang, K. Chen, D. Xu, A maturity model for Blockchain adoption, Financial Innov. 2 (1) (2016) 12. [16] S. Angraal, H.M. Krumholz, W.L. Schulz, Blockchain technology: applications in health care, Circul.: Cardiovasc. Quality Outcomes 10 (9) (2017). [17] S. Saberi, M. Kouhizadeh, J. Sarkis, L. Shen, Blockchain technology and its relationships to sustainable supply chain management, Int. J. Prod. Res. 57 (7) (2019) 2117–2135. [18] P. De Giovanni, Blockchain and smart contracts in supply chain management: a game theoretic model, Int. J. Production Econ. 228 (2020), 107855. [19] T. Ko, J. Lee, D. Ryu, Blockchain technology and manufacturing industry: real-time transparency and cost savings, Sustainability 10 (11) (2018) 4274. [20] A. Lei, H. Cruickshank, Y. Cao, P. Asuquo, C.P.A. Ogah, Z. Sun, Blockchain-based dynamic key management for heterogeneous intelligent transportation systems, IEEE Internet Things J. 4 (6) (2017) 1832–1843. [21] I. Eyal, Blockchain technology: transforming libertarian cryptocurrency dreams to finance and banking realities, Computer 50 (9) (2017) 38–49. [22] A.K. Tyagi, S. Chandrasekaran, N. Sreenath, Blockchain technology: a new technology for creating distributed and trusted computing environment, 2022 International Conference on Applied Artificial Intelligence and Computing (ICAAIC), 2022, pp. 1348–1354, https://doi.org/10.1109/ ICAAIC53929.2022.9792702. [23] N. Kshetri, J. Voas, Blockchain-enabled e-voting, IEEE Softw. 35 (4) (2018) 95–99. [24] Z. Zheng, S. Xie, H.N. Dai, X. Chen, H. Wang, Blockchain challenges and opportunities: a survey, Int. J. Web Grid Serv. 14 (4) (2018) 352–375. [25] I. Miers, C. Garman, M. Green, A.D. Rubin, Zerocoin: anonymous distributed E-cash from bitcoin, Proceedings—IEEE Symposium on Security and Privacy (2013) 397–411, https://doi.org/10.1109/SP.2013.34. [26] A.K. Tyagi, Analysis of security and privacy aspects of blockchain technologies from smart era’ perspective: the challenges and a way forward, in: Recent Trends in Blockchain for Information Systems Security and Privacy, CRC Press, 2021. [27] G.R. White, Future applications of blockchain in business and management: a Delphi study, Strateg. Chang. 26 (5) (2017) 439–451. [28] A.K. Tyagi, M.M. Nair, Internet of everything (IoE) and internet of things (IoTs): threat analyses, possible opportunities for future, J. Inform. Assur. Secur. 15 (5) (2020). ISSN: 1554-1010. [29] A.K. Tyagi, S.U. Aswathy, A. Abraham, Integrating Blockchain technology and artificial intelligence: synergies, perspectives, Challenges Res. Direct. J. Inform. Assur. Secur. 15 (5) (2020). ISSN: 1554-1010. [30] S.K. Singh, S. Rathore, J.H. Park, BlockIoTIntelligence: a Blockchain-enabled intelligent IoT architecture with artificial intelligence, Futur. Gener. Comput. Syst. 110 (2020) 721–743. [31] A. Kumari, R. Gupta, S. Tanwar, N. Kumar, Blockchain and AI amalgamation for energy cloud management: challenges, solutions, and future directions, J. Parallel Distrib. Comput. 143 (2020) 148–166. [32] A.K. Tyagi, Building a smart and sustainable environment using internet of things, in: Proceedings of International Conference on Sustainable Computing in Science, Technology and Management (SUSCOM), Amity University Rajasthan, Jaipur - India, February 26–28, 2019, February 22.

38

SECTION

A Evolution of distributed systems

[33] F. Al-Turjman, J.P. Lemayian, Intelligence, security, and vehicular sensor networks in internet of things (IoT)-enabled smart-cities: an overview, Comput. Electr. Eng. 87 (2020), 106776. [34] S. Zhang, D. Zhu, Towards artificial intelligence enabled 6G: state of the art, challenges, and opportunities, Comput. Netw. 183 (2020), 107556. [35] S. Singh, P.K. Sharma, B. Yoon, M. Shojafar, G.H. Chod, I.-H. Ra, Convergence of blockchain and artificial intelligence in IoT network for the sustainable smart city, Sustain. Cities Soc. 63 (2020), 102364. [36] A.K. Tyagi, M.M. Nair, S. Niladhuri, A. Abraham, Security, privacy research issues in various computing platforms: a survey and the road ahead, J. Inform. Assur. Secur. 15 (1) (2020) 1–16. 16 p. [37] S.M. Nair, V. Ramesh, A.K. Tyagi, Issues and challenges (privacy, security, and trust) in blockchain-based applications, in: Opportunities and Challenges for Blockchain Technology in Autonomous Vehicles, 2021, p. 14, https://doi.org/10.4018/978-1-7998-3295-9.ch012. [38] A.K. Tyagi, T.F. Fernandez, S.U. Aswathy, Blockchain and aadhaar based electronic voting system, in: 2020 4th International Conference on Electronics, Communication and Aerospace Technology (ICECA), Coimbatore, 2020, pp. 498–504, https://doi.org/10.1109/ ICECA49313.2020.9297655. [39] A.K. Tyagi, S. Kumari, T.F. Fernandez, C. Aravindan, P3 block: privacy preserved, trusted smart parking allotment for future vehicles of tomorrow, in: O. Gervasi, et al. (Eds.), Computational Science and Its Applications – ICCSA 2020. ICCSA 2020. Lecture Notes in Computer Science, vol. 12254, Springer, Cham, 2020. [40] A.K. Tyagi, G. Rekha, S. Kumari, Applications of blockchain technologies in digital forensic and threat hunting, in: Recent Trends in Blockchain for Information Systems Security and Privacy, CRC Press, 2021. [41] S. Kumari, A.K. Tyagi, S.U. Aswathy, The future of edge computing with blockchain technology: possibility of threats, opportunities and challenges, in: Recent Trends in Blockchain for Information Systems Security and Privacy, CRC Press, 2021. [42] I. Tibrewal, M. Srivastava, A.K. Tyagi, Blockchain technology for securing cyber-infrastructure and internet of things networks, in: A.K. Tyagi, A. Abraham, A. Kaklauskas (Eds.), Intelligent Interactive Multimedia Systems for e-Healthcare Applications, Springer, Singapore, 2022, https:// doi.org/10.1007/978-981-16-6542-4_1. [43] A.K. Tyagi, G. Rekha, N. Sreenath, Beyond the hype: internet of things concepts, security and privacy concerns, in: S. Satapathy, K. Raju, K. Shyamala, D. Krishna, M. Favorskaya (Eds.), Advances in Decision Sciences, Image Processing, Security and Computer Vision. ICETE 2019. Learning and Analytics in Intelligent Systems, vol. 3, Springer, Cham, 2020. [44] S.S.G. Shreshth Tuli, M. Xu, I. Singh, K.V. Singh, D. Lindsay, S. Tuli, D. Smirnova, M. Singh, U. Jain, H. Pervaiz, B. Sehgal, S.S. Kaila, S. Misra, M. S. Aslanpour, H. Mehta, V. Stankovski, P. Garraghan, Transformative effects of IoT, Blockchain and artificial intelligence on cloud computing: evolution, vision, trends and open challenges, Internet of Things 8 (2019), 100118.

Chapter 3

Distributed computing to blockchain: Architecture, technology, and applications Zhihan Lva, Jingyi Wub, Dongliang Chenb, and Annn Jia Ganderc a

Department of Game Design, Faculty of Arts, Uppsala University, Uppsala, Sweden, b College of Computer Science and Technology, Qingdao University,

Qingdao, China, c Department of Applied IT, The University of Gothenburg, Gothenburg, Sweden

1. Introduction With the rapid development of science and technology, the Internet has covered the world by and large. While the number of users is growing rapidly, relevant information is exploding exponentially. Under this trend, although the application of artificial intelligence, cloud computing, and other technologies can provide users with convenient and fast services, they cannot meet the storage needs of users and cannot solve the problems of information disclosure and privacy security on the Internet [1,2]. Therefore, the efficient storage, management, and security maintenance of massive data on the Internet has become the focus of scholars in related fields. In the era of big data, the interactive data and personal information of mobile intelligent terminals reflect the user’s personal behavior, personality, and preferences. Disclosed privacy may be maliciously utilized by criminals and cause incalculable losses to the users’ property and life [3]. Different from the traditional centralized cloud storage space, the distributed cloud storage based on blockchain technology can not only ensure the reliability and authenticity of data but also avoid data tampering. The blockchain is primarily characterized by partition-block storage. All data are dispersed in each partition, and each block can record the identity document of the previous block. This chain structure for recording guarantees the authenticity and immutability of data in each block. The storage of blockchain is equivalent to cloud storage of distributed storage after encryption [3]. The blockchain technology adopts the public-private key to encrypt and decrypt the stored transmission data to realize the asymmetric encryption algorithm. In addition, due to the characteristics of decentralization, tampering, and unique incentive mechanism, the blockchain technology continues to advance and be extensively applied in various fields. For example, the Inter-Planetary File System employs the blockchain rather than a centralized server to provide services such as storing file metadata, auditing files, and issuing token awards. By applying blockchain technology, participants feel more secure to use local data and participate in training [4]. Moreover, by combining the advantages of distributed computing and strong security of blockchain, multiple users can train a model in parallel, which can protect the privacy of mobile devices and the reliability of the whole distributed training process to the greatest extent [5]. However, in the case of explosive growth in the amount of data, effective analysis of massive and complex data is vitally important. Building a big data analysis and prediction system is a quite convenient and popular solution that can effectively improve the efficiency of data analysts and reduce the usage cost. Furthermore, adding the deep learning algorithm can further strengthen computational performance. Then, the highly correlated data are used as a supplement to the data set, which is helpful to accelerate model training and improve the recognition accuracy. At the same time, aiming at the security of data, encryption technology is used to encrypt data during transmission, and distributed computing method is adopted to expand the computing power of the network. In this way, only trained model parameters need to be uploaded by the equipment, and the information is always in the hands of users, so that users can safely open data permissions [5,6]. Facing the fast-growing trend of computer technology and mobile communication technology, effective storage, reasonable classification, and security assurance of massive data generated by users have critical economic value and social significance, and it is extremely urgent under the current development trend of data intelligence. In the present chapter, the blockchain technology is innovatively utilized to construct a distributed computing model for mobile terminals in the wireless communication scenario, and the deep learning algorithm is employed to improve the analysis efficiency of

Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00019-X Copyright © 2023 Elsevier Inc. All rights reserved.

39

40

SECTION A Evolution of distributed systems

multisource data. Finally, a distributed deep learning network model based on blockchain technology is constructed, which can offer experimental foundation for the subsequent optimization and application of blockchain technology.

2.

Recent related works

2.1 Analysis of the application status of blockchain Since the blockchain technology was proposed in 2008, its application has principally experienced three stages, namely, digital cryptocurrency stage, financial industry stage, and actual scenario stage. In the concrete scenario stage, large Internet companies such as Group Holding Ltd., JD.com, Inc., and Beijing Sankuai Online Technology Co., Ltd., as well as major blockchain start-ups, have explored the in-depth application of the current blockchain technology. Meanwhile, many scholars in related fields have devoted energy into it [7]. By analyzing the data invariance and public accessibility of blockchain to data flow, Perboli et al. applied blockchain to supply chain to create an application case unrelated to finance and demonstrated the key aspects of solutions to implementing blockchain [8]. Moreover, they discussed the role and challenges of blockchain in reducing logistic costs and optimizing operations [9]. Monrat et al. conducted comparative research on blockchain technology, explained the classification and architecture of blockchain, compared different consensus mechanisms, and discussed existing challenges, including scalability, privacy, interoperability, energy consumption, and regulation [10]. In addition to cryptocurrency, blockchain technology can also be applied to financial and social services, risk management, medical facilities, and other fields [11]. Mollah et al. applied blockchain technology to the Internet of Vehicles and constructed a participatory data exchange and storage platform, which was finally verified and proved to be effective [12]. Sun et al. proposed a searchable and encrypted intelligent transportation information blockchain data query algorithm by using searchable encryption algorithm and combining the characteristics of blockchain to ensure the security of logistics information and fast and efficient information query [13]. They split up logistics information into multiple data files, encrypted the files by asymmetric searchable encryption algorithm, and stored them in the cloud server. Ultimately, they validated the correctness, integrity, and security of the scheme and proved the feasibility of the scheme [14].

2.2 Application and development trend of distributed computing in blockchain The kernel of blockchain technology is distributed computing and group trust cooperation mechanism in distributed computing environment, which can solve the challenges of scalability, cooperation ability, trust relationship, and security protection faced by various application fields. Many scholars in relevant fields have studied it [15]. After analyzing the application of blockchain technology to the Internet of Things (IoT), Melloni et al. discussed the framework and employment of blockchain by using distributed computing from perspectives of its advantages, criticality, and future improvements required for effective deployment in convenient real-time on-site operations [16]. Uriarte et al. proposed interoperable distributed cloud solutions by considering existing standards that would allow cloud systems to compete with large suppliers and prevent supplier locking [17]. They believed that the scheme not only pointed out the incompatibility between projects and possible solutions to research problems in this field, but also contributed to the development of cloud systems by reviewing existing standards and proposing new standardization opportunities. Wang et al. put forward a reputation-based consensus protocol for IoT systems supporting blockchain to meet the security requirements of IoT systems [18]. The scholars utilized improved blockchain technology for this protocol to resist stronger attacks, and provide more opportunities for several users with low computing power to participate in consensus. Through experiments, they found that reputation-based consensus protocol had advantages in security and anti-attack ability [19]. Kaur et al. analyzed the role of distributed computing in the blockchain in the security defense of IoT [20]. They proved that the distributed computing based on blockchain could furnish the IoT framework with a higher security level than that of the IoT framework that was not improved by blockchain. Luo et al. constructed a new architecture for automatically unloading user tasks in mobile edge computing scenario to solve the cache problem of massive dynamic data in unmanned aerial vehicles [21]. In this architecture, they adopted distributed computing and edge computing technology in blockchain to cache and unload data. Moreover, they verified the flexibility and visibility of the proposed architecture in the process of data storage and unloading [22]. To sum up, scholars have investigated the application of blockchain technology to diversified fields, and the majority of them focused on distributed computing and blockchain. However, most of them analyze and study data storage, while there is little research on the security in the application scenarios. Therefore, deep learning is combined with distributed computing in this chapter to explore the security problems such as privacy disclosure faced by blockchain technology in the

Distributed computing to blockchain Chapter

3

41

application process, which is of vital significance for the safe development of IoT, e-commerce transactions, and other systems.

3. Security of the distributed network model based on blockchain 3.1 Demand analysis of blockchain technology applied to distributed system Today, in the context of global Internet, users generate a wealth of information through browsing and activities, such as people’s big data trajectory during epidemic prevention and real-time location records of goods during logistics transportation. The traditional distributed system or cloud storage is no longer adequate for the needs of real-time recording and classification of massive data on the current Internet [23]. At the same time, IoT and other systems are running in an open, complex, and dynamic environment of strong unknowability. Consequently, the equipment is vulnerable to the interference of the external environment and the attack of malicious people during the operation, so the reliability and stability of networks are extremely crucial. Blockchain technology has the advantages of security, decentralization, and scalability, which significantly increase the trusted computing power of the IoT system and keep the whole system at a stable and efficient operation state [24,25]. Therefore, after analyzing blockchain technology, this research is aimed at the fine classification and reliability improvement of massive data in the application process of blockchain, which is of great value to solve the problems of data caching and security in the IoT system. Some applications of blockchain technology are presented in Fig. 1. As shown in Fig. 1, with the rapid development of computer technology, the application of blockchain has expanded from Bitcoin to other fields. For instance, blockchain is applied to the financial field, such as transfer payment, bond issuance, and asset issuance; or it’s the application to nonfinancial fields, such as property right certificate, IoT, supply chain, public welfare, culture, and entertainment. In this research, the mobile device is selected as the object, and the blockchain technology is used to provide a distributed deep learning model for mobile terminals in the wireless communication scenario. In this model, deep learning is employed to classify tasks and improve the analysis efficiency of multisource data.

3.2 Analysis of the task allocation of blockchain technology In the IoT system, mobile terminal devices distributed everywhere produce vast quantities of interactive data every day. Inevitably, the cost of interactive data collection and the privacy protection of sensitive data have become the challenges faced by the current IoT system that is still developing. Fig. 2 illustrates the general mobile-distributed computing architectural model formed by distributed nodes or base stations and users. In this distributed system, a macro base station (MBS) covers many small base station (SBSs), which jointly serves U users that are denoted as m ¼ {1, 2…, U}, and each user is connected to an SBS. Multiple base stations share the same spectrum, and they interfere and affect each other. Let Pku(t) be the propagation power of the base station k serving the user u, and su(t) be the Additive White Gaussian Noise. Then, the signal to interference plus noise ratio of the wireless channel connecting the user u and the base station is marked as Eq. (1).

FIG. 1 Applications of blockchain technology.

42

SECTION A Evolution of distributed systems

Data computing center MBS

SBS

SBS

User

SBS

Initiator

FIG. 2 Mobile distributed computing architectural model formed by distributed nodes or base stations and users.

gk ðtÞPku ðtÞ gku ðtÞ ¼ X X u giu ðtÞPi ðtÞ + siu ðtÞ

(1)

i6¼k um

In Eq. (1), gku(t) refers to the channel loss of the user u and the base station k, and giu(t) stands for the channel loss of the user u in another base station i. Assuming that all spectrum resource bandwidth W in a base stations is divided into B subchannels, and the channel bandwidth of the user u is bu ¼ {1, 2…, W/B}, the transmission rate of uploading and downloading between the user u and the base station k is expressed as Eq. (2).   (2) r ku ðtÞ ¼ bu log 1 + gku ðtÞ The energy consumption of a single segment needs to consider the total energy consumption, including the energy consumed by the SBS when downloading the segment, and the energy consumed by the user when executing the segment and transmitting the model results [26]. Denote the downlink transmission power of the SBS as Pku, and then, the transmission power of the user u is also Pku. Therefore, the energy consumed by the user u to complete the segment is derived as Eq. (3). eu ¼ Pku ðtÞ

ND NR 3 self + k h ð Þ t + P ð t Þ u u u r ku ðtÞ r u ðtÞ

(3)

In Eq. (3), k represents the energy efficiency coefficient of the processor, and ND and NR denote the content (data sets and D R the default model) to be downloaded and uploaded for each segment (part of the task). Besides, Nr and Nr refer to the time u u consumption of downloading input data from IPFS and returning result data to IPFS, respectively, and hu signifies the D amount of computing resources actually provided by the user. In addition, Pku ðtÞ rNk ðtÞ is the energy consumed by the base u station when downloading small segments from IPFS, k(hu)3tself u is the energy consumed by the user when executing small NR segments, and Pu ðtÞ r ðtÞ is the energy consumed by the user when transmitting the results back after executing tasks. u The purpose of task allocation optimization is to select users and allocate resources to minimize energy consumption, which allows the network to learn by itself. In addition, the delay of all users should be less than quality of service (QoS) to obtain benefits. Therefore, the optimization objectives can be written as Eq. (4).

Distributed computing to blockchain Chapter

X

3

43

 NR + nu kðhu Þ tu + Pu ðtÞ min Eu ¼ r u ðt Þ  D  (4)  self R X N D a Nu + Nu N u + nu τ st: + k hu r u ðtÞ um r u ðtÞ P In Eq. (4), nu refers to the sum of segments selected by the user, and nu ¼ n. Moreover, the workload of n is the whole ND Pku ðtÞ k r u ðt Þ um

3

um

task, and Eu represents the total energy consumption. Therefore, the goal of task allocation is to minimize energy consumption and propagation delay. Furthermore, blockchain technology is added to the mobile distributed system to classify training tasks according to the difficulty, and the scheduler is responsible for assigning the tasks requested by the initiator to users in the network. The arrival tasks are first stored in the arrival queue of the scheduler. The scheduler takes out one task from the arrival queue each time and puts it into the local queue of some users. The tasks assigned to users are processed according to the first-in first-out rule. Therefore, the scheduling goal is to map tasks to fast-responding users, as shown in Fig. 3. In Fig. 3, tasks are represented by tuples as shown in Eq. (5).   mi ¼ om , dm , dsm , Qm , i (5) In Eq. (5), om refers to the release time of the task mi, dm signifies the deadline of the task, and dsm represents the storage space required for the task. Meanwhile, Qm denotes the remuneration received by the participants who complete the task, and i stands for the category of the task. This means that the system can handle I categories of tasks, and the set of task types requested by the initiator can be expressed as {m1, m2…, mI}. Assuming that the task arrival queue obeys Poisson distribution, the user’s local queue also obeys Poisson distribution. Blockchain technology has developed from 1.0 stage of decentralized currency and payment to 2.0 stage of industry development [27]. In this stage, as a distributed blockchain system, Ethereum provides the concept of intelligent contract, and the script language of intelligent contract can run on Ethereum virtual machine (EVM) [28]. Ethereum is principally composed of six layers, namely, the application layer, intelligent contract layer, incentive layer, consensus layer, network layer, and data layer. Among them, the data layer is the foundation of Ethereum’s data structure, including hash function, asymmetric encryption, digital signature, and other encryption algorithms, which also ensures the security of Ethereum’s account. Moreover, Ethereum adopts the Elliptic Curve Digital Signature Algorithm for digital signature. In the transaction process, each transaction is digitally signed with a private key to ensure that the transaction cannot be tampered with by others and ensure that the transaction is initiated by the sender [29]. Here, denote d as a private key, g as a meta point (x, y), and s according to the elliptic curve algorithm, the public key can be expressed as q ¼ d  g. Fig. 4 displays the process of transaction signature and verification in the digital signature algorithm.

FIG. 3 Blockchain technology applied to task allocation and execution model.

44

SECTION A Evolution of distributed systems

Original message

Message digest

Digital signature of message

Private key

Are they equal?

Original message

Message digest B

Message digest A

Public key

FIG. 4 Flow of transaction signature and verification.

In this process, the signature process needs the sender’s private key to encrypt the transaction. Step 1: A random number k  [1, n  1] is selected, and the point (x1, y1) is calculated according to Eq. (6). ðx1 , y1 Þ ¼ k  g

(6)

Step 2: r is calculated according to Eq. (7). If r ¼ 0, return to the Step 1 and reselect the random number k. r ¼ x1 mod n

(7)

Step 3: If r 6¼ 0, the hash value h(m) of the message digest m is calculated according to Eq. (8). hðmÞ ¼ HASH ðmÞ

(8)

Step 4: Sv is calculated according to the random number k, the hash value h(m) of the message digest, the private key SKv of the non-first vehicle, and Eq. (9). If Sv ¼ 0, return to the Step 1 to reselect the random number k.  Sv ¼ ðhðmÞ + SKv∗r Þ∗k1 mod n (9) Step 5: If Sv 6¼ 0, the signature of the hash value h(m) is {r, Sv}. Then, the original information is verified as follows. Step 1: r and Sv are integers between [1, n  1]; Eq. (10) calculates. o ¼ Sv 1 mod n

(10)

Step 2: Message digest A and message digest B are calculated according to: m1 ¼ ðHASH ðmÞ  oÞmod n

(11)

m2 ¼ ðr  oÞmod n

(12)

Step 3: A point on the elliptic curve is calculated according to Eq. (13). ðx1 , y1 Þ ¼ m1 g + m2 q

(13)

r ¼ x1 mod n

(14)

Step 4: Eq. (14) is solved. If Eq. (14) is equal to 0 or ∞, the signature will be rejected. Otherwise, the signature will be verified. Fig. 5 displays the specific flow of digital signature and signature verification algorithm for road condition messages. Fig. 6 illustrates the distributed task allocation system based on blockchain. In this system, an MBS covers k SBSs, which is recorded as K ¼ {0, 1, 2…, K}, where 0 refers to the MBS. SBSK is described by the tuple , where Ck refers to the calculation frequency of the central processing unit (CPU) of SBSK, Sk denotes the available storage capacity of SBSK, and Pk represents the transmission power of SBSK. They jointly serve N users that are marked as  ¼ {1, 2…, N}, and each user is connected to an SBS. These users cooperate to maintain the blockchain network [30].

Distributed computing to blockchain Chapter

1 2 3 4

k

Input: Selection random number Output: Pass the verification If k 1, n 1 do

Calculate point x1 , y1 , as shown in Eq. (6)

6

Calculate r, the formula is r

7 8

If r=0 do Calculate hash value h m

x1 mod n

HASH m

Calculate S v

10

Sv

11

If Sv

12 13

h m

SKv * r * k

1

mod n

0 do

The receives the signature K If r , Sv 1, n 1 do

14

Calculation h m

15

Calculate message digest a and message digest B, expressed as

16

Calculation r

17

If

18 19 20 21 22 23 24

45

Start

5

9

3

r

0, r

1

and

r

2,

respectively

x1 mod n

do

Otherwise signature verification failed End if End if End if End if End if End

FIG. 5 Flow of digital signature and signature verification algorithm based on blockchain.

MBS

SBS

SBS SBS

User Initiator

FIG. 6 Distributed task allocation system based on blockchain.

These users are candidates for task participants, which are recorded as Un. Equation (15) shows the tuple of Un.   (15) U n ¼ cn , sn , dn , pn , pcn

cn ¼ cn,1 , cn,2 , ⋯, cn,I (16) In Eq. (15), cn refers to the calculation frequency of the CPU of the user, expressed as Eq. (16), which indicates the calculation frequency of different types of CPU. Besides, sn represents the user’s available storage capacity, dn signifies the amount of local interactive data that the user can provide, pn stands for the user’s transmission power, and pcn represents the success rate. The matching pair of task participants is denoted as mp¼ . This tuple refers to the combination of task m and participant Cm. If the participant is the selected user, there is Cm  m. Then, the allocation utility is Qm  pcn, which demonstrates the product of task return value Qm and user success rate pcn. The specific values are shown in Eq. (17).

46

SECTION A Evolution of distributed systems

8 > < > :

Qm  ð0, 1Þ pcn  ð0, 1Þ Qm  pcn  ð0, 1Þ

(17)

In the process of task allocation, the transition probability and expected return of the environment in the wireless network are dynamic and unknown. In this scenario, the agent (MBS) is the intermediary between the task initiator and the user, and it is responsible for collecting status information of the system and making decisions for each request [31]. The state space, action space, and return function of the framework based on Deep Q Network (DQN) are as follows. In state vector, the system information is observed and collected by the agent in each decision time T. The state vector can be written as Eq. (18).  t t t st ¼ nt , τt , V tu , N self (18) u , H u , Eu , B In Eq. (18), nt refers to the workload of the deep learning task, τt represents the QoS limit (delay), and Bt signifies the number of available channels. Moreover, Vtu denotes the credit score, Nself u shows the amount of available local interactive data, Htu indicates the available computing resources, and Etu refers to the energy consumption. The state space is denoted as St, and st  St within time t. In the action space, the agent (MBS) is responsible for selecting participants from users and allocating resources, that is, determining how much computing power that participants need to use within decision-making time T, and how many subchannels need to be allocated to participants for communication. Therefore, the actions are defined as Eq. (19).   (19) at ¼ dtu , btu , htu Let Dt ¼ {dtu} be the user selection vector, where dtu is a binary vector indicating whether the user performs the task, which is marked as Eq. (20). 1, Perform tasks dtu ¼ (20) 0, Else In Eq. (20), dtu ¼ 1 means that the user u is selected as a participant. Otherwise, it is not selected. btu stands for the allocation vector of spectrum resources, where btu  {1, 2, ⋯, W/B} is the subchannel allocated to the user u. htu refers to the calculation resource allocation vector, where htu  {1, 2, ⋯, Hu} is the computing power required to perform tasks. In the return function, the consistency of task allocation is guaranteed by the joint average algorithm. Then, assuming that all participants’ work is successfully completed and can be rewarded, QoS can be expressed as Eq. (21).  

D a ND + N self N tc Nu + ND u u t u X + (21) du  τt , 8um htu r u ðtÞ jdtu j um t

Assume that the action a is selected by random strategy p(aj s), and it represents the transition probability of executing the action a from the state s. After the state st executes the action at, the agent can get an instantaneous return Rt. Therefore, the instantaneous benefits of participants completing the unit segment are 2 3

 X 6 nt 7 1 V tu 7 X (22) Rt ¼ X t E Etu  dtu 6 G + I N self u 4 5 t V max jdu j um jdu j um

um

where G represents the reward of completing the unit segment, and I refers to the coefficient of local interactive data, which aims to keep the numerical range of data and energy consumption in the same order of magnitude. Considering the evaluation criteria of the task allocation process, the instantaneous return is divided into two parts, namely, the energy consumption and quantized rewards of performing tasks, including dividends based on the amount of computing power and local data contributed by the participant [32]. In addition, the return function is for the selected participants. In other words, if dt ¼ 1, there will be a return. If the user is not selected, the return is 0.

Distributed computing to blockchain Chapter

3

47

3.3 Privacy security analysis of blockchain-based distributed computing network model According to the above analysis, the mobile distributed computing process based on blockchain proposed here is implemented based on Ethereum, and Fig. 7 shows the specific design of the architecture. In this architecture, from the bottom up, there is a physical layer, a deep learning layer, a network transport layer, and an intelligent contract layer. The lowest physical layer includes mobile devices, base stations, blockchain data storage, and file storage services of the IPFS. The blockchain data cache space stores the metadata of the task, and the IPFS file storage service stores the complete data of the task. Above the physical lay, the deep learning layer consists of four modules, that is, data interface, training data set, test data set, and model training. The data interface can obtain the relevant data and parameters of deep learning to train the model and finally return the data to the intelligent contract. The next layer is the network transmission layer, which mainly includes the network transmission protocol of blockchain and the peer-to-peer network transmission protocol of the IPFS. The network transmission protocol of blockchain is responsible for transmitting the metadata of the task, and the transmission protocol of IPFS is responsible for transmitting the complete data of the task. The top layer is the intelligent contract running on the EVM. It has three functions of monitoring user attributes, scheduling distributed training, and launching system preprocessing when initiating tasks. During the operation of EVM, the first part is to monitor user attributes and receive attribute data from mobile terminals, and the second part is the distributed training scheduling layer, which is responsible for coordinating the cooperation among participants, aggregating participants’ models, and distributing new models. The third part is the preprocessing part of the system when initiating a task. It is responsible for receiving and pre-processing the task request sent by the initiator, selecting participants, sending task metadata to the participants, and finally returning the training results to the initiator.

Smart contract layer Monitorin g user properties

Task scheduling

Task preprocessing

Network layer

Mobile radio comm unications

Deep learning layer

IPFS

Test data set RF cable Model training Training data set

Physical layer

FIG. 7 Architecture of distributed computing network model based on blockchain technology.

48

SECTION A Evolution of distributed systems

When this model performs task allocation, all users interact in the blockchain network through peer-to-peer network in the form of point-to-point communication to complete resource allocation. The participants in this system primarily include three roles, namely, the task initiator, calculation participant, and verification participant. The task initiator is the user who makes a training request to the system. Any user who joins the blockchain network can initiate a task request. The task is performed by many computing participants, and each computing participant will be trained to get a different model. Verification participants determine whether the training results are valid by verifying the accuracy of the model provided by each calculation participant, and then, they decide whether to enter this model parameter. Most initiators and computing participants are users. As the management module of the system, intelligent contract is responsible for collecting and monitoring user information in real time. After receiving the task, it completes the operations of locking tokens, selecting users, allocating resources, and returning training results. The process of data transmission is analyzed from perspectives of the service delay and energy consumption, respectively. In time delay of business service, task travel time, that is, the time taken by participants to find and obtain tasks, can be expressed as tbt m,n ¼

dsm + taw m r n ðt Þ

(23)

where rn(t) represents the download transfer rate. Eq. (24) shows user training time, that is, the time used by participants to train the model. tdl m,n ¼ si  cn,i  dsm

(24)

In Eq. (24), si refers to the number of CPU cycles required to execute i categories of unit tasks. Eq. (25) indicates user return time, that is, the time taken by participants to return the model. tre m,n ¼

l

(25)

r 0n ðtÞ

In Eq. (25), l represents the space occupied by model parameters, and rn0 (t) refers to the upload transmission rate. Furthermore, energy consumption mainly consists of user opportunity cost and waiting time for allocation. User opportunity cost refers to the cost consumed by users to download, execute, and return tasks, which can be written as Eq. (26). emm,n ¼ Pk

dsm l + kc3n,t  tbt m,n + pn 0 r n ðt Þ r n ðtÞ

(26)

The waiting time for allocation refers to the difference between the task release time om and the task allocation time Ta, as shown in Eq. (27). taw m ¼ T a  om Assuming that the amount of local interactive data that each device can provide is matching are: CI ¼ aðQm  pcn Þ + bdsself n g 0 + bt 0 dl 0 re 0  remm,n + ytaw m tm,n + tm,n + tm,n

(27) dsself n ,

the comprehensive benefits of

(28)

0 dl 0 re 0 0 where a, b, g, and r stand for the weight coefficient, and tbt m,n , tm,n , tm,n , and emm,n are values after normalization. The normalization processing can be presented as Eq. (29).

xi 0 ¼

xi  minðXÞ , x X maxðXÞ  minðXÞ i

(29)

In Eq. (29), X refers to the set composed of xi, min (X) is the element with the smallest value in the set X, and max (X) is the element with the largest value.

3.4 Simulation evaluation Then, the performance of the distributed computing network model based on blockchain technology is evaluated and analyzed. The model proposed here is simulated by MATLAB simulation software, and the deep learning task allocation

Distributed computing to blockchain Chapter

3

49

TABLE 1 Table of simulation tools. Edition Software

Hardware

Parameter

Operating system

Linux 64 bit

Python

Python 3.6.1

Simulation platform

Matlab 2018b

Development platform

PyCharm

CPU

Intel core [email protected] GHz of 8 bit

Memory

Kingston ddr4 2400 MHz 16G

GPU

Nvidia GeForce 1060 8G

Number of participants

5

Number of segments

[200, 400, 600, 800]

Number of available subchannels

[0, 2, 3, 4, 5]

Type

[0,1,2,3]

Size of the segment

1 Mb

Block return G

50

Number of system nodes

500

framework is implemented by tensorflow 1.13.0 software. In the simulation experiment, taking the logistics system as an example, a simulation logistics system is designed, which takes the chain task distribution data generated in the whole logistics system as the data set. Table 1 illustrates the setting of the system hardware, software, and parameters involved in the simulation process. The distributed computing model reported here is compared with the other three frameworks as follows. (1) The task allocation architecture proposed here without task fragmentation: the computational efficiency of users executing tasks is subject to the average computational efficiency of all tasks. (2) The task allocation architecture proposed here without user selection: users are selected randomly. (3) The task allocation architecture proposed here without spectrum resource allocation: task fragmentation is removed from users. The performance is evaluated and analyzed from the perspectives of computing overhead, data transmission delay, data security, and so on.

4. Results and discussion 4.1 Comparative analysis of system performance of models The system performance of the model constructed here is evaluated from the perspective of calculation cost, comprehensive income, and system operation efficiency. The results are summarized in Figs. 8–10. FIG. 8 Computational cost of different task allocation models (A. single-terminal scenario; B. multiterminal scenario) (in this figure, K No. 1: the first repeated experiment of the research algorithm; K No. 2: the second repeated experiment of the research algorithm; K No. 3: the third repeated experiment of the research algorithm; m: the model without task fragmentation; N: the model without spectrum resource allocation; P: the model without user selection).

50

SECTION A Evolution of distributed systems

FIG. 9 Comparison of comprehensive income of each model under different indicators (A. different rounds; B. different delay; C. different energy consumption coefficient) (in this figure, K No. 1: the first repeated experiment of the research algorithm; K No. 2: the second repeated experiment of the research algorithm; K No. 3: the third repeated experiment of the research algorithm; m: the model without task fragmentation; N: the model without spectrum resource allocation; P: the model without user selection).

FIG. 10 Comparison of system operation efficiency of each model under different numbers of system nodes (A. block propagation time; B. throughput; C. CPU utilization) (in this figure, K No. 1: the first repeated experiment of the research algorithm; K No. 2: the second repeated experiment of the research algorithm; K No. 3: the third repeated experiment of the research algorithm; m: the model without task fragmentation; N: the model without spectrum resource allocation; P: the model without user selection).

Distributed computing to blockchain Chapter

3

51

From the calculation cost shown in Fig. 8A, in a single-terminal scenario, the calculation cost of each model does not change significantly with the increase in the number of iterations. Among them, the calculation cost of the model reported here is the lowest and basically stable at about 0.12 s, while the calculation cost of other algorithms is significantly higher. In the multiterminal scenario, the calculation cost of each model grows with the increase in the number of terminals, but it is obvious that the calculation cost of the model reported here is lower than that of other models. Therefore, whether in a single-terminal scenario or a multiterminal scenario, the distributed computing model based on blockchain technology proposed here achieves the optimal calculation cost, which is conducive to the operation of the model. Fig. 9 shows the comprehensive income of each model under different indicators. From the analysis of convergence shown in Fig. 9A, with the increase in rounds, each model shows a trend of increasing first and then stabilizing, finally reaching the convergence state. In addition, because the model reported here can utilize devices more efficiently, the final comprehensive income after convergence is higher. According to Fig. 9B, the comprehensive income of each model gets greater with the increase of delay and task completion, which enlarges the throughput. Moreover, the allocation model based on task fragmentation proposed here can adjust computational efficiency according to different types of tasks, so it can implement more tasks per unit time, and the comprehensive income will be slightly greater than that of the other three models. Through energy consumption of different models shown in Fig. 9C, the comprehensive income of each algorithm shows a downward trend with the increase in energy consumption. Among them, the task allocation model without spectrum resource allocation and the task allocation model without user selection first show an accelerated decline and then a slow decline in the comprehensive income. This may be because the two models ignore the impact of task remuneration and data volume on comprehensive income when the energy consumption coefficient is excessively small. Fig. 10 provides the comparison of the system operation efficiency of each model under different numbers of system nodes. The results of block propagation time presented in Fig. 10B prove that the overall block propagation time of each model increases with more system nodes. However, the block propagation time of the task allocation model reported here is significantly less than that of the other three models, which means that it is more effective. Through Fig. 10B, the system throughput of the task allocation model reported here is significantly higher than that of the other three models. Moreover, with the increase in the number of system nodes, the throughput of the model reported here does not decrease significantly, indicating that the system operation efficiency of this model is higher, and it can calculate more data per unit time than the other three models. In Fig. 10B, when there are 500 system nodes, the CPU utilization of the main control board of the other three models reaches 100%, which means that the terminal will crash and cannot work normally. Obviously, these three types of models cannot be used in practical engineering. However, the main control board of the model proposed here can control CPU utilization within 17.18% and in a relatively stable state. This is because under this model, the computing function is mainly completed by trusted chips, and the CPU utilization of the main control board can be ignored. Therefore, the distributed task allocation model proposed here can be applied to the mobile terminal system.

4.2 Analysis of security performance of data transmission of each model Further analyze the system model built in this research and the other three types of frameworks from the perspective of data transmission, as shown in Figs. 11 and 12. According to comparison results of the security performance of network data transmission of each model under different data message lifetime, with the increase in data message lifetime, the model reported here shows better average delivery rate and lower message leakage rate. The reason may be that this model based on blockchain technology adopts the transmission strategy of message based on message fragmentation and trusted nodes. On the contrary, the comparative models remove task fragmentation, user selection, and spectrum resource allocation, respectively, which weaken the performance of the models. In terms of average delay, the model reported here shows a slow-growth trend with the increase in data message lifetime, and the average delay is basically stable at about 250 ms. Fig. 12 shows the comparison results of Accuracy, Precision, Recall, and F1-value of each model. It can be found that the recognition Accuracy of transmission data of the model reported here reaches 92.40%, which is at least 1.96% higher than that of the other three models. At the same time, this model achieves the maximal values of Precision, Recall, and F1value, and among them, the F1-value is not between Precision and Recall, but smaller than both. Therefore, compared with the other three models, the distributed computing network model based on blockchain technology constructed here can offer better recognition accuracy and better performance.

52

SECTION A Evolution of distributed systems

FIG. 11 Comparison of security performance of data transmission of each model under different data message lifetime (A. average delivery rate; B. average leakage rate; C. average delay) (in this figure, K No. 1: the first repeated experiment of the research algorithm; K No. 2: the second repeated experiment of the research algorithm; K No. 3: the third repeated experiment of the research algorithm; m: the model without task fragmentation; N: the model without spectrum resource allocation; P: the model without user selection).

FIG. 12 Influence of the increase in iteration times of different model on recognition accuracy of transmission data (A. accuracy; B. precision; C. recall; D. F1-value) (in this figure, K No. 1: the first repeated experiment of the research algorithm; K No. 2: the second repeated experiment of the research algorithm; K No. 3: the third repeated experiment of the research algorithm; m: the model without task fragmentation; N: the model without spectrum resource allocation; P: the model without user selection).

Distributed computing to blockchain Chapter

3

53

5. Conclusion Nowadays, with the global coverage of the Internet, users generate a large amount of information through various activities like browsing the Internet. Correspondingly, people are facing a certain threat to privacy information. Here, a distributed computing network model based on blockchain technology is built for mobile devices in the wireless communication scenario. The simulation experiments prove that the model constructed here achieves low calculation cost, excellent recognition accuracy, high comprehensive income, outstanding system operation efficiency, and significantly superior system performance. The research outcome can provide experimental reference for the improvement of blockchain technology application in future. However, this research also has some shortcomings. For example, the blockchain-based distributed computing network model for mobile terminals reported here assumes that users will remain online after joining the distributed training until the end of the task. In practical application, users may be offline during execution due to different reasons, such as unstable wireless network, power depletion of devices, active exit, or high-speed movement. It is essential to solve this consequential problem in the follow-up research work, which is of critical significance for optimizing the blockchain technology and extending its application range.

Acknowledgment This research is financially supported by the Ministry of Science and Technology, Taiwan, ROC under the project number 108-2410-H-019-012SSS and MOST: 106-2410-H-019-020.

References [1] R. Casado-Vara, J. Corchado, Distributed e-health wide-world accounting ledger via blockchain, J. Intell. Fuzzy Syst. 36 (3) (2019) 2381–2386. [2] E. Chukwu, L. Garg, A systematic review of blockchain in healthcare: frameworks, prototypes, and implementations, IEEE Access 8 (2020) 21196– 21214. [3] F. Daniel, L. Guida, A service-oriented perspective on blockchain smart contracts, IEEE Internet Comput. 23 (1) (2019) 46–53. [4] V. Gramoli, From blockchain consensus back to byzantine consensus, Futur. Gener. Comput. Syst. 107 (2020) 760–769. [5] S. Guo, X. Hu, S. Guo, X. Qiu, F. Qi, Blockchain meets edge computing: a distributed and trusted authentication system, IEEE Trans. Ind. Inform. 16 (3) (2019) 1972–1983. [6] S. Gupta, J. Hellings, S. Rahnama, M. Sadoghi, Building high throughput permissioned blockchain fabrics: challenges and opportunities, Proc. VLDB Endow. 13 (12) (2020) 3441–3444. [7] R. Kaur, A. Ali, A novel Blockchain model for securing IoT based data transmission, Int. J. Grid Distrib. Comput. 14 (1) (2021) 1045–1055. [8] M. Li, F.R. Yu, P. Si, W. Wu, Y. Zhang, Resource optimization for delay-tolerant data in blockchain-enabled IoT with edge computing: a deep reinforcement learning approach, IEEE Internet Things J. 7 (10) (2020) 9399–9412. [9] J. Luo, Q. Chen, F.R. Yu, L. Tang, Blockchain-enabled software-defined industrial internet of things with deep reinforcement learning, IEEE Internet Things J. 7 (6) (2020) 5466–5480. [10] S. Luo, H. Li, Z. Wen, B. Qian, G. Morgan, A. Longo, et al., Blockchain-based task offloading in drone-aided mobile edge computing, IEEE Netw. 35 (1) (2021) 124–129. [11] S. Maiyya, V. Zakhary, D. Agrawal, A.E. Abbadi, Database and distributed computing fundamentals for scalable, fault-tolerant, and consistent maintenance of blockchains, Proc. VLDB Endow. 11 (12) (2018) 2098–2101. [12] A. Meloni, S. Madanapalli, S.K. Divakaran, S.F. Browdy, A. Paranthaman, A. Jasti, et al., Exploiting the IoT potential of blockchain in the IEEE P1931. 1 ROOF standard, IEEE Commun. Stand. Mag. 2 (3) (2018) 38–44. [13] M.B. Mollah, J. Zhao, D. Niyato, Y.L. Guan, C. Yuen, S. Sun, et al., Blockchain for the internet of vehicles towards intelligent transportation systems: a survey, IEEE Internet Things J. 8 (6) (2020) 4157–4185. [14] A.A. Monrat, O. Schelen, K. Andersson, A survey of blockchain from the perspectives of applications, challenges, and opportunities, IEEE Access 7 (2019) 117134–117151. [15] N.R. Mosteanu, A. Faccia, Fintech frontiers in quantum computing, fractals, and blockchain distributed ledger: paradigm shifts and open innovation, J. Open Innov. Technol. Market Complex. 7 (1) (2021) 19. [16] A. Muthanna, A.A. Ateya, A. Khakimov, I. Gudkova, A. Abuarqoub, K. Samouylov, A. Koucheryavy, Secure and reliable IoT networks using fog computing with software-defined networking and blockchain, J. Sens. Actuator Netw. 8 (1) (2019) 15. [17] G. Perboli, S. Musso, M. Rosano, Blockchain in logistics and supply chain: a lean approach for designing real-world use cases, IEEE Access 6 (2018) 62018–62028. [18] D. Puthal, N. Malik, S.P. Mohanty, E. Kougianos, C. Yang, The blockchain as a decentralized security framework [future directions], IEEE Consum. Electron. Mag. 7 (2) (2018) 18–21. [19] Y. Sun, X. Li, F. Lv, B. Hu, Research on logistics information blockchain data query algorithm based on searchable encryption, IEEE Access 9 (2021) 20968–20976. [20] R.B. Uriarte, R. DeNicola, Blockchain-based decentralized cloud/fog solutions: challenges, opportunities, and standards, IEEE Commun. Stand. Mag. 2 (3) (2018) 22–28.

54

SECTION A Evolution of distributed systems

[21] S. Wan, M. Li, G. Liu, C. Wang, Recent advances in consensus protocols for blockchain: a survey, Wirel. Netw 26 (8) (2020) 5579–5593. [22] E.K. Wang, R. Sun, C.M. Chen, Z. Liang, S. Kumari, M.K. Khan, Proof of X-repute blockchain consensus protocol for IoT systems, Comput. Secur. 95 (2020), 101871. [23] P. Wei, D. Wang, Y. Zhao, S.K.S. Tyagi, N. Kumar, Blockchain data-based cloud data integrity protection mechanism, Futur. Gener. Comput. Syst. 102 (2020) 902–911. [24] A. Wilczy nski, J. Kołodziej, Modelling and simulation of security-aware task scheduling in cloud computing based on blockchain technology, Simul. Model. Pract. Theory 99 (2020), 102038. [25] Z. Xiong, Y. Zhang, N.C. Luong, D. Niyato, P. Wang, N. Guizani, The best of both worlds: a general architecture for data management in blockchainenabled Internet-of-Things, IEEE Netw. 34 (1) (2020) 166–173. [26] Z. Xiong, Y. Zhang, D. Niyato, P. Wang, Z. Han, When mobile blockchain meets edge computing, IEEE Commun. Mag. 56 (8) (2018) 33–39. [27] H. Yang, Y. Liang, J. Yuan, Q. Yao, A. Yu, J. Zhang, Distributed blockchain-based trusted multidomain collaboration for mobile edge computing in 5G and beyond, IEEE Trans. Ind. Inform. 16 (11) (2020) 7094–7104. [28] R. Yang, F.R. Yu, P. Si, Z. Yang, Y. Zhang, Integrated blockchain and edge computing systems: a survey, some research issues and challenges, IEEE Commun. Surv. Tutorials 21 (2) (2019) 1508–1532. [29] Y. Yuan, F.Y. Wang, Blockchain and cryptocurrencies: model, techniques, and applications, IEEE Trans. Syst. Man Cybern. Syst. Hum. Syst. 48 (9) (2018) 1421–1428. [30] J. Yun, Y. Goh, J.M. Chung, DQN-based optimization framework for secure sharded blockchain systems, IEEE Internet Things J. 8 (2) (2020) 708–722. [31] X. Zhang, P. Sun, J. Xu, X. Wang, J. Yu, Z. Zhao, Y. Dong, Blockchain-based safety management system for the grain supply chain, IEEE Access 8 (2020) 36398–36410. [32] Z. Zhu, G. Qi, M. Zheng, J. Sun, Y. Chai, Blockchain based consensus checking in decentralized cloud storage, Simul. Model. Pract. Theory 102 (2020), 101987.

Chapter 4

Types of blockchain Sana Zebaa, Preetam Sumanb, and Kanishka Tyagic a

Department of Computer Engineering, Jamia Millia Islamia University, New Delhi, Delhi, India, b School of Computing Science and Engineering,

Vellore Institute of Technology, Bhopal, Madhya Pradesh, India, c Aptiv Corporation, San Francisco, CA, United States

1. Introduction Since 2009, blockchain has been a popular phrase, and currently, it has become quite possibly the most progressive technology. It is a distributed document used to store and record exchanges confirmed by personal computers (PCs) about the organization of documents. This innovation is the most persuasive innovation of the 21st century, but its reception is not the simple case, making it a slow channel. Innovation has its own set of difficulties, which should be overcome to accelerate its acceptance. Blockchain has left an impression in almost every area, including finance, health care, web-based companies, the commission’s production network, etc. Consolidating it with other emerging advancements will bring us all new things. Typically, blockchain is a mixture of existing innovations that can mutually make an organization to guarantee trust between people or rallies that have no justifiable excuse to trust each other. Specifically, it uses transmitted document innovation (distributed ledger technology [DLT]) to store secret key data confirmed between customers, which is approved by a predefined network agreement, usually without control of a focal power. Mixing these advancements gives key components to blockchain networks that can eliminate the need for trust, so that value and information can be communicated securely directly between the parties. Because of this outstanding ability, blockchain innovation may weaken the work of mediators who can handle market influences, charge huge expenses, go back in fiscal years, and are not really trustworthy or magnanimous caregivers of individual data. Although known for its computerized monetary resource applications (like Bitcoin), blockchain innovation is counted to affect a broad range of fields. The Organisation for Economic Co-operation and Development (OECD) is considering suggestions for strategies in various regions, including well-being, transport, horticulture, climate, and the retail network. The most basic need or use of the blockchain is to manage the exchange or trade of data through a protected organization. In any event, the way individuals use blockchain and appropriate innovation or registration organizations changes from one circumstance to the next. For example, in the case where we are talking about Bitcoin, this is the way in which blockchain was introduced in the standard. Bitcoin is advanced digital silver which is traded across blockchain and advanced DLT. This kind of blockchain network is a public organization since individuals from all over the world can turn into a hub, check out various hubs, and exchange Bitcoin. Again, say the bank is using a private blockchain network. It will be a contained organization, and only approved people from the bank can get classified data. Consequently, no one in this closed organization has access to banking information. The private organization will have restricted and approved centers monitored by the head of the organization. The data transmitted through that private blockchain network remain within the organization. Any new center that wants to be added to the private organization requires the consent of the head of the organization. A bank may decide the size of its private blockchain for any branch in a city or any branch in a country. Indeed, like these models, there are different approaches to setting up a blockchain network based on its motivation and needs.

2. Literature review Xu et al. [1] proposed a blockchain-based edge registration stage that uses distributed storage and blockchain to access Internet of Things (IoT) hubs to improve the independence and self-management of the edge cloud. For a fairly long application, the creator offers a three-level confirmation model, including a clever verification of the agreement, a confirmation of the script, and a confirmation of the center of expertise. Thunder [2] and others proposed a step that connects the IoT and Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00003-6 Copyright © 2023 Elsevier Inc. All rights reserved.

55

56

SECTION

A Evolution of distributed systems

the blockchain, with emphasis on the legitimacy of sensitive data. There is an additional layer within IoT engineering, called the IoT blockchain admin step, which is used to control the blockchain network. A proof of concept was run using Raspberry Pi and various real gimmicks. This article talks about a glimpse of the benefits and difficulties of blockchain coordination with the IoT. Atlam et al. [3] also discussed future avenues for exploring blockchain and the IoT. They reasoned that the mix of blockchain and the IoT can give an amazing strategy that can prepare new action plans and transmitted apps. With regard to the blockchain innovation, another administration and IoT engineering verification are evoked. Web of things network frameworks use blockchain to implicitly control and register changes or gadget designs [4]. With the help of the blockchain, IoT frameworks were built to accomplish decentralization, which works with organizational character confirmation, reliability, correctness, and synchronization. To overcome the limitations and problems within the framework of the IoT, the creator proposes a framework of the IoT with an appropriate blockchain [5]. Krishna Prasad [6] and others proposed a blockchain model to provide the valor and security of the IoT organization. For this situation, different layers of encryption and decoding are used in the design which uses hashing work. Blockchain and IoT frames use some abilities that affect the incorporation of both. Frustaci et al. [7], depending on the viewpoint of the various critical levels of IoT engineering, filter the security of the IoT to organize it and give characterized care. Another model was also presented, the Internet of Social Objects, in which IoT frameworks are embedded with various interpersonal organizations. Zhou et al. [8] have examined the possibility of “Web of Things Attributes” to well recognize the essential realities of new IoT dangers and the difficulties that have been centered around in late exploration. In this article, the author also talks about the security and protective ramifications of IoT frames. Sultana et al. [9] proposed an IoT organization to monitor the approval, validation, and accuracy of data involved in the IoT organization. For this situation, different layers of encryption and clearance are used in the design that uses hashing work. Blockchain and IoT frames employ a number of abilities that influence the combination of both. The creator also uses the versatile edge register and haze treatment in the proposed design. The SDN infallibly controls and examines traffic information across the IoT organization [10]. An access control and novel authentication mechanism has been developed for lightweight decentralized IoT that is appropriate to a large number of states. Umair Khalid The fog computing and blockchain thought have been used in the mechanism. For experiment purpose, this proposed mechanism can be applied to a number of IoT network use cases [11]. Dabbagh and Sookhak [12] have analyzed the bibliometric conference papers of blockchains and correlated articles and reviewed papers that have been indexed in WoS from 2013 to 2018. They have analyzed those collected papers against five research questions. Suchaad et al. [13] talked about the training or discipline of the blockchain component for children’s home IoT frameworks. A token-based component was proposed for the parent-controlled family setting, where guardians can promote acceptable conduct and prevent inappropriate conduct of young people with the help of the symbolic plan and provides an IoT system to safeguard sensor information. The purpose of this structure is to give the scalability of the blockchain plan for high-yield executives. For this structure, Docker Swarm is used for the support arrangement, and an extra exam is reached to use Kubernetes instead of Docker Swarm [14]. Fan et al. [15] proposed a structure to decide the matter of time disclosure in the IoT system with blockchain. The records sent in progress make it possible to verify and synchronize the time in the IoT sort and to avoid the failure point. Future work also shows a focus on the technique most capable of updating the accuracy of time and reducing compensation no matter how much could reasonably be expected.

3.

Background study

3.1 Blockchain technology A blockchain is a decentralized and expanded database that is used to keep an implacable creation of records, called blocks [16]. Each box holds a timestamp and an association with a passed block. By plan and by reason, blockchains are typically impenetrable for data remediation. A blockchain is a typical record of transactions between parties in an association, not bound by a singular central force [17]. You can imagine a recording as a book of records: it records and stores all transactions between customers in a consequent solicitation. Perhaps a single position controlling this registration (like a bank), a fuzzy copy of the registration is held by all the customers of the association, called centers. Blockchain is an informational index-specific type. It contrasts with an informational index generally average in how it stores information; blockchains store data in blocks that are subsequently linked together. As new information comes along, it goes into another box. The blockchain map is depicted in Fig. 1.

Types of blockchain Chapter

Block Header 1

Block Header 2

Block Header 3

Hash of Pervious Block Header

Hash of Pervious Block Header

Hash of Pervious Block Header

Merkle Root

Merkle Root

Merkle Root

Block 1 Transaction

Block 2 Transaction

Block 3 Transaction

4

57

FIG. 1 Structure of blockchain.

The term blockchain was first depicted in 1991. Group of examiners expected to make a timestamp-mechanized device chronicles so it could not be amended, originated before, or changed with anyone. In addition, blockchain technology was refreshed and re-evaluated by Satoshi Nakamoto in 2008. Nakamoto has grown the first blockchain-based computerized cash project, known as Bitcoin. This blockchain technology used for transmission and tracking of mechanized assets (value/property) starting with an item then on the following in the association. Mechanized assets merge digital money—cryptocurrencies such as Bitcoin, Ripple, Ether, and Litecoin.

3.2 Blockchain features Blockchain development has peer-to-peer, perpetual, interoperability, decentralized, and indefinite quality parts that join all IoT applications and become a security-based blockchain progresses IoT structure [16,18]. So here we can discuss all the blockchain components and Fig. 2 shows the huge blockchain qualities below [19]:

FIG. 2 Key features of blockchain.

58

SECTION

A Evolution of distributed systems

1. Immutability: The creation of unchanged registrations is one of the basic potential gains of blockchain [20]. All concentrated informational indexes can be corrupted and usually require the trust of a paria to maintain the reliability of the information. No matter when you have surrendered to a trade and registered it, it can never be changed. 2. Decentralization: The lack of joint control ensures adaptability and power by utilizing everyone’s resources to take a center of interest and get rid of numerous traffic flows to one [16], thus reducing lethargy and addressing the failure point problem that exists in the associated model [20]. 3. Anonymity: Anonymity provides a compelling strategy to cover the character of patrons and keep their characters hidden. 4. Better security: Blockchain gives better security because there is no point of fault in stopping the whole association. 5. Increased capacity: One of the basic building blocks of blockchain advancement is that it can manufacture the restriction of an entire association. Having a huge number of PCs coordinating by and in general can have more vital power than many united specialists. 6. Less failure: Everything in the blockchain is fully planned, and as it is not dependent on human calculus, it is a significant leniency deficiency. In this respect, accidental dissatisfaction with this structure does not constitute normal performance. 7. User control: With decentralization, clients currently have power over their properties. They are not relying on a thirdparty gathering to keep track of their assets. Everyone can do it until then, with no one else. 8. No third party: The decentralized nature of development turns it into a structure that does not rely on excluded associations; no untouchable, no additional risk. 9. Zero scam: Since the structure works on the calculations, there is no opportunity for people to deceive you from anything. It’s impossible for anybody to use blockchain for their own advantage. 10. Transparency: Decentralized thinking of development makes a direct profile of each party. Each alteration of the blockchain is obvious and makes it more concrete. 11. Authentic nature: This structural nature makes it a phenomenal type of system for each type of person. Therefore, the developers will fight to break it.

3.3 Challenges of blockchain Blockchain offers an incredible response to some applications that need correctness, decentralization, righteousness, consistency, and security without requiring trust in pariah. Anyway, there are a couple of issues to solve to figure out the biggest blockchain limit for different applications and use cases. Common blockchain challenges showed up in Fig. 3 which is discussed in depth. 1. Speed and transmission of information in the blockchain network: Is the existing association moving fast enough for blockchain transactions and updates to make continuous updates in systems? More research is required to meet that criterion.

FIG. 3 Challenges of blockchain technology.

Types of blockchain Chapter

4

59

2. Latency/Delay in the blockchain network: How many times as much as possible the registration needs to be restarted in the blockchain and what is the most invigorating concede that is good? In addition, the enemy may refuse to allow a square digger to appear to all the various diggers for a long time. How do we deal with those kinds of attacks even more effectively? 3. Scalability: The first and most important issue connected with its collection is its versatility. Be that as it may, business networks are prepared to plan an enormous number of trades every second without failure regarding Bitcoin (approximately, 3–7 trades every second) and Ethereum (15–20 trades); there is a great respite to taking care of trades, making blockchain unsustainable for applications of colossal degree. 4. Interoperability: Interoperability is the second gigantic question that needs to be addressed, as it is one of the central inspirations why the affiliations don’t address that issue. A huge portion of blockchains operates in storage facilities and does not speak with other secondary networks because they are not equipped to send and obtain information from another blockchain-based system. 5. Energy consumption: The development works on the proof-of-work framework to support the professions and ensure the confidence to add them to the association. This frame requires a huge computing capacity load to solve complex mathematical puzzles to quantify, verify, and, specifically, to get the entire association. 6. Energy consumption is another blockchain assembly challenge. Most of the blockchain development follow the Bitcoins system and use proof of work as a comprehension estimate. 7. Lack of talent: Interest in blockchain specialists is growing rapidly, but amazing abilities can be considered a critical test factor in collecting this advancement. Starting in 2019, the global bonus for blockchain engineers is more than 517% over the past year. 8. Lack of normalization: Which normalization does blockchain follow is a request that is at this stage without response? Despite the large number of associations that exist, a general standard does not yet exist. The lack of standardization raises questions such as interoperability, increased costs, and disruptive instruments, making mass collection an incredible effort. As the advancement of the blockchain quickly hangs on no rule structure, it probably goes as prevention to the part of new specialists and monetary customers as well. 9. Transaction speed: The resulting test is associated with the transaction speed of a blockchain. In 2019, the Bitcoin blockchain is so ready to just do business with seven trades every second, while the Ethereum blockchain might, theoretically, measure eight. Be that as it may, on Singles Day 2018 in China, Alibaba processed 325,000 jobs every second (reaching a salary of 30.8 billion dollars of similar work). Blockchain will save labor to appear on those levels. Meanwhile, appropriate new record advances are being cultivated which offer thousands or even a huge number of trades every second. Be that as it may, the course of these new record propellants circled in enormous business conditions is at this stage confined. 10. Security concerns: Security is another fundamental point here. We total ability of each blockchain development boasts of its security. Either way, as advancement, blockchain goes further with some wellness circles. 11. The 51% attack on the association is one of its security failures. In this attack, software engineers can expect the authority of the association to be exploited in their own way. They may even change the cycle of commerce and the breaking point of others to make a place. 12. To handle that, the show layer needs a more recognizable security. We have recently seen part of his safety move away from current conditions. Anyway, a simple bunch of unpretentious circumstances have amazing shows that can adapt to that. As a result, nobody knows if they are guaranteed to be used for a surprisingly long time. 13. Lack of confidentiality: Blockchain and security end up being wrong with one another. The freely available reporting structure fills the system, so full safety is not the main issue. Associations must reliably obtain and restrict the induction of their data for a variety of purposes. 14. The criminal connection: The obscure part of blockchain development shot through experts as well as criminal characters. Why? Taking all into account, the possibility of association is decentralized with the goal that no one can know your authentic person. Undoubtedly, various business leaders, affiliations, and policymakers are prepared to take this development. Nevertheless, there are some disturbance arrangements that are responsible for the languid meeting of this advancement. From everything here, we have registered the fundamental questions related to this development. There is no doubt that many business leaders, associations, and policymakers are prepared to tackle this innovation. In any case, there are some sets of challenges which are responsible for the lethargic reception of this innovation. From everything here, we have registered the fundamental problems associated with this innovation. Next to the challenges mentioned above, cost, security, and assurance are the other test factors for huge extension executions.

60

4.

SECTION

A Evolution of distributed systems

Blockchain technology and its history

A blockchain is defined as a distributed database of digital record transactions that continuously stores growing list of records in the form of blocks. The name of this technology comes from its structure, in that separate records, called blocks, and all records are linked in a single list, called a chain. In a blockchain, every block holds a timestamp, hash value, and previous hash value that is used to connect the blockchain with the pervious block. The design of blockchain is secure and trustworthy from tampering due to its immutable features which means once any alteration or modification occurs, then recorded in blockchain. Blockchain is used for recording transactions of system in such a way which makes it problematic or impracticable to alteration, hack, or fraud the system. The two-fundamental entity of blockchain has such transaction and blocks. Blockchain, several times mentioned as DLT, makes the history of any digital asset irreversible and transparent over the use of decentralized and cryptographic algorithm hashing. In 1991, first, Stuart Haber and W. Scott Stornetta have given the blockchain definition. They are announcing timestamp-based digital documents that are secured and don’t tamper through cryptographic hashing. Moreover, Satoshi Nakamoto intellectualized the logic of distributed blockchains. Hence, several forms of blockchain have been demonstrated in Fig. 4. Hence, there is a brief history of blockchain technology discussed in different versions according to the year. l

l l

l

l

l

In 1991: A cryptographically hashed and secured chain of blocks is defined first time by Stuart Haber and W Scott Stornetta. In 1998: The computer scientist Nick Szabo works on “bit gold,” as a decentralized digital currency. In 2000: Stefan Konst has published his theory of cryptographic hashed and protected chains, with its implementation theory. In 2008: The developers have been working additional down the pseudonym Satoshi Nakamoto announcement a white paper launching the model for a blockchain. In 2009: By using Bitcoin, Nakamoto has implemented the first blockchain in conditions of the public ledger for transaction records. In 2014: Blockchain technology is divided from the currency and its potential for other financials. Blockchain 2.0 is born, referring to applications beyond currency.

Back to Blockchain

Timestamp Tampered The first work on a cryptographically secured chain of blocks was described by Stuart Haber

1991

Set of Blockchain Usecases

Around 2014, attention shifted from Bitcoin to Blockchain, hundreds of cryptocurrencies were issued

2008

2014

Different solution based on blockchain technology in Healthcare, Supply Chain and Finance sectors

2015

Bitcoin

Hyperledger - Linux

Satoshi Nakamoto published a white-paper titled “Bitcoin: A Peer to Peer Electronic Cash System”

The Hyperledger project was founded in 2015, when the Linux Foundation announced the creation of the Hyperledger project

FIG. 4 History of blockchain technology [21].

2018

Types of blockchain Chapter

4

61

5. Differentiating blockchain on network and operational parameters Blockchain can be masterminded depending on how much power the association gets. Blockchain is usually requested in two sorts as public blockchain and private blockchain. There are also different blockchain assortments such as blockchain consortium and hybrid blockchain. The various kinds of blockchain have shown in Fig. 5. There are mainly two types of blockchains: private and public blockchains. In any case, there are a couple of assortments too, such as consortium and hybrid blockchain. Each blockchain consists of a large number of nodes dealing with a common network system (P2P). Every focal point of an association has a copy of the normal disk which is resuscitated perfect. Each central point may affirm trades, start or obtain trades and make blocks. The blockchain has been separated into two modes where one is blockchain network access control that gives five types of blockchain. And another mode is the blockchain network individuals who give two kinds of blockchain. Both modes are specified below and inspected in shades. 1. Blockchain types depending on the network access. 2. Member-dependent blockchain types.

5.1 Types of blockchain dependent on network access By now, we should see the comprehension concerning the four kinds of blockchains which are given in Fig. 5: 1. 2. 3. 4.

Public blockchain Private blockchain Consortium/Federated blockchain Hybrid blockchain

Public blockchain A public blockchain is a registration system with no restrictions or approvals. Anyone who moves to the web can connect on a blockchain stage to turn into a supported central point and be a piece of the blockchain network. A central point or customer that is a piece of the public blockchain is supported to access existing and past records. Assert trades or get evidence of work for a move to the square and make mines. The most central use of public blockchain is intended for mining and trading cryptographic types of treasury. Subsequently, the more prominent public blockchains are Bitcoin and Litecoin blockchains. Public blockchains are usually secure if customers are thoroughly aware of security rules and strategies. Anyway, it’s simply risky when people don’t actually follow the safety shows. Model: Bitcoin, Ethereum, Litecoin

FIG. 5 Different types of blockchain.

62

SECTION

A Evolution of distributed systems

Benefits of public blockchain l State-owned blockchains are adequate for what they do. Their benefits merge with the go. l Public blockchain provide a way to deal with protecting customers from a designer application. There are things that even the architects of a claim don’t need to do. l Because public blockchains are open, they are more likely to be used by a ton of components, without imperative rejection control. l Anybody can join public blockchains. l It provides confidence among all customers of the neighborhood. l Everybody feels helped in seeking the advancement of the public association. l The public blockchain requires no officer to work. l Public blockchains are additionally secured according to the quantity of central points of sharing. l It conveys the correctness to the whole association since the available data are open for assertion. Weaknesses of the public blockchain: The public blockchain has its disadvantages. They are as per the following: l l l l

l l

They are suffering the negative effects of lack of commercial speed. Another problem with the public bloc is flexibility. The last hurdle of a public blockchain is choosing the strategy of understanding. Public blockchain use cases: There are various user instances of public blockchain. To improve the reflection, we would have to show some of them below. Voting: Governments can project a voting form via an open blockchain using frankness and trust. Fundraising: Businesses or readers can use the public blockchain to create more fairness and trust.

Private blockchain A private blockchain is a restrictive or compliant blockchain usable simply within a closed association. Private blockchains are regularly used within an affiliate or attempts where just selected people are individuals of a blockchain network. The level of welfare, approvals, approvals, and transparency are owned by the controlling affiliate. So private blockchain is an amount that’s used as a public blockchain anyway has a bit of a restrictive association. Private blockchain networks are sent for the projection of a voting form, management network storage, automation, asset ownership, etc. Examples of private blockchains include multichain and hyperledger projects (cloth, Sawtooth), Corda, etc. Advantages of private blockchains: l l

l l

l l

Private blockchains are fast. The consortium or association that manages a private blockchain can without a very noticeable stretch change the standards of a blockchain, back trades, change adjustments, etc. Validation agents are known, so any chance of a 51% attack on a tractor game plan makes no difference. Transactions are more affordable, since they just ought to be checked by two or three center points that can be trusted to have uncommonly high getting ready force with no ought to be affirmed by 10,000 center points. Since playback approvals are restricted, private blockchains give a more discernible level of safety. Private blockchains are more versatile. Flexibility is possible given the manner in which, in a private blockchain, two or three core points are endorsed to support trades.

Disadvantages of a private blockchain l l

Private blockchain isn’t exactly decentralized. Getting confidence within the private blockchain is outrageous in light of the fact that the linked central points make the last choice.

If you look at everything, because there are several centers here, the security is not overly adequate. Understand that it is feasible to lose security if a number of centers criticize any kind of power and compromise the understanding system employed by the private association. Private Blockchain Use Cases: There are cases of distinguishing private blockchain use. Certain of them are registered: l l l

Board supply chain: Organizations can send a privately owned blockchain to manage their creative organization. Property of assets: Assets can be tracked and verified using a private blockchain. Internal voting: Private blockchain is likewise successful inside projecting a voting form.

Types of blockchain Chapter

4

63

Consortium/federated blockchain A blockchain consortium is a semidecentralized trial where more than one affiliate manages a blockchain network. This flies in the face of what we found in a private blockchain, which is run by a single affiliate. Past what an affiliate can probably go as a central point in this sort of blockchain and exchange information or do mining. Consortia blockchains are generally utilized by banks, affiliated governments, etc. Examples of consortium blockchains are energy web foundation, R3, and the like. Benefits of consortium blockchain l l l l l

It provides greater flexibility and control of resources. The consortium’s blockchains are safer and allow for greater flexibility. It is additionally more useful and differentiated from public blockchain networks. Operates under clear organizational structures. It provides entry controls.

Disadvantages of blockchain consortium l l l l

Even if it is secure, the entire association may be compromised as a result of the reliability of the part. That’s a little less direct. Regulation and limitation can enormously influence network accessibility. It is also less confusing and stands out from different kinds of blockchain.

Use cases of consortium blockchain There are a variety of consortium blockchain use cases. Some are incorporating accompaniment. l

l l

Banks and parts: A meeting of banks can participate and make a consortium. They may choose the center points that will support the trades. Search: A blockchain consortium can be used to share search data and findings. Following foods: It is also amazing with the following foods.

Hybrid blockchain A crossover blockchain is a blend of private and public blockchains. It uses the arrangements of both kinds of blockchain which is that one can have a structure based on private approval in the same manner as a system of public assent less. With a specially intersecting association, customers can deal with who acquires permission to which data set aside in the blockchain. Simply a selected part of the data or records of the blockchain may be allowed to open to the world by keeping the rest as mystery in the private association. The hybrid blockchain game plan is versatile so customers can certainly join a private blockchain with various public blockchain channels. A business in a private association of a blockchain mixture is generally asserted within this association. Be that as it may, customers can also pass it on to the public blockchain for verification. Public blockchains increase hashing and integrate more central points for assertiveness. It works on the safety and rectitude of the network blockchain. Advantages of hybrid blockchain l Functions in a closed environment without the need to discover everything. l The rules may be altered by necessity. l Hybrid networks are also immunized against 51% of attacks. l It provides safety while remaining linked to a public association. l It provides extraordinary flexibility that departs from public association. Challenges of hybrid blockchain l Not quite clear about that. l Upgrading to cross-variety blockchain may be one test. l There is no power to take an interest in the association and make improvements. Use cases of hybrid blockchain Probably the best opportunities for using the hybrid blockchain are based on the support:

64

l

l l

SECTION

A Evolution of distributed systems

Actual inheritance: You can use mixed networks for land purposes where land associations can use them to manage their structures and use everyone to show information to everyone. Retail trade: Retail trade may also use the inter-variety association to rationalize their cycles. Highly controlled industries: Hybrid blockchains are equally incredible for highly coordinated industries such as the financial sectors.

5.2 Types of blockchain dependent on members With reasonable knowledge of blockchain and differentiation between decentralized and consolidated structures, we must explore authorized and unauthorized blockchains.

Permissionless blockchains Within the blockchain without authorization, associations will be open to all individuals. Blockchains permissionless can’t avoid being blockchains that need no approval to join and associate with. They are commonly known as public blockchain. Usually without a blockchain, license is incredible for the execution and administration of principles related to mechanized money. In a permissionless blockchain, a customer can make a road number and thereafter speak with the association by either helping the association with endorsing trades or basically send trades to another customer on the association. Undoubtedly, the main type of blockchain without authorization is Bitcoin. It has enabled clients to shift progressive financial standards among themselves. Additionally, customers may assist the association by participating in the mining structure. It is a course of manipulation of complex mathematical conditions and a moment later use it to endorse occupations. The understanding calculation utilized by Bitcoin is proof of work. There are also other blockchains which are not authorized. Ethereum (ETH) is another notable unauthorized public type that uses an alternative proof of stake approach. It also presents various thoughts as sharply arranged. Attributes of permissionless blockchains Blockchains without permission turn these into attributes of interest. We should show them below. l l

l l

l l

Truly decentralized: Permissionless block channel development is truly decentralized. Anonymity: The blockchain without authorization is open to everyone. Whatever the case may be, that does not mean that it is not obscure. Anyone who joins the association may be baffled as you will not need a KYC to join and investigate the association. Transparency: Public centers can view the professions, which makes the association direct. Confidence: You can follow or look into the trades. In the future, you can trust these blockchains without permission more than a closed or authorized blockchain. Unchanging: All data in the scene are constant, suggesting that you can’t change it at any time. Reinforced security: Cryptography and other security limitations make unauthorized blockchains more secure.

Next to them, another gigantic feature of permissionless blockchains is that anybody can join the association accepting that they need. Blockchains permissionless are also wonderful when it comes to stimulating customers in the association. They can be used for the improvement of individuals because it transmits righteousness and trust to all the association. Benefits of permissionless blockchains From the genuine ascribes, we can list the benefits of blockchains without authorization. l Unauthorized blockchains can be accessed by anyone. l It transmits confidence to all clients or any substance which interacts with it. l Unauthorized blockchains also help clients check network jobs. l

Disadvantages of permissionless blockchains There are further drawbacks to permissionless blockchains including accompaniment. l l l

An unauthorized blockchain is delayed when it comes to trade speeds. Those kinds of blockchains are all the more exciting corresponding. Not all permissionless blockchains are energy capable and may require amazing computing ability to approve trades.

Types of blockchain Chapter

4

65

Use cases of permissionless blockchain There are various types of permissionless blockchain instances. Some are incorporating accompaniment. l l l

Digital identity Voting Fundraising

Reasonable clarity of blockchain without authorization, ideally, has given you some understanding of blockchain without authorization.

Permissioned blockchains In the permissive blockchain, organizations will not be available for everything, except that members are preapproved by an assigned power. Permissive blockchains are a direct opposite to permissionless blockchains. You can imagine blockchain permitted on private blockchain lines as they are closed. There are various motives for deliberately shutting down authorized blockchains. The biggest contrast between permissive and allowed blockchain is that not all people can join the blockchain. It requires the unique consent of the head of the organization or the owner to participate in the organization. Banks, organizations, or various foundations can use the authorized blockchain which must get their information and have no problem complying with the guidelines. One of the major authorized blockchain performances is Ripple (XRP). Attributes of permissioned blockchains There are various authorized blockchain qualities, including accompanying l l l l l

Varying decentralization Governance Customizability Efficient Anonymity and straightforwardness

Benefits of permissioned blockchain There are clear advantages to authorized blockchain. A number of them should be listed below. l

l l l

Allowed blockchain will usually be quick as they can choose their own tuning technique and don’t need to bother with each hub for approval purposes. There is no doubt that they are more versatile. For associations, authorized blockchain (consortium) may provide greater adaptability. Permitted blockchains may also follow the administrative structure.

Disadvantages of permissioned blockchain Blockchain allowed has certain disadvantages, including accompanying. l l l l

An approved blockchain is not really decentralized. They are more complicated. The member’s KYC is needed to assemble the organization with the approval of the administrator. Less mysterious.

Use instances of permissioned blockchain There are a variety of authorized blockchain use instances, including l l l l l l

Research Food following Banking and installments Asset proprietorship Internal casting a ballot Supply chain the board

66

6.

SECTION

A Evolution of distributed systems

Comparison of various blockchain types

Before going any further, note that just one of every odd blockchains is doing something pretty much the same. While there are different variable components, two of the most huge are the “openness” of the stage (public or private) and the level of approvals expected to add information to the blockchain (permissioned or permissionless). Public blockchains (like Bitcoin) are open to everyone to examine and see, while private blockchains should be seen by a selected assembly of people. Basically, permissioned blockchains permit essentially a select social affair of customers to make (for instance, make trades for the record to record) and submit (for instance, affirms new squares for extension to the chain). On the other hand, blockchains without authorization allow anyone to contribute and add data to the registration. Of course, before making a final choice, we focused entirely on two essential kinds of blockchain, such as private and public blockchains. Of course, before making a definitive choice, we concentrated entirely on two basic types of blockchain, such as private and public blockchains. Nevertheless, the fundamental differences are similar to security, flexibility, and correctness. On one hand, where a private association likely will not have all the earmarks of being extraordinarily reliable, you can thoroughly rely upon a public association for its perfect understanding (proof-of-work) structure. In this way, basically, every model or occurrence of a compelling blockchain usage that we have seen so far is of a public blockchain. Public blockchain guarantees the security that hacking the whole association is past problematic. In addition, it offers the correctness of the data that each central point has a comparable clearance to the folder set aside in the blockchain. One of the very successful examples of a public blockchain is the Bitcoin structure. The blockchain has the essential qualification lie instead of a couple of boundaries such as endorsement, security, correctness, and understanding. Table 1 showed the retail relationship of various kinds of blockchain like public, private, and consortium blockchain. This blockchain request was carried out based on the passage of the association. Essentially, the blockchain was also segregated into two authorized types and without blockchain authorization depending on the members of the organization. Table 2 presents a detailed review of permitted and unauthorized blockchains which are categorized on members. The permissioned and permissionless blockchain has various properties such as speed, privacy, and cost, which helps to use this blockchain in various applications. The permissioned blockchain is faster and more costly because it is more

TABLE 1 Comparisons table of different blockchains depend on the network access. Properties

Public blockchain

Private blockchain

Consortium/Federated blockchain

Participants

Permissionless

Permissioned

Permissioned

Permissionless/ Permissioned

Read permission

Public

Public or restricted

Public or restricted

Public or restricted

Immutability level

Almost impossible to tamper

Could be tampered

Could be tampered

May or may not be tampered

Transaction speed

Slow

Lighter and faster

Lighter and faster

Slower and faster

Security

Consensus mechanism (PoW or PoS)

Preapproved participants

Preapproved participants

Preapproved/Consensus mechanism

Centralization

No

Partial

Yes

No/Partial

Efficiency (resource utilization)

Low

High

High

Moderate

Consensus process

Permission less

Needs permission

Needs permission

Permissionless/Need permission

Consensus determination

All miners

Selected set of nodes

Within one organization

All or selected nodes

Network

Decentralized

Partially decentralized

Partially decentralized

Decentralized/Partially decentralized

Hybrid blockchain

Types of blockchain Chapter

4

67

TABLE 2 Comparisons table of different blockchains depend on the members. Property

Permissioned blockchain

Permissionless blockchain

Speed

Faster

Slower

Privacy

Private membership

Transparent/Open to anyone

Cost

Cost-effective

No cost

Security

Less security

More security

Participants

Require permission

Not require permission

Assets

No crypto assets

One or more assets

Ownership

Managed by predefined group of nodes

No one owns mange the network

Decentralization

Partially decentralized

Truly decentralized

Legitimacy

Legal

Illegal

Development

Private

Open source

trustworthy as compared to a permissionless blockchain network. All participants required permission to access the network because of its permissions concepts which have been discussed above. The permissioned blockchain has been developed privately rather than open to access because of its required legal rules and permission conditions. Hence, permission blockchain networks are mostly developed in the organizations. Permissioned blockchain has been partially decentralized because somewhere it depends on any central authority which checks the rules or condition of the network.

7. Future work In the future, need more fixes on cryptographic security calculations that are much more refined than working on coerced active IoT gadgets (lightweight crypto algorithm). It will continue in monetary governments like early adopters; different sectors will adopt this incredible innovation. In the future, can coordinate blockchain with artificial intelligence to make it more secure and its foundation easy to understand.

8. Conclusion The year 2020 is an extended period of blockchain, but its enormous scope of execution includes some major problems which cannot be overlooked. From time to time, some provocations lead to the sluggish reception of blockchain innovation by various companies and associations. Considering everything, this takes us to the furthest limit of our various types of blockchain guide. Generally speaking, it is an intelligent thought to use private blockchain in case you are an organization and need to use it without revealing everything. Especially on these lines, assuming more rectitude in the network, going to a public stage is a decent alternative. However, they are not very appropriate in cases of use by large companies.

References [1] J. Xu, S. Wang, A. Zhou, F. Yang, Edgence: a blockchain-enabled edge-computing platform for intelligent IoT-based dApps, China Commun. 17 (2020) 78–87. [2] L. Hang, D.H. Kim, Design and implementation of an integrated IoT blockchain platform for sensing data integrity, Sensors (Switzerland) 19 (10) (2019), https://doi.org/10.3390/s19102228. [3] H.F. Atlam, A. Alenezi, M.O. Alassafi, G.B. Wills, Blockchain with internet of things: benefits, challenges, and future directions, Int. J. Intell. Syst. Appl. 10 (6) (2018) 40–48, https://doi.org/10.5815/ijisa.2018.06.05. [4] K. Kostal, P. Helebrandt, M. Ries, Management and monitoring of IoT devices using blockchain, Sensors 19 (4) (2019) 856, https://doi.org/10.3390/ s19040856. [5] C. Varghese, J. Jose, IoT device management using blockchain, Int. J. Sci. Eng. Technol. Res. 8 (3) (2019) 79–84.

68

SECTION

A Evolution of distributed systems

[6] K.P. Satamraju, B. Malarkodi, A secured and authenticated internet of things model using blockchain architecture, in: Proceedings of the 2019 TEQIP—III Sponsored International Conference on Microwave Integrated Circuits, Photonics and Wireless Networks, IMICPW 2019, 2019, pp. 19–23, https://doi.org/10.1109/IMICPW.2019.8933275. [7] M. Frustaci, P. Pace, G. Aloi, Evaluating critical security issues of the IoT world: present and future challenges, IEEE Internet Things J. 5 (4) (2018) 2483–2495, https://doi.org/10.1109/JIOT.2017.2767291. [8] W. Zhou, Y. Zhang, P. Liu, The effect of IoT new features on security and privacy: new threats, existing solutions, and challenges yet to be solved, IEEE Internet Things J. 6 (2019) 1606–1616. [9] T. Sultana, A. Almogren, M. Akbar, M. Zuair, I. Ullah, N. Javaid, Data sharing system integrating access control mechanism using blockchain-based smart contracts for IoT devices, Appl. Sci. (Switzerland) 10 (2) (2020), https://doi.org/10.3390/app10020488. [10] B.W. Nyamtiga, J.C.S. Sicato, S. Rathore, Y. Sung, J.H. Park, Blockchain-based secure storage management with edge computing for IoT, Electronics (Switzerland) 8 (8) (2019) 1–22, https://doi.org/10.3390/electronics8080828. [11] U. Khalid, M. Asim, T. Baker, P.C.K. Hung, M.A. Tariq, L. Rafferty, A decentralized lightweight blockchain-based authentication mechanism for IoT systems, Clust. Comput. 23 (3) (2020) 2067–2087, https://doi.org/10.1007/s10586-020-03058-6. [12] M. Dabbagh, M. Sookhak, The evolution of blockchain: a bibliometric study, IEEE Access 7 (2019) 19212–19221, https://doi.org/10.1109/ ACCESS.2019.2895646. [13] S.A.L. Suchaad, K. Mashiko, N.B. Ismail, M.H. Zainal Abidin, Blockchain use in home automation for children incentives in parental control, in: ACM International Conference Proceeding Series, 2018, pp. 50–53, https://doi.org/10.1145/3278312.3278326. [14] J.M. Song, J. Sung, T. Park, Applications of blockchain to improve supply chain traceability, Procedia Comput. Sci. 162 (2019) 119–122, https://doi. org/10.1016/j.procs.2019.11.266. [15] K. Fan, S. Wang, Y. Ren, K. Yang, Z. Yan, H. Li, Y. Yang, Blockchain-based secure time protection scheme in IoT, IEEE Internet Things J. 6 (3) (2019) 4671–4679, https://doi.org/10.1109/JIOT.2018.2874222. [16] S. Zeba, M. Amjad, D.R. Rizvi, Sustainable paradigm for computing the security of wireless internet of things: blockchain technology, in: Smart and Sustainable Approaches for Optimizing Performance of Wireless Networks: Real-time Applications, 2022, pp. 51–66, https://doi.org/10.1002/ 9781119682554.ch3. [17] S. Zeba, M. Amjad, Identification of a person from live video streaming using machine learning in the internet of things (IoT), Int. J. Mob. Comput. Multimedia Commun. 12 (3) (2021) 44–59, https://doi.org/10.4018/IJMCMC.2021070104. [18] U.K. Chopra, A.K. Rathore, R. Pandey, Rendering blockchain immutability in Chatserver: a Node.js approach, in: P.K. Kapur, G. Singh, Y.S. Klochkov, U. Kumar (Eds.), Decision Analytics Applications in Industry, Springer Singapore, 2020, pp. 147–155, https://doi.org/10.1007/978981-15-3643-4_10. [19] S. Zeba, M. Amjad, Mobile-chain framework: distributed health communication framework with mobile blockchain and IoT technology, J. Chengdu Univ. Technol. 26 (9) (2021). Abstract. [20] A. Sahai, A NodeJs approach in blockchain technology, Mukt Shabd J. IX (V) (2020) 618–624. [21] S. Zeba, S. Haque, M.A. Haque, Revolution in IoT with Blockchain Technology, Lambert Academic Publishing, 2021, pp. 1–137, ISBN: 978-620-391142-8.

Chapter 5

Blockchain types: A characteristic view Rajat Verma and Namrata Dhanda Department of Computer Science & Engineering, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India

1. Introduction The initial phase of blockchain started in 1982 when a blockchain-like protocol was used by a well-renowned computer scientist David Chaum in his dissertation [1,2]. Further, the concept of blockchain was evolved by Stuart Haber and W. Scott Stornetta [3,4]. Slowly and gradually, the diverse functionalities were added, and finally, the first conceptualization took place in 2008 by a pseudo-identity Satoshi Nakamoto that certainly represented a group of people, when it was implemented behind the famous cryptocurrency Bitcoin with a measure to provide security and immutability [5]. In the original white paper of Satoshi Nakamoto, the word blockchain was represented by two words, that is, block and chain, but by the year 2016, they eventually became famous and became popular as a single word of blockchain [6,7]. Blockchain is now being used as a primary element to solve the issues of different old technologies that are operating in the market in a fully functional approach [8]. Initially (2008–2013), the blockchain worked as a backbone for the cryptocurrency Bitcoin which represented the blockchain as Blockchain 1.0 and was called “Bitcoin Emergence” [9]. The follow-up phase considered the contracts section which was called Blockchain 2.0 during the tenure between 2013 and 2015 and was represented as “Ethereum Development” [10]. The latest versions are currently dealing with the applications phase as Blockchain 3.0 (2018–present) and then finally to Blockchain with AI (Blockchain 4.0) (Present) [11]. The Application’s Phase is represented by Cardano. In totality, blockchain is just a 24-year-old teenager who became a buzzword in a very short time. Blockchain is depicted as the game changer by many organizations. In general, blockchain is a digital ledger that has three characteristics, namely, decentralization, transparency, and immutability [12]. Blockchain is a series of blocks that are joined together. The connection between the blocks or nodes is possible because of the cryptographic hash values [13]. As the evolution of blockchain took place from 2008 to the present, the usage of blockchain also varied from case to case. In some cases, public blockchain is a requisite. Bitcoin is a perfect example of a public blockchain, in which the node can be from anywhere in cyberspace and can also act as miners that validate transactions [14]. Other than Bitcoin, Ethereum and Litecoin are examples of public blockchains [15]. In public blockchains, if the protocols are followed strictly, then they can be considered as secured, and if not followed properly, then it can be risky. They are simply open as well as transparent. Similarly, private blockchain technology can be utilized by a bank that will be restricted to authorized personnel only. The measure of security is certainly greater in a private blockchain when confronted with the public ones, although in private ones, the level of security is taken care of by the controlling agency. A few popular examples of private blockchain networks are supply chain management (SCM), asset ownership, etc. [16]. One major benefit they have is a faster computation that means the transactions per second (TPS) is higher in private blockchains. It also has a greater scalability factor. The next version depicts the case of a consortium blockchain that is also known as the community blockchain. This brings up the formulation of a consortium using diverse groups of an organization/industry [17]. The constituents of the consortium are allowed to perform transactions and other stuff. Blockchain copies two major concepts of database management system, that is, read and append, but here in blockchain, it is followed more rigorously. Hybrid blockchain is another type of blockchain that deals with the amalgamated version of private as well as public blockchain [18]. These classes are the constituents of the classification that was done by Lin & Liao in 2017 [19]. Another classification took place in the year 2018 where three more types of blockchains were introduced that were permissionless blockchain, permissioned blockchain, and hybrid blockchain [20]. In the initial case, there is no permission needed to become part of the chain. With the help of their system’s computational power, they can be indulged in the authentication process while in permissioned blockchain, advance consent is required to become the authorized node of the blockchain network. With the latest blockchain, a user gets the advantages such as acquisition of technology, enormous use cases to study, ecosystem of applications, etc.

Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00013-9 Copyright © 2023 Elsevier Inc. All rights reserved.

69

70

2.

SECTION

A Evolution of distributed systems

Blockchain

It represents a series of nodes or blocks that are connected in a decentralized environment with the help of hash values. Hash values are the significance of encryption techniques that represents the diverse cryptographical techniques [21]. When the blocks are created, they have a unique timestamp known as the creation timestamp [22]. The structure of a block is represented in Fig. 1 for easy understanding. In Fig. 1, the block’s layout is illustrated which contains distinguished entities such as block number, previous block hash, current block hash, nonce, and creation timestamp [23]. The block number shows the spot of a block in a blockchain. The first block of a blockchain is termed as a genesis block [24]. The next entity, that is, previous block hash, means the hash block of the preceding block. The genesis block will not contain this entity as it is the initiator of the chain. The following entity, that is, current block cryptographic hash value, means the hash value of the block that is being addressed currently. Hashing algorithms are depicted by the popular term, that is, secure hashing algorithm [25]. In blockchain, particularly SHA-256 is applied, although there are diverse variants of it. In SHA-256, every sentence is encrypted by 64 hexadecimal characters [26], and it’s unique which means the hash value is distinct for every different sentence. The next entity, that is, nonce, it is a 32-bit number meant for the objective of security [27]. The last entity is the creation timestamp, which means the time at which the block was generated. When multiple blocks are connected, they form a chain called blockchain. A simple illustration of blockchain is represented in Fig. 2 for quick understanding. In Fig. 2, the schematic diagram of blockchain is depicted. The first block “A” represents the genesis block that will contain data, current-hash value, nonce, and block number but no previous cryptographic hash value. The reason behind this is that no block is before Block A. Block B will have its data, current hash, nonce, block number, and a previous hash value that will be identical to the current hash value of A. It is a mandatory condition as, without it, Blocks A and B wouldn’t be connected. A similar scenario will happen with other blocks comprising the blockchain. There is a subchain originating from Block B (as an example), with elements E and F. Then here, in this case, the subchain originating from Block B will be smaller in comparison to the upper chain from A to D. If the blocks are present in the longest chain, it is valid, and if they do not belong to the main chain, they shall be termed orphan blocks [28]. Blocks E and F will be termed orphan blocks. Blockchain is a network peer-to-peer technology that highlights the decentralized and distributed network [29] which is illustrated in the later subsections.

2.1 Blockchain technology: A peer-to-peer network of nodes The P2P network of nodes deals with a noncentralized and distributed environment where the nodes are connected directly without being affected by the central administrator [30]. In the earlier sections, there is a depiction that blockchain has three major properties, namely, decentralization, immutability, and transparency [12]. The peer-to-peer organization of nodes

FIG. 1 Structure of a block in blockchain.

FIG. 2 Structure of a blockchain [(main chain from A to D) and (subchain from B to F)].

Blockchain types: A characteristic view Chapter

5

71

FIG. 3 A peer-to-peer network (decentralized).

deals with the transfer of the data and figures with no geographical constraints [31]. Fig. 3 shows a quick depiction of a peer-to-peer network for easy understanding. In Fig. 3, several nodes are connected directly. In blockchain technology, there is no central server as depicted by the figure, so this mechanism is fast, hence no central point of failure for consuming a higher bandwidth. This mechanism became the need of the hour because many technologies are following the traditional centralized architecture with a central point of failure like the Internet of Things (IoT). So, blockchain can also perform a key measure in eradicating the centralization concept from IoT and should increase its efficiency [32].

2.2 Blockchain technology: Asymmetric key cryptography and hashing Since blockchain deals with the peer-to-peer mechanism, the query could appear that how blocks are communicating directly without any fear of losing their integrity of information and that’s so in the presence of millions of other nodes. Blockchain incorporates a very popular technique of cryptography, that is, asymmetric key cryptography or public key cryptography [33,34]. This cryptography deals with the usage of the private key as well as the public key [35]. Generally, the encoding process is done using the public key, and decryption is done using the private key. Hashing in a blockchain is an irreversible approach to encryption [36]. In hashing, the input can be of variable size but the output will be of fixed length only. SHA-256, a very popular variant of hashing algorithms, can take the input of variable length but will always give the output of 64 hexadecimal characters. The message digest will be identical if the same input is entered multiple times, but if a minute change occurs in the input, the entire hash value will be changed but the output will be of 64 hexadecimal characters only. Fig. 4 illustrates the working of cryptographic hash SHA-256 variant.

2.3 Characteristics of blockchain Since blockchain has become a buzzword in the last 15 years, several features and characteristics are responsible for this popularity which is mentioned below: 1. Enhanced capacity: This characteristic of blockchain provides a greater volume for the complete network that offers remarkable performance in totality [37,38]. 2. Enhanced security: This feature increases the security of the blockchain network by eradicating the central point of failure. Additionally, the number of nodes that validates the transactions also defines the measure of greater security [39,40]. 3. Immutability: It is a primary pillar of blockchain apart from decentralization and transparency. Here in blockchain, the immutable ledgers are created [41,42]. 4. Minting: Minting is a subset of mining. When the blocks are hashed, the minting of new coins is triggered. It only refers to the latest coins that are coming into existence. In general, they act as an important part of proof of stake (PoS) [43,44].

72

SECTION

A Evolution of distributed systems

FIG. 4 Cryptographic hash working: SHA-256.

5. Quick settlement: Unlike the traditional banking system, which takes days to proceed, blockchain banking is quite fast and takes minimum time to proceed which is quite less than the traditional banking system [45,46]. 6. Decentralization: The bearer has direct control over his account, this means that there is no involvement of the central authority [47,48].

2.4 Advantages and disadvantages of blockchain The mentioned parameters represent the advantages of blockchain. 1. Security: The transactions that use to happen within the blocks of blockchain are justified to correctness with the help of diverse consensus mechanisms [49]. 2. Quick processing [50]. 3. Traceability: All the processes are traceable from inception till the end [51]. 4. Integrity: The data remain trustworthy for all the nodes throughout its life cycle [52]. The mentioned parameters represent the disadvantages of blockchain. 1. High-power use [53]. 2. Cost/Expensive nature [54]. 3. Uncertain status (regulatory) [55].

3.

General classification of blockchain

As blockchain served various purposes from 2008 to the present, only a single type of blockchain cannot complete all the requirements in all the diverse cases. Majorly, the blockchain is classified into four constituents based on the significance and requirements, which are represented in the mentioned points. 1. 2. 3. 4.

Public blockchain [56–67] Private blockchain [68–77] Consortium blockchain [78–92] Hybrid blockchain [93–109]

Let’s explore these diverse types of blockchain in the next subsections.

Blockchain types: A characteristic view Chapter

5

73

3.1 Public blockchain This blockchain measures the case where everything is nonrestrictive. Public blockchain is a blockchain that illustrates the permissionless nature (generally). Permissionless means a user who is present in cyberspace can be a member of this chain and can authenticate transactions [56]. In this measure, the security of the node has remained intact. A few popular examples of public blockchain are Bitcoin, Ethereum, and Litecoin blockchains [57]. The KYC is not required in public blockchain. The approval of transactions takes an order of minutes. This blockchain is expensive. Public blockchain is shown in Fig. 5 for easy understanding. In Fig. 5, a public blockchain network is illustrated that contains four nodes (System 1–System 4). Any system ranging from 1 to 4 can do the mining process [58,59]. The systems can participate in mathematical quizzes to get a consensus. The mechanism can be any for instance Proof of Work (PoW) or PoS [60]. Every blockchain has its for and against and so do the public blockchains.

Advantages The mentioned features represent the advantages of public blockchain. 1. Trust: The proof of work is responsible for this trust in public blockchain [61]. 2. Security: The larger the participants, the more secured network will be. This is so because the larger the propagation of data among the diverse nodes, the more difficult it will act for the hacktivist to tackle the long chains [62]. 3. Transparent and open: A duplicate but genuine copy of the ledger is maintained in every system. The information is open and transparent to all the connected systems [63–67].

3.2 Private blockchain The solidity of the private blockchain is that it is confining, permission oriented, and closed, thus operates for a small amount of seats that are the actual participants of the network. Everything is in the hands of the monitoring and controlling organization [68–70]. It means all systems/nodes cannot participate in blockchain operations. Even for accessing data, nodes will be restricted. A few popular examples of private blockchain are SCM, multichain ledger, asset ownership, etc. [71]. The KYC is required in private blockchain. Private blockchain is shown in Fig. 6 for easy understanding.

FIG. 5 Public blockchain (comprising of four systems).

FIG. 6 Private blockchain (comprising of four systems).

74

SECTION

A Evolution of distributed systems

In Fig. 6, a private blockchain is illustrated that comprised four nodes with their accessory permission parameter (System 1–System 4). If a system has to participate in the operations, then initially, they have to be competent as per the permission parameters allotted by the agency [72]. If they complete the tasks allotted by the agency, they will be allowed to enter the network, and if not, they will not be allowed to be a participant of the network. Private blockchain is not so expensive.

Advantages and disadvantages of private blockchain The mentioned points illustrate the advantages of private blockchain. 1. Speed: When compared to the transaction count of the public blockchain, they provide a much efficient result. That means, in private blockchains, the transaction count is much higher [73,74]. A smaller number of systems fasten up the process of verification and validation [75]. Their TPS can range from hundreds to thousands at a single time [76]. 2. Scalability: It is fairly scalable as everything is in the hands of the authority, the size of the network could be as per the needs of the agency [77]. The mentioned points illustrate the disadvantages of private blockchain. 1. Absence of anonymity: There is no anonymity on this blockchain.

3.3 Consortium blockchain This category of blockchain handles a semidecentralized network. Here, the systems/nodes can select in advance whether the data will be open or private in nature of accessibility [78,79]. A consortium blockchain is maintained by multiple organizations rather than one as was there in private blockchain [80]. Some popular examples of consortium blockchain are banks, government agencies, energy web foundation, etc. [81,82]. Consortium blockchain is shown in Fig. 7 for easy understanding.

Advantages of consortium blockchain The succeeding points depict the advantages of consortium blockchain. 1. Increased speed: It is faster in comparison to the public blockchain. Public blockchains tend to be slower when a high number of nodes/systems are involved in the platform [83,84]. 2. Scalable: As the public blockchain considers a large number of users, that is, the number of users is certainly lesser in the consortium blockchain, so there are no scalability issues [85]. 3. Low costs (transactions): In public blockchain, a large number of users are present, and thus, the transaction pace variates at a rapid speed. In consortium blockchain, every aspect is regulated and thus there is no fluctuation in the transactions [86]. 4. Low-energy consumption: Consortium blockchain consumes very low energy to perform the process of validation [87]. 5. Zero-risk of 51% attacks: Since this blockchain follows the proper authentication and authorization process, there is certainly a zero issue of this 51% attack [88]. 6. Zero criminal activity [89]. 7. Regulations [90].

FIG. 7 Consortium blockchain (comprising of four systems with two permission parameters).

Blockchain types: A characteristic view Chapter

5

75

Consortium blockchain technology versus private blockchain technology: The comparison Since private and consortium blockchain shares a lot of common features. A comparison between them is highlighted in Table 1 [91,92].

3.4 Hybrid blockchain In the case of hybrid blockchain, the user feels the controlled access and freedom at the same point of time depicting a wellcombined form of private as well as public blockchain [93]. Here in hybrid blockchain, the approach is to follow a public blockchain concept using the private network. The KYC is required in hybrid blockchain. It is not so costly.

Advantages of hybrid blockchain The succeeding points show the advantages of hybrid blockchain. 1. 2. 3. 4.

Operates in a closed system [94]. Flexibility in rules and regulations [95]. Protection from 51% attack [96]. Minimum transaction cost [97].

Consortium blockchain technology versus hybrid blockchain technology: The comparison In many forms, the user can get confused, that is, hybrid and consortium blockchain are identical. Well, the answer is NO [98–100]. Table 2 demonstrates the comparison between the consortium blockchain technology and hybrid blockchain technology. They (consortium and hybrid) might sound identical but they are not. The rationale is that both perform their operations according to their indigenous characteristics and approaches. TABLE 1 Consortium blockchain technology versus private blockchain technology: The comparison. S. no.

Parameter

Consortium blockchain

Private blockchain

1.

Access

Involvement with multiple organizations

Involvement with single organization

2.

Authority of decentralization

Decentralized

Partially decentralized

3.

Speed of transactions

Quick

Quick

4.

Immutability (characteristic of blockchain)

Partially

Partially

5.

Data handling

Involvement with multiple organizations (read and write)

Involvement with single organization (read and write)

6.

Nature

Cheap (cost)

Cheap (cost)

TABLE 2 Consortium blockchain technology versus hybrid blockchain technology: The comparison. S. no.

Parameter

Consortium blockchain

Hybrid blockchain

1.

Access

Selected systems get complete access

Some resources are public and some are restricted

2.

Authority of decentralization

Decentralized

Partially decentralized

3.

Speed of transactions

Quick

Quick

4.

Privacy aspect

Partial privacy

Partial privacy

76

SECTION

A Evolution of distributed systems

Diverse use cases for hybrid blockchain The succeeding activities illustrate the diverse use cases of hybrid blockchain. 1. Government activities: Many activities of the government can be enhanced using blockchain technology [101,102]. The activities done by the government should follow the hybrid blockchain. A particular reason behind this is that completely following the public or private blockchain will create problems such as revealing the data that is not required. The hybrid blockchain mechanism should consist of the creation of the network by the government authorities and the useability of it will be with the common people. Diverse applications can be there as mentioned below: Voting system secured by blockchain [103] Automating the acquisitions by blockchain [104] Recording of complex data by blockchain [105]

l l l

2. Banking sector: The blockchain followed by banking sector should follow two criteria: Coping up with the internal matters Securing customer’s data

l l

Both of these concerns could be easily solved by hybrid blockchain [106]. 3. Hybrid IoT: With hybrid blockchain, the devices could be kept in a privatized network and the access to those devices should be selective. Acute data could be released in public depending on the security it requires [107,108]. 4. Supply chains: IBM Food Trust also follows the hybrid blockchain [109]. Blockchain will enhance the measure of accountability and transparency in SCM.

3.5 Public blockchain versus private blockchain versus consortium blockchain: The comparison Table 3 demonstrates the comparison among the public blockchain, private blockchain, and consortium blockchain.

3.6 Applications The succeeding points depict the applications of diverse blockchains.

TABLE 3 Public blockchain versus private blockchain versus consortium blockchain: The comparison. S. no.

Parameter

Public

Private

Consortium

1

Read: Permission

Public

Could belong to public class or restricted class

May belong to public class or restricted class

2

Effectiveness

Low

High

High

3

Principle of blockchain: immutability

Not possible to tamper

Can be tampered

Can be tampered

4

Principle of blockchain: decentralization

Yes

No

Partial

5

Nature of consensus

Permissionless

Not permissionless

Not permissionless

6

Nature of participants

Anonymous, being malicious probability (high)

Trusted and identified

Trusted and identified

7

Access

Decentralized management

Involvement with single organization

Involvement with multiple organization

Blockchain types: A characteristic view Chapter

5

77

1. Public blockchain: Exchanging and mining cryptocurrencies is a primary function of this type of blockchain. It will perform better with social groups and forms as well as nongovernment organizations. The reason is that they are built on trust and transparency. 2. Private blockchain: The main aim of this blockchain is not to share the controlling operations as well as information with the public but be confined. So, the applications include SCM, voting (internal), and asset ownership. 3. Consortium blockchain: Payments and banking are the major application areas of this blockchain. The manner in which it can be done is diverse banks can form a group, known as a consortium and the systems that will validate the transactions and other stuff could be decided. An identical scenario could be made with medical organizations, research organizations, etc. 4. Hybrid blockchain: This works using a combined approach of public and private. It permits the systems to operate privately and can make only some information public as required or requested. Real estate, retail, and regulatory financial markets come in this category.

4. Other classification of blockchain This classification is faintly varied from the common classification of blockchain. Typically, it deals with additional four types of blockchain that are represented below: 1. 2. 3. 4.

Public permissionless blockchain network [110–117] Public permissioned blockchain network [118–120] Private permissionless blockchain network [121–141] Private permissioned blockchain network [142,143]

The other categorization of these blockchains is highlighted in Table 4 for easy understanding. Let’s explore these diverse types of blockchain in the next subsections.

4.1 Public permissionless blockchain network On a public permissionless blockchain network such as Ethereum, the authoritative party does not exist [110]. Any system present in cyberspace can be a member of the network and can validate transactions through mining [111]. It means that the central administrator is absent on the network level. Smart contracts are the components on the blockchain responsible for developing the logic for permissions [112,113]. A few important characteristics of public permissionless is highlighted below: l l l

Consensus method followed: proof of work [114] Requires good scalability Deals with trade-off between slow speed and high latency [115]

Concerning the high-energy requirements, instead of PoW, PoS is being followed for the high-scale public blockchain such as Ethereum [116,117].

TABLE 4 Other classification of blockchain. Type of blockchain

Permissionless

Permissioned

Public

Major challenge Scalability and privacy

Major challenge Centralization and privacy

Ethereum, Bitcoin, and Waves

Sovrin and Ripple

Major challenge Scalability and consensus

Major challenge Centralization and consensus

Holochain and Monet

Hyperledger Fabric, Enterprise Ethereum Alliance

Private

78

SECTION

A Evolution of distributed systems

4.2 Public permissioned blockchain network Since it is the permissioned genre of public blockchain, instead of PoW, PoS is applied here [118]. With the PoS, the finality and speed are increased. Here also, a token is required [119]. With the better consensus mechanism, the resilience is also increased [120]. The major challenges are centralization and privacy. Sovrin and Ripple follow the public permissioned blockchain network.

4.3 Private permissionless blockchain network In a private permissionless blockchain network, the system nodes will only acknowledge their existence and are not allowed to share any raw facts and figures. The smart contracts present on these private permissionless blockchain network defines which nodes are permitted to perform operations but the smart contracts also define which nodes will read the contract or share any data. In this, every smart contract has its ad-hoc chains that perform the required operations [121–124]. The best framework for these private permissionless blockchain networks is the holochain [125] that is depicted in the next subsection.

Holochain This chain has predominantly worked to build decentralized applications [126,127]. Holochain provides a well-suited platform for it [128]. The user can have their chain in which data can be added. The chain can perform splitting, merging to complete the interaction in a complex manner. Following are the characteristics of holochain that are mentioned below [129–131]. l l l l l

Versatility: Real-world use cases corresponds to this characteristic. Scalable: It permits the chain to be scalable as the apps can interact using APIs. Resilient: It is flexible and strong. No mining required. No token required.

Generally, holochain is an amalgamation of digital signatures, hashing, and distributed hash tables (DHTs) [132]. The currencies are considered optional in holochain [133]. Some other uses of holochain are mentioned below: l l l l l

Supply chains [134] Social media platforms [135] Feedback systems [136] Governance [137] Scheduling processes [138]

Holochain is much optimized than conventional blockchains [139]. Few characteristics of holochain are mentioned below [139–141]: l l l l

No No No No

PoW. PoS. wastage on mining. global delays.

Some cons are also there where holochains are not at all suitable. They include the areas of sensitive/hidden data, large files, and one-person use. They should be avoided for the cases of sensitive data. For large-sized activities, it should be avoided as it will cause the process to be slow.

4.4 Private permissioned blockchain network This is also a type of blockchain network whose biggest drawback is centralization and consensus [142]. The certitude of the validator is at maximum when compared to all the previous blockchains. There is no necessity for the token [143].

Blockchain types: A characteristic view Chapter

5

79

5. Consensus mechanisms They are the procedure in which the systems agree on a common agreement to achieve reliability and gain trust in a distributive environment [144]. Let’s explore the diverse consensus mechanisms one by one.

5.1 Proof of work A popular cryptocurrency Bitcoin uses PoW [145]. The prominent logic behind this consensus mechanism is that mathematical puzzles will be solved to mine the blocks. The first miner who completes the tasks of mathematical puzzles (hash functions) will get the chance to mine to block [146]. This mechanism of PoW requires very high energy and computer power. It is a very costly operation. It is very popular in public blockchain. Characteristic features of PoW are as follows: l l

Quite complex to obtain a solution for the mathematical functions or problems. Correctness of the solution is easily attainable and verifiable.

Few other cryptocurrencies that are using PoW are as follows: l l l

Litecoin [147] Monero coin [148] Dogecoin [149]

5.2 Proof of stake The chief alternative of PoW is the PoS which is a far efficient consensus algorithm than PoW. There is a capacity of each system that the amount of coins they can handle with, PoS works on this principle. It depicts that the higher the capacity of coins the node can hold, the greater the computing power the node can handle [150,151]. It is less risky when compared to the traditional PoW. In the present time, altcoins use the concept of PoS [152]. Few other cryptocurrencies that are using PoS are as follows [153–155]: l l l

Peercoin: It was initiated in August 2012. Blackcoin: It was initiated in 2014. ShadowCoin.

Few advantages of PoS is mentioned below [156]: 1. Energy efficient. 2. Decentralization. 3. Enhanced security.

5.3 Proof of capacity This consensus mechanism uses the space present in hard drives and storage. The most important benefit of using this system of proof of capacity is their efficiency when compared to the most popular consensus algorithms [157]. This approach is cheaper and greener to validate the transactions. The hard drives can also belong to android-based systems [158]. Many other types of consensus algorithms are highlighted below for easy understanding. l

l

l

l

Proof of elapsed time: The credit for this consensus goes to Intel Corporation and follows a lottery system architecture [159]. Proof of authority (PoA): It permits a limited number of actors so that the blockchain could be updated more frequently and requires almost very little computing power as well as very low electricity. It is a popular choice in private and consortium blockchain mechanisms [160]. Proof of activity: When the two prominent consensus mechanisms are amalgamated together, that is , PoW and PoS, PoA is formed. Decred cryptocurrency follows this architecture [161]. Proof of burn: This mechanism is used to minimize the issue of double spending. It also addresses the enormous consumptions of PoW systems [162].

80

l

l

l

l

6.

SECTION

A Evolution of distributed systems

Delegated proof of stake: Scalability is increased here when compared to the traditional PoW systems and works on the principle of election [163]. Byzantine fault tolerance: In almost every practical problem, malfunctioning and malicious activities use to happen. This mechanism is used to provide a trustworthy and decentralized environment even in the presence of malicious activities [164]. Proof of importance: This estimates the eligible and legitimate users, who can add the blocks in a blockchain. PoI prioritizes the miners on the basis of the number of transactions they have performed [165]. Direct acyclic graphs (DAGs): Traditionally, DAGs are those that have NO cycles. Here, DAGs can act as an alternative to the conventional blockchains in terms of speed and scalability [166].

Conclusion

Blockchain is a wonder that has flourished gradually from its first conceptualization in 2008. Since then, it is being used for a variety of measures. Depending on the need of the hour, the blockchain can be configurationally customized. From its first conceptualization, blockchain has advanced from the era of Bitcoin emergence to the applications era and finally to artificial intelligence (AI). Since blockchain has evolved itself in the last 15 years, the usage of blockchain has also become unique. The decentralized peer-to-peer technology blockchain has so much to offer to the complete ecosystem with its custom categories. The introduction of blockchain with its different characteristics and measures is highlighted in this chapter. The foremost objective of dealing with the types of blockchain (a total of eight types of blockchain) is fulfilled in this chapter. A quick overview of mining and its diverse consensus mechanism is also illustrated in this chapter.

References [1] D. Devi, G.S. Rohith, S.S. Hari, K.S. Ramachandar, Blockchain based mechanism to eliminate frauds and tampering of land records, in: ITM Web of Conferences, vol. 37, EDP Sciences, 2021, p. 01011. [2] T. Geng, L. Njilla, C.T. Huang, Smart markers in smart contracts: enabling multiway branching and merging in blockchain for decentralized runtime verification, in: 2021 IEEE Conference on Dependable and Secure Computing (DSC), IEEE, 2021, pp. 1–8. [3] S. Haber, W.S. Stornetta, How to time-stamp a digital document, in: Conference on the Theory and Application of Cryptography, August, Springer, Berlin, Heidelberg, 1990, pp. 437–455. [4] A. Elbuz, M. Osmanoglu, O.O. Tanriover, Designing a secure blockchain-based trading platform for internet of things, Commun. Fac. Sci. Univ. Ankara Ser. A2-A3 Phys. Sci. Eng. 61 (1) (2019) 102–110. [5] S. Ghimire, H. Selvaraj, A survey on bitcoin cryptocurrency and its mining, in: 2018 26th International Conference on Systems Engineering (ICSEng), December, IEEE, 2018, pp. 1–6. [6] B. Vivekanadam, Analysis of recent trend and applications in block chain technology, J. ISMAC 2 (04) (2020) 200–206. [7] A. Thakre, F. Thabtah, S.R. Shahamiri, S. Hammoud, A novel block chain technology publication model proposal, Appl. Comput. Inform. 18 (2020) 195–207. [8] R. Verma, N. Dhanda, V. Nagar, Addressing the issues & challenges of internet of things using blockchain technology, Int. J. Adv. Sci. Technol. 29 (05) (2020) 10074–10082. Retrieved from https://sersc.org/journals/index.php/IJAST/article/view/19491. [9] J.G. Fraser, A. Bouridane, Have the security flaws surrounding BITCOIN effected the currency’s value? in: 2017 Seventh International Conference on Emerging Security Technologies (EST), September, IEEE, 2017, pp. 50–55. [10] V. Jacynycz, A. Calvo, S. Hassan, A.A. Sa´nchez-Ruiz, Betfunding: a distributed bounty-based crowdfunding platform over ethereum, in: Distributed Computing and Artificial Intelligence, 13th International Conference, Springer, Cham, 2016, pp. 403–411. [11] D.D.F. Maesa, P. Mori, Blockchain 3.0 applications survey, J. Parallel Distrib. Comput. 138 (2020) 99–114. [12] R. Verma, N. Dhanda, V. Nagar, Security concerns in IoT systems and its blockchain solutions, in: J.M.R.S. Tavares, P. Dutta, S. Dutta, D. Samanta (Eds.), Cyber Intelligence and Information Retrieval, Lecture Notes in Networks and Systems, vol. 291, Springer, Singapore, 2022, https://doi.org/ 10.1007/978-981-16-4284-5_42. [13] C.K. Adiputra, R. Hjort, H. Sato, A proposal of blockchain-based electronic voting system, in: 2018 Second World Conference on Smart Trends in Systems, Security and Sustainability (WorldS4), October, IEEE, 2018, pp. 22–27. [14] U. Mukhopadhyay, A. Skjellum, O. Hambolu, J. Oakley, L. Yu, R. Brooks, A brief survey of cryptocurrency systems, in: 2016 14th Annual Conference on Privacy, Security and Trust (PST), December, IEEE, 2016, pp. 745–752. [15] T. Dogru, M. Mody, C. Leonardi, Blockchain Technology & its Implications for the Hospitality Industry, Boston University, 2018. [16] P. Akhavan, M. Namvar, The mediating role of blockchain technology in improvement of knowledge sharing for supply chain management, Manag. Decis. 60 (2021) 784–805. [17] Z. Li, J. Kang, R. Yu, D. Ye, Q. Deng, Y. Zhang, Consortium blockchain for secure energy trading in industrial internet of things, IEEE Trans. Ind. Inf. 14 (8) (2017) 3690–3700. [18] L. Wu, K. Meng, S. Xu, S. Li, M. Ding, Y. Suo, Democratic centralism: a hybrid blockchain architecture and its applications in energy internet, in: 2017 IEEE International Conference on Energy Internet (ICEI), April, IEEE, 2017, pp. 176–181.

Blockchain types: A characteristic view Chapter

5

81

[19] M. Liu, K. Wu, J.J. Xu, How will blockchain technology impact auditing and accounting: permissionless versus permissioned blockchain, Curr. Issues Audit. 13 (2) (2019) A19–A29. [20] H.M. Kim, H. Turesson, M. Laskowski, A.F. Bahreini, Permissionless and permissioned, technology-focused and business needs-driven: understanding the hybrid opportunity in blockchain through a case study of insolar, IEEE Trans. Eng. Manag. 69 (2020) 776–791. [21] R. Sobti, G. Geetha, Cryptographic hash functions: a review, Int. J. Comput. Sci. Issues 9 (2) (2012) 461. [22] A. Galiev, N. Prokopyev, S. Ishmukhametov, E. Stolov, R. Latypov, I. Vlasov, Archain: a novel blockchain based archival system, in: 2018 Second World Conference on Smart Trends in Systems, Security and Sustainability (WorldS4), October, IEEE, 2018, pp. 84–89. [23] G. Ma, C. Ge, L. Zhou, Achieving reliable timestamp in the bitcoin platform, Peer-to-Peer Netw. Appl. 13 (6) (2020). [24] S. Singh, N. Singh, Blockchain: future of financial and cyber security, in: 2016 2nd International Conference on Contemporary Computing and Informatics (IC3I), December, IEEE, 2016, pp. 463–467. [25] N. Kishore, B. Kapoor, Attacks on and advances in secure hash algorithms, IAENG Int. J. Comput. Sci. 43 (3) (2016) 326–335. [26] X. Wu, K. Wang, X. Wang, H. Kan, J. Kurths, Color image DNA encryption using NCA map-based CML and one-time keys, Signal Process. 148 (2018) 272–287. [27] S. Weiser, D. Schrammel, L. Bodner, R. Spreitzer, Big numbers-big troubles: systematically analyzing nonce leakage in (EC) DSA implementations, in: 29th USENIX Security Symposium USENIX Security 20, 2020, pp. 1767–1784. [28] M. Saad, J. Spaulding, L. Njilla, C.A. Kamhoua, D. Nyang, A. Mohaisen, Overview of attack surfaces in blockchain, in: Blockchain for Distributed Systems Security, 2019, pp. 51–66. [29] J.P. Vergne, Decentralized vs. distributed organization: blockchain, machine learning and the future of the digital platform, Organ. Theory 1 (4) (2020), 2631787720977052. [30] J. Kan, L. Zou, B. Liu, X. Huang, Boost blockchain broadcast propagation with tree routing, in: International Conference on Smart Blockchain, December, Springer, Cham, 2018, pp. 77–85. [31] M. Castro, P. Druschel, A. Ganesh, A. Rowstron, D.S. Wallach, Secure routing for structured peer-to-peer overlay networks, ACM SIGOPS Oper. Syst. Rev. 36 (SI) (2002) 299–314. [32] S.N. Mohanty, K.C. Ramya, S.S. Rani, D. Gupta, K. Shankar, S.K. Lakshmanaprabu, A. Khanna, An efficient lightweight integrated blockchain (ELIB) model for IoT security and privacy, Futur. Gener. Comput. Syst. 102 (2020) 1027–1037. [33] T.M. Ferna´ndez-Carames, P. Fraga-Lamas, Towards post-quantum blockchain: a review on blockchain cryptography resistant to quantum computing attacks, IEEE Access 8 (2020) 21091–21116. [34] H. Handschuh, P. Paillier, Smart card crypto-coprocessors for public-key cryptography, in: International Conference on Smart Card Research and Advanced Applications, September, Springer, Berlin, Heidelberg, 1998, pp. 372–379. [35] R.L. Rivest, A. Shamir, L. Adleman, A method for obtaining digital signatures and public-key cryptosystems, Commun. ACM 21 (2) (1978) 120–126. [36] H.G. Fill, F. H€arer, Knowledge blockchains: applying blockchain technologies to enterprise modeling, in: Proceedings of the 51st Hawaii International Conference on System Sciences, January, 2018. [37] H. Zhang, S. Leng, H. Chai, A blockchain enhanced dynamic spectrum sharing model based on proof-of-strategy, in: ICC 2020–2020 IEEE International Conference on Communications (ICC), June, IEEE, 2020, pp. 1–6. [38] D.C. Nguyen, P.N. Pathirana, M. Ding, A. Seneviratne, Blockchain for 5G and beyond networks: a state of the art survey, J. Netw. Comput. Appl. 166 (2020), 102693. [39] M. Kubendiran, S. Singh, A.K. Sangaiah, Enhanced security framework for e-health systems using blockchain, J. Inf. Process. Syst. 15 (2) (2019) 239–250. [40] M.H. Miraz, M. Ali, Blockchain enabled enhanced IoT ecosystem security, in: International Conference for Emerging Technologies in Computing, August, Springer, Cham, 2018, pp. 38–46. [41] N. Emmadi, H. Narumanchi, Reinforcing immutability of permissioned blockchains with keyless signatures’ infrastructure, in: Proceedings of the 18th International Conference on Distributed Computing and Networking, January, 2017, pp. 1–6. [42] Z. Zheng, S. Xie, H. Dai, X. Chen, H. Wang, An overview of blockchain technology: architecture, consensus, and future trends, in: 2017 IEEE International Congress on Big Data (BigData Congress), June, IEEE, 2017, pp. 557–564. [43] S. King, S. Nadal, Ppcoin: Peer-to-Peer Crypto-Currency with Proof-of-Stake, 2012. Self-published paper, August, 19(1). [44] S.K. Kakkattil, Blockchain technology in managing halal cryptocurrency, in: Halal Cryptocurrency Management, Palgrave Macmillan, Cham, 2019, pp. 53–67. [45] V. Karthika, S. Jaganathan, A quick synopsis of blockchain technology, Int. J. Blockchains Cryptocurrencies 1 (1) (2019) 54–66. [46] J. Lind, O. Naor, I. Eyal, F. Kelbert, E.G. Sirer, P. Pietzuch, Teechain: a secure payment network with asynchronous blockchain access, in: Proceedings of the 27th ACM Symposium on Operating Systems Principles, October, 2019, pp. 63–79. [47] N. Alzahrani, N. Bulusu, Towards true decentralization: a blockchain consensus protocol based on game theory and randomness, in: International Conference on Decision and Game Theory for Security, October, Springer, Cham, 2018, pp. 465–485. [48] P. De Filippi, The interplay between decentralization and privacy: the case of blockchain technologies, J. Peer Prod. 7 (2016). [49] J.H. Park, J.H. Park, Blockchain security in cloud computing: use cases, challenges, and solutions, Symmetry 9 (8) (2017) 164. [50] M. Muzammal, Q. Qu, B. Nasrulin, Renovating blockchain with distributed databases: an open source system, Futur. Gener. Comput. Syst. 90 (2019) 105–117. [51] Q. Lu, X. Xu, Adaptable blockchain-based systems: a case study for product traceability, IEEE Softw. 34 (6) (2017) 21–27. [52] I. Zikratov, A. Kuzmin, V. Akimenko, V. Niculichev, L. Yalansky, Ensuring data integrity using blockchain technology, in: 2017 20th Conference of Open Innovations Association (FRUCT), April, IEEE, 2017, pp. 534–539.

82

SECTION

A Evolution of distributed systems

[53] V. Gatteschi, F. Lamberti, C. Demartini, C. Pranteda, V. Santamaria, To blockchain or not to blockchain: that is the question, IT Prof. 20 (2) (2018) 62–74. [54] D. Li, W.E. Wong, J. Guo, A survey on blockchain for enterprise using hyperledger fabric and composer, in: 2019 6th International Conference on Dependable Systems and their Applications (DSA), January, IEEE, 2020, pp. 71–80. [55] D.J. Cumming, S. Johan, A. Pant, Regulation of the crypto-economy: managing risks, challenges, and regulatory uncertainty, J. Risk Financ. Manag. 12 (3) (2019) 126. [56] S. Kim, Blockchain for a trust network among intelligent vehicles, Adv. Comput. 111 (2018) 43–68. Elsevier. [57] Y. Sovbetov, Factors influencing cryptocurrency prices: evidence from bitcoin, ethereum, dash, litcoin, and monero, J. Econ. Financ. Anal. 2 (2) (2018) 1–27. [58] C. Klinkm€ uller, A. Ponomarev, A.B. Tran, I. Weber, W. van der Aalst, Mining blockchain processes: extracting process mining data from blockchain applications, in: International Conference on Business Process Management, September, Springer, Cham, 2019, pp. 71–86. [59] R. Singh, A.D. Dwivedi, G. Srivastava, A. Wiszniewska-Matyszkiel, X. Cheng, A game theoretic analysis of resource mining in blockchain, Clust. Comput. 23 (3) (2020) 2035–2046. [60] R. Zhang, W.K.V. Chan, Evaluation of energy consumption in block-chains with proof of work and proof of stake, J. Phys. Conf. Ser. 1584 (1) (2020) 012023. [61] M.H. ur Rehman, K. Salah, E. Damiani, D. Svetinovic, Trust in blockchain cryptocurrency ecosystem, IEEE Trans. Eng. Manag. 67 (4) (2019) 1196–1212. [62] A. Dorri, M. Steger, S.S. Kanhere, R. Jurdak, Blockchain: a distributed solution to automotive security and privacy, IEEE Commun. Mag. 55 (12) (2017) 119–125. [63] M. Yoo, Y. Won, A study on the transparent price tracing system in supply chain management based on blockchain, Sustainability 10 (11) (2018) 4037. [64] F.S. Hardwick, R.N. Akram, K. Markantonakis, Fair and transparent blockchain based tendering framework-a step towards open governance, in: 2018 17th IEEE International Conference on Trust, Security and Privacy in Computing and Communications/12th IEEE International Conference on Big Data Science and Engineering (TrustCom/BigDataSE), August, IEEE, 2018, pp. 1342–1347. [65] N. Leonardos, S. Leonardos, G. Piliouras, Oceanic games: centralization risks and incentives in blockchain mining, in: Mathematical Research for Blockchain Economy, Springer, Cham, 2020, pp. 183–199. [66] M. Singh, S. Kim, Trust bit: reward-based intelligent vehicle commination using blockchain paper, in: 2018 IEEE 4th World Forum on Internet of Things (WF-IoT), February, IEEE, 2018, pp. 62–67. [67] A. Hasselgren, J.A.H. Rensaa, K. Kralevska, D. Gligoroski, A. Faxvaag, Blockchain for increased trust in virtual health care: proof-of-concept study, J. Med. Internet Res. 23 (7) (2021), e28496. [68] K.A. Kumari, R. Padmashani, R. Varsha, V. Upadhayay, Securing internet of medical things (IoMT) using private blockchain network, in: Principles of Internet of Things (IoT) Ecosystem: Insight Paradigm, Springer, Cham, 2020, pp. 305–326. [69] R. Gowthamani, K.S.K. Rani, E. Mohanraj, S. Sudhakar, Enhancing security amid blockchain technology – a quick review, Int. J. Sci. Technol. Res. 9 (2020) 5126–5129. [70] A. Imteaj, M.H. Amini, P.M. Pardalos, Introduction to blockchain technology, in: Foundations of Blockchain, Springer, Cham, 2021, pp. 3–13. [71] A.K. Shrestha, J. Vassileva, Blockchain-based research data sharing framework for incentivizing the data owners, in: International Conference on Blockchain, Springer, Cham, 2018, pp. 259–266. [72] C. Mandolla, A.M. Petruzzelli, G. Percoco, A. Urbinati, Building a digital twin for additive manufacturing through the exploitation of blockchain: a case analysis of the aircraft industry, Comput. Ind. 109 (2019) 134–152. [73] S. Rouhani, R. Deters, Performance analysis of ethereum transactions in private blockchain, in: In 2017 8th IEEE International Conference on Software Engineering and Service Science (ICSESS), November, IEEE, 2017, pp. 70–74. [74] K.H. Kwak, J.T. Kong, S.I. Cho, H.T. Phuong, G.Y. Gim, A study on the design of efficient private blockchain, in: International Conference on Computational Science/Intelligence & Applied Informatics, July, Springer, Cham, 2018, pp. 93–121. [75] R. Yang, R. Wakefield, S. Lyu, S. Jayasuriya, F. Han, X. Yi, et al., Public and private blockchain in construction business process and information integration, Autom. Constr. 118 (2020), 103276. [76] B. Cao, X. Wang, W. Zhang, H. Song, Z. Lv, A many-objective optimization model of industrial internet of things based on private blockchain, IEEE Netw. 34 (5) (2020) 78–83. [77] W. Li, A. Sforzin, S. Fedorov, G.O. Karame, Towards scalable and private industrial blockchains, in: Proceedings of the ACM Workshop on Blockchain, Cryptocurrencies and Contracts, April, 2017, pp. 9–14. [78] P. Zheng, Q. Xu, Z. Zheng, Z. Zhou, Y. Yan, H. Zhang, Meepo: sharded consortium blockchain, in: 2021 IEEE 37th International Conference on Data Engineering (ICDE), April, IEEE, 2021, pp. 1847–1852. [79] X. Zhang, X. Chen, Data security sharing and storage based on a consortium blockchain in a vehicular ad-hoc network, IEEE Access 7 (2019) 58241–58254. [80] M. Du, Q. Chen, J. Chen, X. Ma, An optimized consortium blockchain for medical information sharing, IEEE Trans. Eng. Manag. 68 (2020) 1677–1689. [81] A.S. Musleh, G. Yao, S.M. Muyeen, Blockchain applications in smart grid – review and frameworks, IEEE Access 7 (2019) 86746–86757. [82] S. Jain, Understanding Blockchain: Architecture, Applications and Challenges, Banarsidas Chandiwala Institute of Information Technology, 2020, p. 23.

Blockchain types: A characteristic view Chapter

5

83

[83] L. Zhang, Y. Huang, T. Jiang, High-speed railway environmental monitoring data identity authentication scheme based on consortium blockchain, in: Proceedings of the 2019 2nd International Conference on Blockchain Technology and Applications, December, 2019, pp. 7–13. [84] H. Chen, L.J. Zhang, FBaaS: functional blockchain as a service, in: International Conference on Blockchain, June, Springer, Cham, 2018, pp. 243–250. [85] G. Bansal, A. Dua, G.S. Aujla, M. Singh, N. Kumar, Smartchain: a smart and scalable blockchain consortium for smart grid systems, in: 2019 IEEE International Conference on Communications Workshops (ICC Workshops), May, IEEE, 2019, pp. 1–6. [86] G. Sun, M. Dai, J. Sun, H. Yu, Voting-based decentralized consensus design for improving the efficiency and security of consortium blockchain, IEEE Internet Things J. 8 (8) (2020) 6257–6272. [87] L. Zhou, G. Wang, T. Cui, X. Xing, Cssp: the consortium blockchain model for improving the trustworthiness of network software services, in: 2017 IEEE International Symposium on Parallel and Distributed Processing with Applications and 2017 IEEE International Conference on Ubiquitous Computing and Communications (ISPA/IUCC), December, IEEE, 2017, pp. 101–107. [88] S. Hong, Development of a secure and intelligent IoT system based on a consortium blockchain, Int. J. Emerg. Multidiscip. Res. 1 (2) (2017) 9–14. [89] M. Li, C. Lal, M. Conti, D. Hu, LEChain: a blockchain-based lawful evidence management scheme for digital forensics, Futur. Gener. Comput. Syst. 115 (2021) 406–420. [90] M. Fan, X. Zhang, Consortium blockchain based data aggregation and regulation mechanism for smart grid, IEEE Access 7 (2019) 35929–35940. [91] J. Kang, Z. Xiong, D. Niyato, P. Wang, D. Ye, D.I. Kim, Incentivizing consensus propagation in proof-of-stake based consortium blockchain networks, IEEE Wireless Commun. Lett. 8 (1) (2018) 157–160. [92] T.H. Yuen, PAChain: private, authenticated & auditable consortium blockchain and its implementation, Futur. Gener. Comput. Syst. 112 (2020) 913–929. [93] K.N. Griggs, O. Ossipova, C.P. Kohlios, A.N. Baccarini, E.A. Howson, T. Hayajneh, Healthcare blockchain system using smart contracts for secure automated remote patient monitoring, J. Med. Syst. 42 (7) (2018) 1–7. [94] J. Hu, M.J. Reed, M. Al-Naday, N. Thomos, Hybrid blockchain for IoT—energy analysis and reward plan, Sensors 21 (1) (2021) 305. [95] M. Pilkington, Blockchain technology: principles and applications, in: Research Handbook on Digital Transformations, Edward Elgar Publishing, 2016. [96] M. Daghmehchi Firoozjaei, A. Ghorbani, H. Kim, J. Song, Hy-bridge: a hybrid blockchain for privacy-preserving and trustful energy transactions in internet-of-things platforms, Sensors 20 (3) (2020) 928. [97] P. Bhanupriya, S. Gauni, K. Kalimuthu, C.T. Manimegalai, A modified hybrid blockchain framework for secured data transaction, J. Phys. Conf. Ser. 1964 (4) (2021) 042040. [98] K.L. Brousmiche, A. Durand, T. Heno, C. Poulain, A. Dalmieres, E.B. Hamida, Hybrid cryptographic protocol for secure vehicle data sharing over a consortium blockchain, in: 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData), July, IEEE, 2018, pp. 1281–1286. [99] Y. Bai, Q. Hu, S.H. Seo, K. Kang, J.J. Lee, Public participation consortium blockchain for smart city governance, IEEE Internet Things J. 9 (2021) 2094–2108. [100] Z. Cui, X.U.E. Fei, S. Zhang, X. Cai, Y. Cao, W. Zhang, J. Chen, A hybrid blockchain-based identity authentication scheme for multi-WSN, IEEE Trans. Serv. Comput. 13 (2) (2020) 241–251. [101] Y. Goswami, A. Agrawal, A. Bhatia, E-governance: a tendering framework using blockchain with active participation of citizens, in: 2020 IEEE International Conference on Advanced Networks and Telecommunications Systems (ANTS), December, IEEE, 2020, pp. 1–4. [102] A. Gupta, P. Khanna, S. Kumar, A hybrid blockchain-secured elderly healthcare environment, in: Blockchain for 5G-Enabled IoT, 2021, pp. 401–439. [103] H. Yi, Securing e-voting based on blockchain in P2P network, EURASIP J. Wirel. Commun. Netw. 2019 (1) (2019) 1–9. [104] R. Qin, Y. Yuan, F.Y. Wang, Blockchain-based knowledge automation for CPSS-oriented parallel management, IEEE Trans. Comput. Soc. Syst. 7 (5) (2020) 1180–1188. [105] M. Stoffers, Trustworthy Provenance Recording Using a Blockchain-like Database, Doctoral dissertation, Leipzig University, 2017. [106] M. Dehghani, M. Ghiasi, T. Niknam, A. Kavousi-Fard, M. Shasadeghi, N. Ghadimi, F. Taghizadeh-Hesary, Blockchain-based securing of data exchange in a power transmission system considering congestion management and social welfare, Sustainability 13 (1) (2021) 90. [107] G. Sagirlar, B. Carminati, E. Ferrari, J.D. Sheehan, E. Ragnoli, Hybrid-iot: hybrid blockchain architecture for internet of things-pow sub-blockchains, in: 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData), July, IEEE, 2018, pp. 1007–1016. [108] B.W. Jo, R.M.A. Khan, Y.S. Lee, Hybrid blockchain and internet-of-things network for underground structure health monitoring, Sensors 18 (12) (2018) 4268. [109] S. K€ ohler, M. Pizzol, Technology assessment of blockchain-based technologies in the food supply chain, J. Clean. Prod. 269 (2020), 122193. [110] R. Xie, Y. Wang, M. Tan, W. Zhu, Z. Yang, J. Wu, G. Jeon, Ethereum-blockchain-based technology of decentralized smart contract certificate system, IEEE Internet Things Mag. 3 (2) (2020) 44–50. [111] D. Efanov, P. Roschin, The all-pervasiveness of the blockchain technology, Procedia Comput. Sci. 123 (2018) 116–121. [112] A. Shojaei, I. Flood, H.I. Moud, M. Hatami, X. Zhang, An implementation of smart contracts by integrating BIM and blockchain, in: Proceedings of the Future Technologies Conference, October, Springer, Cham, 2019, pp. 519–527. [113] J.A.T. Casallas, J.M.C. Lovelle, J.I.R. Molano, Smart contracts with blockchain in the public sector, Int. J. Interact. Multimedia Artif. Intell. 6 (3) (2020).

84

SECTION

A Evolution of distributed systems

[114] M. Cash, M. Bassiouni, Two-tier permission-ed and permission-less blockchain for secure data sharing, in: 2018 IEEE International Conference on Smart Cloud (SmartCloud), September, IEEE, 2018, pp. 138–144. [115] E. Irannezhad, The architectural design requirements of a blockchain-based port community system, Logistics 4 (4) (2020) 30. [116] D.R. Lee, Y. Jang, H. Kim, Poster: a proof-of-stake (PoS) blockchain protocol using fair and dynamic sharding management, in: Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, November, 2019, pp. 2553–2555. [117] S. Azouvi, G. Danezis, V. Nikolaenko, Winkle: foiling long-range attacks in proof-of-stake systems, in: Proceedings of the 2nd ACM Conference on Advances in Financial Technologies, October, 2020, pp. 189–201. [118] S. Tikhomirov, Ethereum: state of knowledge and research perspectives, in: International Symposium on Foundations and Practice of Security, October, Springer, Cham, 2017, pp. 206–221. [119] C.T. Nguyen, D.T. Hoang, D.N. Nguyen, D. Niyato, H.T. Nguyen, E. Dutkiewicz, Proof-of-stake consensus mechanisms for future blockchain networks: fundamentals, applications and opportunities, IEEE Access 7 (2019) 85727–85745. [120] X. Liang, S. Shetty, A state-aware proof of stake consensus protocol for power system resilience, in: Proceedings of the Tenth ACM International Conference on Future Energy Systems, June, 2019, pp. 431–432. [121] S.P. Novikov, O.V. Mikheenko, N.A. Kulagina, O.D. Kazakov, Digital registry of professional competences of the population drawing on distributed registries and smart contracts technologies, Bus. Inform. 4 (46) (2018) 43–53. [122] G. Ramezan, C. Leung, A blockchain-based contractual routing protocol for the internet of things using smart contracts, Wirel. Commun. Mob. Comput. 2018 (2018). [123] H. Kalodner, S. Goldfeder, X. Chen, S.M. Weinberg, E.W. Felten, Arbitrum: scalable, private smart contracts, in: 27th USENIX Security Symposium USENIX Security 18, 2018, pp. 1353–1370. [124] H. Baharmand, T. Comes, Leveraging partnerships with logistics service providers in humanitarian supply chains by blockchain-based smart contracts, IFAC-PapersOnLine 52 (13) (2019) 12–17. [125] K. Janjua, M.A. Shah, A. Almogren, H.A. Khattak, C. Maple, I.U. Din, Proactive forensics in IoT: privacy-aware log-preservation architecture in fog-enabled-cloud using holochain and containerization technologies, Electronics 9 (7) (2020) 1172. [126] A. Brock, D. Atkinson, E. Friedman, E. Harris-Braun, E. McGuire, J.M. Russell, et al., Holo Green Paper. Green Paper, 2018. [127] S. Manski, M. Bauwens, Reimagining new socio-technical economics through the application of distributed ledger technologies, Front. Blockchain 2 (2020) 29. [128] C. Fan, S. Ghaemi, H. Khazaei, P. Musilek, Performance evaluation of blockchain systems: a systematic survey, IEEE Access 8 (2020) 126927– 126950. [129] U. Majeed, L.U. Khan, I. Yaqoob, S.A. Kazmi, K. Salah, C.S. Hong, Blockchain for IoT-based smart cities: recent advances, requirements, and future challenges, J. Netw. Comput. Appl. (2021), 103007. [130] T. Beutel, Decentralising Power, Competence and Incentives—A Case Study on Emerging Visions in the Blockchain Space, Master’s dissertation, University of Edinburgh Business School, 2018. https://www.researchgate.net/publication/327427029. (Accessed 18 July 2019). [131] R.T. Frahat, M.M. Monowar, S.M. Buhari, Secure and scalable trust management model for IoT P2P network, in: 2019 2nd International Conference on Computer Applications & Information Security (ICCAIS), May, IEEE, 2019, pp. 1–6. € Ozkasap, € [132] Y. Hassanzadeh-Nazarabadi, A. K€upc¸€u, O. LightChain: scalable DHT-based blockchain, IEEE Trans. Parallel Distrib. Syst. 32 (10) (2021) 2582–2593. [133] A. Panwar, V. Bhatnagar, Distributed ledger technology (DLT): the beginning of a technological revolution for blockchain, in: 2nd International Conference on Data, Engineering and Applications (IDEA), February, IEEE, 2020, pp. 1–5. [134] S. Suhail, R. Hussain, A. Khan, C.S. Hong, Orchestrating product provenance story: when IOTA ecosystem meets electronics supply chain space, Comput. Ind. 123 (2020), 103334. [135] G. Martinez-Rosell, S. Lovera, Z.A. Sands, G. De Fabritiis, PlayMolecule crypticscout: predicting protein cryptic sites using mixed-solvent molecular simulations, J. Chem. Inf. Model. 60 (4) (2020) 2314–2324. [136] C. Antal, T. Cioara, I. Anghel, M. Antal, I. Salomie, Distributed ledger technology review and decentralized applications development guidelines, Future Internet 13 (3) (2021) 62. [137] K. Wahlstrom, A. Ul-haq, O. Burmeister, Privacy by design, Australas. J. Inf. Syst. 24 (2020). [138] F.H. Khoso, A. Lakhan, A.A. Arain, M.A. Soomro, S.Z. Nizamani, K. Kanwar, A microservice-based system for industrial internet of things in fog-cloud assisted network, Eng. Technol. Appl. Sci. Res. 11 (2) (2021) 7029–7032. [139] J.J. Hunhevicz, D.M. Hall, Do you need a blockchain in construction? Use case categories and decision framework for DLT design options, Adv. Eng. Inform. 45 (2020), 101094. [140] G.J. Katuwal, S. Pandey, M. Hennessey, B. Lamichhane, Applications of blockchain in healthcare: current landscape & challenges, arXiv (2018). preprint arXiv:1812.02776. [141] A. Meloni, S. Madanapalli, S.K. Divakaran, S.F. Browdy, A. Paranthaman, A. Jasti, et al., Exploiting the IoT potential of blockchain in the IEEE P1931. 1 ROOF standard, IEEE Commun. Stand. Mag. 2 (3) (2018) 38–44. [142] C. Lepore, M. Ceria, A. Visconti, U.P. Rao, K.A. Shah, L. Zanolini, A survey on blockchain consensus with a performance comparison of PoW, PoS and pure PoS, Mathematics 8 (10) (2020) 1782. [143] K. Christidis, M. Devetsikiotis, Blockchains and smart contracts for the internet of things, IEEE Access 4 (2016) 2292–2303. [144] S. Aggarwal, R. Chaudhary, G.S. Aujla, N. Kumar, K.K.R. Choo, A.Y. Zomaya, Blockchain for smart communities: applications, challenges and opportunities, J. Netw. Comput. Appl. 144 (2019) 13–48.

Blockchain types: A characteristic view Chapter

5

85

[145] M. Conti, E.S. Kumar, C. Lal, S. Ruj, A survey on security and privacy issues of bitcoin, IEEE Commun. Surv. Tutorials 20 (4) (2018) 3416–3452. [146] M.H. Miraz, D.C. Donald, Application of blockchain in booking and registration systems of securities exchanges, in: 2018 International Conference on Computing, Electronics & Communications Engineering (iCCECE), August, IEEE, 2018, pp. 35–40. [147] V.T. Patil, A. Acharya, R.K. Shyamasundar, Landcoin: a land management system using litecoin blockchain protocol, in: Proceedings of the Symposium on Distributed Ledger Technology, 2018. [148] J. Li, N. Li, J. Peng, H. Cui, Z. Wu, Energy consumption of cryptocurrency mining: a study of electricity consumption in mining cryptocurrencies, Energy 168 (2019) 160–168. [149] M. Harrigan, L. Shi, J. Illum, Airdrops and privacy: a case study in cross-blockchain analysis, in: 2018 IEEE International Conference on Data Mining Workshops (ICDMW), November, IEEE, 2018, pp. 63–70. [150] L.M. Bach, B. Mihaljevic, M. Zagar, Comparative analysis of blockchain consensus algorithms, in: 2018 41st International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO), May, IEEE, 2018, pp. 1545–1550. [151] A. Li, X. Wei, Z. He, Robust proof of stake: a new consensus protocol for sustainable blockchain systems, Sustainability 12 (7) (2020) 2824. [152] H. C¸apar, Using cryptocurrencies and transactions in medical tourism, J. Econ. Adm. Sci. 37 (2020) 677–693. [153] Z. Zheng, S. Xie, H.N. Dai, X. Chen, H. Wang, Blockchain challenges and opportunities: a survey, Int. J. Web Grid Serv. 14 (4) (2018) 352–375. [154] A.F. Zorzo, H.C. Nunes, R.C. Lunardi, R.A. Michelin, S.S. Kanhere, Dependable IoT using blockchain-based technology, in: 2018 Eighth LatinAmerican Symposium on Dependable Computing (LADC), October, IEEE, 2018, pp. 1–9. [155] Y. Li, S. Mayer, Money creation in decentralized finance: a dynamic model of stablecoins and crypto shadow banking, in: Fisher College of Business Working Paper No. 2020-03-030, Charles A. Dice Center Working Paper No. 30, 2020. [156] K. Kosˇt’a´l, T. Krupa, M. Gembec, I. Veresˇ, M. Ries, I. Kotuliak, On transition between PoW and PoS, in: 2018 International Symposium ELMAR, September, IEEE, 2018, pp. 207–210. [157] A.A. Mohamed, A.O. Ibrahim, Blockchain consensuses algorithms based on proof of work: a comparative analysis, Int. J. Comput. Commun. Netw. 2 (1) (2020) 12–20. [158] T. Volety, S. Saini, T. McGhin, C.Z. Liu, K.K.R. Choo, Cracking bitcoin wallets: I want what you have in the wallets, Futur. Gener. Comput. Syst. 91 (2019) 136–143. [159] A. Pal, K. Kant, DC-PoET: proof-of-elapsed-time consensus with distributed coordination for Blockchain networks, in: 2021 IFIP Networking Conference (IFIP Networking), June, IEEE, 2021, pp. 1–9. [160] K. Toyoda, K. Machi, Y. Ohtake, A.N. Zhang, Function-level bottleneck analysis of private proof-of-authority ethereum blockchain, IEEE Access 8 (2020) 141611–141621. [161] A. Ometov, Y. Bardinova, A. Afanasyeva, P. Masek, K. Zhidanov, S. Vanurin, et al., An overview on blockchain for smartphones: state-of-the-art, consensus, implementation, challenges and future trends, IEEE Access 8 (2020) 103994–104015. [162] K. Karantias, A. Kiayias, D. Zindros, Proof-of-burn, in: International Conference on Financial Cryptography and Data Security, February, Springer, Cham, 2020, pp. 523–540. [163] F. Yang, W. Zhou, Q. Wu, R. Long, N.N. Xiong, M. Zhou, Delegated proof of stake with downgrade: a secure and efficient blockchain consensus algorithm with downgrade mechanism, IEEE Access 7 (2019) 118541–118555. [164] K. Lei, Q. Zhang, L. Xu, Z. Qi, Reputation-based byzantine fault-tolerance for consortium blockchain, in: 2018 IEEE 24th International Conference on Parallel and Distributed Systems (ICPADS), December, IEEE, 2018, pp. 604–611. [165] L.S. Sankar, M. Sindhu, M. Sethumadhavan, Survey of consensus protocols on blockchain applications, in: 2017 4th International Conference on Advanced Computing and Communication Systems (ICACCS), January, IEEE, 2017, pp. 1–5. [166] H. Pervez, M. Muneeb, M.U. Irfan, I.U. Haq, A comparative analysis of DAG-based blockchain architectures, in: 2018 12th International Conference on Open Source Systems and Technologies (ICOSST), December, IEEE, 2018, pp. 27–34.

This page intentionally left blank

Chapter 6

DApps: Decentralized applications for blockchains Harjot Singh Decision Tree Analytics, Gurugram, Haryana, India

I thought [those in the Bitcoin community] weren’t approaching the problem in the right way. I thought they were going after individual applications; they were trying to kind of explicitly support each [use case] in a sort of Swiss Army knife protocol. Vitalik Buterin, inventor of Ethereum

1. Introduction Application development in the past three decades or so has seen multiple designs based on the hardware availability and internet penetration. The earliest of the applications were built for large machines like the main frame as access to sophisticated hardware was privileged. However, with the PC boom, applications moved to smaller machines. Rudimentary word processors and standalone database applications like FORTRAN and DBase found their way into the PC screens. These applications had their own installation and upgrade challenges. Patch management and security updates were a maintenance nightmare. Slowly with improved network speeds, the design philosophy changed and centralized systems working on the client-server architecture ruled the roost and are till date the dominant architecture for middle-to-large-scale applications. However, the vertical scaling could only go as long, and with the increased data and large user base, there was a requirement to grow horizontally. Data grew and databases started bursting on the seams. Big Data was the new norm, and to handle the vast amounts of data, scaling vertically wasn’t just enough. Google has often been credited for pioneering work in horizontal scaling just out of sheer necessity to handle large volumes of data. In this chapter, we intend discussing the paradigm shift in application development from centralized to decentralized and give a brief overview of Ethereum.

1.1 Distributed versus decentralized systems A distributed system, as the name suggests, consists of a finite set of machines (referred to as nodes) connected to each other via a network and which communicate with each other by passing messages to each other. The nodes have their own local memory and resources but present a common, single interface to an external user from a functional perspective. All underlying details including node failure, message passing, etc. are handled by the distributed operating system. While the components of the system may be located at geographically distinct locations, compute resources and data ownership are shared evenly across the network [1]. There is however a flexibility to implement a centralized or decentralized decision-making (Fig. 1). Distributed systems have an added advantage of being more reliable as failure of one node does not affect the entire system. This configuration is scalable and distributes the load on the network which enhances the efficiency for the network utilization. On the flip side, these systems are complex and heavily dependent on the network. Network latency can adversely impact the efficiency of the entire system. It’s really easy to confuse distributed systems with decentralized systems; the latter are characterized by the fact that the decision-making is spread across the nodes and there is no single node taking the final decision. Decentralized systems are distributed systems where no specific component owns the decision-making [2]. A decentralized system is a subset of the distributed systems. Nodes take their decisions independently and the aggregated system response is decided based on responses from the individual nodes. This mechanism ensures that no single node is vulnerable to being the single point of failure. Applications built upon such systems run on the peer-to-peer network of nodes with no single node controlling the Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00021-8 Copyright © 2023 Elsevier Inc. All rights reserved.

87

88

SECTION

A Evolution of distributed systems

FIG. 1 Distributed systems: block diagram.

application, which makes it almost impossible to take down the application as no single node controls the application. Also, there is no single node that receives or responds to requests to the system. Decentralized systems provide more control to the users along with enhanced benefit of speed and flexibility in the system with no single system having absolute control. Decentralized systems are typically characterized by the phenomenon of self-organization. This phenomenon aims at achieving order and coordination at a local level, to achieve the end goals without the intervention of a central controlling node. Decentralized systems do not have a central clock for the system [3]. Each node uses its own clock and operates independent of its peers. There are multiple central units which keep listening for connections from other nodes. This system can scale well both vertically (by enhancing the hardware of individual nodes) as well as horizontally (addition of new nodes) based on the load and user requirements. These systems are configured for high availability by design and to function autonomously. The major limitation that these systems suffer from is of coordination between the nodes, when operating at scale. In the absence of a central authority, coordination and consensus become a major challenge. Also, when operating small decentralized systems, it is very hard to justify the low cost:benefit ratio. Node failures are difficult to detect, and it is also difficult to detect as to which node served a particular request (Fig. 2). A comparative analysis of the two systems compared on various parameters is summarized below:

Parameter

Distributed systems

Decentralized systems

Fault tolerance

High

Moderate

Maintenance

High

Moderate

Scalability

High

Moderate

Application development cost

Moderate

Moderate

DApps: Decentralized applications for blockchains Chapter

6

89

FIG. 2 Decentralized systems: representative diagram.

2. Decentralized applications (DApps) 2.1 Centralized apps versus decentralized apps: Design paradigm Traditional application development revolved around the client-server architecture. Centralized applications relied on compute-intensive servers with server side (Java, PHP, and Python) and client-side scripting (JavaScript, Angular, and React) as the predominant technology. Fig. 3 describes the block level architecture of the centralized applications versus

FIG. 3 Centralized versus decentralized apps: design.

90

SECTION

A Evolution of distributed systems

decentralized applications. Decentralized applications or DApps are open-sourced applications, running on peer-topeer networks, with no central controlling entity. These applications are built on top of blockchain networks and utilize smart contracts to secure user data. While the data are kept secure through encryption, the record of data and transactions is kept completely public and transparent by storing it on the blockchain. The main difference in the two architectures is that while the centralized applications run the backend on large, centralized web servers, the back-end code for DApps runs on decentralized peer-to-peer networks such as Ethereum (technically can be any other blockchain). Ethereum is being discussed here because they were the pioneer and its large-scale adoption. Also note that it is normally the transactional data which need to be captured irrefutably would normally go into the blockchain to keep the prohibitive costs in check. (DApps may also in the background be using certain decentralized storage solutions such as IPFS to store relevant details which may be needed for efficient working of the DApp). To keep the focus on the crux of the matter, the flow in Fig. 3 has been kept simple for explanation to the readers. Servers of centralized applications are normally controlled by a single individual or entity, whereas the peer-to-peer network of the decentralized networks is not controlled by anyone. Centralized servers become the single point of failure in centralized applications, unless redundancy is built in, which normally increases the implementation cost prohibitively. Nodes in a decentralized network act independently and the decentralized implementation introduces redundancy by default. Interactions between the DApp front end and the blockchain backend are routed using the APIs, such as the JSON-RPC (JSON remote procedure call, which is a lightweight RPC protocol). What is intriguing is that to the end user, a DApp may just appear identical in feel and functionality to a regular centralized application. It’s what is under the hood that makes DApps different. Technically, DApps can use any blockchain in the backend to store the transactions. But for a regular developer, it would be huge task to set up a blockchain from the scratch, then enable writing of smart contracts, and then build the application on top of that. One is likely to get bogged down in setting up the backend rather than working on the DApp itself. However, as shown in Fig. 3, Ethereum solved this problem for the application developers, so that they could concentrate on writing the application code rather than worrying about the underlying infrastructure. Ethereum provides a complete backend infrastructure with a Turing complaint language “Solidity” to write smart contracts with ease and store them on the blockchain. Alternative platforms like Moralis also pitch themselves as a Web3 backend infrastructure platform. But more on this a little later. DApps offer the following advantages out of the box: l

l

l

l

Eliminates intermediaries: DApps are able to build trustless smart contracts and eliminate the need for a trusted third party to validate the transaction. Essentially no downtime: Decentralized nature of the DApps makes them failure-proof as there is no single point of failure. Open source: Being open source the code is always open for scrutiny and validation and hence gets continuously improved. Prevents censorship: In the absence of a central authority, censorship becomes extremely hard as the censoring authority now needs to take down the entire network, which may not be possible always.

2.2 Ethereum While there are other multiple platforms (Polygon and Binance) which have come in the market and have started to provide services similar to Ethereum and to be honest are eliminating certain shortcomings of the Ethereum platform such as slow transaction rate and high gas charges, but it was Ethereum which was the pioneer. So, it’s essential to understand what triggered the rapid development and adoption of the DApps. At the time of writing this chapter, Ethereum is still to upgrade PoW to PoS, so some readers may find the context above a little different by the time things go to print. But what cannot be questioned is that Ethereum opened the floodgates for mass adoption and building of DApps. Conceptualized in 2013 by Vitalik Buterin, Ethereum was designed to be an open-source, decentralized blockchain with an in-built smart contract capability and a Turing complaint coding language (Solidity) out of the box. The Ethereum white paper [4] describes it as transaction-based state machine, wherein the genesis state (initial state) is transitioned from one state to another based on execution of incremental transactions. The current state is referred to the “canonical” state. States hold valid information. Transactions represent a valid arc between two states. Transactions are grouped together to form a block. A transaction-based flow of Ethereum can be picturized as in Fig. 4. Ethereum’s world state can also be broken down at a block level (refer Fig. 5). Accounts are objects which constitute the “world state.” The collection of account objects defines the world state. Each account can be visualized as a combination of

DApps: Decentralized applications for blockchains Chapter

6

91

FIG. 4 Ethereum: transaction-based state machine.

FIG. 5 Ethereum: world state block level architecture.

an “address” and its corresponding “account state” to which the address points. States are mapped using unique addresses (160-bit identifiers). The world state mapping is implemented as a modified Merkle Patricia Tree (trie). An “account state” encapsulates within itself four items, viz., nonce, balance, storage hash, and the code hash. The account state “s” for address “x” is denoted as s[x] and comprises the four fields listed above. A small brief of the four fields is as under [4]: l

l

l

l

Nonce: Conventionally denoted as s[x]n, this scalar value signifies the number of transactions generated from this particular address (“x”) or the number of account contracts created in case of accounts with associated code. Balance: As the name signifies, this scalar value indicates the Ether balance in “Wei” owned by this address(“x”). This is denoted by s[x]b. Storage hash: Formally denoted by s[x]s, this is the 256-bit hash of the root node of the Merkle Patricia Tree that encodes the storage contents of the account. Code hash: Denoted by s[x]c, this field contains the hash of the EVM code of this account. On receipt of message call by this address, this particular code is executed. Unlike other fields described above, this particular field is immutable and thus cannot be changed once constructed.

Ethereum was designed to be a blockchain on top of which one could run literally any application. Think of Ethereum as a twolayered platform with the blockchain forming the lower layer and the smart contracts running on top of the blockchain using a self-sufficient language: Solidity, with the Ethereum Virtual Machine (EVM) doing all the heavy lifting of translating the code. One can also think of Ethereum as global distributed operating system for decentralized applications (DApps).

92

SECTION

A Evolution of distributed systems

FIG. 6 Ethereum block level representation from DApps perspective.

The platform uses Ether as its native cryptocurrency as an incentive fee to the miners for the proof-of-work for adding blocks to the blockchain. The Ethereum platform is designed to enable developers to not just develop but also deploy their DApps by paying a fee (for both the compute and the underlying blockchain storage). One would not be wrong in terming Ethereum as “Blockchain as a Service” (BaaS). Fig. 6 tries to show the Ethereum structure at a macro level from a functional/application development perspective for building DApps. Ethereum currently uses proof of work as the consensus mechanism. At any specified block in the Ethereum chain, there exists a singular unique canonical state. Each further unique state for subsequent blocks is defined by the EVM. Ethereum has two distinct types of account, viz., externally owned accounts (EOA) and contract accounts. EOA accounts are controlled by public-private key pairs, while contract accounts are controlled by the code stored within the account itself. EOA accounts cannot contain EVM code within them. Contract accounts are on the other end fully autonomous by themselves and contain the EVM code, which is also used to control the contract. However, both these accounts are treated similarly and are functionally reduced to the same contract type inside the EVM. In either case, the address of the account is a 160-bit code, used to identify the account. Accounts primarily use two types of transactions (the smallest unit of operation which cannot be further subdivided), viz., contract creation or a message call to execute the smart contracts. Transactions are executed sequentially and cannot overlap each other. Ethereum uses Solidity as the programming language to code these smart contracts. These smart contracts are converted to opcodes and fed to the EVM which interprets the opcodes and executes the contracts. These smart contracts on execution are irreversibly captured on the blockchain network and can be used to store data or perform a sequence of actions as the use case may be.

DApps: Decentralized applications for blockchains Chapter

6

93

There are certain key differences between the EOA and contract accounts [5]:

EOA account

Contract account

Can be created free of cost

Creating an account is chargeable

Can initiate transactions

Can only respond to a received transaction

Transactions between EOA accounts need ether or token transfers

Transactions can be used to further initiate code to execute different actions such as initiating a new contract of transferring tokens

While the underlying blockchain implementation in Ethereum is a pretty standard one, it is the EVM (Ethereum Virtual Machine) combined with “Solidity” language, which provides the level of abstraction needed for interacting with the underlying blockchain. EVM provides the runtime environment for transaction execution on the Ethereum blockchain. Java developers may rudimentarily try and equate it to the Java Virtual Machine, though it would not be a fair comparison. The Ethereum website itself refers to EVM as a “distributed state machine” or a “World State Machine.” One can visualize EVM as a decentralized compute engine working simultaneously on hundreds of projects. It forms the backbone of the Ethereum’s entire structure. EVM enables and executes the smart contracts. The EVM runs as a completely isolated thread on each Ethereum node and has absolutely no access to the network, file system, or any other process of the node. Some also refer to EVM as a canonical computer (think as a world computer) which exists as a single entity but executing/ running on thousands of connected computers themselves running an Ethereum client. Each participating node on the Ethereum network maintains a copy of the state of the “distributed state machine.” Nodes communicate to each other and approve/reject (validate) transactions. EVM adds functionalities to the underlying blockchain and enables the developers to concentrate on the DApp rather than the underlying blockchain infrastructure (refer Fig. 3 again to put things in context). EVM has four main characteristics [6]: l

l

l

l

It is deterministic in nature. This implies that irrespective of the number of times, the code gets executed, the output will not vary. This especially makes it a very valuable characteristic for handling financial transactions. EVM execution is isolated from the underlying node. This makes the EVM execution secure and independent of the code on the underlying node, thus making it safe and secure. EVM is terminable. To ensure time-bound execution of smart contracts, Ethereum utilizes the concept of “gas” which is used to regulate and prioritize the execution of the functions. This also ensures that a machine operation gets halted once the gas limit is reached. EVM creates an incentivized economy. The Global Computer (EVM) runs on a peer-to-peer network. Anyone can join the network and run any application/code in a trustless manner by paying a gas fee.

2.3 Ethereum building blocks Before moving further, it is essential that we get familiarized with certain jargon and building blocks of Ethereum.

Smart contracts The pioneering contribution to the thought process of smart contracts was made by Nick Szabo in 1996. His work was intended to establish a secure and trustworthy way for two entities on the internet to contract without the need for a third-party intermediary. Put across simply, smart contracts are digital protocols to establish digital identity and enforce a set of binding rules between the transacting parties, without the need for a validating/trusted third party. Nick Szabo in his paper [7] Smart Contracts: Building Blocks for Digital Markets defined smart contracts as “a set of promises, specified in digital form, including protocols within which the parties perform on the other promises.” Smart contracts in context to Ethereum are designed to leverage the benefits of the underlying blockchain. As in official records, contracts on the Ethereum blockchain can be kind of etched in stone (immutably written on the blockchain). With the underlying infrastructure, Ethereum’s smart contracts open up possibilities for fascinating use cases not just in finance but in a large number of other sectors such as land records, legal documents, digital identity management, and IPRs. Literally, anything involving two humans to agree on a particular matter can be codified into a smart contract, be it a legal

94

SECTION

A Evolution of distributed systems

FIG. 7 Flow diagram: smart contracts.

agreement or a land record or a will. In their simplest technical definition, smart contracts are binding agreements between any two parties over the internet written as lines of code. The code by itself is complete and capable of executing itself when certain specific conditions are met or on a defined trigger such as a specific date/time. Individuals/Parties from all over the world can interact anonymously in a trusted manner without ever needing a third-party intervention to establish the trust. Leveraging the underlying blockchain, the Ethereum smart contracts are both transparent and immutable. Fig. 7 tries to explain the flow of a basic smart contract. Also, since the smart contracts are executed on a distributed network, it’s not easy to take it down or censor the same. Smart contracts use the compute of the underlying “world machine” (EVM) to execute the contract code. To incentivize the execution of a smart contract, the participants of a smart contract will need to pay a transaction charge also referred to as the “gas fees” to execute the smart contract on the Ethereum blockchain. The gas fee is commensurate to the compute required to execute the smart contract. This incentivizes the nodes to extend their compute to the Ethereum network for a fee, which they can monetize.

Solidity for Ethereum smart contracts Smart contracts work as a series of “if…then…else” conditions written as code onto the blockchain. The nodes of the Ethereum execute the set of instructions once the conditions set for the contract execution are met/satisfied. These conditions may be occurrence of specified events or a specified time. In any condition, the smart contract is self-sufficient in terms of determining when to execute and what to execute. Once executed, the transactions are immutably recorded on the underlying blockchain. Smart contracts on the Ethereum blockchain are coded using “Solidity” the principal language to code smart contracts on the Ethereum platform. Solidity was built grounds up as a contract-oriented language much in the manner humans would execute a contract, while retaining the object-oriented capabilities. Solidity aligns pretty close to Javascript in its implementation and is easy to learn for developers with prior experience in Javascript. Solidity is typed statically and is compiled into low-level opcodes for execution by the underlying EVM. Solidity contracts allow just about any two individuals or entities across the globe to get into a smart contract even though the two might be using different currencies, even if the two entities don’t trust each other. Business rules are codified using simple code snippets and are completely autonomous from an execution standpoint, that is, they do not need any monitoring or intervention to execute. Other alternatives for Solidity, though not as popular, are Bamboo and Vyper. Earlier Serpent and Mutan were also used but both languages have now been deprecated. Solidity itself has undergone various revisions based on the growing sense of security that has gotten associated with the smart contracts. Fig. 8 shows an example of a very rudimentary Solidity contract simply printing a string. The compiler [8] also shows the deployment cost and the assembly equivalent code. Developers familiar with Javascript should find the syntax pretty familiar.

DApps: Decentralized applications for blockchains Chapter

6

95

FIG. 8 A rudimentary solidity contract.

3. Building DApps 3.1 DApps: A functional flow To understand how to build DApps, it’s important to revisit Fig. 3. Earlier, we had left out certain subtle details in DApps as it was more dwelling on its comparison with the centralized applications rather than the DApp itself. Fig. 9 however is now trying to open up the layers in greater detail and dwell on the brass tacks. To develop DApps, one needs to understand the complete stack and the way the different layers communicate with each other. It’s essential to understand the components piece by piece. At a very high level, a DApp can be broken into three main components. l l l

Front end: what the end user sees and interacts with. Back end: where the business logic of the system is written. Data store: where the data actually resides.

Let’s take it from the top. Any user will login/interact with a DApp using a browser or a mobile application. There are a number of browsers which a user may use to interact with the application. The front end of any DApp will look and feel like a normal centralized application. In fact, the end user may not even know that she/he is working on a DApp. Front-end technologies such as HTML, CSS, and React rule the roost in this layer. Depending upon the complexity of the application, a developer can pick and choose the language of her/his choice. The front end encapsulates within itself all the functionalities essential to enable users to interact with the application. To be truly distributed the front end is itself hosted on a decentralized storage solution like IPFS (Interplanetary File System), StorJ, Swarm, etc. Though technically this is not an absolute requirement but for an application to truly fit into the definition of being decentralized, this is the defined approach. The next step is to let this front-end talk or speak to the back-end. The back-end logic is typically implemented on the Ethereum blockchain, where using a smart contract or a series of smart contracts (depending upon the complexity of the application and coded using Solidity) are hosted. Herein comes the next challenge as Ethereum itself is a decentralized network and there is no central node listening for a request to process. As covered earlier, Ethereum nodes keep a copy

96

SECTION

A Evolution of distributed systems

FIG. 9 Block level flow diagram for DApps.

of all states of the Ethereum world machine along with the associated code and data to execute the smart contracts. Thus, to essentially read or write data on the Ethereum blockchain, the application (DApp in this case) needs to interact with one of the nodes as it is only through a node that one can send a request to the EVM to execute a smart contract or transactions. This throws up another challenge of making sure that there is a node to broadcast a new transaction which needs to be executed by the EVM. There are two possible approaches to get this accomplished: l l

Set up own Ethereum Node essentially running the Ethereum Client to interact with EVM. Outsource the work to third-party service providers such as “Infura,” Bloq,” ANYBlock,” and “Alchemy.”

The former approach though doable has challenges of setting up one’s own node, which itself is a pretty complex task, and then syncing the entire Ethereum data. There are three main challenges: l l l

It is inherently complex to connect to the Ethereum blockchain. It is slow to sync the blockchain. Storage on Ethereum is expensive and prohibitive for storage-intensive applications.

There are limitations that would hurt the user experience of DApps. It takes both considerable bandwidth and compute to set up one’s own node and in all likelihood may take away attention from the development of the actual Application (DApp) itself. Additionally, with scale, the complexity of the node architecture will increase and will demand dedicated technical resources for maintenance. Furthermore, the Ethereum blockchain is also storage hungry, which further adds challenges in node maintenance. This is wherein the third-party service providers jump right in and offer to provide the Ethereum node as a service (BaaS) literally, but at the cost of introducing a centralized service in the DApp (but that is a discussion for another time). The heavy lifting is done by the third party and provides the application developer a clean set of somewhat familiar APIs (JSON-RPC) to simply make the DApp front end interact with the underlying Ethereum blockchain without having to worry about managing the complexities of running a node. Infura, Alchemist, and Bloq are certain leading third parties providing this service. Whether self-hosted or using a third-party service, these particular nodes connecting the front end with the underlying Blockchain are referred to as “Providers.” Providers provide both read and write functionality to the underlying Ethereum blockchain. The workflow can be broadly understood by referring to Fig. 10.

DApps: Decentralized applications for blockchains Chapter

6

97

FIG. 10 Providers: simplifying Ethereum access using JSON-RPC (APIs).

FIG. 11 Crypto wallet (MetaMask): block level workflow.

There is however one more catch, while the read operations can be handled using the providers, without any kind of authentication. Write operations are permitted on the underlying blockchains only if they are digitally signed. This is where a crypto “Wallet” comes into play. There are a number of wallets in the market. “Metamask,” “Fortmatic,” “Trust Wallet,” and “Portis” are amongst the few known wallets. Metamask in fact provides functionalities of both as a wallet and as a provider. Wallets enable applications to manage the keys and digitally sign the transactions. Metamask for example can be installed as a browser plugin and can be used to store a user’s private keys in the browser. Fig. 11 shows a simple use case of MetaMask being used for authenticating a user login, though the same concept can be extended to while writing signed transactions to the Ethereum blockchain. The flow can be briefly enumerated in the following steps: 1. A user trying to login to an application through a browser, on clicking the login button, will trigger an API call to the backend, in response to which the backend will dig out the “user model” (this model will be a design alteration to typical implementations of centralized applications) which in addition to the basic user details in case of DApps will contain the “user’s public address” and a randomly generated “Nonce.” 2. The user model details are returned to the front end as part of the API response. 3. On receipt of the details, the front end will trigger the MetaMask in the browser and prompt a confirmation message to the user to sign the nonce with his private key.

98

SECTION

A Evolution of distributed systems

4. On accepting the confirmation, a callback function sends the nonce signed with the user’s private key to the backend, wherein the same is cryptographically verified. 5. If the cryptographic confirmation confirms the user’s ownership of the account, then a JWT token of session ID is returned to the front end and the login process is deemed to have been successful. This brings us finally to the storage. Technically one can store the entire data and smart contract on the Ethereum blockchain, but storing everything on the blockchain is expensive can be cost prohibitive and at scale. Each addition of data on the blockchain also results in additional cost, as adding data increase cost to the underlying Ethereum nodes. This factor singularly is prohibitive for making scalable applications. The way out for this is to use the off-chain decentralized storage solutions like IPFS, etc., which cost a fraction to store the data as against storing on the Ethereum blockchain. Typical IPFS implementations see the files stored on the file system, while the file hashes are stored on the blockchain to reduce storage on the blockchain and accordingly the cost of the application. Note here the use case is different from what has been described above while describing the front end. IPFS can be used both for hosting the front end as also for storing and accessing data as akin to a file system, albeit in a decentralized manner on a decentralized platform. Thus, providers interact with IPFS to store/retrieve data of the application and economize on the storage cost while simultaneously reducing the operational cost of the application. While it is fine to use providers to both read and write data from/to the Ethereum blockchains, but read response times from the Ethereum blockchain can quickly blow up, especially in case of complex smart contracts, introducing latency in the user experience and thus affecting the overall performance of the DApp. Web3.js is the library commonly used for listening to the events triggered by smart contracts. Developers can listen to the trigger events and specify callbacks or specific actions when these events are triggered. These events are then used to perform further actions based on the use case in the DApp front end. As an example, if a smart contract is set to debit money from wallet of user X and credit to wallet of user Y then, the Web3.js library can be used to listen to the event when the smart contract is triggered, and the event can be used to adjust the wallet balances in the front end of the users.

3.2 Increasing read efficiency for DApps: The graph There is a growing challenge to optimize/reduce the read times from the Ethereum blockchain. Read times from the Ethereum blockchain can quickly grow out of proportion for complex operations such as aggregations, joins, and filtering of data. This affects the response time and affects the overall user experience of the DApp. Real-time applications such as decentralized exchanges and decentralized gaming applications need quick and prompt responses to have a delightful user experience. This is where “The Graph” comes into play. The Graph is a decentralized protocol for reducing time to query the data from blockchains and decentralized storages (such as IPFS) by pre-indexing the data. The Graph indexes the blockchain data and decentralized storage data and groups them into open APIs called subgraphs. Similar to how search engines like Google and Bing index the web, The Graph intends to index the data on blockchains like Ethereum and data on decentralized storage networks. Developers are able to easily access the subgraphs using GraphQL APIs. This way developers can easily query the underlying blockchain data by using simple APIs, rather than coding complex subroutines. A subgraph’s description is given in the “SubGraph Manifesto” which in essence contains data about the blockchain events, smart contract, and how the event data are mapped together before it is stored on the Graph Node’s database. Graph nodes typically scan the blockchain database (think of crawlers crawling the web), collect the data, filter out the data, and index the same for quick response to the queries triggered by the DApp front end. “The Graph” found quick adoption in decentralized exchanges (DEXs) where reduced response times are a major factor in the user experience and can significantly impact the traded volumes. Uniswap is one such DEX which uses The Graph. Aave (a decentralized lending system) [9] and Curve (an automated market-making service focused on stablecoins) [10] are two more DApps using the Graph. The Graph uses “The Graph Token” (GRT) as its native ERC 20-based token. GRT serves both to exchange and incentivize the community of the Graph, which consists of different players referred to as curators, indexers, and delegators. The Graph’s utility can be quickly understood [11] by referring to Fig. 12. 1. DApps continuously add data to the Ethereum blockchains through a transaction executed on a smart contract. 2. These smart contracts themselves raise or trigger events while processing the transaction. 3. The Graph nodes continuously scan the Ethereum blockchain for data that may have been specified in the manifesto of a subgraph.

DApps: Decentralized applications for blockchains Chapter

6

99

FIG. 12 The Graph flow diagram.

4. On finding the matching events post-execution of the smart contract, the Graph node runs the mapping needed by the subgraph and retrieves, indexes, and stores it in the data store. This completes the journey of the data travel from the DApps to the blockchain and further to the Graph data store. 5. For retrieving the data now, the DApps need not communicate with the blockchain. Instead, it can now utilize the GraphQL APIs to quickly fetch contact data via the Graph node (6) from the data store (7). Data retrieval times are thus significantly reduced as the application now does not need to traverse the linear blockchain. This process above thus lets The Graph decentralize the API and query layer of an internet application stack. The Graph lets application developers both run their own graph nodes and also provide The Graph as a hosted service, for those wanting to let The Graph do the heavy lifting. While the description above is pretty high level, The Graph internally is much more complex and uses a large-role-based and -incentivized community which are grouped as follows [12]: l l

l l

l l

Indexers: These are the node operators of The Graph, who get financially incentivized to run the nodes. Consumers: These are the actual users who use the indexed data and pay the indexers (using GRT, the native currency of The Graph). Curators: They use GRTs to indicate as to which graphs would be financially rewarding to index. Delegators: Think of them as those funding the indexers by staking them with GRT in return for a slice in the indexer’s revenue. Fishermen: They verify optimum network response times to the consumer queries. Arbitrators: Their job revolves around identifying malicious indexers to enhance quality of service for the consumers.

Thus, with this arrangement, Fig. 9 can now be modified and visualized as Fig. 13.

3.3 Scalability of DApps: Driving throughput of transactions per second Though conceptually blockchains are aptly fulfilling the requirements decentralization and security, it is the scalability which is a major challenge in developing and competing against the current centralized applications. DApps riding the underlying blockchains and decentralized infrastructure are able to achieve the desired degree of decentralization. Even in terms of security, blockchains have proved to be robust against any malicious actors. However, the blockchains are currently struggling to achieve scalability primarily due to relatively large transaction settlement times. Bitcoin blockchain currently processes 4–7 transactions per second (TPS) as against VISA which settles 20,000 TPS. This large gap in transaction settlement time is one of the major reasons as to why blockchains and as a result DApps are struggling to gain mass adoption.

100 SECTION

A Evolution of distributed systems

FIG. 13 Block level flow diagram for DApps.

A number of initiatives have both within the blockchains (known as Layer-1 scaling) and outside the blockchains (known as Layer-2 scaling) have been started. Sharding is a popular Layer-1 scaling mechanism and its implementation involves breaking the state of the complete blockchain into unique datasets referred to as “Shards,” and hence the name. The nodes are assigned individual shards rather than having to maintain the entire blockchain. Nodes process these shards in parallel simultaneously and thus enable parallel processing of multiple transactions. Layer-2 blockchains are independent blockchains operating on top of Layer-1 blockchains. The underlying principle is to take the transaction settlement load off the main chain. Transactions are settled faster by using faster consensus algorithms (examples include proof of stake, proof of staked authority, etc.) and transactions are processed in bulk. Batches of these transactions are then summarized and only the summary is committed to Layer-1 blockchain by opening a “bridge” periodically. This reduces the amount of data that needs to be committed to Layer-1 blockchain, making the process lighter, cheaper, and efficient. Layer-2 blockchains may issue their own currency but are bound to inherit its security from Layer-1 or the main chain. Detailed discussion on these Layer-1 and Layer-2 solutions is beyond the scope of this chapter. Some examples of Layer-2 solutions are Bitcoin Lightning Network, Binance Smart Chain (BSC) and Polygon (also referred to as Ethereum’s Internet of Blockchains), etc. Average block time on BSC is 3 s while on Polygon this is 2 s. Binance Smart Chain is Ethereum compatible and DApps compatible with Ethereum can be moved to BSC and can scale as also work faster.

DApps: Decentralized applications for blockchains Chapter

6

101

3.4 DApps: Development frameworks With the growing popularity of DApps, a number of frameworks have been developed to help DApp developers to build the DApps rapidly. DApp frameworks are pieces of code written primarily to make build applications for blockchains easier. While akin to regular apps one is not bound to use a framework, using a framework assists the developer in testing, debugging, compiling, and deploying a DApp faster. We would be discussing a popular framework, viz., Truffle in this chapter. While Truffle is generally recommended for beginners, Hardhat is for professionals, looking to build enterprise-grade DApps.

Truffle: Beginners DApp framework Truffle framework is ideal for beginners and allows developers to compile, deploy, and test their DApps. In addition to Ethereum, this framework supports other compatible blockchains like Polygon, Binance Smart Chain, and Hyperledger. This framework provides tools to write smart contracts in Solidity. Truffle is written in JavaScript [13]. Installation of Node Package Manger (NPM) which comes with Node.js is a prerequisite to use the Truffle framework. To test the DApps, developers need dummy blockchain environments, where they can deploy and test their smart contracts. Truffle provides a development network to run and test the DApps without needing them to be deployed on the main blockchain. Think of it as a local blockchain for developmental purposes. This local in-memory blockchain is referred to as Ganache. Ganache is available in two versions: one command line (also referred to as Ganache-CLI) version, which is only compatible with Ethereum and a second desktop version which supports development for both Ethereum and Corda. The Truffle framework allows quick set up of DApps as it provides a large number of functionalities out of the box. Below are the steps to set up a simple application on a Linux-based system. The procedure below was tested on Ubuntu and the Node was installed from NodeSource rather than the Ubuntu repository: l

Check if Node is installed by typing the command:

l

If Node is installed on your system, then this command will show the version of the Node installed. Else enable the source repository (NodeSource in this case) by using the curl command below:

$ node -v

curl -sL https://deb.nodesource.com/setup_12.x j sudo -E bash -

l

This procedure was tested with version 12, you may want to suitably upgrade to the latest suitable version by changing the numerals in “setup_xx.x”. Install Node and NPM using the command below.

l

Using the NPM manager, one can then install Truffle by using the command below.

l

One can check the Node and NPM versions installed by using the commands:

l

$ sudo apt install nodejs npm $ npm install -g truffle $node -v $npm –version l

l

The next step is to install Ganache, a local in-memory blockchain used extensively for development. Ganache provides 10 external accounts, with addresses on our local Ethereum blockchain, with each account preloaded with 100 ethers [14], which are fake off course. Visit https://trufflesuite.com/ganache/ to download the Ganache. Choose the appropriate version for the OS on which you are working and click download. Navigate to the folder where the file gets downloaded. In Linux you will need to alter the default file permissions to enable the execution and subsequent installation by using the command: $ chmod a+x ganache-2.5.4-linux-x86_64.AppImage

l

Execute the file by using the command: ./ganache-2.5.4-linux-x86_64.AppImage

l

This would execute the file and open the Ganache interface, which should look like the one below.

102 SECTION

A Evolution of distributed systems

l

With Truffle and Ganache in place, one is now aptly placed to initialize Truffle in your project, by using the command:

l

If all been installed correctly, then you should see a screen which looks like the one below:

l

Truffle provides certain “boilerplates” out of the box. Think of these as pretested templates which can be used to customize the template to our use case. One can choose from a number of templates available at https://trufflesuite.com/ boxes/. Simply download the one that suites your need. For the purpose of this chapter, we “unboxed” the “azure-hello-blockchain” by using the command “$ truffle unbox azure-hello-blockchain”. If all goes well, then one should see the screen below:

$ truffle init

l

DApps: Decentralized applications for blockchains Chapter

6

103

l

One can now open the DApp in Visual Studio Code or any other familiar IDE to edit the code. The Visual Studio code window should look something like the one shown below:

l

A brief description of the important folders/files is as under: 1. contracts directory: This directory contains all the smart contracts. Smart contracts in Solidity are identified by the extension “.sol”. 2. The “Migrations.sol” contract handles the migrations to the blockchain. 3. migrations directory: This folder contains all the migration files. For those familiar with other web development, frameworks like “Flask,” “Django,” etc. will understand that this folder contains files used to change state of data in the underlying database. Similarly, here this folder handles migrations when updating the blockchain’s state. 4. src folder: This folder is by convention where the client-side application is coded. 5. test directory: This is the folder where the developer will write the tests for the smart contracts. 6. truffle.js: This is the main configuration file for the Truffle project.

104 SECTION

A Evolution of distributed systems

While detailed application development is beyond the scope of this chapter, still I feel that one should be in a good position to start diving into the space of writing DApps by now.

Hardhat DApp framework: An overview For those looking for serious enterprise-grade coding, Hardhat would be the framework of choice. This framework focuses on developing DApps for the Ethereum blockchain. It enables developers to automate recurring tasks [15] and concentrate on the development process. Similar to Truffle, Hardhat lets developers test, compile, debug, and deploy DApps. It is a complete suite for decentralized application development and comes prebuilt with an Ethereum network (referred to as Hardhat Network) designed for development and testing of the smart contracts. The command line interface (CLI) used to interact with the Hardhat is known as “Hardhat Runner.” The CLI is pretty sturdy and allows for building complex workflows. Similar to Truffle, developers can use NPM to install Hardhat on Ubuntu-based systems. Hardhat is fortunately under active development and is a well-maintained framework. As of January 2022, the Github page of Hardhat had 26,000 [16] users and 6000 users [17]. For those familiar with JavaScript and typescript, learning this framework will be a breeze. However, it is strongly recommended that those beginning to venture into DApp development should start with Truffle and then graduate to Hardhat.

4.

Conclusion

The DApp ecosystem is growing and rapidly taking over various fields. They bring with them inherent decentralized and security features of the underlying blockchains. DApps have found rapid adoption in the financial domain for obvious reasons and a large number of DEX and decentralized finance applications have seen serious adoption of DApps, and a large number of DApps built just around these two cases are available globally. NFT is another hot topic but due to constraints in this chapter, they have been left out. Future of the DApp community will be largely dependent on the quality of the DApps that they can make and how much mass adoption they can achieve. With growing security and privacy concerns and rise in frauds and scams, it is very likely that DApps will rule the roost going forward.

References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

https://www.gemini.com/cryptopedia/blockchain-network-decentralized-distributed-centralized. https://zipmex.com/learn/distributed-vs-decentralized/. https://www.geeksforgeeks.org/comparison-centralized-decentralized-and-distributed-systems/. https://ethereum.github.io/yellowpaper/paper.pdf. https://ethereum.org/en/developers/docs/accounts/. https://moralis.io/evm-explained-what-is-ethereum-virtual-machine/. https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart_contracts_2. html. https://soliditylang.org/. https://www.kraken.com/learn/what-is-aave-lend. https://www.kraken.com/learn/what-is-curve-crv. https://thegraph.com/docs/en/about/introduction. https://thegraph.com/blog/the-graph-network-in-depth-part-1. https://blog.logrocket.com/top-5-decentralized-app-development-frameworks/. https://www.dappuniversity.com/articles/the-ultimate-ethereum-dapp-tutorial. https://hardhat.org/getting-started/. https://github.com/nomiclabs/hardhat. https://discord.com/invite/TETZs2KK4k.

Chapter 7

Analyzing information flow in solidity smart contracts Raju Haldera, Md. Imran Alama,b, Akshay M. Fajgea, Neeraj Kumar Singhc, and Agostino Cortesib a

Indian Institute of Technology Patna, Patna, Bihar, India, b Universita` Ca’ Foscari Venezia, Venezia, Italy, c INPT-ENSEEIHT/IRIT,

University of Toulouse, Toulouse, France

1. Introduction About 12 years after its inception, Blockchain technology [1] is set to pave the way to connect companies, industries, and economies with transparency, security, and trust. As blockchain technology progressed from versions 1.0 to 4.0, it provided support for smart contracts. Smart contracts are executable codes that run on the blockchain to enable decentralized implementation and enforcement of agreements between untrustworthy parties [2]. With the addition of smart contracts, the technology enables the creation of decentralized apps, making it a good competitor for a vast number of applications in banking, finance, supply chain management, insurance, and real estate [3]. Therefore, paying attention to the quality of smart contracts is of the utmost importance, as once deployed, it is hard to change, update, or fix any bugs. Solidity is by far considered as one of the most popular smart contract languages supported by Ethereum blockchain platform [4, 5]. Even though the Ethereum core community is continuously working hard to ease and improve development with Solidity, a number of security attacks [6] on deployed Ethereum have occurred in the recent past. One of the most challenging issues in this context is maintaining the confidentiality and integrity of sensitive data during smart contract development [7, 8]. Confidentiality refers to restricting sensitive information’s access and disclosure to only authorized users. For example, when shopping online, sensitive information such as credit card details must be provided only to the payment gateway, not to the merchant or any other third party. The term integrity refers to the protection of data from unauthorized alterations in order to make sure its reliability and consistency. Standard security measures such as encryption and access control can effectively restrict information leakage at the source. However, they are incapable of ensuring the confidentiality and integrity of data during system execution. To exemplify this, let us categorize the programs variables into two distinct sets, private (denoted by h) and public (denoted by l), with high and low sensitivity levels, respectively. An attacker can guess the sensitive values of private variables h by observing the values of the public variables l on the output channel, if the program contains an assignment statement l :¼ h; or a conditional statement if (h == 0) then l := 20; else l := –20. The former is called a direct/explicit flow where the values of l are directly influenced by the values of h, whereas the latter is called indirect/ implicit flow where the values of l are indirectly influenced by the values of h present in the guard. While the above is related to the confidentiality of sensitive data, a dual of this problem is the integrity where tainted input data flow along the program code and affect/corrupt critical computations [9]. Code Snippets 1 and 2 demonstrate an instance of an integrity breach. The random function in Code Snippet 1 generates a random integer using the block timestamp and later performs a critical task based on the generated random number. In line 2, timestamp of the block is assigned to a private variable salt, which is used to calculate the values of parameters x, y, and seed. Finally, it returns a random number whenever the function is externally called. Code Snippet 1 Timestamp dependency [6] 1 .... 2 uint256 constant private salt=block.timestamp; 3 function random(uint Max) constant private returns (uint256 result){ 4 uint256 x = salt * 100 /Max; Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00024-3 Copyright © 2023 Elsevier Inc. All rights reserved.

105

106 SECTION

5 6 7 8 9

A Evolution of distributed systems

uint256 y = salt * block.number / (salt % 5) ; uint256 seed = block.number/3 + (salt % 300) + Last_Payout + y; uint256 h = uint256(block.blockhash(seed)); return uint256((h/x)) % Max + 1 // random number between 1 and Max }

Code Snippet 2 implements the condition where the random function is called in line 3 and its return value is assigned to the variable roll. Observe that the success of the critical computation at line 6 depends on the value of roll. A malicious miner can take advantages by modifying the local system’s timestamp to trigger this call. Code Snippet 2 Timestamp dependency [6] 1 .... 2 3 4 5 6 7

if( (deposit > 1 ether ) && (deposit > players[Payout_id].payout)){ uint roll = random(100); // create a random number if( roll % 10 == 0 ) { msg.sender.send(WinningPot); WinningPot=0; }}

Language-based information flow security analysis [7, 8, 10, 11] has developed as a viable technique for identifying undesired information flows within software systems, preventing unauthorized disclosure of sensitive information or alteration of crucial data. It captures security vulnerabilities at the application level. The fundamental advantage of language-based security analysis is the ability to naturally describe security policies and enforcement mechanisms employing welldeveloped formal techniques. These techniques enable both the formulation and verification of rigorous security policies. The purpose of this chapter is to extend the traditional language-based information-flow analysis [12, 13] to the case of Solidity smart contracts in order to identify potential undesirable information flow within the contract code that could result in a violation of confidentiality or integrity. To summarize, our main contributions in this chapter are: l

l

l

l l

We apply data-flow analysis which accumulates (direct/indirect) dependency information among the smart contract variables, indicating possible information flow along all possible paths in the smart contract. To this end, we define concrete semantics of Solidity language and we design its abstraction in the domain of positive propositional formula Pos which encodes variables’ dependences in the form of logical formula. We detect insecure information flow based on the truth value assignments to these propositional variables according to the security levels of program’s variables and the satisfiability checking of the logical formula accumulated at each program point of the program. We address both the flow and context sensitivity aiming to achieve more precision in the analysis results. We discuss the possibility of the integration of numerical abstract domains along with Pos as a way to improve precision of the analysis results by removing possible false dependences.

The remainder of this chapter is organized as follows: Section 2 summarizes the current state of the art in the literature. Section 3 discusses background information of Blockchain Technology, Language-based Information Flow, and Data-flow Analysis. The abstract syntax and concrete semantics of a subset of Solidity programming language are defined in Section 4. We define the dependency analysis of Solidity in the domain of Pos in Section 5 and the verification of undesired information flow is described in Section 6. We discuss possible improvement of the analysis by combining with other numerical abstract domains in Section 7. Finally, we conclude the chapter in Section 8.

2.

Related work

Information flow security analysis involves statically determining how a program’s outputs are related to its inputs, that is, how the former depend, directly or indirectly, on the latter. A series of works on information flow security analysis have been proposed for various programming paradigms [8, 10, 12, 14–20]. Denning in his seminal paper [10] first introduced lattice-based model to prevent sensitive information leakage. The lattice model defines a partial order among various security labels (e.g., low < high) and allows only upward flow of information to preserve the confidentiality of sensitive information.

Analyzing information flow in solidity smart contracts Chapter

7

107

 

 

The most popular approach to information flow analysis is security-type systems that attach security levels (e.g., low or high) to various specific language constructs and check the improper flow of sensitive information by using a set of typing rules [7, 8, 11, 21, 22]. A sound security-type system assures that no high inputs will flow to low outputs either directly, via data-flow (explicit-flow), or indirectly, via control-flow (implicit-flow), during program execution [14]. Authors in Ref. [21] present a type-based information flow analysis for ML. A generic type system for Java-like language is proposed in Ref. [22]. Beside the security-type systems, program dependence graph (PDG) is also another promising technique for information flow security analysis of programs [14, 23–25]. Unlike security-type systems, PDG-based approach is context, object, and flow sensitive, and can handle industrial-level programs. Various formal method techniques such as model checking, abstract interpretation, Hoare logic, etc., have also been applied to detect improper information flow in the software systems [13, 20, 26–30]. Authors in Ref. [29] introduced a semantics characterization-based information flow analysis of programs. The semantics characterization is expressed in terms of equality between the programs and is capable enough to capture various covert flows as well as nontermination. Abstract interpretation-based information flow analysis of imperative programs in the domain of positive propositional formulae is presented in Ref. [13, 30]. In particular, variables dependencies are represented in the form of logic formula, which is then verified in terms of satisfiability after assigning truth values according their sensitivity levels. The analysis precision is then improved by combining with it the analysis results in a numerical abstract domain. Further, the authors in Refs. [12, 31, 32] extended the approach to the case of database languages. Hoare-like logic-based interprocedural information flow analysis of object-oriented program is discussed in Ref. [20]. The principle of noninterference property is expressed by defining assertion a , which states that two concurrent states s and s0 agree on the values of a (i.e., there is no leak of private information via a). This assertion is then statically checked by using Hoare-like logic whose judgments take the form ⊩ffgSfcg, where f are the assertions hold before execution of S, c are the assertions hold after execution of S. Amtoft and Banerjee [26] proposed Hoarelogic-based information flow analysis of imperative programs. In particular, the proposed approach first computes abstraction of prelude (a state transfer function) before and after the execution of a command and then formalizes Hoare-like logic for checking the noninterference property in the form of independences (a set of pair of the form [x w]). Authors in Ref. [27] define a set of proof rules for secure information flow based on axiomatic approach.

3. Background 3.1 Blockchain technology [1] Most often, the terms Blockchain Technology and Distributed Ledger Technology (DLT) are synonymously used. However, it is critical to understand that a blockchain is a cryptographically connected, sequential chain of blocks. In contrast, DLT is a decentralized ledger shared among multiple nodes/participants who agree on the standard protocol for sharing, validating, and updating the ledger data. Unlike the traditional database system, DLT functions decentralized way and fully controls the ledger’s data to users to promote transparency. All blockchains are DLTs. A blockchain is a peer-to-peer distributed ledger, forged by consensus, combined with a system for smart contracts and other assistive technologies. Blockchain, which bundles transactions into blocks that are chained together, and then broadcasts them to the nodes in the network, is probably the best-known type of distributed ledger technology. It is difficult to disagree with immutability feature when deploying blockchain-based solutions for a variety of socioeconomic systems that are currently centralized. The blockchain’s immutability feature makes it useful for various applications such as bookkeeping, access control, and asset management. Once a transaction is recorded on the blockchain, its modification is nearly impossible. Much of the early interest in blockchain technology has been around its application in financial transactions [33]. However, blockchain today is applied in multiple areas such as supply chain, traffic management, health care, insurance, etc., in addition to financial transactions [34]. It is also used in tax collection, property deed transfers, social benefits distribution, and even voting procedures [35, 36]. Some recent works state that individuals can use this technology to hold and better control personal information, and then selectively share pieces of those records when needed [37, 38]. In addition, blockchain technology provides a better track of intellectual property rights and ownership for art, commodities, music, and film [39–41].

3.2 Solidity smart contracts [4, 5] Smart contracts have achieved a lot of attention with the rise of blockchain technologies such as Ethereum. All smart contracts are written to implement business logic that handles cryptocurrencies or tokens denoting real-world assets. Smart contracts executing in a blockchain architecture must be deterministic, otherwise, consensus may never be reached.

108 SECTION

A Evolution of distributed systems

To address this, many blockchain platforms require domain-specific languages such as Solidity to write smart contracts so that nondeterminism can be eliminated. Ethereum blockchain has an execution engine called the Ethereum virtual machine (EVM), which enables Ethereum-based blockchains to expand their capabilities by executing code on a distributed network in a decentralized way. As part of the Ethereum network, the EVM executes the code. Solidity is a programming language developed to write smart contracts exclusively for the Ethereum blockchain network. However, EVM is only intelligent enough to understand low-level instructions known as byte code, and the compiler is required to convert the Solidity’s complex code to an EVM-compliant byte code. The Solidity programming language comes with a compiler called the Solidity compiler (SOLC) that does this translation. Solidity is a statically typed programming language, which means that variable types are explicitly defined and thus decided during compilation. Solidity’s syntax is remarkably similar to scripting languages such as JavaScript, and it is highly influenced by C++ and Python programming languages. To demonstrate the structure of Solidity Smart contracts, consider a simple helloWorld example depicted in Code Snippet 3. Code Snippet 3 Hello world example 1 2 3 4 5 6 7 8 9 10 11 12 13

// SPDX–License–Identifier: GPL–3.0 pragma solidity 0.8.0; import ’./other_solidity_source_file.sol’; //Single line comment /* Multi-line comments: Spans multiple lines */ contract HelloWorld { function getMessage() public pure returns (string memory) { return "Hello␣From␣Solidity"; } }

Most of the Solidity file is made up of the following components: License specifier: This indicates the license under which the code is published. Pragma directives: The pragma instruction defines the current version of the Solidity file compiler. One can specify the compiler version for the code using the pragma directive. Import statement: The import keyword enables us to import Solidity files and access their code within the current Solidity file. Comments: Like other programming languages, Solidity supports single- and multiline comments. Contracts/libraries/interfaces: Along with pragma, imports, and comments, a single Solidity source file can define multiple contracts, libraries, and interfaces. Typically, the definition of a contract is composed of various constructs such as state variables, enumeration definitions, structure definitions, event statements, error statements, modifier definitions, and function definitions. More information about Solidity smart contracts can be found in Ref. [4].

3.3 Language-based information flow security [10, 11] Language-based information flow security analysis has a long history, going back to the seminal work of the Dennings in the 1970s [10]. Additional advances have been broadly outlined in survey by Sabelfeld and Myers [11]. The starting point in secure information flow analysis for confidentiality preservation is the classification of program variables into different security levels. The main significance is to classify variables as L, meaning low security, denoting public information; and other variables as H, meaning high security, representing private information. The security goal is to prevent information in H variables from being leaked improperly. Such leaks could take a variety of forms, of course, but certainly we need to prevent information in H variables from flowing to L variables. Since the purpose is to prevent flow of sensitive information from an H variable to a L one, the security lattice low v high, ensure that sensitive information flows only upwards in the lattice.

Analyzing information flow in solidity smart contracts Chapter

7

109

On the other hand, in case of respecting integrity property, the security levels of the variables are classified as tainted and untainted. If we view some variables as containing possibly tainted information, then we may wish to prevent information from such variables flowing into untainted variables. This is modeled using a lattice with untainted v tainted. The semantic of protecting secret information in the security literature is formalized as noninterference, and is described in terms of indistinguishable relation on program states. Two program states are indistinguishable for low if they agree on values of low variables. The noninterference property states that any two executions of a program with two initial states that are indistinguishable for low result in two final states that are indistinguishable for low. Goguen and Meseguer [42] defined noninterference property in terms of indistinguishable relation on program states as follows: s1 ’low s2 ¼)½½Ss1 ’low ½½Ss2

(1)

where S is a program statement or program, s1 and s2 (s16¼ s2) are two states of S before executing it, [[S]]s1 and [[S]]s2 are the states obtained after executing the program S on s1 and s2, respectively. s1 ’lows2 implies that two program states are indistinguishable for low if they share same low input value. Eq. (1) clearly states that if two program states are indistinguishable for low then executing the program with different values of high variables is once again indistinguishable for low. This means that varying high input values during execution of a program gives same output. To exemplify this, let consider the code snippet l :¼ h; if (h ¼¼ 10) then l :¼ 5; else l :¼ 10. According to Eq. (1), this code snippet is insecure because taking 10 and 15 as initial high values and 0 as initial low value, we get different final values for l (i.e., [[l :¼ h]](0, 10) ¼ (10, 10) ≄low(15, 15) ¼ [[l :¼ h]](0, 15)). However, the code snippet if (l ¼¼ 10) then h :¼ h + 5; else l :¼ l + 10; is a secure program as final values of l is only depend on the initial value of l. The notion of noninterference can easily be extended to the case of program’s integrity, where program’s execution with different tainted data should not affect the values of the (untainted) variables involved in critical computational part of the program.

3.4 Data-flow analysis [43] Data-flow analysis is a technique for investigating the inner workings of a computer program. The control-flow graph (CFG) of a program is used to determine how the information propagates within the program. Compilers typically make use of data-flow analysis information when optimizing a program. Data-flow analysis can provide a variety of useful details, including busy expressions, live variables, available expressions, and reaching definition. Numerous categories of program analysis exist, including forward analysis, backward analysis, may analysis, and must analysis. A forwards analysis makes use of knowledge about each programming point’s predecessors, whereas a backward analysis is based on the node’s successors’ information. A may analysis is used to explain information that could be true, whereas a must analysis is used to describe information that is certain to be true. Combinations of the above-mentioned program analysis techniques and their respective categories, represented in Table 1. Example 1 Consider the program in Code Snippet 4 for reaching definition (RD) analysis. Its CFG is depicted in Fig. 1. Data-flow equations for RD analysis at a given program point p is computed using Eq. (2). RDðpÞ ¼

8
32){

Analyzing information flow in solidity smart contracts Chapter

7

111

5 if(y > x) 6 z = y; 7 else z = y * y; 8 x = z; 9 } 10 print(x, y, z)

4. Solidity language: Syntax and semantics This section defines the syntax and semantics of Solidity language. For simplicity in the formalism, we consider a subset of language features relevant for our objective.

4.1 Solidity syntax Solidity is a well-known smart contract language among Ethereum developers. Its design is inspired by JavaScript language. Unlike JavaScript, it is a statically typed language instrumented with many blockchain-specific features. Table 3 depicts the abstract syntax of its subset. The arithmetic expressions exp can either be a numerical value v or a contract variable id or an expression obtained by applying a binary arithmetic operator  on two arithmetic expressions. Similarly, we define Boolean expression bexp as well. We define a smart contract sc as a sequence of state variables’ declarations sdecl followed by an optional constructor constr? and a number of functions func*. While sdecl always refers to blockchain memory, the declaration ldecl local to a functions may refer to either storage or memory as denoted by store.

4.2 Concrete semantics Let us now consider various semantics domains of Solidity variables and define the concrete semantics of the language in Table 3. Our semantics formalism is primarily motivated from Ref. [44].

Semantic domains Solidity is a statically typed language where the type of each variable (state and local) needs to be specified. Let us describe the domains of various data types that we consider in our Solidity grammar. 1. int and uint: There are primarily two classes of integral types in Solidity: signed integers and unsigned integers. Solidity provides multiple integer types for each category, such as intX and uintX, where X ranges from 8 to 256 in steps of 8— for example, uint8, int24, etc. 2. address and address payable: The address data type has a capacity of 20 bytes and is used to hold an Ethereum contract account address or an address externally owned by users. address payable is same as address, but provides additional member methods such as transfer and send. 3. bool: The only valid values for the Boolean type are false and true. It is important to remember that, unlike other programming languages, Solidity cannot convert Boolean type to integer.

Environments and states Ethereum, taken as a whole, can be viewed as a transaction-based state machine [5]. In general, Ethereum maintains a set of users accounts, each of which is associated with a unique address. Each account, irrespective of their types, comprises the following four fields: nonce, balance, storageRoot, and codeHash. nonce is a scalar value that indicates the number of transactions sent from this account. In case of smart contract account, this number represents the number of contracts created by this account. balance indicates the number of Wei owned by this address. storageRoot is a 256-bit hash of the root node of a Merkle Patricia tree that encodes the storage contents of the account. The hash of the EVM code of the account is represented by codeHash. In order to define the semantics of Solidity smart contracts, let us define environments, stores, and smart contracts states. Let Var, Val, MLoc, and SLoc be the set of variables, the domain of values, the set of local memory locations, and the set of blockchain storage locations, respectively. The set of environments, stores, and states are defined here: l l

The set of local environments is defined as LEnv : Var!MLoc. The set of local stores is defined as LStore : MLoc!Val.

112 SECTION

A Evolution of distributed systems

TABLE 3 Abstract syntax of a subset of solidity. Expressions exp



E

Arithmetic expressions

exp

::¼

v

INT or UINT value

|

id

Identifier

|

exp1  exp2

where  ¼ {+, , *, /}

bexp



B

Boolean expressions

bexp

::¼

true | false

Truth/falsity

|

exp1  exp2

where  ¼ f , , ¼¼g

|

bexp1  bexp2

where  ¼ {_, ^}

|

¬bexp

Negation





L

Labels

sc



SC

Smart contracts

Labeled commands

type

::¼ |

store ldecl

::¼ ::¼

storage | memory

Data location



type store id(:=exp)?;

Local variable declaration

::¼

id:=exp;

Assignment

stmt

::¼

ldecl | assgn

Statement



|

if bexp then stmt1 else stmt2 endif

|

while ‘bexp do stmt done

::¼

stmt1stmt2 ‘

type id; | sdecl1sdecl2

State variable declaration

::¼



Function parameter

::¼



Constructor

func

::¼



function id(par) (returns(par)){stmt}

Function definition

sc

::¼

contract id{sdecl constr? func*}

Smart contract

par constr

l

Value types

assgn

sdecl

l

address | address payable



|

l

int | uint | bool

type store? id | par1, par2 constructor(par){stmt}

The set of blockchain environments is defined as BEnv : Var!SLoc. The set of blockchain stores is defined as BStore : SLoc!Val. The set of states is defined as S : LEnvLStore  BEnv  BStore. So, a state r  S is denoted by a tuple hle, ls, be, bsi where le  LEnv, ls  LStore, be  BEnv and bs  BStore.

Semantics We are now in a position to define the concrete semantics of various Solidity constructs below. We use the functions currLabel() and nextLabel() which, given a smart contract statement c, return the label of c and the label of the statement following c, respectively.

Analyzing information flow in solidity smart contracts Chapter

7

113

(1) Expressions L½½v ¼ fðr, vÞ | r  Sg  fðr, vÞ | r  S, lsðleðidÞÞ ¼ vg L½½id ¼ fðr,vÞ | r  S, bsðbeðidÞÞ ¼ vg

if leðidÞ  LEnv if beðidÞ  BEnv

L½½exp1  exp2  ¼ fðr,v1  v2 Þ | ðr,v1 Þ  L½½exp1 ,ðr, v2 Þ  L½½exp2 g L½½true ¼ fðr, trueÞ | r  Sg L½½f alse ¼ fðr,f alseÞ | r  Sg L½½exp1  exp2  ¼ fðr, v1  v2 Þ | ðr, v1 Þ  L½½exp1 , ðr,v2 Þ  L½½exp2 g L½½bexp1  bexp2  ¼ fðr,b1  b2 Þ | ðr, b1 Þ  L½½bexp1 , ðr, b2 Þ  L½½bexp2 g L½½¬bexp ¼ fðr,¬bÞ | ðr, bÞ  L½½bexpg (2) Local variable declaration 



L½½ type store id≜

fð‘, rÞ!ð‘0 , r0 Þ | r  Sg 0

00

fð‘, rÞ!ð‘ , r Þ | r  Sg

if store is memory if store is storage

where ‘0  nextLabel(‘type store id), r ¼ (le, ls, be, bs), r0 ¼ ðle½id ! l0 , ls½l0 ! v0d , be, bsÞ with l0 as a fresh local memory location and v0d as the default memory value, and r00 ¼ ðle, ls, be½id ! l00 , bs½l00 ! v00d Þ with l00 as a fresh storage location and v00d as the default storage value. n fð‘, rÞ!ð‘0 , r0 Þ | r  Sg if store is memory L½½‘ type store id :¼ exp≜ fð‘ , rÞ!ð‘0 , r00 Þ | r  Sg if store is storage where ‘0  nextLabel(‘type store id:=exp), r ¼ (le, ls, be, bs), ðr, vÞ  L½½exp, r0 ¼ (le[id ! l0 ], ls[l0 ! v], be, bs) with l0 as a fresh local memory location, and r00 ¼ (le, ls, be[id ! l00 ], bs[l00 ! v]) with l00 as a fresh storage location. (3) Assignment statement L½½‘ id :¼ exp≜

n

fð‘, rÞ!ð‘0 , r0 Þ | r  Sg fð‘, rÞ!ð‘0 , r00 Þ | r  Sg

if leðidÞ  LEnv if beðidÞ  BEnv

where ‘0  nextLabel(‘id:=exp), r ¼ (le, ls, be, bs), ðr, vÞ  L½½exp, r0 ¼ (le, ls[le(id) ! v], be, bs), r00 ¼ (le, ls, be, bs [be(id) ! v]). (4) Sequence L½½stmt1 stmt2 ≜fð‘, rÞ ! ð‘0 , r0 Þ | r  S, ð‘, rÞ ! ð‘00 , r00 Þ  L½½stmt1 , ð‘00 , r00 Þ ! ð‘0 , r0 Þ  L½½stmt2 g where ‘  currLabel(stmt1) and ‘0  nextLabel(stmt2). (5) Conditional L½½if ‘ bexp then stmt1 else stmt2 endif  ≜fð‘, rÞ ! ð‘0 , r0 Þ | r  S, ðr, trueÞ  L½½‘ bexp, ððcurrLabelðstmt1 Þ, rÞ ! ð‘0 , r0 ÞÞ  L½½stmt1 g

[ fð‘, rÞ ! ð‘0 , r00 Þ | r  S, ðr, f alseÞ  L½½‘ bexp, ððcurrLabelðstmt2 Þ, rÞ ! ð‘0 , r00 ÞÞ  L½½stmt2 g

where ‘0  nextLabel(if ‘bexp then stmt1else stmt2endif ).

114 SECTION

A Evolution of distributed systems

(6) Iteration

L½½while ‘ bexp do stmt done ¼ lfp∅ ðFÞ where FðcÞ ¼ fð‘, rÞ ! ð‘,r0 Þ | r  S, ðr,trueÞ  L½½‘ bexp, ððcurrLabelðstmtÞ,rÞ ! ð‘, r0 ÞÞ  L½½stmtg [fð‘,rÞ ! ð‘0 ,rÞ | r  S, ðr, falseÞ  L½½‘ bexpg [fð‘, rÞ ! ð‘, r00 Þ | r  S, ðr,trueÞ  L½½‘ bexp,ðð‘,r0 Þ ! ð‘, r00 ÞÞ  c, ððcurrLabelðstmtÞ,rÞ ! ð‘, r0 ÞÞ  L½½stmtg where ‘0  nextLabel(while ‘bexp do stmt done) and nextLabel(stmt) ¼ currLabel (while‘bexp do stmt done) ¼ ‘. (7) State variable declaration L½½‘ type id≜fð‘, rÞ ! ð‘0 , r0 Þ | r  Sg where ‘0  nextLabel(‘type id), r ¼ (le, ls, be, bs), r0 ¼ (le, ls, be[id ! l], bs[l ! vd]) with l as a fresh storage location and vd as the default storage value. (8) Constructor L½½‘ constructorðparÞfstmtg≜fðð‘, rÞ, vin Þ ! ð‘0 , r0 Þ | r  Sg where ‘0  nextLabel(‘constructor(par){stmt}), r ¼ (le, ls, be, bs), r00 ¼ (le[Par ! l], ls[l ! vin], be, bs), ððcurrLabelðstmtÞ, r00 Þ ! ð‘0 , r0 ÞÞ  L½½stmt. (9) Function Let Parmemory and Parstorage be the distinct set of function parameters which are located in memory and blockchain in in storage, respectively. Let vmemory and vstorage be the input values corresponding to Parmemory and Parmemory , respectively, in in in in storage memory where vin ¼ vin [ vin . The semantics of the function is defined as follows: L½½‘ f unction idðparin Þ ðreturnsðparout ÞÞfstmtg≜fðð‘, rÞ, vin Þ ! ðð‘0 , r0 Þ, vout Þ | r  Sg where l l l

l

r ¼ (le, ls, be, bs), memory storage r00 ¼ ðle½Parin ! l, ls½l ! vmemory , be½Parin ! l0 , bs½l0 ! vstorage Þ, in in 0 0 00 ððcurrLabelðstmtÞ, r Þ ! ð‘ , r ÞÞ  L½½stmt , where ‘0  nextLabel(‘function id(parin) (returns (parout)){stmt}), ðr0 , vout Þ  L½½ðparout Þ.

(10) Smart contract L½½contract idfsdecl constr? func* g≜fðð‘, rÞ ! ð‘0 , r0 ÞÞ | r  Sg where ‘  currLabel(sdecl), ‘0  nextLabel(func*), ðð‘, rÞ ! ð‘00 , r00 ÞÞ  L½½sdecl ð‘000 , r000 ÞÞ  L½½constr? and ðð‘000 , r000 Þ ! ð‘0 , r0 ÞÞ  L½½func* .

5.

and

ðð‘00 , r00 Þ !

Formal dependency analysis of solidity smart contracts

In order to analyze Solidity smart contracts for identifying insecure information flow, in this section, we define an abstract semantics of Solidity in the domain of positive propositional formulae Pos. The primary goal of this domain is to encode variables’ dependences in the form of logical formula whose satisfiability based on the truth values as per variables’ security levels determines possible security property violation.

Analyzing information flow in solidity smart contracts Chapter

7

115

5.1 Abstract domain: Pos [45–47] Dependencies among program’s variables and statements are the key players in the analysis of information flow along program’s control paths. As cited in Ref. [45], many static analyses use Boolean functions to express such dependencies. Following the similar idea of dependency-based analysis, in this section, we consider Boolean function of the form xp ! yq to represent the dependency such as “whenever x has property p, y has property q.” To this aim, we use the abstract domain Pos which receives much attention in case of abstract interpretation of logic programs [45–47]. This domain is most commonly applied to the analysis of groundness dependencies for logic programs. Let PropVar ¼ fxi | i  g be a countably infinite set of propositional variables and PropCon ¼ {^, _, !, ¬} be the set of logical connectives. We denote by PF the set of all propositional formula defined over PropVar and PropCon. Let B≜PropVar ! {true, false} be the set of truth-assignment functions that assign truth value (either true or false) to each propositional variable in PropVar. Given a formula f PF and a truth-assignment r  B, we mean by r⊨f that f is satisfied under the truth-assignment r. Given two propositional formulae f1 and f2, we use the shorthand notation f 1 ⊨f 2 to denote “r⊨f 1 implies r⊨f 2” for any r  B [13]. The domain PF is ordered by f 1 > > ½l, h if minimumðXÞ ¼ l ^ maximumðXÞ ¼ h > > < a ðXÞ ¼ ½∞, h if ∄minimumðXÞ ^ maximumðXÞ ¼ h > > > > ½l, + ∞ if minimumðXÞ ¼ l ^ ∄maximumðXÞ > > > > : ½+∞,  ∞ if ∄minimumðXÞ ^ ∄maximumðXÞ 8 ∅ if a ¼ ? > > > > > > fk  | l k hg if a ¼ ½l, h > > < g ðaÞ ¼ fk  | k hg if a ¼ ½∞, h > > > > fk  | l kg if a ¼ ½l, + ∞ > > > > :  if a ¼ ½+∞,  ∞ where X  ℘ðÞ and a  . This is depicted pictorially in Fig. 3.

Octagons [55] Given a set of points in n-dimensional space, it can be approximated by octagonal abstract domain which encodes binary constraints between program variables in the form of kixi + kjxj is the top element for which the bound for all constraints is ∞. The Galois connection between L and A is formalized as hL, a , g, Ai, where a and g on S  ℘ðn Þ and m  ? are defined here: if S ¼ ∅: a ðSÞ≜m? if S 6¼ ∅: a ðSÞ ¼ m where mij ≜ 8 maxfrðxl Þ  rðxk Þjr  Sg when i ¼ 2k  1, j ¼ 2l  1 > > > < or i ¼ 2l, j ¼ 2k > maxfrðxl Þ+rðxk Þjr  Sg when i ¼ 2k, j ¼ 2l  1 > > : maxfrðxl Þ  rðxk Þjr  Sg when i ¼ 2k  1, j ¼ 2l 8 ∅ if m ¼ m? > > < n if m ¼ m> g ðmÞ ¼ fðk1 ,…, kn Þ  n |ðk1 ,  k1 …kn ,  kn Þ > > :  domðmÞ and 8i, j : x  x < ∅n  if P ¼ P> g ðPÞ ¼ n o ! ! ! ! > : r  S|8ðv : x  kÞ :v :rð x Þ  k otherwise where P   and the environment r  S≜Var7! maps each variable to its value in . A summary on the strength and weakness of different relational and nonrelational abstract domains is reported in Table 5.

7.2 The reduced product The abstract semantics defined earlier accumulates variables dependences at different program points. These dependences are determined based on the syntactic presence of variables in program statements. Such syntax-based computation yields false positives [58]. For instance, consider the statement “y ¼ 4w mod 2,” even though the variable y is syntactically dependent on w, we can observe that semantically there is no dependency as the expression value “4w mod 2” is always equal to 0. Few proposals in the literature attempted to remove such false dependences from syntax-based analysis by considering program’s semantics in suitable abstract domains [16, 59, 60]. In similar direction as suggested in Refs. [13, 48], in this section, we describe how to improve precision of the analysis result obtained in the domain Pos by combining it with the analysis results in other widely used numerical abstract domains. The static analyses of programs in the above-mentioned numerical abstract domains (domain of intervals, polyhedra, octagons, etc.) determine a sound approximation of programs’ runtime behaviors accumulating possible values of variables (in abstract form) at each program point [61, 62]. As suggested in Refs. [13, 48], here we recall how a reduced product between both the propositional formulae domain and the numerical abstract domain allows to exclude false dependences among program’s variables. Consider an abstract domain  where the numerical values are abstracted by, for instance, an interval or an octagon or a polyhedra. Suppose S* and S* represent the set of concrete and abstract traces, respectively. Given the lattices

Analyzing information flow in solidity smart contracts Chapter

7

121

Lc ¼ h℘ðS* Þ, , ∅, S* , \ , [i, Lp ¼ h℘ðS* Þ, vp , ?p , >p , up , up i and Ln ¼ h, vn , ?n , >n , un , un i, let (Lc, a0, g0, Lp) and (Lc, a1, g1, Ln) be two Galois Connections. The reduced product RP : ℘ðS* Þ   ! ℘ðS* Þ be a reduced product operator defined as RP(S, d) ¼ S0 , where S  ℘ðS* Þ is a set of partial traces, d  , and n o S0 ¼ h‘i , ck i j h‘i , cj i  S ^ ck ¼ ðcj fx ! y j y  dgÞ

8. Conclusion This chapter addressed two crucial security issues—confidentiality and integrity—of smart contract-enabled Ethereum decentralized applications. The primary reason behind this vulnerability is information flow in an uncontrolled way when smart contracts are in execution. Being part of smart contracts statements, variables with different sensitivity levels influence each other when the statements execute. We considered a formal language-based security analysis which performs a lattice-theoretic security policy enforcement while verifying the smart contracts for possible security compromise. The use of Abstract Interpretation theory served as a generic framework to adopt semantics-based analysis and verification on top of its syntactic counterpart, as a way to improve analysis precision with a wise choice of abstraction level. Though we addressed a subset of Solidity features in our proposal, Solidity possesses many other crucial blockchain-specific features, for example, account-based financial transactions, which require appropriate treatment in this perspective. Our future work aims a prototype development based on our proposal to demonstrate the efficacy of the system, with an extended support to more Solidity features.

Acknowledgment This research was supported by the Core Research Grant (Grant Number: CRG/2022/005794) from the Science and Engineering Research Board (SERB), Department of Science and Technology, Government of India.

References [1] S. Nakamoto, Bitcoin: a peer-to-peer electronic cash system, 2008. https://bitcoin.org/bitcoin.pdf. [2] V. Buterin, Ethereum white paper: a next-generation smart contract and decentralized application platform, 2014. https://translatewhitepaper.com/ wp-content/uploads/2021/04/EthereumOrijinal-ETH-English.pdf. [3] M. Pilkington, Blockchain technology: principles and applications, in: Handbook of Research on Digital Transformations, Edward Elgar, 2016. [4] Ethereum, Solidity Documentation—Release 0.8.4., http://solidity.readthedocs.io/. [5] G. Wood, Ethereum: a secure decentralised generalised transaction ledger, 2014. https://ethereum.github.io/yellowpaper/paper.pdf. [6] P. Praitheeshan, L. Pan, J. Yu, J. Liu, R. Doss, Security analysis methods on Ethereum smart contract vulnerabilities: a survey, 2019. arXiv preprint arXiv:1908.08605. [7] D. Volpano, C. Irvine, G. Smith, A sound type system for secure flow analysis, J. Comput. Secur. 4 (2–3) (1996) 167–187. [8] G. Smith, Principles of secure information flow analysis, in: M. Christodorescu, S. Jha, D. Maughan, D. Song, C. Wang (Eds.), Malware Detection, Advances in Information Security, vol. 27, Springer US, Novy Smokovec, Slovakia, 2007, pp. 291–307. [9] D. Hedin, A. Sabelfeld, A perspective on information-flow control, in: Proceedings of the 2011 Marktoberdorf Summer School, IOS Press, 2011. [10] D.E. Denning, A lattice model of secure information flow, Commun. ACM 19 (1976) 236–243. [11] A. Sabelfeld, A.C. Myers, Language-based information-flow security, IEEE J. Sel. Areas Commun. 21 (2003) 5–19. [12] A. Cortesi, R. Halder, Information-flow analysis of hibernate query language, in: Proceedings of the 1st International Conference on Future Data and Security Engineering, Springer LNCS 8860, Vietnam, 2014, pp. 262–274. [13] A. Cortesi, P. Ferrara, R. Halder, M. Zanioli, Combining Symbolic and Numerical Domains for Information Leakage Analysis, Springer, 2018, pp. 98–135. [14] C. Hammer, G. Snelting, Flow-sensitive, context-sensitive, and object-sensitive information flow control based on program dependence graphs, Int. J. Inf. Secur. 8 (2009) 399–422. [15] S. Just, A. Cleary, B. Shirley, C. Hammer, Information flow analysis for Javascript, in: Proceedings of the 1st ACM SIGPLAN International Workshop on Programming Language and Systems Technologies for Internet Clients, ACM Press, Portland, Oregon, USA, 2011, pp. 9–18. [16] A. Jana, R. Halder, K.V. Abhishekh, S.D. Ganni, A. Cortesi, Extending abstract interpretation to dependency analysis of database applications, IEEE Trans. Softw. Eng. 46 (5) (2018) 463–494. [17] M.I. Alam, R. Halder, Refining dependencies for information flow analysis of database applications, Int. J. Trust Manage. Comput. Commun. 3 (3) (2016) 193–223. [18] R. Akella, H. Tang, B.M. McMillin, Analysis of information flow security in cyber-physical systems, Int. J. Crit. Infrastruct. Prot. 3 (3–4) (2010) 157– 173.

122 SECTION

A Evolution of distributed systems

[19] D. Hedin, A. Birgisson, L. Bello, A. Sabelfeld, JSFlow: tracking information flow in JavaScript and its APIs, in: Proceedings of the 29th Annual ACM Symposium on Applied Computing, 2014, pp. 1663–1671. [20] T. Amtoft, S. Bandhakavi, A. Banerjee, A logic for information flow in object-oriented programs, ACM SIGPLAN Not. 41 (1) (2006) 91–102. [21] F. Pottier, V. Simonet, Information flow inference for ML, in: Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 2002, pp. 319–330. [22] U. Sch€ opp, C. Xu, A generic type system for featherweight Java, in: Proceedings of the 23rd ACM International Workshop on Formal Techniques for Java-Like Programs, 2021, pp. 9–15. [23] C. Hammer, J. Krinke, G. Snelting, Information flow control for Java based on path conditions in dependence graphs, in: Proceedings of the IEEE International Symposium on Secure Software Engineering (ISSSE 2006), IEEE, Arlington, VA, 2006, pp. 87–96. [24] S. Cavadini, Secure slices of insecure programs, in: Proceedings of the ACM Symposium on Information, Computer and Communications Security, ACM Press, Tokyo, Japan, 2008, pp. 112–122. [25] D. Wasserrab, D. Lohner, G. Snelting, On PDG-based noninterference and its modular proof, in: Proceedings of the ACM SIGPLAN Fourth Workshop on Programming Languages and Analysis for Security, ACM, 2009, pp. 31–44. [26] T. Amtoft, A. Banerjee, A logic for information flow analysis with an application to forward slicing of simple imperative programs, Sci. Comput. Program. 64 (2007) 3–28. [27] G.R. Andrews, R.P. Reitman, An axiomatic approach to information flow in programs, ACM Trans. Program. Lang. Syst. 2 (1) (1980) 56–76. [28] R. Dimitrova, B. Finkbeiner, M. Kova´cs, M.N. Rabe, H. Seidl, Model checking information flow in reactive systems, in: Proceedings of the 13th International Conference on Verification, Model Checking, and Abstract Interpretation, Springer-Verlag LNCS, Philadelphia, PA, 2012, pp. 169–185. [29] R. Joshi, K.R.M. Leino, A semantic approach to secure information flow, Sci. Comput. Program. 37 (1–3) (2000) 113–138. [30] M. Zanioli, P. Ferrara, A. Cortesi, SAILS: static analysis of information leakage with sample, in: Proceedings of the 2012 ACM Symposium on Applied Computing, ACM Press, Riva del Garda (Trento), 2012, pp. 1308–1313. [31] R. Halder, M. Zanioli, A. Cortesi, Information leakage analysis of database query languages, in: Proceedings of the 29th Annual ACM Symposium on Applied Computing, SAC ’14, ACM, Gyeongju, Korea, 2014, pp. 813–820. [32] R. Halder, A. Jana, A. Cortesi, Data leakage analysis of the hibernate query language on a propositional formulae domain, in: Trans. Large-Scale Data- and Knowledge-Centered Systems, vol. 23, Springer, 2016, pp. 23–44. [33] D. Vujicic, D. Jagodic, S. Ranđic, Blockchain technology, bitcoin, and Ethereum: a brief overview, in: 2018 17th International Symposium InfotehJahorina (INFOTEH), IEEE, 2018, pp. 1–6. [34] A.A. Monrat, O. Schelen, K. Andersson, A survey of blockchain from the perspectives of applications, challenges, and opportunities, IEEE Access 7 (2019) 117134–117151. [35] S. Krishnapriya, G. Sarath, Securing land registration using blockchain, Procedia Comput. Sci. 171 (2020) 1708–1715, https://doi.org/10.1016/j. procs.2020.04.183. [36] F.Þ. Hja´lmarsson, G.K. Hreiðarsson, M. Hamdaqa, G. Hja´lmty‘sson, Blockchain-based e-voting system, in: 2018 IEEE 11th International Conference on Cloud Computing (CLOUD), IEEE, 2018, pp. 983–986. [37] B. Putz, M. Dietz, P. Empl, G. Pernul, Ethertwin: blockchain-based secure digital twin information management, Inf. Process. Manag. 58 (1) (2021) 102425. [38] M. Shuaib, S. Alam, M.S. Alam, M.S. Nasir, Self-sovereign identity for healthcare using blockchain, Mater. Today Proc. (2021). [39] A. Whitaker, A. Bracegirdle, S de Menil, M.A. Gitlitz, L. Saltos, Art, antiquities, and blockchain: new approaches to the restitution of cultural heritage, Int. J. Cult. Policy 27 (3) (2021) 312–329. [40] N. Wang, H. Xu, F. Xu, L. Cheng, The algorithmic composition for music copyright protection under deep learning and blockchain, Appl. Soft Comput. 112 (2021) 107763. [41] J. Shen, Blockchain technology and its applications in digital content copyright protection, in: Proceedings of the 4th International Conference on Economic Management and Green Development, Springer, 2021, pp. 18–25. [42] J.A. Goguen, J. Meseguer, Unwinding and inference control, in: IEEE Symposium on Security and Privacy, IEEE, 1984, p. 75. [43] F.E. Allen, J. Cocke, A program data flow analysis procedure, Commun. ACM 19 (3) (1976) 137. [44] C. Marco, C. Gabriele, A. Vincenzo, Towards an operational semantics for solidity, in: The Eleventh International Conference on Advances in System Testing and Validation Lifecycle (VALID 2019), 2019, pp. 1–6. [45] T. Armstrong, K. Marriott, P. Schachte, H. Søndergaard, Two classes of Boolean functions for dependency analysis, Sci. Comput. Program. 31 (1) (1998) 3–45. [46] A. Cortesi, G. File, W.H. Winsborough, Prop revisited: propositional formula as abstract domain for groundness analysis, in: LICS, 1991, pp. 322–327. [47] A. Cortesi, G. File, W.H. Winsborough, Optimal Groundness Analysis Using Propositional Logic, J. Log. Program. 27 (2) (1996) 137–167. [48] M. Zanioli, A. Cortesi, Information leakage analysis by abstract interpretation, in: SOFSEM 2011: Theory and Practice of Computer Science—37th Conference on Current Trends in Theory and Practice of Computer Science, Novy´ Smokovec, Slovakia, January 22–28, 2011. Proceedings, 2011, pp. 545–557. [49] A. Cortesi, G. Costantini, P. Ferrara, A survey on product operators in abstract interpretation, in: EPTCS, Semantics, Abstract Interpretation, and Reasoning about Programs, vol. 129, 2013, pp. 325–336, https://doi.org/10.4204/EPTCS.129.19.

Analyzing information flow in solidity smart contracts Chapter

7

123

[50] P. Cousot, R. Cousot, Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints, in: Proceedings of the POPL’77, 1977, pp. 238–252. [51] P. Cousot, R. Cousot, Systematic design of program analysis frameworks, in: Proceedings of the 6th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, ACM Press, San Antonio, TX, 1979, pp. 269–282. [52] P. Cousot, Constructive design of a hierarchy of semantics of a transition system by abstract interpretation, Theor. Comput. Sci. 277 (1–2) (2002) 47–103. [53] P. Cousot, N. Halbwachs, Automatic discovery of linear restraints among variables of a program, in: Proceedings of the POPL ’78, 1978, pp. 84–96. [54] A. Mine, A new numerical abstract domain based on difference-bound matrices, in: Programs as Data Objects, Second Symposium, PADO, 2001, pp. 155–172. [55] A. Mine`, The octagon abstract domain, Higher Order Symbol. Comput. 19 (1) (2006) 31–100. [56] L. Chen, A. Mine`, P. Cousot, A sound floating-point polyhedra abstract domain, in: Proc. of the 6th Asian Symposium on PLS, 2008, pp. 3–18. [57] N.V. Chernikoba, Algorithm for discovering the set of all the solutions of a linear programming problem, USSR Comput. Math. Math. Phys. 8 (6) (1968) 282–293. [58] I. Mastroeni, D. Zanardini, Data dependencies and program slicing: from syntax to abstract semantics, in: PEPM ’08: Proceedings of the 2008 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, ACM Press, San Francisco, CA, 2008, pp. 125–134. [59] R. Halder, A. Cortesi, Abstract program slicing on dependence condition graphs, Sci. Comput. Program. 78 (9) (2013) 1240–1263, https://doi.org/ 10.1016/j.scico.2012.05.007. [60] R. Halder, A. Cortesi, Abstract program slicing of database query languages, in: Proc. of the 28th Symposium On Applied Computing, ACM Press, Coimbra, Portugal, 2013, pp. 838–845. [61] L. Chen, A. Mine, P. Cousot, A sound floating-point polyhedra abstract domain, in: Proc. of the 6th Asian Symposium on Programming Languages and Systems, ACM Press, Bangalore, India, 2008, pp. 3–18. [62] A. Mine, The octagon abstract domain, Higher Order Symbol. Comput. 19 (2006) 31–100.

This page intentionally left blank

Chapter 8

Formal verification and code generation for solidity smart contracts Neeraj Kumar Singha, Akshay M. Fajgeb, Raju Halderb, and Md. Imran Alamb,c a

INPT-ENSEEIHT/IRIT, University of Toulouse, Toulouse, France, b Indian Institute of Technology Patna, Patna, Bihar, India, c Universita` Ca’ Foscari

Venezia, Venezia, Italy

1. Introduction Ethereum [1] is an open-source computing platform, also known as the Ethereum virtual machine (EVM), for blockchain technology with contract functionality. The blockchain technology has been adopted successfully in different business sectors, such as e-commerce, banking, finance, insurance, energy trading, health-care services, and asset management. Manipulation of critical transactions, as well as management of digital assets, making them attractive targets for security threats and attacks, which may result in financial losses and data leakage. EVM, on the other hand, executes bytecode of smart contracts written in Solidity [2, 3], a JavaScript-like language, on a simple stack machine to handle and transfer digital assets, which are extremely difficult due to Ethereum’s openness, allowing both programs and anonymous users to call into the public methods of other programs. In such cases, the use of trusted and untrusted code together in a large and complex application, particularly one involving financial management or privacy data, can be dangerous. For example, the DAO is hacked by an attacker by examining EVM semantics to transfer 50 million USD in Ether [4]. Since software plays an important role in the blockchain technology, we need effective ways to evaluate smart contracts in order to certify and ensure safe transactions. The blockchain community and industrial partners are looking for better technology and methods to provide safe and secure transactions. Furthermore, smart contracts must meet safety and security standards. We believe that formal methods have the potential to develop safe and secure systems that are also certifiable with required features that can be used to verify and certify smart contracts. This chapter contributes a framework for analyzing, verifying, and implementing smart contracts while maintaining functional correctness and required safety properties through incremental refinement in Event-B [5]. We use the Rodin [6] tool to develop formal models of smart contract specifications. The primary use of this formal development is to assist in the construction, clarification, and validation of the smart contract requirements. Furthermore, the developed Event-B models are used to generate smart contracts in Solidity using our developed tool EB2Sol. This developed tool covers a subset of the Event-B modeling language in order to generate a Solidity subset. In this chapter, we will go over technical details about implementation as well as design decisions made during prototype development. Finally, we use a case study to demonstrate the scalability and effectiveness of our proposed framework. In summary, the main contributions of this chapter are 1. 2. 3. 4.

a framework for using formal methods to develop smart contracts from requirements analysis to code generation; smart contracts (in Solidity) are generated from the proven Event-B formal models; EB2Sol is developed to generate Solidity code; and the proposed framework is used for developing several case studies in order to formalize the development of smart contracts.

The rest of the chapter is as follows. Section 2 reviews the related work. Section 3 briefly overviews key elements of EventB modeling language, including refinement, and Solidity smart contract. A framework for developing formal Solidity smart contract in Event-B is presented in Section 4. Section 5 outlines the translation principle and development architecture of EB2Sol. Section 6 describes a case study to demonstrate the applicability of the proposed framework, including implementation of Solidity smart contract. In Section 7, we provide an assessment and Section 8 concludes the chapter with the future work.

Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00028-0 Copyright © 2023 Elsevier Inc. All rights reserved.

125

126 SECTION

2.

A Evolution of distributed systems

Related work

Solidity smart contracts are widely used on the Ethereum platform for blockchain technology. Following several attacks [4, 7] in recent years, formal methods are now regarded as first-class citizens for mitigating potential risks through formal reasoning on defined contracts. Several approaches based on formal methods for the development of smart contracts have been proposed in recent years. Palina et al. [8] provided a comprehensive overview of formal models and smart contract specifications. They also highlighted some of the identified challenges and gaps in order to guide future research in the area of formal methods for developing trustworthy smart contracts. In [9], the authors proposed EVM semantics in the K Framework based on the ERC20 Standard Token for formalizing and analyzing smart contracts. Hirai et al. [10] defined EVM in Lem language that can be translated into many standard interactive theorem provers. In particular, they prove interesting safety properties of Ethereum smart contracts in Isabelle/ HOL. The ConCert framework [11] was developed for verifying smart contracts in Coq in order to detect vulnerability. In [12], the authors proposed a lazy approach to determine input conditions under which the contract terminates or not by statically proving conditional termination and nontermination of a smart contract. This is accomplished by ensuring in advance that both the current state and the contract’s input satisfy the termination conditions. Wang et al. [13] presented VERISOL, a formal verification tool for smart contracts verification based on semantic conformance of smart contracts against a state machine model with access-control policy. They discovered some previously unknown bugs in the published smart contracts, then fixed the bugs and would be able to perform model checking-based verification with VERISOL. In [14], the authors described an SMT-based formal verification module integrated with the Solidity compiler for identifying potential bugs during the compile time, such as arithmetic overflow/underflow, unreachable code, trivial conditions, and assertion fails. In [15], the authors presented a framework for analyzing and verifying the run-time safety properties as well as functional correctness of Ethereum contracts using the F* functional programming language. In [16], the authors showed smallstep semantics of EVM bytecode in F*. They validated the executable code against the Ethereum test suite. Furthermore, they identified some bugs and defined several security properties to prevent them, such as call integrity and atomicity. In a similar vein, Zhu et al. [17] presented a mechanism for translating Solidity contracts to Event-B models by defining transfer functions covering a subset of the Solidity language. Further, the produced Event-B model can be refined at different abstraction levels to verify properties associated with Solidity contracts using Rodin [6]. A structured approach to smart contracts verification based on refinement in the Event-B modeling language proposed in Ref. [18]. Our work is also in this vein, as we propose a framework based on Event-B formal methods for specifying, analyzing, verifying, and implementing smart contracts through refinement by preserving the required safety properties. In addition, we have developed a prototype tool, EB2Sol, to generate Solidity smart contracts from verified Event-B models. As far as we know, this is the first tool for translating Event-B models into Solidity smart contracts.

3.

Background

3.1 Event-B modeling framework This section summarizes the core components of the Event-B modeling language [19], including modeling concepts. The Event-B language has two main components, which are described in Table 1: context and machine. A context describes the static structure of a system, including carrier sets s and constants c, as well as axioms A(s, c) and theorems Tc(s, c) that state their properties. A machine defines a system’s dynamic structure, which includes variables v, invariants I(s, c, v), theorems Tm(s, c, v), variants V (s, c, v), and events evt. Terms such as refines, extends, and sees are used to describe the relation between components of Event-B models. In a machine, events are used to modify state variables by providing appropriate guards.

Modeling actions over states An Event-B model is characterized by a set of state variables that can be modified by a set of events. An invariant I(s, c, v) expresses the required safety properties that the variable v must satisfy during event activation. An event is a state transition in a dynamic system that contains guard(s) and action(s). A guard, predicate based on state variables, is required for an event to be enabled. A action, also known as a before-after predicate, is a generalized substitution that describes how the occurrence of an event changes one or more state variables. An event evt can be defined in three ways: the first is BEGIN v : jBAP(s, c, v, v0 ) END, in which the action, BAP(s, c, v, v0 ), is not guarded and is always enabled; the second is WHEN

Formal verification and code generation for solidity smart contracts Chapter

8

127

TABLE 1 Model structure. CONTEXT ctxt_id_2 EXTENDS ctxt_id_1 SETS s CONSTANTS c AXIOMS

MACHINE machine_id_2 REFINES machine_id_1 SEES ctxt_id_2 VARIABLES v INVARIANTS

A(s, c)

I(s, c, v)

THEOREMS

THEOREMS

Tc(s, c) END

Tm(s, c, v) VARIANT V (s, c, v) EVENTS Event evt any x where G(s, c, v, x) then v : jBA(e)(s, c, v, x, v0 ) end END

G(s, c, v) THEN v : jBAP(s, c, v, v0 ) END, in which the action, BAP(s, c, v, v0 ), is guarded by G(s, c, v), and the guard must be satisfied to enable the action; and the final is ANY x WHERE G(s, c, v, x) THEN v : jBAP(s, c, v, x, v0 ) END, where the action, BAP(s, c, v, x, v0 ), is guarded by G(s, c, v, x) and depends on the local state variable x to describe nondeterministic events. The Rodin platform generates proof obligations (POs) [20]. Event-B supports a variety of POs (see Table 2), such as invariant preservation, nondeterministic action feasibility, variant, well definedness, and so on. Invariant preservation

TABLE 2 Some of the associated proof obligations. Theorems

A(s, c) ) Tc(s, c) A(s, c) ^ I(s, c, v) ) Tm(s, c, v)

Invariant preservation

A(s, c) ^ I(s, c, v) ^ G(s, c, v, x) ^ BAP(s, c, v, x, v0 ) ) I(s, c, v0 )

Event feasibility

A(s, c) ^ I(s, c, v) ^ G(s, c, v, x) ) 9v0 .BAP(s, c, v, x, v0 )

Variant progress

A(s, c) ^ I(s, c, v) ^ G(s, c, v, x) ^ BAP(s, c, v, x, v0 ) ) V (s, c, v0 ) < V (s, c, v)

128 SECTION

A Evolution of distributed systems

ensures that each invariant is preserved by each event; nondeterministic action feasibility shows the feasibility of the event e with respect to the invariant I; variant ensures that each convergent event decreases the proposed numeric variant; and well definedness ensures that each axiom, theorem, invariant, guard, action, and variant is well defined.

Refinement To model a complex system, the Event-B modeling language supports a stepwise refinement technique. The refinements allow us to gradually model a system and provide a way to strengthen invariants, introducing more detailed system behavior. By modifying the state description, this refinement method converts an abstract model into a more concrete version. The refinement process adds new events to a list of state variables by refining each abstract event to a concrete version, or by simply refining each abstract event to a concrete version. These refinements preserve the relationship between an abstract model and its concrete model, while introducing new events and variables to specify more concrete system behavior. Gluing invariants connect the abstract and concrete state variables. Each abstract event is correctly refined by its concrete version, thanks to the generated POs. Table 3 shows some of the important POs associated to refinement, such as event simulation, guard strengthening, and invariant preservation. The simulation ensures that each action in a concrete event simulates the corresponding abstract action; the guard strengthening in a refinement ensures that the concrete guards in the refining event are stronger than the abstract ones; and the invariant preservation ensures that each invariant is preserved by each refined event. These POs contain axiom A(s, c) invariant I(s, c, v), gluing invariant J(s, c, v, w), guard H(s, c, y, w), witness W(s, c, x, w, y, w0 ), and before-after predicate BAP(s, c, w, y, w0 ). A set of new events introduced in a refinement step is referred to as hidden events because they are not visible to the environment of the system being modeled. These introduced events are beyond the environment’s control. Skip is refined by new events that are not visible in the abstract model. Any number of executions of an internal action may occur between each execution of a visible action. By strengthening the guards and/or predicates, the refined model reduces the degree of nondeterminism. The refinement of an event e by an event f implies that the event f simulates the event e, ensuring that the set of traces of the refined model includes (up to stuttering) the traces of the resulting model.

Rodin Rodin [20] is an open-source Eclipse-based integrated development environment (IDE) for developing Event-B models. Rodin is a foundational collection of plug-ins for project management, formal development, syntactic analysis, proof assistance, and proof-based verification. Furthermore, it supports extension points for a variety of additional plug-ins that provide various functionalities and features related to model checking, animation, code generation, additional proof capabilities using SMTs and external theorem provers (i.e., Why3, Isabelle), UML-B, theory plug-ins, composition and decomposition, refactoring framework, and model editors.

Applications The Event-B method has been used successfully to design critical systems for a variety of applications, including the control system for the Meteor line 14 in Paris and the VAL shuttle for Paris CDG airport [21–23], as well as medical devices [24–26], autonomous systems [27, 28], security protocols [29, 30], control-command systems [31–33], and distributed protocols [34–38]. More information can be found in Ref. [39]. TABLE 3 Refinement POs. Event simulation

A(s, c) ^ I(s, c, v) ^ ^ J(s, c, v, w) ^ H(s, c, y, w) ^ W(s, c, x, w, y, w0 ) ^ BAP(s, c, w, y, w0 ) ) BAP(s, c, v, x, v0 )

Guard strengthening

A(s, c) ^ I(s, c, v) ^ J(s, c, v, w) ^ H(s, c, y, w) ^ W(s, c, x, w, y) ) G(s, c, v, x)

Invariant preservation

A(s, c) ^ I(s, c, v) ^ J(s, c, v, w) ^ H(s, c, y, w) ^ W(s, c, y, w, v0 , w0 ) ^ BAP(s, c, w, y, w0 ) ) I(s, c, v0 , w0 )

Formal verification and code generation for solidity smart contracts Chapter

8

129

3.2 Solidity Solidity is a programming language designed specifically for developing smart contracts that compiled into bytecode executable by Ethereum platform’s execution engine, often known as EVM. Smart contracts are programs that execute on a decentralized network without the intervention of a central authority. Solidity enables the developers to create self-enforcing business logic via smart contracts, resulting in a trustworthy and authoritative record of transactions. The syntax of Solidity is quite similar to those of scripting languages like JavaScript, and it is heavily influenced by C++, Python. Solidity extensively utilizes programming techniques derived from other languages. It features variables, static typing, functions, libraries, and interfaces. In addition, it offers a range of control structures such as for, while, do-while, and if-else. In case of an object-oriented programming language like Java, programmers work with classes, whereas Solidity programmers deals with contracts. Each contract can define various Solidity constructs such as state variables, functions, function modifiers, events, errors, structure types, and enum types. This section outlines the major Solidity constructs that are relevant to our goal. More information about Solidity programming language can be found in Ref. [2].

Solidity types, special functions, and variables Solidity is a statically typed programming language, which means that variable types are declared explicitly and thus determined at compile time. In Solidity, numerous elementary types exist that can be combined to form more sophisticated types. Solidity offers an extensive range of types, notably value types, reference types such as arrays and structures, mapping types, user-defined types, and it also supports elementary type conversion. Solidity does not support undefined or null values, newly declared variables always have a default value based on their type. Table 4 summarizes the most frequently used value types. In the global namespace, special variables and functions exist at all times and are primarily used to relay information about the blockchain or to perform general-purpose utility operations. Table 5 lists some of the most frequently used variables and functions from the global namespace of Solidity. In addition, solidity supports various denominations of Ethereum cryptocurrency such as wei, gwei, and ether, as a suffix to number literals. Errors are handled in Solidity using state-reverting exceptions. This exception nullifies any state changes made during the execution of the code and notifies the caller of an error. The assert and require functions enable programmers to check for conditions and throw exceptions if they are not met. The assert function should be preferred exclusively to check for internal errors and invariants. The require function supports optional error message and should be used to ensure the existence of valid conditions that must be identified during contract execution. This includes conditions on input values or the return values of external contract calls. The revert function is another mechanism available in the global namespace for reporting errors and undoing state changes during contract code execution. In addition, this function accepts and returns an optional message containing details about the error to the caller.

TABLE 4 Solidity value types. Value types

Keyword

Description

Boolean type

bool

Possible values true and false

Integer types

intX

Signed integers where X varies from 8 to 256 in steps of 8

uintX

Unsigned integers where X varies from 8 to 256 in steps of 8

address

Ethereum address of 20 bytes

address payable

Additional members like transfer and send

Byte arrays (fixed size)

bytesX

X varies from 1 to 32

Byte arrays (dynamic size)

bytes

Similar to bytes1[] but skips padding

string

Similar to bytes, but do not allow length or index access

enum

Default value is the first member

Address types

Enumerated type

130 SECTION

A Evolution of distributed systems

TABLE 5 Frequently used special variables and functions. Type

Variable/function

Description

address

msg.sender

Sender of the message (current call)

uint

msg.value

Number of wei sent with the message



assert(bool)

Used for internal errors



require(bool, [message])

Used for checking condition on input



revert([message])

Abort execution and revert state changes

uint

< address > .balance

Balance of the address in wei



< address payable > .transfer(uint)

Send given amount of wei to address

bool

< address payable > .send(uint)

Send wei to address, returns false on failure

Contract

this

Refers to the current contract

uint

now

Current block timestamp

address payable

tx.origin

Sender of the transaction

Function modifiers Modifiers in Solidity are analogous to the Object-Oriented Programming decorator patterns. A modifier controls how a function behaves at run-time. In the example provided in Code Snippet 1, the modifier validate(int) restricts the execution of the increment function if the parameter value of increment function is less than 1. Code Snippet 1 Modifier example pragma solidity >=0.6.0; contract ModifierExample { int public number; modifier validate(int value){ require(value>0, "value␣of␣incrementBy␣must␣be␣greater␣than␣0"); _; } function increment(int incrementBy) validate(incrementBy) public{ number += incrementBy; } }

Multiple modifiers can be applied to a function or constructor by specifying them in a whitespace-separated list and are evaluated from left to right. Modifiers are inheritable properties of contracts and may be overridden by derived contracts. The symbol 0 _;0 in modifier body returns the flow of execution to the original function code. It applies to various contexts, such as providing an easy-to-understand approach to express certain guards, confirming specific conditions after the function execution.

4.

Formal framework for Solidity smart contracts

Fig. 1 depicts a modeling framework for formalizing and implementing Solidity smart contracts that support the correct by construction approach. In this proposed framework, there are three main important process blocks: (1) Event-B model, (2) formal verification, and (3) Solidity implementation. The Event-B model block deals with complex modeling of smart contracts, and building a formal model of smart contracts may require several iterations. Starting from an initial model, it is

Formal verification and code generation for solidity smart contracts Chapter

8

131

Feedback

Event-B Model AM

RM 1 Rodin Platform

Formal

EB2Sol Generator

Solidity Implementation

RM 2

RM n FIG. 1 A framework for developing formal Solidity smart contracts.

gradually enhanced by adding design decisions and handling requirements. Note that the progressive safe enrichment allows to add the required safety properties and low-level system requirements related to smart contracts. These refinements preserve the relationships between an abstract model and its corresponding concrete model, while introducing low-level details and new properties to specify more concrete behavior of a system. This incremental development ensures the correctness of concrete behavior of a smart contract system in relation to the abstract model. Rodin tools are used to verify the abstract and refined Event-B models. The analyzed models provide feedback to the original Event-B model, which is depicted in Fig. 1. The second block of Fig. 1 is concerned with formal verification, which is an important step in proving and disproving the correctness of a formalized system’s intended behavior under the given safety properties and assumptions. In the process of system verification, we can use an automated theorem prover to check the consistency and correctness of the generated formal model. Using mathematical operators, a formal notation can be analyzed and manipulated, and mathematical proof procedures can be used to test (and prove) the internal consistency (including data conservation) and syntactical correctness of the specifications. The formal verification ensures that the model is correctly designed, that the developed formal specification has the required properties, and that the generated models are free of errors, oversights, and bugs. The Rodin development framework can be used for project management as well as model verification via syntactical and refinement checking. Furthermore, this tool can be used to discharge the generated POs. If any inconsistencies in the model are discovered during the system verification process, we can modify the model obtained in the previous step of the development process. We can iterate until we get a correct model. The final block in our framework is related to Solidity implementation using our developed tool EB2Sol. This is the last stage of our framework proposal. From the formalized, proved, and validated formal models, it generates Solidity language code for system implementation. This phase of development includes the major executable components, concrete data structure definitions, and some auxiliary structures or functions that may be assumed in a design. However, it is also critical to rigorously review the system implementation in relation to the specified system requirements and selected design. Automatic code generation has become standard practice in developing verified code in a target language corresponding to the given specification, required configurations, and platform information without any human intervention in the new age of software development and automation of the development life cycle. In our proposed framework, we use our developed tool EB2Sol, an extension of EB2ALL [40, 41], to generate source code in Solidity language from the verified formal specification. Section 5 describes the basic architecture of this tool as well as the development process. This automation process has several advantages. For example, the automatic code generation tool produces executable software with far fewer implementation errors than a human programmer. Manually implementing the formal specification can be time consuming and error prone. In automatic code generation, code maintenance and successive changes are simple to handle, and the consistency between the generated code and the given formal specification is always maintained. However, there are some drawbacks to automatic code generation. For example, automatically generated codes can be difficult to understand, excessive code can be generated, and incorrect code is still a possibility.

132 SECTION

5.

A Evolution of distributed systems

EB2Sol: Event-B to Solidity

In this section, we describe the development architecture for our developed tool EB2Sol, which is an extension of EB2ALL [41], developed as a new plug-in for generating Solidity smart contracts from Event-B models. Fig. 2 depicts the overall architecture of the EB2Sol automatic code generation tool. The given boxes show different steps of the code generation process. The first block is associated with the Event-B model, which serves as an input to the code generation tool.

5.1 Preprocessing and generated POs Most of the time, systems fail due to a run-time error. Overflow and underflow of bounded integers, for example, are types of run-time errors that should be checked before producing the Solidity code. There is a preprocessing step in the code generation process that allows for the introduction of a context file based on the Solidity language to provide a deterministic range for data types in order to make the Event-B model deterministic [42]. To obtain the deterministic model, we can use vertical refinement to refine the previous concrete model, which provides deterministic definitions of constants and variables. For this, we can introduce a Solidity context file, which contains bounded integer data types. Table 6 shows a map between Event-B and Solidity types for signed and unsigned integers. Note that the Solidity context file is an Event-B context file, which is required to generate correct code. Adding a new context file may generate new set of POs that must be proved before generating the Solidity code as well as to verify the specification in order to ensure the system’s consistency.

Event-B Model

Solidity Context File Pre-processing Discharging Generated POs

Lexical Analysis

Syntax Analysis Error Handler

Semantic Analysis

Solidity Smart Contract FIG. 2 Development architecture of EB2Sol.

Formal verification and code generation for solidity smart contracts Chapter

8

133

TABLE 6 Signed and unsigned integers. Event-B type

Formal range

Solidity type

tl_int8

 2 ..2  1

tl_int16

 2 ..2

1

int16

tl_int24

 2 ..2

1

int24





tl_int256

2

tl_uint8

0..2  1

tl_uint16

7

15

15

23

23

int8

… 255

..2

255

1

8

int256 uint8

16

1

uint16

24

1

uint24

0..2

tl_uint24

0..2





tl_int256

7

… 256

0..2

1

uint256

5.2 Translation of Event-B to Solidity The main objective is to translate the Event-B model into a semantically observationally equivalent standard Solidity smart contracts. The developed translator is based on a set of transformation rules that map between the Event-B and Solidity constructs. In fact, the transformation functions allow to produce code in target language applying a set of rules when matching the inputs from the source language. We define a set of transformation functions to generate Solidity code from the Event-B model. These transformation rules are given in Table 7. A set of supported symbols of EB2Sol tool is given in Table 8. This table shows a subset of Event-B syntax to equivalent Solidity smart contracts. All constants defined in a model’s context must be replaced with their literal values. We consider Event-B formal notations available at Ref. [5] and capture the Event-B grammar in an abstract syntax tree (AST). This translation tool accepts conditional, arithmetic, and logical formal model expressions. Event-B model that contains machines and contexts are translated to Solidity contracts. Here we provide the translation process for dealing with context and machine models.

Context models The context of an Event-B model consists of sets, enumerated sets, constants, arrays, and functions, all of which are associated with their respective type. For translation purposes, the translation tool supports all types of context components. The observational equivalence is based on the equivalence of Event-B values and the values of Solidity smart contracts. This TABLE 7 Transformation function. Tdecl:

Datatype and constant declaration translation function

Tst:

State variables translation function

Taxm:

Axioms translation function

Tpred:

Predicate translation function

Tthm:

Theorem translation function

Tevt:

Events translation function

Tgrd:

Event’s guards translation function

Tact:

Event’s actions translation function

Texp:

Expressions translation function

134 SECTION

A Evolution of distributed systems

TABLE 8 Event-B to Solidity. Event-B

Solidity

Comment

const_x  ^ cons_x¼120

int256 constant const_x ¼ 120

Constant declaration

x

int256 x

Signed integer variable declaration

x

uint256 x

Unsigned integer variable declaration

x  tl_int16

int16 x;

Signed integer variable declaration

b  BOOL

bool b;

Boolean variable declaration

x  n..m !

int [m+1] x;

Array declaration

x¼y

if(x¼¼y) {…}

Conditional statement

x 6¼ y

if(x!¼y) {…}

Conditional statement

x¼y) {…}

Conditional statement

(x>y) ^ (xz)

if ((x>y) && (x>¼z) {…}

Conditional statement

(x>y) _ (xz)

if ((x>y) k (x>¼z) {…}

Conditional statement

¬x N=2 2Q  N > 0

(7)

By combing the two conditions, we get, N < 2Q  2ðN  f Þ f < N=2 N > 2f if N min ¼ 2f + 1

(8)

then 2Q > f + 1 or Q > f + 1=2 therefore, for non-Byzantine failures Q min ¼ f + 1

(9)

Byzantine failure: What is the Quorum size Q necessary to ensure Liveness and Safety in a network with N nodes and f fault nodes that may experience Byzantine failure? Byzantine failure can cause a node to vote for an incorrect block or decision, resulting in a split in the decision and forking. Liveness: At least one nonfaulty node or Quorum is required to prevent the network from stalling. Because it is feasible that Byzantine nodes will fail to respond. As a result, for liveliness: QNF

(10)

Safety: The majority should be present to prevent the network from breaking into several decisions. Byzantine failure, unlike non-Byzantine failure, allows nodes to vote; hence, we must account for defective nodes in the voting process. Q > N=2 2Q  N > 0

(11)

The maximum number of node failures that can be present in the network is determined by this equation. As a result, it may also be written as Safety: 2Q  N > F

(12)

158 SECTION

A Evolution of distributed systems

where f is the maximum number of defective nodes that may be tolerated. We obtain by combining the two criteria: N + f < 2Q < 2ðN  f Þ N + f < 2N  2f 3f < N N > 3f if N ¼ 3f + 1

(13)

then 2Q>4f + 1 or Q>2f + 1=2

therefore, for Byzantine failures Q min ¼ 3f + 1

(14)

3.4 Delegated byzantine fault tolerance (DBFT) This solution complies with the PBFT’s rules; however, it does not need the participation of all nodes in the voting process in order to add a new block. A consensus technique, such as the PBFT approach, is used to select some nodes as representatives of other nodes [13]. Some professional nodes have been elected to keep track of all transactions for all nodes in this way. This method is used by the NEO algorithm [10]. While DBFT is less prone to delays than PBFT, limiting the number of voters might threaten the network’s decentralization. DBFT was the first viable BFT to operate at scale, overcoming DBFT’s intrinsic problems. Prepare, response, and publish are the three steps of the DBFT algorithm. The next sections go through each of these phases in further depth. N: The number of active consensus nodes. i: Each consensus node (delegates) in the system can be identified as i  N. h: Block height. f: The number of Byzantine (that is, malicious) nodes, with f being no more than (N  1)/3. v: The current view number (each view is a new round or attempt at consensus). b: The proposed block of atomic transactions, the execution of which transitions the system to the next valid state. p: The leader for this opinion that suggests the block, or the speaker’s index. The N consensus nodes are made up of the speaker and the remaining delegates. s: The acceptable level of agreement. The network is vulnerable to a malfunction if it falls below this threshold. s ¼ ((N  1)  f). The following are steps of DBFT on a conceptual level: 1. A client “broadcasts” a signed transaction to the distributed system’s nodes. 2. The transaction is received by the N consensus nodes, who add it to memory pool of transactions. 3. The special speaker p bundles the transactions from the memory pool into a new proposal for block b. Fig. 14 depicts the execution of the DBFT algorithm. 4. The other N  1 delegates are given the new proposed block b, check it, and announce the outcome. Any consensus node gets consensus and broadcasts the new block after getting at least (N  f) verifications. Prepare: The view’s speaker is in charge of broadcasting the Prepare-Request message to delegates and launching the new proposed block of transactions. Response: If the proposed block is correctly confirmed, the delegates broadcast the Prepare-Response message after receiving the Prepare message. The consensus nodes go on to the next step after getting (N  f) complete block verifications. Publish: The nodes generate a new block and proceed to another round of consensus. If consensus is not reached in a particular round (view), the consensus nodes may recommend switching to a new speaker and repeating the consensus protocol after obtaining at least (N  f) offers to switch to a new view with same view number. The DBFT flowchart is shown in Fig. 15.

Blockchain consensus algorithms Chapter

159



i

Prepare

9

Response

Publish

Reply

View-Change

New-Speaker

Speaker

Delegate Delegate

Delegate View v+1

View v

FIG. 14 DBFT operations.

start The Speaker (leader) is identified. Wait 15 seconds to other delegate to follow. The leader broadcasts the proposed block to secondary delegates.

The secondary delegates receive the proposal and validate it After receiving s number of 'prepare-Response' broadcasts, each second replica reaches the consensus and publishes a signed block. When the leader receives a full block a new round of consensus begins End FIG. 15 DBFT flowchart.

DBFT decides on the primary replica during the consensus process introducing a 15 s delay. DBFT creates a lot of network traffic because there are many broadcasts in the communication among replicas, and the primary replica has to verify signatures the majority of replicas as the last stage of the consensus. This was solved in DBFT 2.0 with the addition of a new commit phase. To avoid stalling, DBFT 2.0 includes a recovery message implementation in addition to the consensus algorithm. This recovery technique also has the added benefit of considerably reducing block times when network latency has been degraded due to a network attack [37].

3.5 Istanbul byzantine fault tolerance (IBFT) IBFT [38] is a blockchain consensus mechanism based on proof of authority that provides instant finality. It differs from PBFT because PBFT’s validator set is static, but IBFT’s validator set is dynamic. This enables blockchains using the IBFT consensus process to verify transactions more quickly than chains using the PBFT consensus algorithm. To begin, the validator pool is created by selecting a group of nodes. These nodes will decide how a proposed block is appropriate for inclusion in the chain. From among all these validator nodes, the proposer will be chosen at random. After receiving messages from the pool of validators, this single proposer will decide what to add to the chain. Fig. 16 depicts the execution of the IBFT algorithm. This is presented as a proposed block to the other validators. The block will only be added to the ledger if it is deemed legitimate by a supermajority of the validators. The validators choose a new proposer at the end of each consensus round,

160 SECTION

A Evolution of distributed systems

Proposer

Propose

Pre-Prepare

Prepare

Commit

Validator 1

Validator 2 Validator 3

FIG. 16 IBFT operations.

and the procedure is repeated. To decide if a proposed block is eligible for inclusion to the chain, IBFT employs a pool of validating nodes validators on the Ethereum network. The proposer is chosen at random from among the Validators and is in charge of developing a block. The Validators may choose a new proposer after the consensus round, who will be responsible for delivering the candidate block at the following block interval. The consensus method is a state machine that ensures that all Validators add the same block to the chain at the same level. The proposer is changed if a block fails to insert, and the procedure is restarted. If less than 1/3 of the validating nodes behave wrongly, the IBFT consensus process provides system stability Tolerance for F defective nodes requires at least 3F + 1 node in the validation group. IBFT state machine: The state machine and its transitions are given in the diagram and explanation below. Fig. 17 depicts the state machine and its transitions. 1. Awaiting proposal. The verifier is waiting for the current proposer to supply a new block. If this round’s validator is also the proposer, they prepare the proposed block and send it in a preprepare message. 2. Preparing. Has got a proposed block and alerted validator-peers; is currently waiting for validator-peers to indicate whether or not the block should be accepted. 3. Ready. Has obtained block acceptance from validator-peer and is waiting for them to be in a similar situation. The suggested block has been “locked-in” at this point and cannot be altered until an insertion attempt has been made.

[Failed] /UnlockBlock

FIG. 17 IBFT state machine.

Timeout

Timeout

Timeout

Rx2F+1PrepareMsgs /GossipCommitMsg; LockBlock

Preparing

Rx2F+1 RoundChangeMsg

RxPrepareMsg /ValidateProposal

Round Change

Rx2F+1CommitMsgs /Appended Block To Chain

Ready

Awaiting Proposal

[Success] /StartRoundTimer

Check Insert Result

[Invalid]

[Valid] /GossipPrepareMsg

Check Proposal Validity

Blockchain consensus algorithms Chapter

9

161

4. Round change. Before a consensus could be achieved, the round ran out of time, or the block failed to insert. Wait for the next round number to be agreed upon by all validators: On the same intended round number, a validator waits for 2F + 1 ROUND CHANGE messages. 5. New round: The proposer will submit a new block proposal. Validators await the message PRE-PREPARE. 6. Preprepared: After receiving the PRE-PREPARE message, a validator transmits the PREPARE message. After that, it awaits 2F + 1 PREPARE or COMMIT signals. 7. Prepared: After receiving 2F + 1 PREPARE messages, a validator transmits COMMIT messages. It then waits for 2F + 1 COMMIT messages to arrive. 8. Committed: After receiving 2F + 1 COMMIT messages, a validator can add the proposed block to the blockchain. 9. Final committed: The validator is ready for the next round after successfully inserting a new block into the blockchain. The transitions are explained in the following. 1. Awaiting proposal → preparing. When the proposer sends a new block (Preprepare message) 2. Awaiting proposal → round change. The received proposal was not a legitimate block according to a set of rules 3. Preparing → Ready. When validator-peers provide 2F + 1 notifications (Prepare message) indicating that the proposed block is acceptable for insertion. 4. Ready → awaiting proposal. When validator-peers provide 2F + 1 alerts (Commit messages) signaling that they are ready to attach the block to the chain. The process of adding the block to the chain begins at the transition. 5. Ready → round change. However, block insertion has failed according to Ready->Awaiting Proposal. 6. Round change → awaiting proposal. The next round number to be utilized is decided by 2F + 1 validators.

3.6 BFT-SMaRT protocol BFT-SMART [39] is a Java-based state machine replication library designed to tolerate f Byzantine nodes with a total number of nodes is n 3f + 1. A state transfer service is offered in BFT-SMART to repair a faulty node, reassign it to the system, and access other nodes to obtain replicas’ latest recent status. The state transfer service saves each node’s operation records on other disks to ensure that the system can recover stably from errors occurring simultaneously at all f nodes. Furthermore, using a Trusted Third Party (TPP)-specific client, BFT-SMART built a reconfiguration service to add/remove replicas dynamically. The BFT-SMART algorithm divides nodes into two types: leaders and backups, and it has a reconfiguration protocol [40] that is very similar to the view change protocol used in PBFT to deal with a leader failure. The BFT-SMART method’s consensus process is based on a module called Mod-SMaRt [41], which uses a leaderdriven algorithm described in [42]. As illustrated in Fig. 18, the consensus process includes three phases: propose, write, and accept. The network as a whole elects a leader node. A client sends a REQUEST message to all nodes, including the client serial number, digital signature, and operation request information, and then waits for a response before continuing to the consensus process. The leader node verifies the correctness of the incoming REQUEST message, while the system is in the normal phase (no node fails or has an error). The leader node receives the incoming message, assigns a serial number, and transmits the PROPOSE message to replica nodes when the verification is passed. Other replica nodes will receive and deliver the WRITE message to all nodes, including itself, as long as a replica node accepts and forwards the message. The node sends an ACCESS message to all nodes, including itself, when it receives 2f WRITE messages. The request is executed when a node gets 2f + 1 ACCESS messages. The algorithm records the content of the series of request operations and the encryption certificate for each node and simultaneously responds with ACCEPT to the client. If an error occurs in a node, the number of Request Client

Propose

Write

Accept

Reply

Byzantine Consensus Execute

P0 P1 P2 P3

FIG. 18 BFT-SMaRT operations.

162 SECTION

A Evolution of distributed systems

error nodes is f ¼ n1 3 Moreover, the algorithm triggers timeout twice, is forced to jump to the synchronization phase, and the reconfiguration protocol will re-elect the leader node. This process and the consensus process can both run at the same time. The REQUEST will be immediately sent to all nodes after the first timeout occurs. The timeout might be caused by a defective node that only delivers its answer to a subset of nodes in the network rather than the entire network. The node enters the next reconfiguration and sends a STOP message to inform other nodes when the second timeout is activated. When a node receives more than f STOP notifications, it begins the next reconfiguration process right away. All nodes send a STOP DATA message to the new leader node after the election is complete. The leader node will issue a SYNC message to all nodes if it receives at least n  f valid STOP DATA messages. To ensure that the leader node has collected and delivered correct information, the node that gets the SYNC message will execute the same process as the leader node. All other replicas will begin to synchronize with the leader after being validated as valid [43].

3.7 Verifiable byzantine fault tolerance (VBFT) VBFT is a consensus mechanism designed by the Ontology team and based on verifiable random function (VRF). VBFT also combines aspects of proof of stake and Byzantine Fault Tolerance. The Ontology consensus network consists of all consensus nodes responsible for consensus on transaction requests, block generation, maintaining the blockchain, and distributing consensus blocks to synchronous node networks. Ontology nodes can apply for participation by placing a stake; then, by using a verifiable random number, several nodes are selected and responsible for proposing, verifying, and voting for new blocks. In other words, nodes are selected, block verification nodes get set, and after confirmation nodes are set, the consensus is completed by a node set. VBFT follows parameters specifically defined by Ontology’s governance model and fully supports randomness and fairness of consensus for network construction. The mechanism supports public chains aiming to increase scale and improve performance [44]. The VBFT flowchart is shown in Fig. 19.

start VRF is used to choose alternate proposal nodes from the consensus network. Each proposal node proposes a block. Based on VRF, verification nodes are selected from the consensus network. The suggested blocks are collected by each verification node from the consensus network.

Each verification node verifies the proposed block and votes for it with the greatest priority. Based on VRF, confirmation nodes are chosen from the consensus network.

The vote results of the aforementioned verification nodes are verified by confirmation nodes, which decide the final consensus outcomes. The conclusion achieved by the confirmation nodes is subsequently acknowledged by all nodes in the consensus. This marks the conclusion of one round of consensus, and a new round of consensus will begin after confirmation. End FIG. 19 VBFT flowchart.

Blockchain consensus algorithms Chapter

9

163

3.8 Tendermint consensus Tendermint [45] is a consensus algorithm that was created with consortium blockchain applications in mind. It works similarly to PBFT, but it also ensures that no more than one-third of the nodes are corrupted. A leader node is chosen in a roundrobin manner for each new block until one is able to commit the block. To be committed, a block must get more than pair of validator votes in a given time period, using a method similar to PBFT’s three-phase commit. Tendermint-Core is a standalone consensus engine that has been integrated into Hyperledger Burrow and Ethermint to work with the Ethereum Virtual Machine (EVM). The consensus algorithm may be broken down into the following components, which are fairly orthogonal: l

l

l

Proposals: The correct proposer must propose a new block, gossiping to the other validators in each round. The proposer should be skipped if a proposal is not received on time. Votes: To provide excellent Byzantine Fault Tolerance, two voting phases are required. Prevote and precommit are the terms for them. A commit is defined as a collection of more than two-thirds of validators precommit for the same block in the same round Locks: If only one-third of the validators are malicious, Tendermint ensures that no two validators commit the same block at the same time. This is accomplished with the help of a locking mechanism that controls how a validator may prevote or precommit based on prior prevotes and precommits at the same height. It is worth noting that this locking mechanism must be properly developed to avoid jeopardizing the integrity of the system. [46].

A set of validators is used in the consensus algorithm. It is a round-based algorithm in which a proposer is selected from a group of validators. The proposer proposes a new block for the Blockchain at the latest height in each round. The proposer is chosen via a deterministic round-robin method that ultimately relies on the validators’ voting power. The voting power of the validators, on the other hand, is proportional to their security deposit. The consensus algorithm is a weakly synchronous protocol that consists of three phases (propose, prevote, and precommit) in each round bound by a duration evenly divided among the three steps. These steps illustrate the transfer of states in each validator. The state transition diagram for each validator is shown in Fig. 20. A new proposer is chosen at the start of each round to proposing a new block. Before being committed to the blockchain, the proposed block has to go through two-stage voting. When a validator receives a proposed block, it first validates it, then prevotes if everything looks OK. The validator provides a special vote called prevote nil if the block is not received within the proposal timer or if the block is invalid. The validator then waits for the prevote interval to arrive in order to obtain prevotes from the supermajority (+2/3) of validators. A +2/3 votes indicates that the supermajority validators have voted for the proposed block, suggesting their trust in it, and is referred to in Tendermint as a Polka. The validator precommits the block at this point. If the validator does not get enough prevotes for the proposed block, it sends a precommit nil special vote. The validator then waits for +2/3 precommits from the supermajority of validators during the precommit time period. It commits the block to the blockchain after it is received. If +2/3 of the precommits are not received within the precommit period, the next round starts and the processes are repeated with a new proposer [47].

Wait for pre-commit from +2/3

+2/3 Pre-Commit for Block

Propose Block

+2/3 Pre-Vot for Block

Wait for pre-vote from +2/3

Pre-Commit Nil

Commit New Round

Pre-Vote Nil Invalid Block or Not Recived in time

Propose New Hight FIG. 20 Tendermint consensus diagram.

Valid Block

Propose Block

164 SECTION

A Evolution of distributed systems

3.9 Raft algorithm The Raft consensus mechanism is based on the “leader-election” model and is a CFT protocol. Raft achieves consensus by selecting a leading node to accept and replicate incoming entries from clients. The protocol is divided into three phases, allowing for a strong and very well leader election. The leader election, log replication, and safety are the three steps. In Raft, time is divided into arbitrary periods known as “terms,” with each term being defined by an increasing number. Each node in Raft is either a leader, a follower, or a candidate, and each node is hierarchically ranked in different states. The protocol’s primary entity is the leader, who is elected per channel with the task of communicating with clients and then replicating their entries to their synchronized followers via systematic “heartbeats.” If the leader crashes, at least one of its followers will notice the divergence, cast a vote to the network, and attempt to take its place. Some nodes may fight for votes from other nodes in order to win the election process. Therefore, these nodes are considered “candidates” [48]. Each server participating in the protocol can only take one of the following roles at a time (Fig. 21): l l

l

Follower: Followers do not initiate communication and simply reply to RPCs. Candidate: Candidates begin a new election by increasing the term length, seeking a vote, and casting their vote for themselves. Become leader, follower (get outvoted or accept RPC from valid leader), or restart these procedures depending on the election’s outcome (within a new term). Only a candidate with a log including all committed commands is eligible for the position of leader. Leader: The leader sends heartbeats (empty AppendEntries RPCs) to all followers, thereby preventing timeouts in idle periods. For every command from the client, append to local log and start replicating that log entry; in case of replication on at least a majority of the servers, commit, apply committed entry to its leader state machine, and return the result to the client. If the log index is higher than the next index of a follower, append all log entries at the follower using RPC, starting from his next index [49].

Raft consensus algorithm works in broadly two stages: l

l

l

Leader election: The heartbeat of a leader is sent to follower nodes as authority to sustain clusters. While waiting for a response in the form of heartbeats from a leader, it will consider when it is real time. The node switches to candidate mode and makes a Remote Procedure Call request. It passes through three stages: The candidate node will become the leader if it receives many vote values from the cluster nodes. Other servers of the new leader become initiated as time passes by receiving heartbeats from their leader. Candidates who ran for leader but did not get a large number of votes in the election are relegated to the follower state. If the other candidate’s nodes earn fewer votes than the leader, they keep their candidate status and are rejected by the remaining cluster nodes via the Remote Procedure Call [50]. Log replication: To better understand the beginning level audience, the client’s scope is limited to writing requests. The leader’s logs are replicated, or exact copies are sent to other nodes (followers) when the logs are complete with requests from clients. Log access often includes the following: l The value of the command that the client wants to run. l Determine the location of the entry in the node’s log. l The command’s execution time.

Time out, New election

Start

Follower

Time out, Starts election

Candidate

Discover current Leader or new term Discovers server with Higher term FIG. 21 Raft algorithm diagram.

Receives votes from Majority of servers

Leader

Blockchain consensus algorithms Chapter

9

165

The leader node synchronizes the current leader entries with their logs to all other services. Until the user’s client replicates. The customer requests that their entries be sent to their superiors. When many servers in a cluster successfully copy new entries into their logs, this is referred to as a committed state. After the entry has been committed, the leader will execute the entry and respond with the client’s reply. It should be noted that these entries are processed in the order in which they are received. As a result, this state is an entry committed algorithm [51].

3.10 Ripple protocol consensus algorithm (RPCA) The Ripple [52] consensus protocol was designed to provide better security and a robust real-time cryptocurrency-based network for sending remittances without the need for smart contracts to be developed. Each node in RPCA has a unique node list (UNL), a group of trustworthy validators specifically configured to participate in the consensus process. In Ripple’s vast network, trust does not imply that the set belonging to each node’s UNL is trustworthy, but rather that this set will act honestly and that the nodes included in each node’s UNL are not intended to collude with one another, break the protocol’s rules, or manipulate the network with positive votes on malicious transactions. Each node listens to its trusted validators, but if a set of transactions cannot be agreed upon, the node’s proposals are adjusted to reflect the trusted validators’ suggestions. In order to reach an overall consensus, RPCA requires that at least 15 of nodes in each node’s UNL be defective. The ripple protocol consensus algorithm (RPCA) is used by all nodes every few seconds to ensure the network’s accuracy and agreement. The current ledger is considered “closed” and becomes the last-closed ledger if consensus is obtained. The last-closed ledger maintained by all nodes in the network will be identical if the consensus algorithm is successful and there is no fork in the network. The RPCA proceeds in rounds. In each round [53]: 1. Initially, each server makes public in the form of a list known as the “candidate set” all valid transactions it has seen before the start of the consensus round that has not yet been applied (these may include new transactions initiated by the server’s end users, transactions held over from a previous consensus process, etc.). 2. The candidate sets of all servers on the UNL are then merged, and each server votes on the validity of all transactions. 3. Transactions that receive more than a certain proportion of “yes” votes go to the next round, if there is one, while those that do not receive enough votes are either deleted or added to the candidate set for the next ledger’s consensus process. 4. A minimum of 80% of a server’s UNL agreeing on a transaction is required in the last round of consensus. All transactions that match this criterion are recorded in the ledger, closed and replaced by the new last-closed ledger. Ripple’s consensus is achieved between the verification nodes. A list of trusted nodes named UNL is preconfigured on each verification node (unique node list). As illustrated in Fig. 22, the nodes in the list can vote on a specific transaction. The identity of the voting node is known to the user in Ripple’s consensus method, as illustrated in the algorithm flow of Fig. 23. As a result, the method is more efficient than anonymous consensus algorithms like the PoW above, and the transaction confirmation time is only a few seconds. This, however, means that the consensus process is only appropriate for the Permissioned Chain, which is the local blockchain scenario. The Byzantine Fault Tolerance (BFT) capacity of the Ripple ConÞ sensus Algorithm is nðn1 2 . It can tolerate Byzantine faults in 20% of the nodes in the network without compromising the final correct consensus [10]. Many authentication methods used in certification agreements based on Swarm Intelligence are Ripple’s consensus algorithm variants.

Application

Tracking Node

Validating node

Validating node Validating node

Validating node

Validating node

Tracking Node

Application

FIG. 22 Node interaction in the Ripple consensus process.

166 SECTION

A Evolution of distributed systems

Other verification nodes

Other verification nodes

Other verification nodes

Other verification nodes

Transaction Proposal

Client

Transaction

Trading candidate set ( more than 1% of votes, t increased from 50 to 80)

Transaction candidate set

Trading candidate set ( Acquired more than 80% of votes)

Finally close the ledger

Transaction Proposal (Send to other nodes)

Verify Node

FIG. 23 Ripple consensus algorithm.

4.

DAG-based consensus algorithms

The third group is DAG-based consensus, which is a new class of consensus algorithms. These algorithms allow several different blocks to be published and recorded simultaneously on the network. In this section, we will introduce DAG-based consensus.

4.1 Tangle IOTA, a cryptocurrency for the Internet of Things, is built on the mathematical foundation of Tangle [54]. As a DAG-based ledger for recording transactions, Tangle allows various branches to merge into the chain over time, resulting in significantly better overall throughput than PoW and PoS. In Tangle, any new transaction must approve several previous transactions to get access to the network as a new block. The sooner transactions can be verified, the greater the transaction arrival rate. Furthermore, solid professional miners are not required in Tangle because the workload required to produce a new block is low. Some basic concepts in Tangle are listed as follows and also illustrated in Fig. 24. Block: All of the blocks in Fig. 24 provide storage units for data like transactions, digital signatures, and hash values. In Tangle, a block is simply referred to as a transaction because it records one transaction. Tip: It refers to a transaction (or block) that has yet to be approved. Each edge in Fig. 24 represents an approval; a direct edge denotes direct approval, while a path connecting two transactions with many hops shows indirect authorization. Own weight: A transaction’s own weight is proportional to the amount of effort its issuer puts in. Indirect Approval

9

6

Cumulative Weight

2

1 11

7

4

1

8 3

2 Direct Approval

FIG. 24 An example of consensus process in Tangle.

Tip Confiremed UnConfiremed

Blockchain consensus algorithms Chapter

9

167

Cumulative weight is the total of a transaction’s weight plus the own overall weights of the transactions that approve it directly or indirectly. The confirmation level of a transaction in the Tangle network is indicated by cumulative weight. The main procedures are listed in issuing a new transaction and letting the other nodes accept it (i.e., reach an agreement for the consensus). 1. To store the new transaction, a node constructs a storage unit. 2. Using the Markov Chain Monte Carlo (MCMC) tips selection method [55], the node picks two no-conflict tips and stores the hash of the selected tips in its storage unit. 3. The node uses a nonce to solve a cryptographic problem to satisfy the difficulty target, which is comparable to PoW but with a low difficulty of work to prevent spamming. 4. The node signs the new transaction with its private key and broadcasts it to others. 5. When the other nodes get it, they use the digital signature and nonce to decide whether it is legal.

4.2 Hashgraph Hashgraph [56] is a proposed consensus algorithm for replicated state machines that ensures Byzantine Fault Tolerance, asynchrony, decentralization, no PoW, ultimate consensus with probability one, and fast performance. Hashgraph has two essential components: the gossip protocol and virtual voting. All users will know every transaction via the gossip protocol. After that, a virtual voting method will be used to agree on the sequence of transactions. In order to get a better understanding of Hashgraph, we will briefly introduce how the gossip protocol and virtual voting work. According to the gossip protocol, each Hashgraph user should pick another user at random every fixed interval to announce all the transactions it is aware of. All participants in this manner will eventually know every event. It is worth noting that the gossip protocol is a low-cost technique; the overhead to exchange a storage unit, which contains positional information (3–6 bytes), signature (64 bytes), and transactions inside the unit, is quite minimal (about 100 bytes). The system must first choose “famous witnesses” via virtual voting (all users perform the voting algorithm based on the graph connectivity) to reach a consensus. The famous witnesses are chosen among the witnesses who appear first in each round. Voting and checking are both parts of the election process. All users will accept the creation time of the confirmed events, which will serve as proof to avoid double-spending [57].

5. Comparative evaluation and future trends of consensus algorithms Because of its high levels of security, immutability, and decentralization, blockchain technology has found a number of uses in recent years, and blockchain provides a wide range of applications [58]. As previously said, the key aspect of a blockchain is the consensus process used to establish an agreement. For this purpose, many algorithms have been devised, and the three main groups of consensus algorithms (Proof-based consensus, Voting-based consensus, and DAG-based consensus) are reviewed in Sections 2, 3, and 4. Numerous researches have been conducted to examine the security, scalability, efficiency, and uses of these algorithms in solving real-world issues. We gave Taxonomy and comparison in Table 1 based on the facts mentioned in the previous sections in order to further examine the consensus above techniques. As previously stated, each of these algorithms was developed for a specific goal, and each has its own set of benefits and drawbacks. Some of them, such as PoW, PoS, and DPoS, are specifically designed to make it impossible for an attacker to successfully carry out a Sybil assault. Others seek to address flaws in well-known consensus algorithms; for example, PoI algorithms seek to resolve concerns with the proof-of-stake model by ascertaining an account’s overall support for the network. [59]. The PoI consensus algorithm surpasses the other approaches because to its safety against 51% and double-spending attacks, decentralized structure, energy efficiency, and quick and scalable structure, as shown in Table 1. Furthermore, despite the fact that DAG is not a consensus technique, blockchains based on it function admirably across the board. As a result, consensus algorithm-based blockchains should evaluate and contrast their criteria with DAG-based blockchains. PoC fits the same conditions as PoW; however, it is quicker and uses less energy. dBFT has a more centralized structure than its related algorithm, PBFT. Each of the other algorithms in this table has its own set of benefits and drawbacks, and none of them is still touted as the greatest and final solution to the consensus problem. For permissioned blockchains, various consensus protocols with good trade-offs between consensus protocol parameters (energy consumption, scalability, finality, tolerated adversary, and throughput) have been proposed.

TABLE 1 Taxonomy and comparison of blockchain consensus algorithms. Taxonomy of consensus algorithms Proof-based consensus

Votingbased consensus

Consensus name

Designing goal

Decentralization level

Permission model/node identity management

Electing miners/ verifiers based on

Energy efficiency

PoW

Sybil-proof

Decentralized

Permissionless

Work (hash)

PoS

Energy efficiency

Semicentralized

Permissionless

PoET

Safety

Semicentralized

PoWeight

Customization and scalability

PoC

Scalability

%51 Attack

Double spending attack

Hardware dependency

Speed

No

Strong

Vulnerable

Vulnerable

Yes

Slow

Stake

Yes

Strong

Vulnerable

Difficult

No

Fast

Permissionless

Work (hash)

Yes

Strong

Safe

Difficult

Yes

Fair

Decentralized

Permissionless

Weight

Yes

Strong

Safe

Difficult

No

Fast

Less energy than PoW

Decentralized

Permissionless

Work (hash)

Fair

Strong

Vulnerable

Vulnerable

Yes

Slow

PoA

Benefits of both Pos and PoW

Decentralized

Permissioned

Vote and work

No

Strong

Safe

Vulnerable

Yes

Fair

PoI

Improve PoS

Decentralized

Permissionless

Importance scores

Yes

Strong

Safe

Safe

No

Fast

PoB

N/A

Decentralized

Permissionless

Burnt coins

No

Medium

Vulnerable

vulnerable

No

Fast

DPoS

Organize PoS effectively

Semi-centralized

Both

Vote

Yes

Strong

Vulnerable

Vulnerable

No

Fast

PBFT

Remove software errors

Decentralized

Both

Vote

Yes

Low

Safe

Safe

No

Slow

IBFT

Provides instant finality

Decentralized

Both

Vote and PoA

Yes

Low

Safe

Safe

No

Fair

BFT-SMaRT protocol

Tolerate f Byzantine nodes

Decentralized

Both

Vote

Yes

Strong

Safe

Safe

No

Fast

VBFT

Combination of a PoS and a BFT protocol

Decentralized

Both

Vote

Yes

Strong

Safe

Safe

No

Fair

Raft

Safety

Decentralized

Permissioned

Vote

No

Medium

Safe

Safe

No

Fair

Paxos

Remove software errors

Decentralized

Permissioned

Vote

No

Low

Safe

Safe

No

Slow

DAG-based consensus

Tendermint

More efficient and secure than PoW

Decentralized

Both

Vote

Yes

Medium

Safe

Safe

No

Slow

DBFT

Faster PBFT

Semicentralized

Permissioned

Vote

Yes

Medium

Vulnerable

Vulnerable

No

Slow

Ripple

security and a robust realtime network

Decentralized

Permissioned

Vote

Yes

Strong

Safe

Safe

No

Fast

Tangle

Speed and scalability

Decentralized

Permissionless

N/A

Yes

Strong

Safe

Safe

No

Fast

Hashgraph

Speed

Decentralized

Permissionless

N/A

Yes

Strong

Safe

Safe

No

Fast

170 SECTION

A Evolution of distributed systems

As a result, developing consensus protocols for public blockchains that achieve a balanced trade-off of these requirements remains a challenge. We propose the following areas for future trends of consensus Algorithms: 1. 2. 3. 4.

6.

Redesigning or enhancing alternative protocols so that they can be used in the real world. Using nontransferable incentives (such as reputation or familiarity) to adjust mining difficulty dynamically. Using the same simulation framework, such as BlockSim, to evaluate various protocols on the same system. Redesigning permissioned blockchain protocols such that they may be used on public blockchains and have desired characteristics.

Conclusions

Understanding the various consensus methods used in distributed networks is essential for increasing the performance of a blockchain network. Over the last decade, we have seen exponential increase in the development of blockchain technology and its applications in a variety of fields. In such distributed and decentralized systems, obtaining a single data value across all participants is a significant difficulty for sustaining the system’s credibility. This chapter’s main purpose was to showcase the most widely used established blockchain consensus approaches. In addition, we thoroughly analyzed the present literature on consensus algorithms in terms of its essential characteristics and direction, and we made recommendations for future study in this area.

References [1] G. Drosatos, E. Kaldoudi, Blockchain applications in the biomedical domain: a scoping review, Comput. Struct. Biotechnol. J. (2019), https://doi.org/ 10.1016/j.csbj.2019.01.010. [2] S.M.H. Bamakan, N. Faregh, A. ZareRavasan, Di-ANFIS: an integrated blockchain-IoT-big data-enabled framework for evaluating service supply chain performance, J. Comput. Design Eng. 8 (2) (2021) 676–690. [3] S.M.H. Bamakan, S.G. Moghaddam, S.D. Manshadi, Blockchain-enabled pharmaceutical cold chain: applications, key challenges, and future trends, J. Clean. Prod. (2021) 127021. [4] N. Kshetri, 1 Blockchain’s roles in meeting key supply chain management objectives, Int. J. Inf. Manag. 39 (2018) 80–89, https://doi.org/10.1016/j. ijinfomgt.2017.12.005. [5] H. Min, Blockchain technology for enhancing supply chain resilience, Business Horizons 62 (1) (2019) 35–45, https://doi.org/10.1016/j. bushor.2018.08.012. [6] D. Macrinici, C. Cartofeanu, S. Gao, Smart contract applications within blockchain technology: a systematic mapping study, Telemat. Inform. 35 (8) (2018) 2337–2354, https://doi.org/10.1016/j.tele.2018.10.004. [7] S. Haber, W.S. Stornetta, How to time-stamp a digital document, in: Paper Presented at the Conference on the Theory and Application of Cryptography, 1990. [8] S. Nakamoto, Bitcoin: a peer-to-peer electronic cash system, Decentralized Business Review (2008) 21260. https://klausnordby.com/bitcoin/ Bitcoin_Whitepaper_Document_HD.pdf. [9] F. Casino, T.K. Dasaklis, C. Patsakis, A systematic literature review of blockchain-based applications: current status, classification and open issues, Telematics Inform. 36 (2019) 55–81. [10] Z. Zheng, S. Xie, H. Dai, X. Chen, H. Wang, An overview of blockchain technology: architecture, consensus, and future trends, in: Paper Presented at the 2017 IEEE International Congress on Big Data (BigData Congress), 2017. [11] A. Panarello, N. Tapas, G. Merlino, F. Longo, A. Puliafito, Blockchain and IoT integration: a systematic survey, Sensors (Basel) 18 (8) (2018), https:// doi.org/10.3390/s18082575. [12] L. Lamport, R. Shostak, M. Pease, The byzantine generals problem, ACM Trans. Program. Lang. Syst. (TOPLAS) 4 (3) (1982) 382–401. [13] M. Salimitari, M. Chatterjee, An Overview of Blockchain and Consensus Protocols for IoT Networks, 2018. arXiv preprint arXiv:1809.05613. [14] C. Xu, K. Wang, M. Guo, Intelligent resource management in blockchain-based cloud datacenters, IEEE Cloud Comput. 4 (6) (2017) 50–59. [15] S.J. Alsunaidi, F.A. Alhaidari, A survey of consensus algorithms for blockchain technology, in: Paper Presented at the 2019 International Conference on Computer and Information Sciences (ICCIS), 2019. [16] C.T. Nguyen, D.T. Hoang, D.N. Nguyen, D. Niyato, H.T. Nguyen, E. Dutkiewicz, Proof-of-stake consensus mechanisms for future blockchain networks: fundamentals, applications and opportunities, IEEE Access 7 (2019) 85727–85745. [17] L. Ismail, H. Materwala, A review of blockchain architecture and consensus protocols: use cases, challenges, and solutions, Symmetry 11 (10) (2019) 1198. [18] I. Bashir, Mastering Blockchain, Packt Publishing Ltd., 2017. [19] L. Bach, B. Mihaljevic, M. Zagar, Comparative analysis of blockchain consensus algorithms, in: Paper Presented at the 2018 41st International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO), 2018. [20] Waves Docs, Leased Proof of Stake (LPoS), 2018, Retrieved from: https://docs.wavesplatform.com/en/platform-features/leased-proof-of-stake-lpos. html.

Blockchain consensus algorithms Chapter

9

171

[21] L. Chen, L. Xu, N. Shah, Z. Gao, Y. Lu, W. Shi, On security analysis of proof-of-elapsed-time (poet), in: Paper Presented at the International Symposium on Stabilization, Safety, and Security of Distributed Systems, 2017. [22] J. Buntinx, What is Proof-of-Weight? 2018, Available from: https://nulltx.com/what-is-proof-of-weight/#. (Reterived 31 March 2019). [23] Y. Gilad, R. Hemo, S. Micali, G. Vlachos, N. Zeldovich, Algorand: scaling byzantine agreements for cryptocurrencies, in: Paper Presented at the Proceedings of the 26th Symposium on Operating Systems Principles, 2017. [24] Protocol-Labs, Filecoin: A Decentralized Storage Network, 2017, Available from: https://filecoin.io/filecoin.pdf. (Reterived 31 March 2019). [25] Bitcoin-Wiki, Proof of Burn, 2018, Available from: https://en.bitcoin.it/wiki/Proof_of_burn. (Reterived 30 March 2019). [26] P4Titan, A Peer-to-Peer Crypto-Currency with Proof-of-Burn, 2014, Available from: https://github.com/slimcoin-project/slimcoin-project.github.io/ raw/master/whitepaperSLM.pdf. (Reterived 10 March 2019). [27] S. Dziembowski, S. Faust, V. Kolmogorov, K. Pietrzak, Proofs of space, in: Paper Presented at the Annual Cryptology Conference, 2015. [28] T. NEM, NEM Technical Reference, 2018. https://nem.io/wpcontent/themes/nem/files/NEM_techRef.pdf. [29] A.N. Nikolakopoulos, J.D. Garofalakis, NCDawareRank: a novel ranking method that exploits the decomposable structure of the web, in: Paper Presented at the Proceedings of the Sixth ACM International Conference on Web Search and Data Mining, 2013. [30] I. Bentov, C. Lee, A. Mizrahi, M. Rosenfeld, Proof of activity: extending Bitcoin’s proof of work via proof of stake, IACR Cryptol. ePrint Arch. 2014 (2014) 452. [31] G. Hardin, The tragedy of the commons, Science 162 (3859) (1968) 1243–1248. [32] D. Larimer, Delegated Proof-of-Stake (DPOS), Bitshare Whitepaper, 2014. Available from: http://docs.bitshares.org/bitshares/dpos.html. (Reterived 31 March 2019). [33] L. Lamport, Paxos made simple, ACM Sigact News 32 (4) (2001) 18–25. [34] W.-C. Shi, J.-P. Li, Research on consistency of distributed system based on Paxos algorithm, in: Paper Presented at the 2012 International Conference on Wavelet Active Media Technology and Information Processing (ICWAMTIP), 2012. [35] M. Castro, B. Liskov, Practical byzantine fault tolerance, in: Paper Presented at the OSDI, 1999. [36] F.B. Schneider, Implementing fault-tolerant services using the state machine approach: a tutorial, ACM Comput. Surv. (CSUR) 22 (4) (1990) 299–319. [37] Q. Wang, R. Li, S. Chen, Y. Xiang, Formal Security Analysis on dBFT Protocol of NEO, 2021. arXiv preprint arXiv:2105.07459. [38] H. Moniz, The Istanbul BFT Consensus Algorithm, 2020. arXiv preprint arXiv:2002.03613. [39] A. Bessani, J. Sousa, E.E. Alchieri, State machine replication for the masses with BFT-SMART, in: Paper Presented at the 2014 44th Annual IEEE/ IFIP International Conference on Dependable Systems and Networks, 2014. [40] E. Alchieri, F. Dotti, O.M. Mendizabal, F. Pedone, Reconfiguring parallel state machine replication, in: Paper Presented at the 2017 IEEE 36th Symposium on Reliable Distributed Systems (SRDS), 2017. [41] J. Sousa, A. Bessani, From Byzantine consensus to BFT state machine replication: a latency-optimal transformation, in: Paper Presented at the 2012 Ninth European Dependable Computing Conference, 2012. [42] C. Cachin, Yet another Visit to Paxos, IBM Research, Zurich, Switzerland, 2009. Tech. Rep. RZ3754. [43] Wang, G. SoK: Understanding BFT Consensus in the Age of Blockchains, n.d. [44] A. Aggarwal, S. Gaba, M. Mittal, A comparative investigation of consensus algorithms in collaboration with IoT and blockchain, in: Transforming Cybersecurity Solutions Using Blockchain, Springer, 2021, pp. 115–140. [45] J. Kwon, Tendermint: consensus without mining, Draft v. 0.6, Fall 1 (11) (2014). https://www.weusecoins.com/assets/pdf/library/Tendermint% 20Consensus%20without%20Mining.pdf. [46] E. Buchman, Tendermint: Byzantine fault tolerance in the age of blockchains (Doctoral dissertation, University of Guelph), 2016, https://atrium.lib. uoguelph.ca/xmlui/handle/10214/9769. [47] M.S. Ferdous, M.J.M. Chowdhury, M.A. Hoque, A. Colman, Blockchain Consensus Algorithms: A survey, 2020. arXiv preprint arXiv:2001.07091. [48] T.S. Kumar, V.I. Indrani, Analysis of raft consensus algorithm, Int. J. Innov. Res. Eng. Manag. (IJIREM) (2020). ISSN: 2350-0557. [49] H. Howard, ARC: Analysis of Raft Consensus, 2014. Retrieved from: https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-857.pdf. [50] L. Lamport, Time, clocks, and the ordering of events in a distributed system, in: Concurrency: The Works of Leslie Lamport, 2019, pp. 179–196. [51] B.W. Lampson, How to build a highly available system using consensus, in: Paper Presented at the International Workshop on Distributed Algorithms, 1996. [52] D. Schwartz, N. Youngs, A. Britto, The ripple protocol consensus algorithm, Ripple Labs Inc White Paper 5 (8) (2014) 151. [53] I. Kotilevets, I. Ivanova, I. Romanov, S. Magomedov, V. Nikonov, S. Pavelev, Implementation of directed acyclic graph in blockchain network to improve security and speed of transactions, IFAC-PapersOnLine 51 (30) (2018) 693–696. [54] S. Popov, The Tangle, Whitepaper, 2018, 2017. https://iota.org/IOTAWhitepaper.pdf. [55] Q. Bramas, The Stability and the Security of the Tangle, 2018. Retrieved from: https://hal.archives-ouvertes.fr/hal-01716111. [56] L. Baird, The Swirlds hashgraph consensus algorithm: fair, fast, byzantine fault tolerance, in: Swirlds Tech Reports SWIRLDS-TR-2016-01, Tech. Rep., 2016. [57] K. Crary, Verifying the Hashgraph Consensus Algorithm, 2021. arXiv preprint arXiv:2102.01167. [58] S.M.H. Bamakan, A.B. Bondarti, P.B. Bondarti, Q. Qu, Blockchain technology forecasting by patent analytics and text mining, Blockchain Res. Appl. 2 (2) (2021) 100019. https://www.sciencedirect.com/science/article/pii/S2096720921000142. [59] S.M.H. Bamakan, A. Motavali, A.B. Bondarti, A survey of blockchain consensus algorithms performance evaluation criteria, Expert Syst. Appl. 154 (2020) 113385.

This page intentionally left blank

Chapter 10

A systematic study on the development of decentralized application (dApp) Ananya Banerjee Department of Computer Science, Kalyani Government Engineering College, Kalyani, West Bengal, India

1. Introduction We are all aware of what an app is and why we use it nowadays. However, in today’s society, another term, dApp, has become quite popular. Decentralized applications are considerably more powerful than centralized applications in aspects such as cost, security, ownership, transparency, immutability, consistency, integrity, and availability. Therefore, one question that may arise in our minds is what is a dApp and why do we require it. Digital applications or programs that run on a peer-to-peer network of computers rather than a single [1] computer are known as decentralized apps (dApps). The major advantage is resilience to censorship since no single entity controls it. It is not reliant on a server, which may crash and cause data loss. There will be no downtime or restrictions as a result of this. Now we must determine why a dApp is preferable to an app. The term “Decentralization” in dApps is an important distinction between dApps and apps. DApps move an application’s focus and actual implementation away from a centralized network and onto a decentralized network. The majority of the app’s resources are controlled and delivered from a single location. Users have no control over any element of dApp’s performance. End users now have access to the blockchain network through a decentralized server network. Now we have a good understanding of what a dApp is and why it is important, we need to know where the research on the topic stands, i.e., to what degree this topic is already well known and will serve as a starting point for the future decentralized application research. The article [2] took a look at the current status of dApps and discussed the path of blockchain development to meet the desired features of dApps, which will provide readers with an overview of dApp research and keep them up to date on the latest blockchain advancements. The popularity [3] of dApps has previously been examined, and the patterns of how smart contracts are arranged in a dApp have already been summarized. The descriptive study of the dApps was the major emphasis of this work. The paper [4] suggested various implications for dApp consumers in terms of selecting appropriate dApps, dApp developers in terms of improving dApp efficiency, and blockchain suppliers in terms of improving dApp support. In the healthcare area, the article [5] already offered assessment measures to analyze blockchain-based dApps in terms of practicality, expected capabilities, and compliance. After reviewing the literature, it is obvious that while dApp ideas are explored in terms of many domains such as trust systems, IoT-based dApps, healthcare, and so on, information for ultimate dApp creation is nowhere to be found.

1.1 Background DApps are totally open-source applications [6] that are created on distributed platforms with trust dispersed among their users. This implies they are built to eliminate single points of failure while also being more visible and responsible than traditional apps. Furthermore, typical apps run on a single network of computers, but dApps function on a decentralized, peer-to-peer network that no single organization has total control over. Even if just one node in the network is online, it will execute its purpose. To summarize, the following are the facts concerning dApps: l l l l

Computer apps that operate on a distributed network are known as decentralized apps, or dApps. They do not have a “central authority,” and their performance is entirely dependent on their user community. Users install software created by the developer firm on their devices that performs a specified purpose. The performance of dApps is also influenced by the devices used by users.

Readers may be asking why we utilize dApp at this point. Many of us who use apps on a daily basis are aware that many of our digital assets do not genuinely belong to us and are under the authority of the app’s proprietors. For example, the Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00009-7 Copyright © 2023 Elsevier Inc. All rights reserved.

173

174 SECTION

A Evolution of distributed systems

information we post to websites might be quickly removed or blocked by the web host, and we have no control over how these programs utilize our data. Core components of the program are executed on a distributed network that is publicly available and viewable by anybody having distributed platforms. Users utilize private keys to provide ownership over digital assets and tokens on this network, allowing them to have complete control over their digital assets and tokens. Users have complete control and power over these assets. Other dApp developers may build competing products that connect into this distributed network, offering customers greater choice and flexibility over how they engage with these apps. DApps [7], in a nutshell, give consumers back control. Here, Table 1 depicts the differences between application (app) and decentralized application (dApp). Below Figs. 1 and 2 depict the app vs. dApp scenario diagrammatically.

TABLE 1 App vs. DApp. App vs. DApp Parameter

Application (App)

Decentralized application (DApp)

Presence of intermediaries

Traditional apps must entrust money transactions to a trustworthy third party.

DApp abolishes the intermediaries and store transaction within itself.

Compatibility

One app to another connectivity requires permission and if both the apps are homogeneous then they are compatible otherwise throw incompatible exceptions.

DApps on blockchain are simply integrated and intercompatible.

Fault tolerance

Suffers from single point failure.

Can tolerate multiple failure. Failure of one node does not hamper the entire network action.

Efficiency

Single-server efficiency is less compared to multiple ones. Thus, these systems are susceptible to DDoS attacks.

Computational capacity is higher and thus highly efficient.

Security

Less secure

Highly secure with the power of cryptography.

Tamperproof

Data can get hacked/altered.

Data stored on an immutable blockchain cannot get irreversible and unaltered.

Transparency

Less transparent

Higher transparency achievable through blockchain shared ledger data structure.

Cost

Incurred more cost for server maintenance and third party intervention.

Abolition of third party cut down the overall system cost.

Control

System control resides to single authority.

All nodes can store and validate transaction, i.e., no single coordinator is present. All nodes work together to achieve a common goal.

Scalability

Increase of user must increase in the server capacity.

Network capacity gets increased automatically if the user base is increasing in nature.

App

App

ISP

http protocol

App

ISP

ISP

Centralized Server

Single point storage FIG. 1 Centralized App.

App

ISP

http protocol

A systematic study on the development of decentralized application (dApp) Chapter

10

175

Start Anonymous entry Selective Endorsement policy Yes Approved?

Allow to enter in to the network

No Block anonymous user entry

End FIG. 2 Decentralized App.

DApp features So, let us talk about some of the characteristics of a dApp, and how any app that meets these criteria qualifies as a dApp. l

l

l

l l

l

Decentralization and data ownership: On the blockchain, a dApp is a program that runs. A dApp [8] must function on a blockchain network rather than a centralized server since all activity and data must pass through a distributed network of machines/nodes. There is not a single point of failure in their system. Open source and autonomous: DApps are open source and run independently, with no single individual or organization in possession of the majority of tokens. The majority of decentralized apps are open source. The source code of such an app may be viewed by everyone, which promotes trust in it. Although one does not need to open source their code in order to create a dApp, it is a frequent practice. Many dApps, and particularly dApp developers, do not control the data of their users. Users have the option of owning their data and sharing it with other dApps or completely removing it from the ecosystem. Tokenization: To offer value to their contributing users or nodes, dApps create dApp tokens. DApps operate on blockchains, allowing them to easily supply some type of valued asset, such as tokens, that may be used as currency and enabling apps that need the exchange of value. For such objectives, traditional programs would need to create bank or card transactions and keep your money in their wallets. Users can access some services by using dApps’ own digital currency (tokens). DApps, on the other hand, allow users to keep their money/rewards in their own wallets. Accessibility: In return for tokens, users receive access to the dApp. Incentivazation: When miners/validators successfully contribute to the blockchain-based decentralized system, they are rewarded with tokens. Distributed consensus: Any distributed system’s principal goal is to reach a consensus on whether to complete or abandon a job. The cost component increases exponentially when the rollback order is increased. In a perfect system, where there are no flaws, achieving this form of agreement is simple. Decentralized consensus is used to make all network decisions, including the validation of transactions. DApp community must agree on a cryptographic technique to demonstrate evidence of value, such as proof of work (PoS) or proof of stake (PoS) (PoW). Here, Fig. 3 illustrates the common characteristics of dApp.

176 SECTION

A Evolution of distributed systems

Data repository

Data repository

Dapp

Dapp

Data repository

Dapp

Dapp

P Bl eer oc to kc p ha ee in r Ne tw or

Dapp

Data repository

Data repository

k

Dapp

Data repository

FIG. 3 DApp characteristics.

Benefits of dApp A decentralized application (dApp) is one that runs on a decentralized network and is not controlled by a single administrator. It runs on a peer-to-peer network and uses blockchain technology. It links users with providers directly. Individual data ownership and control is becoming increasingly important in both the digital economy and larger society. DApps [6–8] provide a technology that allows data to be published in an unaltered state, accessible to everybody, held by the original owner, and impossible to be acquired by a centralized entity. DApps are also secure and cannot be tampered with as a result of this. Here is a rundown of some of the major benefits of distributed apps. In Fig. 4, advantages of dApp are shown pictorially. l

l

l

l

l

Security/confidentiality: A dApp’s main advantage is its high level of security. The data is dispersed to all nodes in the network since it is operated on the blockchain. Furthermore, transactions on the blockchain are permanent; this implies that all transactions remain accumulated indefinitely and cannot be altered, resulting in more secure data security. Transparency of data has been enhanced: Data transparency is the second and most critical feature of dApps. The data in the distributed app is saved on a distributed network, which means it exists on numerous machines at the same time. Only users that are connected to the dispersed network have access to the data. As a result, data kept on the distributed ledger is more transparent, and no one can delete or alter a record without the approval of all network members. No single point failure/fault tolerance: Because no one node controls the data transaction or data records in this P2P decentralized network, fault-tolerant dApps do not have a single point of failure. Its dispersed character significantly confirms this. Abolition of third party: Abolition of third party leads to financial improvements and cost efficiency and makes the overall system faster. Blockchain technology enables businesses and people to conduct transactions directly with end users, without the need for a middleman. It reduces people’s reliance on financial institutions/banks while also improving the country’s financial efficiency. Because a decentralized system eliminates the need for a third party, transactions are faster and less expensive. Furthermore, because there is no central data center to store all of the data, dApps are resistant to downtime and physical outages. As a result, the user may conduct business at any time, in a quick and cost-effective manner. Tamperproof: Because a dApps network has no central regulating authority, it is able to control and avoid Internet Censorship violations. Manipulation of data sets in an individual’s benefit is nearly difficult. This implies that no one, not

A systematic study on the development of decentralized application (dApp) Chapter

10

177

FIG. 4 Dapp advantages.

l

even government authorities, may attempt to stop a dApp because dApps are decentralized and do not rely on a specific IP address. Immutable and trustworthy: Users have more confidence and trust in dApps since they are not owned by a single business and their data will not be stolen or corrupted.

Examples of dApp With the introduction of peer-to-peer (P2P) networks, the first decentralized apps developed. Decentralized programs that operate on P2P networks include BitTorrent, Popcorn Time, and Tor. However, it was with the advent of blockchain technology that dApps took off. In a strict sense, cryptocurrencies, such as Bitcoin, are examples of decentralized applications. l

l

l

l

l

l

Bitcoin: Technically, Bitcoin [9] was the first DApp. Bitcoin provided a blockchain network that allowed individuals to conduct decentralized transactions. Despite the fact that Bitcoin was the initial DApp, Ethereum is the blockchain network most closely connected with dApps. Although the Bitcoin blockchain is not as user-friendly as Ethereum’s in terms of developing dApps, the world’s first cryptocurrency’s fame has aided the development of various apps built on its blockchain. Factom is a decentralized network that uses the Bitcoin blockchain as its foundation. It is made to hold a limitless quantity of data that cannot be changed. The US Department of Homeland Security is one of Factom’s customers, and it uses the platform to store sensitive data. Golem: Golem is an open-source, decentralized supercomputer that can be accessed by anybody in the globe. The combined energy of all the computers that power Golem gives it its strength. Users can rent out their computer capacity to other users, perhaps resulting in a worldwide computing industry. Augur: Augur is a dApp that seeks to provide a trading profit predicting tool. This would be accomplished through the use of a decentralized network and prediction markets. Melonport: Melonport is a digital asset management platform that enables users to create or invest in digital asset strategies in a competitive and open environment. The program creates a track record that is auditable and accessible, allowing for a completely new approach to asset management. EtherTweet: EtherTweet is a similar-to-Twitter decentralized blogging platform. Content submitted on EtherTweet, however, cannot be erased because it is a DApp. As a result, using blockchain technology, it creates an unfiltered, immutable record of content publishing. Everipedia: Everipedia is a public, worldwide Internet encyclopedia based on wiki principles and includes free material. Everipedia moved to the EOS blockchain platform at the beginning of August 2018. As a result, it became the first decentralized encyclopedia in the world, making it immune to censorship.

178 SECTION

A Evolution of distributed systems

The Ethereum blockchain [10] is the parent of all of the aforementioned dApps except Bitcoin. Ethereum is an open-source, decentralized blockchain that enables users to build smart contracts.. The platform’s native cryptocurrency is ether. In terms of market capitalization, ether is the second most valuable cryptocurrency after Bitcoin. Vitalik Buterin, a programmer, invented Ethereum in 2013. Ethereum has its own programming language, solidity, and the network allows users to build smart contracts, which are self-executing digital copies of contracts with pre-programmed rules. DApps built on the Ethereum network have the potential to speed up development, improve security, and boost scalability.

DApp types Decentralized apps may be categorized into three groups based on the blockchain model [7] that is used: Type 1: This category includes dApps that have their own blockchain, such as Bitcoin and other alternative cryptocurrencies with their own blockchain. Bitcoin and Ethereum are examples of Type 1 category. Type 2: This sort of decentralized app makes use of the Type 1 app’s blockchain. These decentralized apps are protocols, and therefore require tokens to work. The finest example of a Type 2 application is the Omni protocol. Omni is a peerless, trustless, and easy-to-use distributed trading platform built on top of the Bitcoin blockchain as a layer to support peerless, trustless, and easy-to-use asset or value exchanges between participants without the use of middlemen. Augur is an example of this category. Type 3: The protocol used by Type 2 applications is used by Type 3 dApps. A Type 3 dApp is the SAFE Network (where SAFE stands for Secure Access for Everyone). It is a decentralized data storage and communications network that uses its members’ extra computer power to replace data centers and servers. It may also be thought of as a self-contained data network that allows for the building of censorship-resistant websites and apps. It makes use of the Omni protocol to create SafeCoins, which are then utilized to enable its functional components. Table 2 summarizes the dApp type in a tabular format.

Working principle of App vs. dApp Traditional applications are created by handcrafting [6] a user interface for the web, mobile, or desktop. Requests from the frontend are then sent to a single company’s or individual’s centralized server. Low-cost hosting, rapid running speeds, easy development, and a carefully regulated user experience are all advantages of centralization. Data is saved on behalf of the user within the dApp system in order for the app and all of its transactions to work correctly. Unlike a centralized database, which is owned and controlled by a single individual, the blockchain network is completely decentralized, meaning that it is run and viewed by all users on the ecosystem. This makes tampering with the data extremely difficult, while simultaneously allowing for maximal data visibility and ownership. Because dApps are open-source software, anybody may look at the code and contribute to it. They communicate with backend programming that runs on a decentralized blockchain, which records all of the transactions that occur inside it. dApps often employ a crypto token to power these transactions. Finally, dApps utilize a consensus technique, such as proof of work, proof stake, or others, to establish an agreement and complete a transaction. Here, Fig. 5 shows the architecture of dApp.

TABLE 2 Summary of dApp types. Parameter

DApp types

Type

Type 1

Type 2

Type 3

Platform

Own blockchain platform

Use the type 1’s blockchain platform.

Use the type 2’s blockchain platform.

Example

Bitcoin, Ethereum

Omni, Augur

SAFE Network

Application

Financial

Financial application with information of outside blockchain world.

Beyond financial sector such as energy distribution, governance, education, cloud storage, car rental etc.

A systematic study on the development of decentralized application (dApp) Chapter

10

179

Dapp features

Runs on Blockchain

Decentralization

Open source

No single point failure

Token-based reward Tokenization

FIG. 5 Simple dApp architecture.

1.2 Problem statement In this chapter, the problem statement will be developed based on concepts such as how to build a dApp, what steps are required to build it, what tools are available and suitable, and how a dApp can be created and effective in comparison to traditional app-based systems using a case study on a real-life problem. This chapter primarily focuses on fundamental dApp theoretical knowledge and how to apply it to dApp development. Any student who wants to know what a dApp is and how to make one would benefit from this chapter.

1.3 DApp development steps A dApp has three functionalities: frontend, smart contract and blockchain network. The frontend uses an API to interface with the smart contract. The smart contract’s code then picks and saves data on the blockchain’s decentralized network. Blockchain [11] opens us a myriad of possibilities for building applications in a variety of sectors, including Digital Objects, Video Streaming, Insurance, e-Commerce, and many more. In order to create an efficient and complex dApp for any feature, Ethereum dApp development follows a set of steps. The stages for developing a successful dApp on the platform are outlined below. Step 1: DApp frontend: A dApp must be open-source and self-contained, with no single company holding the bulk of cryptocurrency tokens. Smart contracts must be used in the backend code, which must operate on a decentralized blockchain. Create a dApp (frontend) for web or mobile app development on the Ethereum Blockchain. Step 2: Blockchain as platform: This tool is now part of the Truffle toolkit; it is simple to use and get started with thanks to a command-line interface (CLI). The program does not mine blocks by default; however, the CLI may be used to specify a block interval for development purposes. While there are several clients from which a developer may pick, “TestRPC” is recommended for a beginner dApp developer. Ethereum TestRPC is a blockchain replica that is quick and easy to customize. It lets one to make calls to the blockchain without incurring the costs of hosting an Ethereum node. Step 3: Communication with blockchain: here frontend, i.e., dApp gets communicate with blockchain, i.e., backend with the API web3.js. web3.js is a set of libraries that let one use HTTP, IPC, or WebSocket to communicate with a local or distant Ethereum node. Step 4: Smart contract creation: A smart contract is a computer program or transaction protocol that is designed to automate the execution, control, and documentation of legally significant events and activities in accordance with the conditions of a contract or agreement. Because smart contracts need “gas,” or a measure of computational power, a developer creating smart contracts must follow the following basic rules for effectiveness. Because the consequence of a smart contract is irrevocable, it is critical to code simple, error-free smart contracts. Simple computational logic uses less gas, and the code should be as simple as possible. The platform’s smart contracts are written in the solidity language. When triggered, smart contracts are programmed to execute based on a precondition. The code used to create business logic and functionality in Ethereum dApps is the most important aspect of the development process. Step 5: Deployment of smart contract: To deploy a smart contract, means just transmit an Ethereum transaction containing the smart contract’s built code to no one in particular. Truffle is a great tool for testing smart contracts since it allows the developer to keep all of her contracts in one place and blends in seamlessly with the testing framework. To make the deployment work, “TestRPC” must be executed in a separate window, which can be easily done with a config.js file. The “truffle test” script may perform regular tests and deploy contracts in the test environment. Step 6: Smart contract invocation: Applications use a smart contract to produce transactions that are then recorded on the ledger, which is a distributed ledger that maintains all of an organization’s transactions. These firms’ applications use this smart contract to complete an agreed-upon step in a business process. Smart contract calls must be in hexadecimal strings, although there are Ethereum contract “application binary interface” (ABI) libraries that can help.

180 SECTION

A Evolution of distributed systems

Step 7: Ethereum account setup: The developer will need to spend ether to execute the smart contracts, and she will need to open an account for this. Back to the truffle test, the developer can see ether transferring between accounts. Step 8: Transaction with smart contract: The developer must also pay fees to the miner, who keeps track of the network’s status and receives ether as payment. Someone has three options: one may send ether to another address, or one can run a contract function that will update the system and spend the ether. After all nodes (miners) affirm and establish an agreement after calculation, transactions are carried out. According to the proof-of-stake (POS) method, a mix of gas and ether, Ethereum’s native cryptocurrency, must be paid in order for the nodes to carry out the calculation.

DApp development tools l

l

l

l

l

l

l

Smart contract development [12] Languages: Solidity—The language of Ethereum smart contracts. Framework Truffle—The most widely used framework for developing, testing, and deploying smart contracts. Truffle, Ganache, and Truffle are all part of the Truffle suite (Truffle [13]). IDEs Remix—Remix IDE (remix.ethereum.org [14]) is an open-source application that allows one to build solidity contracts directly from your browser. It is developed in JavaScript and may be used in the browser, locally in the browser, or on a desktop computer. Visual studio code—Extension for Visual Studio Code [15] that provides solidity support, e.g., chai, mocha, etc. Atom—Atom [16] editor with packages such as Atom Solidity Linter, Etheratom, autocomplete solidity, and language solidity. Blockchain test network Ganache—Ganache [17] is an Ethereum emulator that speeds up, simplifies, and secures the development of Ethereum applications. It comes with all of the most common RPC functions and features (such as events) and can be executed deterministically, making development a snap. With a visible user interface and logs, this app allows one to test the Ethereum blockchain. Communication to Ethereum frontend API: web3.js [18]—The Ethereum JavaScript API links to the Generic JSON-RPC specification. To utilize this library, one must operate a local or remote Ethereum node. Out of box tools—Truffle Boxes [13] are useful boilerplates that let you to focus on the aspects of your dApp that make it stand out. Truffle Boxes can also contain additional useful modules, solidity contracts and libraries, frontend views, and more, all the way up to whole sample dApps, in addition to Truffle. Ethereum client—geth-Go Ethereum [19] is available as a standalone client named geth, which can be installed on almost any operating system, or as a library that can be integrated into any Go, Android, or iOS apps.

1.4 DApp development result and discussion Blockchain and smart contracts are enormous fields that require much more research. This chapter focuses on the development phase of dApps, smart contracts, and how they could be beneficial in the crowdfunding business. Crowdfunding is an excellent way to generate funds for a new company or initiative. There are a few problems in it. This chapter can emphasize such challenges and use them as the basis for the chapter’s recommended work, with the goal of resolving the problems outlined below. l

l

l

l l l

Trust—When it comes to crowdfunding, trust is perhaps the most important problem and hence needs a tamper-proof data structure to meet this demand. Choosing the right platform—appropriate asset management and control in an insecure and open to everyone environment. Realistic targets and deadlines—this may be achieved through legal contracts/agreements with other parties (to address this issue, a blockchain-based digital agreement is presented here that can be performed without the need for human interaction). Fulfillment—no provision for it in the budget. Forgetting to budget for shipping and packing (proposed method organized with if then else conditional form). Copyright issues—several authoritative domains that cannot trust one another can steal one others ideas (solve this issue proposed system must be distributed, tamper-proof, no central trusted authority exists).

A systematic study on the development of decentralized application (dApp) Chapter

10

181

Issues—There is no assurance that transactions will be completed. l l l

Why smart contracts remain sluggish, and scaling is a challenge. Public blockchains are fighting to maintain their decentralized nature. Oracles have the potential to destabilize the trust model.

Here, a discussion about the initialization of proposed work will take place, which will consist of multiple steps that will be discussed below; using this framework, anybody may build their own contract and dApp. Proposed methodology This section depicts the proposed framework’s overall operating concept, which is divided into many sections. They are discussing the following: Without any prior understanding of Crypto Primitives, anyone may develop their own contract and deploy it to the given network using the presented framework. The proposed contract was compiled by the stated compiler, and after deployment/migration to the specified host, port, and network id, it returned a summary of the total number of contracts deployed and the total cost incurred with this task. The proposed work is divided into four sections: private network creation, new smart contract creation, smart contract deployment to the private blockchain network, and dApp development. 1. Private network creation—The term “private network” refers to the construction of a network that is private in nature and restricts all of its permissions to the proposed framework, distinguishing it from other Blockchain networks. As a result, this method necessitates architectural specification. Because a private network limits access privileges to a single authority/organization, entity involvement may always be permission-based. This design enforces security using a multi-party consensus process, which removes massive anonymous entities, while the inclusion of preapproved entities improves transactional efficiency. This step entails the development of a private blockchain network as well as the imposition of new regulations on that blockchain. To build a private network that will limit all access rights, i.e., all permissions will be centralized in the suggested framework. It differs from other Blockchain networks in that it does not require permission to enter and code structure abuse is strictly forbidden. Here, Fig. 6 depicts the working policy of private blockchain architecture, which imposes the user access privileges for the proposed system. Process of private network creation—First start by establishing a new project and then populating it with folders such as contracts, migrations, test, and the config.js file. No need to connect any frontend to this at this time. It is a simple structure for creating a contract, deploying the contract, and testing the contract. As previously stated, this stage does not involve a web3 application, i.e., there is no interaction with the browser and no decentralized application development.

FIG. 6 Process flow diagram of proposed private blockchain network.

182 SECTION

A Evolution of distributed systems

2. DApp creation—The second part entails the deployment of decentralized applications and contracts on a private blockchain network. The creation and implementation of a decentralized application entails numerous processes, each of which is addressed separately below. 3. Smart contract creation. During this step, a smart contract may be created based on a need specification, and numerous solidity files are needed to build the smart contract code. 4. Deployment of smart contract to the private blockchain network. Following the development of the smart contract, another file is created that contains the deployment specification, which is a simple JavaScript file that deploys the smart contract. App folder: This folder contains everything related to web applications, including JavaScript files, style sheets, and index.html files. Contract folder: The solidity files in the contract folder are used to develop our new smart contract. The compilation and deployment of these newly formed smart contracts required some migrations files, such as the initial and deploy migrations files, which function in the same way as the solidity files artifacts are deployed to the underlying private network. Here, folder named test folders which contains all JavaScripts and solidity files as well as here configuration JavaScript file which tells us where it should deploy to such as host and port specification in the testing area where we can test our newly generated smart contract loyalty. Another file utilized here is web config.js, which is used to compile the JavaScripts as well as the web application and deploy it to a specific location called build folder. In a nutshell, the contract folder contains solidity files for creating smart contracts. While it works as if it takes the solidity files artifacts and delivers them to the underlying private network, compiling and deploying these newly formed smart contracts required some migrations files, such as initial and deploy migrations files. At the time of compilation of the proposed contract framework, the specified compiler is in charge of compiling the contracts and beginning the deployment and migration of the contract to the specified host, port, and network id, as well as providing a summary of the total number of deployments and final cost incurred with this task. The proposed work is based on a smart contract design approach that enables the development of crowdfunding as a use case utilizing blockchain technology. Smart contracts enable a decentralized ledger of all assets and transactions between startup consumers and individual investors that is safe, distributed, and shareable. The goal is to create a Kickstarter, which is an existing crowdfunding site that suffers from third-party interference, and our major goal is to eliminate such third-party intrusions totally. Because blockchain technology is still relatively new in the recent scenario, most of the parts of this new technology are changing on a daily basis, and as a result, version mismatch difficulties are present that may arise owing to beta versions of existing blockchain platforms. However, still successfully constructing smart contracts and Compilation, migrations, and testing, as well as creating private blockchains and in memory blockchain simulations using Ethereum TestRPC. This chapter is also aware with numerous web-based blockchain development platforms such as Remix IDE (online smart contract authoring editor), MetaMask, and Mist wallet, which are browser plugins for accessing Ethereum’s primary Blockchain network through user interface, with Mist providing e-wallet specifications.

Results Screenshots of proposed work are included in this section. Private blockchain creation Step 1: Create a new directory for workplace.. The commands listed below are utilized to do this. $mkdir ex-private network $cd ex-private network Step 2: Genesis file creation. The characteristics that define the blockchain are stored in a file called a Genesis file. A Genesis file is the starting point for every blockchain transaction. Step 3: Data directory instantiation. The data directory is where all of the information about the blockchain is kept. Run the following command to create the data directory. $geth init ./genesis.json –datadir mychaindata Here, Fig. 7 depicts the creation of private blockchain.

A systematic study on the development of decentralized application (dApp) Chapter

10

183

Decentralization Smart Contract Transparency Censorship

Fault Tolerant Dapp

Faster transaction settlement Data Integrity Immutable & Trust-worthy FIG. 7 Private blockchain creation output.

Mining process To perform the mining here, geth command-line options are used. Here, to perform the mining geth command-line networking option, –nodiscover is used to add peers manually. To unlock account, geth account unlock command is used as –unlock 0 to unlock a specified account, and to enable mining, geth mining option –mining is used here. Run the command below to perform mining. $geth –datadir ./mychaindata/ –nodiscover –unlock 0 –mine Here, Fig. 8 illustrates the mining process with output. Migration The smart contract will be deployed using this basic JavaScript code. While it works as if it takes the solidity files artifacts and deploys them, the compilation and deployment of these newly formed smart contracts required some migrations files, such as initial and deploy migrations files. Here, Fig. 9 describes the successful running output for migration test cases.

FIG. 8 Mining process output.

184 SECTION

A Evolution of distributed systems

Blockchain enabled Dapp

Back-end Wallet interface for user

Off chain data

Web3 provider

Front-end Blockchain platform

Data repository

Wallet address

Transaction

Smart contract

On chain data

Hash details

FIG. 9 Migration output.

Wallet interface To transfer some values from one account to another must need a wallet interface where two accounts must be present, one for sender and other for receiver account. In this step, following operations must be take place. l l l l l

wallet creation key generation creation of transaction testing of transaction transaction signing

Here, Fig. 10 depicts a simple wallet interface. Smart contract creation Step 1: go to Remix IDE to write smart contract code using solidity. Step 2: create a .sol extension file to write the required code for smart contract. Here, Fig. 11 gives an example smart contract using Remix IDE.

FIG. 10 Output of wallet interface.

A systematic study on the development of decentralized application (dApp) Chapter

10

185

FIG. 11 Smart contract creation using Remix IDE.

Smart contract testing Loyalty is tested in the smart contract component of the testing section. This section contains a number of test cases, such as those in which the initial value of a variable mentioned in the contract cannot be changed at any point. To check if the starting values are the same as the previous one or not, a simple checking constraint is used, which states that if the value is similar to the previously stated value, the test will pass the contracts connected with it, else an exception error will be thrown. Similarly, test cases might impose constraints on the initial variable’s type check. As test cases, any feasible circumstances linked with a given smart contract can be used. Here, Fig. 12A and B show the smart contract testing and ether transfer using smart contract which is shown in Fig. 12C. To perform Ether transfer using smart contract, following steps are needed. step 1: Using Remix IDE go to the MetaMask account step 2: Add some ethers to the MetaMask account step 3: Deploy the smart contract step 4: After successful deployment of smart contract, one can check the account status using etherscan. Ether Transfer using MetaMask Step 1: MetaMask wallet creation Step 2: Section of Test NZetwork Step 3: Addition of dummy ethers to the wallet Step 4: Using send option, one can send dummy ether to another account using MetaMask wallet. Here, Fig. 13 shows the ether transfer using MetaMask and accounts status in etherscan.

2. Implication Although much study has been conducted on this topic, there is insufficient developer knowledge. From a development standpoint, one must understand what environmental setup is required, as well as what tools are accessible and which tools are user-friendly. Based on this, the chapter attempts to construct its sections in such a way that they are not confined to dApp theory but also cover the fundamentals of dApp development from the primary to intermediate levels.

186 SECTION

A Evolution of distributed systems

FIG. 12 (A) Smart contract successful compilation. (B) Smart contract testing. (C) Ether transfer using smart contract.

A systematic study on the development of decentralized application (dApp) Chapter

10

187

FIG. 13 Ether transfer using MetaMask.

3. Conclusion This chapter has already completed the following tasks: dApp construction, smart contract generation and compilation, migrations and testing, as well as private blockchain creation and in-memory blockchain simulation using Ethereum TestRPC. Learners will also become familiar with various online web-based blockchain creation platforms such as Remix IDE (online smart contract writing editor), MetaMask, and Mist wallet, which are browser plugins for accessing the Ethereum main blockchain network via user interface and Mist provide e-wallet specifications. Here in this chapter, crowdfunding is taken as use case. Blockchain technology can act as a game changer to this sector. The call for financial specialist insurance and security in crowdfunding agreements could be replied by the presentation of the blockchain innovation. There are difficulties with crowdfunding comparable to manhandle, trust and privacy. In future, the technology could be used to execute crowdfunding contracts with more security can be imposed.

References [1] G. Ryan, Introduction to dapps j ethereum.org, Available at: https://ethereum.org/en/developers/docs/dapps/. (Accessed 9 August 2021). [2] W. Cai, et al., Decentralized applications: the Blockchain-empowered software system, IEEE Access 6 (2018) 53019–53033, https://doi.org/10.1109/ ACCESS.2018.2870644. [3] K. Wu, An Empirical Study of Blockchain-based Decentralized Applications, 2019, (July 2017). Available at: http://arxiv.org/abs/1902.04969. [4] K. Wu, et al., A first look at blockchain-based decentralized applications, in: Software: Practice and Experience, 2019, https://doi.org/10.1002/ spe.2751. [5] P. Zhang, et al., Metrics for assessing blockchain-based healthcare decentralized apps, in: 2017 IEEE 19th International Conference on e-Health Networking, Applications and Services, Healthcom 2017, December, 2017, pp. 1–4, https://doi.org/10.1109/HealthCom.2017.8210842. [6] C. Breed, What even is a DApp and why are they useful? j CENNZnet j Medium, Available at: https://medium.com/centrality/what-even-is-a-dappand-why-are-they-useful-10f64c13d454. (Accessed 29 October 2021). [7] StormGain, Decentralised app examples and explanations, Available at: https://stormgain.com/blog/dapps-what-are-decentralised-apps. (Accessed 29 October 2021). [8] OpenGeeksLab, An Essential Guide To DApp Development, Available at: https://opengeekslab.com/blog/dapp-development/. (Accessed 29 October 2021). [9] What are DApps and what are some examples? Available at: https://blog.liquid.com/what-are-dapps-and-what-are-some-examples. (Accessed 29 October 2021). [10] what is ethereum - Google Search, Available at: https://www.google.com/search?q¼what+is+ethereum&rlz¼1C1YTUH_enIN974IN974& oq¼wh&aqs¼chrome.2.69i59l4j35i39j69i60l3.2332j0j7&sourceid¼chrome&ie¼UTF-8. (Accessed 29 October 2021). [11] 101 Blockchains, Beginner’s Guide to DApp Development, Available at: https://101blockchains.com/dapp-development-guide/. (Accessed 29 October 2021).

188 SECTION

A Evolution of distributed systems

[12] GitHub, ConsenSys/ethereum-developer-tools-list: A guide to available tools and platforms for developing on Ethereum, Available at: https://github. com/ConsenSys/ethereum-developer-tools-list. (Accessed 29 October 2021). [13] Truffle Suite, Truffle Suite - Truffle Suite, Ganache one click blockchain, 2022, Available at: https://trufflesuite.com/ganache/. [14] remix.ethereum.org, Remix IDE, 2021, Available at: https://remix.ethereum.org/. [15] Download Visual Studio Code, Available at: https://code.visualstudio.com/download. [16] Atom, Available at: https://atom.io/. [17] TRUFFLE SUITE, Available at: https://trufflesuite.com/ganache/index.html. [18] ChainSafe/web3.js, Available at: https://github.com/ChainSafe/web3.js. [19] geth.ethereum.org, Available at: https://geth.ethereum.org/downloads/.

Chapter 11

AI, IoT, blockchain, and cloud computing: The necessity of the future Meghna Manoj Naira and Amit Kumar Tyagib a

School of Computing Science and Engineering, Vellore Institute of Technology, Chennai, Tamil Nadu, India, b Department of Fashion Technology,

National Institute of Fashion Technology, New Delhi, Delhi, India

1. Introduction: AI + IoT + blockchain + cloud computing Today we are living in an era, where almost of the applications are trying to shift toward using of Internet of Things (IoT) or Internet Connected Things. These technologies are changing the living style of human beings and make everyday life easier to live. As an application of IoT applications, IoT can be used in many applications like Healthcare, Agriculture, Transportation, Logistics, etc., but when these devices are used in healthcare service, they help healthcare professionals to take or care patients on time. On the other side, there are serval issues also raised with respect to these smart devices like security, privacy, trust, etc. Now on another technology, blockchain is a novel concept to provide decentralized and distributed structure, i.e., to communicate among all other peers. Blockchain is a most secured technology of current era, which work on distributed ledger concept. There is huge possibility of blockchain to integrate with IoT-based applications. On another side, IoTs can help a lot to artificial intelligence which provide autonomous structure and intelligence to do task efficiently. Also, IoT devices can share this data on Cloud side (depends on public/private/hybrid). Hence, these technologies can be introduced below as: l

l

l

l

Artificial intelligence (AI): AI is used to interpret and process data in IoT applications, including intelligent machineto-human decision-making capabilities. Artificial intelligence is when, in a way that seems intelligent, a machine can complete a series of tasks or learn from data. Therefore, as artificial intelligence is applied to the Internet of Things, it means that, without human intervention, these machines can interpret data and make decisions and act on that data. Internet of Things (IoT): For quite some time, the main components needed for IoT have existed and are now mature, such as the inexpensive sensors required to convert analog to digital, the reliable transmission networks, and the processing and decision-making of intelligent analytics. It is the whole stack coming together that has made it possible for IoT to become a trend. Blockchain: Blockchain is used for providing a decentralized and distributed platform for IoT applications. By setting up a harmonized digital network for IoT data open to multiple parties, blockchain technology may promote data standardization. Data is stored in one data format on blockchain networks because of the use of hash functions. Data will then be highly standardized. Cloud computing: Cloud computing, also simply referred to as “cloud,” is a collection of internet-connected servers and computers that create a vast distributed system that can provide on-demand internet services on a pay-for-use basis. Most cloud computing services can be classified into three major categories: IaaS (Infrastructure-as-a-Service), PaaS (Platform-as-a-Service), and Software-as-a-Service (Software-as-a-Service) (SaaS).

Motivation and structure of work The motivation for working in the field of research on some of the strong fields of AI, blockchain, IoT, and cloud computing is to foresee and showcase the effective applications and utilities that can be developed when working with these technologies in an integrated manner. Each of the above-mentioned domains have a strong base and foundation and perform functionalities that together solve a number of problems offered in by an innovative idea. The structure of this work is as follows. Section 2 talks about the background and base study of AI, IoT, blockchain and cloud computing services and walks through the numerous existing applications. Section 3 focuses and highlights the major applications of the above-mentioned technologies and the role of each technology in the successful implementation of the corresponding

Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00001-2 Copyright © 2023 Elsevier Inc. All rights reserved.

189

190 SECTION

A Evolution of distributed systems

framework. Section 5 summarizes the detailed applications of Section 4 in a nutshell. Following which is Section 5 which elucidates the research gaps and challenges in each of the technologies with regard to the above-mentioned applications. Section 6 opens up on the different future scopes and challenges for researchers to work on in the future, and Section 7 concludes this paper.

2.

Background of AI, IoT, blockchain and cloud computing

Artificial intelligence (AI) is one of the emerging technologies which allows humans to facilitate and curate more efficient methodologies and approaches toward solving problems and creating algorithms. In simpler words, AI is the simulation of human intelligence and related processes using machines, tech gadgets, etc., using cognitive skills which focus on the ideas of learning, reasoning, and self-correction. The benefits and advantages of AI are exploited and utilized to its best abilities in a plethora of fields including those of health, transportation, education, commerce, and so on [1]. One of the major features of AI is its potential and capability to rationalize and grow based on the trainings and experiences gained. Machine learning (ML) and deep learning (DL) are further subsets of the broad umbrella that categorizes AI. These sub-divisions mainly deal with automated adaptive learning and absorption of large volumes of data for further structuring. The main motive of incorporating AI in gadgets, systems, and algorithms is to instill the sense of thinking humanly, thinking rationally, acting humanly, and acting rationally. The very essence of AI broke out in the ancient Greek myths on antiquity, wherein traces of AI were evidently traceable in areas of deductive reasoning and related concepts. On another side, another field which has been gaining a rampant reach in the technical world is that of Internet of Things (IoT) which specializes on the interconnectivity and interactions of various devices over the internet. IoT is often defined as a network or a system of interconnected computing devices and machines which provides the facility to support data transfer in the absence of human intervention. The IoT creates an ecosystem of itself with all the necessary web accessible devices which are pre-embedded with microprocessors, sensors, etc. The interaction and transferring of data between these devices and gadgets are made possible via the internet of these connected devices. Furthermore, IoT has been branching out to numerous other fields including those of transportation in the form of Internet of Vehicles (IoV), halt in the form of Internet of Health (IoH), etc. The major reasons which contribute to the proliferation of IoT in various fields is the fact that currently connection of every day gadgets has become the new trend be it kitchen appliances, cars, monitors, etc., via embedded systems. Factors like connectivity, low-cost and low power sensor technology, and various analytical components have supported the growth of IoT in a strong and proficient way. Blockchain has had a revolutionary breakthrough over the year by lending its support and profound benefits in numerous areas of research and sciences. Blockchain is a distributed ledger system which was initially curated for the underlying foundation of Bitcoins. However, its expansion has made it useful in a diverse line of applications ranging from finance to IoT to voting systems and even healthcare. The major advantage of blockchain is that data is stored in the form of blocks which are further linked together in the form of chains. So, each time a new set of information is to be stored, the data will be collected together in a new block and appended to the chain as per the chronology. This is one of the major reasons for blockchains to account for security issues as in most of the cases the data is stored in the forms of cryptographic hash which takes the role of a unique ID. Consequently, most of the applications that rely on blockchain are able to access a high level of data accessibility, security, privacy, and trust. Yet another important and indulging field is that of cloud computing which involves the provision of services with regard to computing including those of servers, storage, databases, analytics, etc. The main highlight of this is that it is a gateway to reliable and efficient innovation, flexibility of resources and scaling of economies. In simpler words, cloud computing allows users to avail required computing resources like data storage without directly having to utilize space on their workspaces. Most of the large cloud systems in the current day have distributed functionalities and operations over numerous locations from central servers. Fig. 1 elaborates on the integration of blockchain system with various other elements and components involved in the Internet of Vehicles (IoV) be it resource sharing, management of traffic and vehicles, broadcasting control, or data protection. Further, Table 1 explains and elaborates on the various nodes and components involved in the integration mechanism of blockchain and IoV.

3.

Application scenarios in the near future

There will be many sectors which will use IoT-based cloud-driven blockchain network in their use. This section elucidates some of the extensive and elated applications in different fields and highlights the use of AI, IoT, blockchain, and cloud computing in each of these applications.

AI, IoT, blockchain, and cloud computing Chapter

11

191

FIG. 1 Integration of blockchain and Internet of vehicles.

TABLE 1 Description of elements involved in Fig. 1. Application

Application

Application

Data Security and Management

- The data is passed on to neighboring vehicles - The number of RSUs dependable on the vehicles for appropriate services is quite high leading to difficulty in preserving privacy with ease.

- IoV integrated with blockchain have portrayed the efficiency of vehicle decentralization which leads to better management of data and control via consensus strategies. - Blockchain, being immutable and decentralized, is the main reason for utilization in IoV to tackle data related problems by resolving issues in an efficient and reliable manner.

Data and Resource Trading

- Trading of the created data and gaining power over computation and communication through internet resources is permitted in IoV.

- Peer-to-peer (P2P) data has been developed using blockchain along with resource trading with vehicles over a distributed ledger platform. - The independent training involved has led to the drastic reduction of transactional costs.

Resource Sharing

- The resource sharing involved among the vehicles ultimately leads to enhancing the services. - Ensuring that a direct resource sharing takes place among vehicles in a secure and reserved manner can be challenging.

- In order to accelerate the resource sharing factor among vehicles, the removal of depending on third parties and intermediaries can be obtained through blockchain. - This is because, blockchain offers direct resource sharing between the service provider and the user.

Vehicle Management

- The variations and numerus possibilities involved in offering parking services make privacy and security preservation a challenge. - The IoV network becomes more complex to manage.

- Blockchain usage has led to an increase in the management and control of the vehicle in smart parking applications - Managing and controlling vehicles over the distributed network has provided a platform validating and verifying service requests through smart contracts. Continued

192 SECTION

A Evolution of distributed systems

TABLE 1 Description of elements involved in Fig. 1—cont’d Application

Application

Application

Ride Sharing

- The combination of vehicles and users involved in sharing the services through internet is an emerging trend. - However, if the details of the user are outsourced, it can lead to the compromise of privacy.

- Blockchain has put forth an enhanced ride sharing service in comparison with the cloud-based platform. - It has provided services for vehicle and passenger searching as well as matching using RSUs instead of relying on cloud.

Content Broadcasting

- IoV systems are also capable of broadcasting content in order to eliminate the content via vehicles and RSUs - The reliability of vehicles and RSUs is indeed a risk with regard to malicious tampering of data.

- Blockchain is used for providing safety and security to the content. - Using blockchains which stores content in different blocks ensures quick content publishing. - Blockchain being immutable ensures that the content is highly resistant and strong against any attack.

Traffic Control and Management

- Traffic management depends on the data created from vehicles and RSUs - However, the system is subject to security and privacy vulnerabilities.

- It is varied from the conventional approach which uses central control for management and blockchain for distributed control. - Better security and validation are provided through the immutability feature of blockchain. - Using smart contract in blockchain has proven to be advantageous to traffic management and control with regard to validation.

Forensic Application

- Autonomous vehicles prefer automation for data integration and security in relation to post-accident forensics.

- Using blockchain in forensics has proven to be a better alternative for storing vehicle related records safely. - Research and analyses have showed that traceability and transparency can be improved on using blockchain - Smart contract that is used in blockchain ensures a distributed fair pact among vehicles, insurance companies, and related parties.

3.1 The integration of IoT devices into CPS Internet of Things (IoT) is a field which has gained massive attention over the years and is mainly related to the interconnection of various devices/nodes via the internet. Cyber physical systems are yet another field of research and application which involves the computation and integration of various algorithms and cyber components. The different elements involved in these are described as follows: (a) AI: Today’s vehicles also have driver-assist functionality based on AI, such as self-parking and advanced cruise controls. AI has been used to optimize software for traffic management, which in turn decreases by as much as 25% wait times, energy consumption, and emissions. It will build fully autonomous vehicles in the future. The technology of artificial intelligence will transform everyday life from the way we see it at present. Machine learning technology, for example, could theoretically revolutionize human resource roles such as hiring, performance appraisal and training, to name a few [2]. (b) IoT: Intelligent technologies for smarter homes and offices, smarter transport networks, smarter hospitals, smarter businesses, and factories will be available in the future. In retail and supply chain management (SCM) operations, IOT can have several advantages. There are many applications of IoT technologies since they can be applied to almost any technology capable of providing relevant information about its own service, the efficiency of an activity, and even the environmental conditions that we need to track and manage at a distance. (c) Blockchain: Blockchain could be used to move user data through networks and systems in a safe and efficient manner. The technology may also be used to retain and safeguard real estate ownership records, names, and more. Blockchains act as decentralized networks to record and register transactions involving a specific digital currency that take place. Blockchain is essentially a transaction ledger that maintains identical copies inside a network across each member device. The fact that the ledger is spread over each part of the network helps to make the blockchain’s protection simpler.

AI, IoT, blockchain, and cloud computing Chapter

11

193

(d) Cloud computing: We can link anything to cloud computing digitally today. It offers a whole new world of work, software, networks, and services. The future of cloud computing can be seen as a mix of on-site computing and cloudbased software products that will help to create hybrid IT solutions. Cloud technology is immensely advantageous, which is the key reason why the future of cloud computing can be as strong and vast as it pretends to be. The extreme agility and usability of a cloud is much superior to the use of established technologies, for one thing.

3.2 The role of IoT devices in Industry 4.0 Industry 4.0 is often acknowledged as the 4th industrial revolution to address the urbanization factors with respect to the industrial parameter. It is a concept that is extensively researched upon for implementation to provide a holistic approach to urbanization and development. IoT devices to play a major role in the effective execution of Industry 4.0. The different elements involved in these are described as follows: (a) AI: The Industry 4.0 revolution is set to lead it. IoT and AI are two independent technologies that have a major impact on multiple verticals of the industry. While the digital nervous system is the IoT, AI becomes the brain that makes decisions that control the system as a whole. In the manufacturing realm, AI is also revolutionizing process monitoring and process control. It can be easier said than done, however, to incorporate AI, and many AI projects struggle. DataProphet, a manufacturing AI-as-a-service technology provider, recommends three best practices for manufacturers adopting AI for process control to counter this reality: choose a constructive and comprehensive AI solution, improve human skill with machine learning, and continuously optimize. (b) IoT: The idea that connectivity, automation technologies, and digitization are creating the fourth major revolution in the manufacturing business is Industry 4.0, also known as the fourth industrial revolution. Thanks to trends such as IoT (Internet of Things) leveraging, including wireless networking and sensors for collecting machine data and allowing predictive maintenance, as well as 3D printing, factory floor robots and cobots, machine learning and AI (artificial intelligence), 5G, and digital twins, among other trends. (c) Blockchain: The technology of blockchain will become a fundamental cornerstone of Industry 4.0. In adopting blockchain, as the world embraces an integrated distributed ecosystem that preserves confidence and verifiable ownership, the global production environment can evolve to become more flexible and more efficient. Worth and originality can be redefined once more. The next step of industrial manufacturing will be Industry 4.0 and will see a paradigm change toward smart factories that combine cyber and physical structures. (d) Cloud computing: Across the globe, industry reports agree that cloud technology is a crucial enabler of the Technological Revolution 4.0.0. Cloud computing is effectively enabling advances on the Internet of Things (IoT), automation and robotics as the latest Industry Revolution continues to ignite. Cloud technology helps businesses, as they expand, to scale up their computer solutions. The days of estimating how many servers to buy in the past are long. The technology of the cloud scales with the company’s computing needs. Cloud technology is opening up a whole range of new technologies for larger corporations.

3.3 Co-operative robotics: The integration of AI and IoT Cooperative robotics majorly covers robots which are utilized for applications which involve direct interaction and communication with the bot within its immediate work environment. AI being the core of robotics application is extremely essential for implementing the various computation algorithms along with IoT to integrate the various sensors involved in the bot. The different elements involved in these are described as follows: (a) AI: The combination of artificial intelligence (AI) and robotics is an effective tool for automating tasks both within and outside the factory. AI has become more popular in robotic solutions in recent years, bringing versatility and learning capabilities to previously static applications. The system’s ability to deal with a complex environment is due to the way preparation and execution are interleaved and the robots are organized using a MAS [3]. Even when several adjustments occur during the robots’ travel, their decisional system is able to reconfigure the direction in the most efficient manner. The issue definition, the robots’ climate, and their motion capabilities can all be converted to a finite state representation using some abstraction and sensing procedures. The distributed nature of the considered application, which included two robots, as well as the limited computational resources of individual robots, were investigated. (b) IoT: The Internet of Robotic Things (IoRT) [4] is a term first proposed by Dan Kara of ABI Research, which entails supplementing existing IoT with active sensorization, thus allowing for novel business ideas at the intersection of IoT and Robotics. Most IoT projects are currently focusing on managing, monitoring, and optimizing systems and

194 SECTION

A Evolution of distributed systems

processes using connected devices with plain, onboard, and passive sensors. Despite their effect, IoT solutions’ full potential could be realized by delving deeper into the more advanced and transformative aspects of pervasive connectivity to, and communication among, smart devices. (c) Blockchain: Most IoT projects are currently focusing on managing, monitoring, and optimizing systems and processes using connected devices with plain, onboard, passive sensors. Despite their effect, IoT solutions’ full potential could be realized by delving deeper into the more advanced and transformative aspects of pervasive connectivity to, and communication among, smart devices. In reality, in the field of distributed control and cooperative robotics, security and distributed communication have long been unresolved problems. The failure of distributed control and multi-robotic systems’ networks and intruder attacks have been recorded. Blockchain technology has the potential to fully rectify this situation. Cooperative or swarm robots are a group of robots that have been equipped to perform a complex task that is beyond the capabilities of a single robot, such as in the automation industry, espionage, or surgical procedures. (d) Cloud computing: Cloud robotics is a rapidly developing area that allows robots to offload compute and storageintensive tasks to the cloud. In terms of computational memory and storage, robots are constrained. Cloud computing offers limitless computation memory, storage, and collaboration opportunities. There are two types of cloud-enabled robots: standalone and networked robots. The advent of cloud computing and other advanced technologies has enabled the expansion of the computing and data distribution capabilities of networked robotics by creating a cloud-based robotic architecture that uses both a centralized and decentralized cloud to handle machine-to-cloud and machineto-machine communication, respectively.

3.4 Smart city applications: The connection of billions of things Smart home, smart drainage and applications like smart transportation, etc., come under smart city applications. It is gaining extreme highlight over the years, with many cities joining the race toward becoming a smart and intelligent space. The different elements involved in these are described as follows: (a) AI: AI in smart cities will play a major role in making urbanization a smarter target of sustainable development, making cities fitted with advanced features for living, biking, shopping and enjoying a healthy and more comfortable life in such an environment. In reality, when developing smart cities, many problems such as administration, sanitation, traffic congestion, security monitoring, parking management, and many more can be helped by AI to provide residents with a sustainable solution. When applied in the right ways, the use of artificial intelligence in smart cities will improve lives. In cities or urban growth, there are several zones where AI can be used to boost the system’s efficiency and effectiveness. (b) IoT: The Internet of Things, commonly referred to as IoT, is designed without the need for human involvement to add the power to transfer and exchange data across networks. Home appliances, electric meters, cars, security systems, speaker systems, etc., are part of IoT products. These devices are fitted with software and sensors that enable the transfer of data to make a rational decision, adding smartness to the device, which is then processed. (c) Blockchain: Blockchain will help smart cities build integrated local commerce solutions. For retailers, service providers, restaurants, and accommodation options, virtual storefronts will use blockchain as a secure, distributed method for peer-to-peer transactions, payments, and identification services on a smart city platform. Openness, interconnection, peer-to-peer and peer-to-peer, storage and sharing functionality inside the blockchain are important to the openness, interconnection, peer-to-peer, and mutual characteristics of the Internet. IoT allows devices to send data to private blockchain networks across the Internet to produce tamper-resistant records of mutual transactions. IBM blockchain allows business partners, but without the need for central control and management, to share and access IoT data with you. (d) Cloud computing: Cloud-based and Internet of Things (IoT)-based services in which real-world user interfaces use mobile phones, sensors and RFIDs are promoted by Smart City technologies. Cloud computing and IoT are two of the most significant ICT models currently defining the next generation of computing. Cloud computing and IoT are two of the most significant ICT models currently defining the next generation of computing. Both principles have a significant influence on how smart applications/solutions are built and implemented for smart cities. Cloud computing illustrates the distribution over the Internet-as-a-service of hardware and software services on demand.

AI, IoT, blockchain, and cloud computing Chapter

11

195

3.5 Smart grid and other energy domains Smart grids have evolved from grids which are electric in nature consisting of transmission lines, transformers, etc., which is responsible for delivering current/electricity from the power plant to places of necessities. Smart grids are smarter versions of the traditional grids which permits and allows for crossway transmission of signals between the users and the source. The different elements involved in these are described as follows: (a) AI: Artificial intelligence (AI) techniques, such as expert systems (ESs), fuzzy logic (FL), and artificial neural networks (ANNs or NNWs), have created an advanced frontier in power electronics and power engineering. These techniques provide powerful tools in modern smart grid (SG) and renewable energy systems for design, simulation, control, estimation, fault diagnostics, and fault-tolerant control (RESs). Over the last few decades, AI technology has experienced rapid growth, and its applications have steadily expanded in modern industrial systems. Without any debate regarding AI applications in SG and RESs, this special issue will remain incomplete. (b) IoT: The smart grid is part of an IoT system, which can be used to remotely track and control everything from lighting, traffic signals, traffic congestion, parking spaces, road warnings, and early detection of items like power influxes as the result of earthquakes and severe weather. The IoT smart energy grid is based on the ATmega family controller that controls the system’s various operations. Through using Wi-Fi technology, the device communicates over the internet. This project has advanced capabilities to track energy usage and even detect power theft, in addition to monitoring the grid. (c) Blockchain: Blockchain incorporation into the smart grid requires the society to commit to the maintenance of transactions in the system. Transactions of smart contracts are executed. In the blockchain, transaction history is stored and duplicated to all complete nodes. Effective data aggregation systems based on blockchain technology can be used to solve the privacy and security problems of the grid. Blockchain can also be used by energy delivery systems to remotely manage energy transfer to a specific region by tracking the consumption statistics of that area. (d) Cloud computing: Smart grid is the next generation power infrastructure by assimilating principles of advanced communications and future control technologies. Its gaining significance is due to its greater robustness, reliability, and versatility over traditional power systems. As in modern electrical power systems, the need for cloud computing services and storage that can be dealt with is growing. Some characteristics of cloud computing that are desirable for smart grid applications are versatile network-shared resources and services, parallel processing, and omnipresent access. Although the cloud computing model for smart grids is considered powerful, it has some limitations such as security and reliability.

3.6 Machine learning Machine learning (ML) is one of the major subsets of artificial intelligence (AI) which is solely used for the curation of machines which would be trained to learn and adapt to surroundings based on the epochs and prior trainings. It has a number of applications in the current world. The different elements involved in these are described as follows: (a) AI: Although machine learning is based on the concept that machines should be able to learn and adapt through practice, AI refers to a wider idea where machines can “smartly.” perform tasks. Machine learning, deep learning, and other techniques are used by artificial intelligence to solve real problems. Computer speech and image recognition have improved with more language and image inputs on our computers. Likewise, there was much more knowledge to gain from machine learning. All these developments have brought artificial intelligence closer to its original objective of producing smart machines that we are beginning to see more and more in our daily lives. (b) IoT: With most industrial IoT platforms, such as Microsoft Azure IoT, Amazon AWS IoT, or Google Cloud IoT Edge, machine learning for predictive capabilities is now incorporated. For rapid, automatic responses and enhanced decision making, IoT and machine learning provide insights hidden in IoT data. By ingesting images, video, and audio, machine learning for IoT can be used to project future patterns, identify anomalies, and increase intelligence. (c) Blockchain: Using the analytical capacity of machine learning, the protection mechanisms inherent in the blockchain can be improved. In the financial services sphere, the ability to process large volumes of data safely and efficiently will create enormous value for organizations and end users. Blockchain can handle almost any form of current transaction as a distributed ledger. This is the key reason behind its rapidly rising success and power. The blockchain is specifically designed to facilitate and simplify the process of tracking transactions. This implies that, using this fully decentralized framework, every form of asset can be transparently transacted.

196 SECTION

A Evolution of distributed systems

(d) Cloud computing: Without the need for specialized skills in AI or data science, the cloud offers access to intellectual abilities. AWS, Azure, and GCP have many options for machine learning that do not require in-depth knowledge of AI, the theory of machine learning, or a data science team. The Google Cloud ML Engine is a hosted platform that runs jobs and predictions on a scale for machine learning training. The Cloud ML Engine automates the provisioning and control of all resources for running jobs. The lifecycle of deployed models and their variants can also be controlled. To create a machine learning solution, you do not need to use a cloud provider. There are, after all, many open-source machine learning systems that businesses can run on their own hardware, such as TensorFlow, MXNet, and CNTK.

3.7 5G and beyond 6G enabling technologies 5G is kicking up some more notches with the 6G chip. Although that is quicker than the fastest 5G you get, for 6G it is just the beginning. Even a specialist in wireless networking reports that 6G networks will support speeds of up to 8000 gigabits per second; they will also have much lower latency and bandwidth than 5G. (a) AI: The recent rise in diversified mobile applications, especially those sponsored by AI, is prompting heated debates on the future evolution of wireless communications. Although 5G is being implemented across the globe, business and academic initiatives have begun to look beyond 5G and conceptualize 6G. We expect to experience an unparalleled transition to 6G that will make it radically different from the previous generations of wireless cellular systems. 6G will go beyond the mobile Internet, in particular, and will be expected to support universal AI services from the center to the network’s end devices. (b) IoT: With 5G, data-transfer rates will dramatically increase. 5G would be 10 times faster than the existing LTE networks, according to rumors. This speed boost will allow IoT devices to communicate and exchange data faster than ever before. 5G aims to deliver mobile devices with dramatically higher speeds and a more secure connection than any network before it. That said, 5G is more than just a fast internet connection. Exponential growth in the ability to bring more data faster would fuel unparalleled growth in technology projects for the Internet of Things (IoT). (c) Blockchain: In order to address incumbent problems in 5G networks, smart healthcare in 6G would need to go one step further. In terms of better decentralization, security, and privacy, the deeper and pervasive incorporation of blockchains in future networks will advance current healthcare systems and enhance performance. Effective resource management and sharing are essential for achieving all these ambitious requirements with the shortage of spectrum resources. To accomplish all this, one potential technology is the blockchain. The blockchain has recently acquired an important role, and is of great interest to the 6G network and other networks, because of its inherent properties. (d) Cloud computing: 6G wireless networks are often used for the combination of terrestrial, aerial, and maritime interactions into an efficient framework that is highly protected, safe, and secure. Researches and analyses being conducted around the globe are putting forth cutting-edge techniques like AI, ML, quantum communication, blockchain, fog/edge computation, etc.

3.8 Transportation Transportation sector is one of the major fields which imparts a major share in urbanization and mobilization of people in a city. Many cities are trying to bring in smart inventions in this field using various intelligent techniques and developments. The different elements involved in these are described as follows: (a) AI: Artificial intelligence (AI) is one of the new fields that is changing the transportation industry. It is not a brand-new word. Artificial intelligence was first discussed in the 1950s by academics. Since then, AI has gone through a series of ups and downs, with optimistic hopes being met with bitter disappointment. AI has the ability to improve traffic efficiency, relieve traffic congestion, free up driver time, make parking more convenient, and facilitate car- and ridesharing. AI will minimize fuel consumption caused by vehicles idling when stationary, as well as improve air quality and urban planning, by assisting with traffic flow. All modes of transportation are becoming safer, cleaner, smarter, and more convenient as a result of AI. AI can be used in cars, facilities, drivers, and passengers, as well as the way these elements work to provide a transportation service [5]. AI aids in the detection of business developments, the identification of risks, the reduction of traffic congestion, the reduction of greenhouse gas and air pollutant pollution, and the design and management of transportation. (b) IoT: IoT for transportation is the networking of objects via embedded sensors, actuators, and other devices that gather and transmit data about real-world activities. IoT for transportation is the networking of objects via embedded sensors, actuators, and other devices that gather and transmit data about real-world activities. The transportation industry is

AI, IoT, blockchain, and cloud computing Chapter

11

197

FIG. 2 Functioning of blockchain technology in transportation.

evolving as a result of the use of IoT-enabled technology. The transportation industry is constantly changing to provide commutes that are safer, quicker, healthier, and more comfortable. The next big industry change is upon us, and IoT is at the forefront. The Internet of Things’ promise is causing a surge in smart vehicles and connected networks. Vehicles will have real-time data on where everyone else on the road is thanks to IoT-powered communication. As a result of this knowledge, cars will be able to brake or turn as needed to avoid a collision. Many vehicles also have assisted driving features, but the IoT’s interconnectivity will improve their accuracy. This connectivity is also important for self-driving cars. (c) Blockchain: Blockchain is a distributed ledger technology that keeps track of all transactions in chronological order. This data is stored in the ledger in the form of blocks, each of which is linked to the next. As a result, altering or changing the details becomes nearly impossible. This function of blockchain allows it to be used in almost any field where there is some kind of exchange. For order monitoring and verification, blockchain technology offers a scalable and immediate solution. The supply chain for truck parts and used trucks could be monitored on a digital ledger using blockchain, making the commercial transportation industry’s version of “CARFAX on steroids.” When we speak about the transportation sector, we must remember that it forms an important part of the supply chain. Transportation is, in truth, the backbone of all industries. As a result, businesses must have a fully integrated supply chain. As shown in Fig. 2, the distributed blockchain is used to keep a track of the data being simulated from the RFID tags attached to each of the vehicles in the network in a safe and encrypted manner. (d) Cloud computing: Cloud computing has changed the way companies operate in a variety of ways. Traditional transportation, for example, has used an IT environment that has allowed the industry to exchange information about a vehicle’s diagnostics and passenger counts over a local network. The introduction of cloud computing has improved the industry’s information flow by allowing stakeholders in the transportation industry to store more fleet data. Indeed, cloud computing has had the greatest effect on the transportation industry in this region. Most vehicles in the transportation industry are overworked in order to reach tight deadlines. This raises questions about vehicle health because only a small amount of time is set aside for maintenance. However, this could jeopardize passenger safety and the company’s reputation. To address this problem, a transportation company may install sensors in critical vehicle components that continuously send data to a cloud.

3.9 Smart agriculture Agriculture and farming are some of the sectors which provide a living to many people across the world, especially in countries like India. Making use of improvised and efficient strategies will definitely help in increasing the yield and produce, leading to a spike for the farmers income. The different elements involved in these are described as follows: (a) AI: People have had to get innovative to become more productive in how we farm, using less land to produce more crops and increasing the quality and yield of those farmed acres as the world population continues to increase and land becomes more scarce. Agriculture is a $5 trillion industry worldwide, and AI is now being used to help produce healthy crops, manage pests, track soil and growing conditions, coordinate data for farmers, reduce workload, and enhance a variety of agriculture-related tasks in the food supply chain. On a regular basis, farms generate hundreds of thousands

198 SECTION

A Evolution of distributed systems

of data points on the land. Farmers can now use AI to monitor a number of items in real time, including weather, temperature, water usage, and soil conditions obtained from their farm, to better inform their decisions. By deciding crop choices, the best hybrid seed choices, and resource utilization, AI technologies, for example, assist farmers in optimizing preparation to produce more bountiful yields. (b) IoT: In agriculture, as in other sectors, the Internet of Things offers previously unattainable productivity, resource and cost savings, automation, and data-driven processes. However, in agriculture, these advantages are not improvements; they are fixes for an entire sector grappling with a slew of dangerous issues. A system for monitoring the crop field with the aid of sensors (light, humidity, temperature, soil moisture, etc.) and automating the irrigation system is installed in IoT-based smart farming. Farmers can keep an eye on their fields from anywhere. When compared to traditional farming, IoT-based smart farming is extremely effective. (c) Blockchain: Agricultural technology, such as precision farming, farmland mapping, IoT sensors, location intelligence, and crop management apps, and transportation technologies are enabling agricultural businesses to produce better results in terms of food production and supply chain management. Increased food demand brings new problems, such as counterfeit goods, which pose a threat to food supply chains at various levels. Farmers and customers are at a disadvantage due to a lack of accountability and inefficiency. Finally, blockchain farming and distributed ledger technology (DLT) have the potential to improve agricultural supply chain productivity, transparency, and trust. By establishing trusting relationships, blockchain for agriculture supply chain will empower all market participants. For smallholders who want to invest in farming, the blockchain will add accountability to agricultural financial transactions, credit history, and financial agreements. Smaller farmers will be able to pay for raw materials and equipment partly or after distribution with shared access and irreversible deals, ensuring fair market pricing [6]. (d) Cloud computing: Agriculture is a significant source of income and livelihood for any of the world’s most populous countries, such as India, China, and others. Incorporating IoT and cloud computing into the agricultural sector would result in improved crop production by controlling costs, tracking efficiency, and maintaining equipment, all of which would benefit farmers and the nation as a whole. From sensors and tracking tools that collect soil data to agricultural field photos and observations from human actors on the ground accurately feeding data repositories along with their GPS coordinates, there are realistic applications for cloud computing that build an entire ecosystem. Sensors, for example, can now detect the position of a bale of hay in a field, as well as other items.

3.10 Weather forecasting In the current world, where mother nature seems to be taking a toil over weather making it quite unpredictable, efficient and reliable weather forecasting is a necessity for people to plan and structure their day-to-day activities. This calls for an optimized technology to provide support in predicting weather conditions. The different elements involved in these are described as follows: (a) AI: Conventional approaches to weather forecasting completely rely on statistical measurements and do not include any binary response. Deep space satellites (e.g., NOAA’s Deep Space Climate Observatory (DSCOVR)), weather balloons, radar systems, etc., are all used for data collection and gathering. However, with the growth in the volume of data and corresponding changes in the weather conditions, the predictions are likely to vary to a great extent. In order to bring in the element of precision and accuracy, AI can be utilized and it also helps in reducing the workload on the employees. Machine learning algorithms are used to make AI predictions. By using linear regression principles to process more complex data in a shorter amount of time, meteorologists can now make more accurate forecasts, saving lives and resources. Other predictions that machine learning can help with include temperature, wave height, and precipitation. (b) IoT: The system is proposed using sensors to measure environmental conditions in a specific location, such as temperature, humidity, and CO Level. Sensors detect changes in the atmosphere and submit data to users for statistical analysis. The Internet of Things (IoT) is a technology that allows you to track, store, manipulate, and link your machine to the rest of the world. It is a more effective and sophisticated way to access the internet. The Internet of Things (IoT) opens up a whole new universe of possibilities for improving weather prediction accuracy. According to Gartner, IoT will hit 5.8 billion enterprise and automotive endpoints in 2020, up 21% from 2019 [7]. Note that weather forecasting is very useful in a variety of sectors, such as the power industry and the agricultural transportation department, and therefore, weather forecasting is an important part of economic development [8–10]. (c) Blockchain: Weather forecasts are based on a compilation of data about the present state of the environment and an interpretation of certain conditions in order to predict how the atmosphere will change in the future. Weather prediction

AI, IoT, blockchain, and cloud computing Chapter

11

199

has come a long way from the days when all one had to do was look at the clouds on the horizon. Today, there are satellites in orbit that continuously track the weather across the globe, and there are millions of instruments recording meteorological data all over the world. Since blockchain like Bitcoin SV removes centralized points of failure, weather and climate data will be immutably preserved and available on the blockchain even in the worst-case scenario. This decentralized storage of weather and climate data will prove to be crucial in the future. Using the same instrument rather than a variety of weather stations improves the credibility of a weather monitoring network. The data from the weather station is then fed into nexus, which both stores the weather data and serves as a blockchain node at the same time. Nexus links the weather station to the Internet of Things (IoT), allowing weather data to be traded on a decentralized market and station operators to be rewarded with the WXB token, which can then be exchanged for Bitcoin or other major cryptocurrencies. (d) Cloud computing: Via cloud-deployed applications, data-sharing and collaboration tools, and the use of cloud-based computing resources to enable data analysis and model simulations, cloud computing provides new opportunities to the scientific community. Cloud services support a wide range of public-facing web sites and web-based applications, including data processing and delivery networks that disseminate critical weather forecasting, extreme weather warnings, and climate data. Although the term “in the cloud” is often used in advertisements for new software applications, systematic methods for identifying cloud resources and their applications have been developed [10].

3.11 Cyber security In the twenty-first century era, where people from golden agers to new fangled spend a large amount of time on online platforms and cyber spaces, data breaches, cyberattacks, data and privacy leakages are plenty in number and its very important to ensure safety for users. The different elements involved in these are described as follows: (a) AI: Artificial intelligence (AI) and machine learning (ML), according to experts, have both negative and positive impacts on cybersecurity. Training data is used by AI algorithms to learn how to adapt to various situations. They learn by copying and adding to their knowledge as they go. Even though technologies related to security and protection of data are stabilizing and evolving, cyberattacks and threats are still on the rise. The main reason behind this is lack of precision and efficiency in the conventional malware identification algorithms. Cybercriminals are consistently deriving novel ways to crack the security algorithms and hack the system. The problem is that most antimalware or antivirus programs currently use signature-based detection to detect threats, which is unsuccessful in detecting new threats. Artificial intelligence will help in this situation. Researchers and security software developers are attempting to harness the power of artificial intelligence to create solutions that can detect and remediate advanced cyberattacks as well as control data breaches. Artificial intelligence has revolutionized every area in which it has been applied. It has the potential to have a major effect on cybersecurity in a variety of ways. With cyber threats growing in both number and sophistication, the use of artificial intelligence in cybersecurity is becoming increasingly important, and security firms are working hard to meet the need. However, as much as everybody wants AI-based security programs, it is also important to consider the disadvantages and work around them. (b) IoT: Not only in the IoT, but in all apps, computers, and systems where we exchange information, privacy is a major concern. Even if users take care to protect their data, there are circumstances beyond their control. Hackers can now plan attacks with unparalleled complexity and correlate data from a variety of private sources in addition to public networks. According to a Cisco infographic, there are currently more things linked to the Internet than humans. According to the study, 25 billion devices are projected to be linked by 2015, with 50 billion by 2020. All devices that bind to the Internet are exponentially widening the attack surface for hackers and adversaries in this rapidly changing world. According to a new report, 70% of IoT devices have significant vulnerabilities. There is undeniable evidence that our reliance on interconnected technology is compromising our security. Vulnerable IoT devices can be accessed and data stolen, or the devices can be manipulated in a way that causes physical harm. Alternatively, IoT devices in buildings may be remotely hacked to disrupt a polling station physically. Although this is not the same as a conventional cyberattack, it still poses a threat to election-related activities. A fire alarm device, for example, may be activated remotely if not properly secured, or a heating system could be turned off, all of which could cause polling, vote tabulation, or other election day activities to be delayed. Fig. 3 showcases the various components of IoT which are involved in ensuring the cyber security of the applications being used by the user via the cloud services which are connected through the gateway.

200 SECTION

A Evolution of distributed systems

FIG. 3 Six principles of IoT cyber security across the stack.

(c) Blockchain: Blockchain is a data structure which stores data in a safe and secure manner using the cryptographic encryption techniques and decentralized consensus mechanism. Each and every block in a ciphered chain is linked together with the other blocks in an immutable way. There exists a consensus mechanism which validates and authenticates the transactions within the chain to ensure safety and privacy of data. The decentralized framework ensures no failure of a single point. However, there are a few prime differences with respect to security between blockchain and related technologies. Although blockchain technology creates a tamper-proof ledger of transactions, it is not impervious to cyberattacks or fraud. Those with malicious intent can exploit known flaws in blockchain technology and have been effective in a number of hacks and frauds over the years. Phishing, routing, Sybil, and 51% attacks are the four main ways that hackers and fraudsters risk blockchain. Phishing is a technique of acquiring the credentials of a user by deceiving them using fraud emails embedded with hyperlinks which appear to be authentic. When attackers get their hands over the credentials of the user, it leads to the loss of money for both the user as well as the blockchain network. Hackers/attackers are able to conquer credentials easily during the transfer of data to service providers in real time and it appears to be a normal process for the users as the routing assault is not transparent to the users. In Sybil attacks, the cyber criminals make use of various false network identities to send in bogus data and flood the network, ultimately crashing the system. When considering mining for a large-scale blockchain which is public, it calls for a very high amount of computational power. However, if a miner could pool in sufficient amount of money, they will be capable of controlling more than half of the mining control of the blockchain. (d) Cloud computing: Cloud security, also known as cloud computing security, is a set of policies, controls, procedures, and technologies that work together to safeguard cloud-based applications, data, and infrastructure. Cloud protection can be designed to meet the exact needs of the enterprise, from granting access to filtering traffic. The IT industry is also being disrupted by the digital transformation movement. The growing adoption of security solutions to combat cyberattacks has resulted from businesses’ transition to cloud computing. Cybersecurity is the latest buzzword in the cloud computing world, with companies constantly striving to protect their networks and devices from fraudulent attacks. Security in the cloud is a joint obligation between the cloud provider and the client. In the shared responsibility model, there are three types of responsibilities: those that are always the responsibility of the company, those that are always the responsibility of the client, and those that differ depending on the service model: Infrastructure as a Service (IaaS), Platform as a Service (PaaS), or Software as a Service (SaaS), such as cloud email.

3.12 Smart healthcare system: The connection of IoNT and IoMT Healthcare sector is one of the other sectors which have faced a major integration with smart devices and gadgets to improve the services offered to the patients. Utilizing IoNT and IoMT, which are medical subsets of IoT is a great way to enhance the medical facilities. The different elements involved in these are described as follows: (a) AI: AI analyzes data in order to mine, automate, and predict processes throughout a healthcare system. It has been used to forecast ICU transfers, enhance clinical workflows, and even identify the risk of hospital-acquired infections from a patient. To improvise the already existing surgical approaches, cognitive surgical robotics collects data from real surgical processes. This is one of the best uses of artificial intelligence, as doctors can gather data from pre-op medical records while gaining insights. (b) IoT: The interactions of patients with doctors prior to the Internet of Things were limited to visits and telephone and text communications. There was no way physicians or hospitals could continuously monitor the health of patients and make recommendations accordingly. Using IoT provides an encouragement to the healthcare fraternity to actively engage and involve with the patients. Sensors and other IoT tagged devices are used for tracking the medical devices being used including those of wheelchairs, nebulizers, oxygen pumps, etc. Remote monitoring in the healthcare sector

AI, IoT, blockchain, and cloud computing Chapter

11

201

Al Algorithms

Sensors required for monitoring medical services

IoT Devices

IoT Server

FIG. 4 Functioning of smart healthcare system using IoT and cloud.

has been made possible by Internet of Things (IoT)-enabled devices, unleashing the potential to keep patients safe and healthy, and empowering doctors to provide superlative care. As interactions with doctors have become easier and more efficient, it has also increased patient engagement and satisfaction. (c) Blockchain: The healthcare sector has emerged as one of the IoT and its associated technologies’ most favored use cases. However, the integration of blockchain in all walks of health facilities requires a long way to go before becoming true and this is due to the security concerns arising. Blockchain comes to the rescue to sole security and privacy related concerns of data and the users and has hence found various opportunities to enhance the healthcare sector. Traditional healthcare systems are dramatically embracing new technology for the transformation into smart healthcare ecosystems. (d) Cloud computing: In healthcare, cloud computing improves the industry’s productivity, while reducing costs. Cloud computing makes it simpler and safer for medical record sharing, automates backend processes, and also makes it easier to build and manage telehealth applications. In smart cities, the security, privacy, and management of healthcare systems deliver computing services and cloud computing technology tools. The tasks are passed to the cloud proxy server in the huge mobile cloud computing, and only the reports are sent back to the mobile devices. Fig. 4 details the process of utilizing IoT, AI, and cloud services for the smart healthcare application. All the sensors and medical devices which are to be monitoring a patient are interconnected with an IoT node which are further twined with a server through which necessary neural and fuzzy algorithms are applied and is then interconnected to access the cloud services for further data analyses and storage.

4. Summary of major works This section will give insights on some of the major applications which have been covered in the fields of AI, blockchain, cloud computing, and IoT. The fact these fields are interconnected and have various domains of applications is what makes them versatile and efficient. AI: As observed from the previous section, AI is an extremely powerful area of application with numerous possibilities. In the case of integration of nodes and device in IoT to that of CPS, the strategy proves to be providing efficient results in the fields traffic management, self-parking, etc., leading to a revolutionary performance. In the case of the role played by AI in IoT in evergreen Industry 4.0, AI has had a major impact on the development of technologies in this arena, taking up the role of the brain and controlling the numerous tasks to be handled. When coming to cooperative robotics, the magical essence of intricacy provided by the combination of AI and robotics has proven to be complementing each of the different components involved. The main role of AI here is to bring in the element of versatility. On the other hand, when considering the use of AI in smart city applications, it is extremely essential for helping the growth of urbanization and to promote the concept of sustainable development. One of the other major fields where AI has shown prolific growth is in that of smart healthcare system because easy, accurate, and reliable analyses of data in bulk volumes can be fluently carried out by AI algorithms. Most importantly, it also ensures a fast and quick response and line of action. Another area of application for AI is that of smart grids and related, wherein a plethora of techniques related to fuzzy logic, neural networks, etc., can be effectively put to practice using algorithms in AI. Machine learning (ML) is one such other field which has gained significant importance over the years and is one of the subsets of the umbrella formed by AI.

202 SECTION

A Evolution of distributed systems

ML and deep learning (DL) techniques are mainly utilized for solving real-life problems and tasks. Furthermore, in this fastmoving world, majority of the human race depend on faster and quicker networking and communications 5G and 6G innovations have been up at the forefront and AI has been playing a major role in it. One of the next important and crucial applications for AI is in the field of transportation as it is extremely helpful in optimizing and relieving traffic congestions, and making travel experiences more comfortable. One of the other major applications of AI is in the field of smart agriculture as it can help in bringing innovations and ideations into reality and increase productivity to a great extent by easing out the work of the farmers. On similar grounds, one other such application is related to weather forecasting, wherein AI models for required details are trained and analyzed with improved accuracy and efficiency. Cyber security is one of the other rapidly growing fields which implements AI in order to train data to adapt to various situations and to condemn cyber threats and attacks in a smarter way. IoT: With a rampant increase in the number of devices and the interconnection of various components, IoT has been significantly researched and implemented on for quite a few years. Hence, the number of applications for it has also been quite varied and extensive. In the case of integrating IoT-related nodes with CPS, IoT plays a major role in providing the foundation for interlinking smart technologies for smarter environment systems. Considering the fourth industrial revolution of Industry 4.0, IoT is very often considered to be the centric focus as it escalates the ideas of connectivity and automation in combination with elements of AI be it in predictive maintenance, 3D printing, and so on. Cooperative robotics is one of the other such arenas where IoT has been utilizing its capabilities by evolving in the form of Internet of Robotic Things (IoRT). IoRT has made active linkages between sensors and devices much easier and more efficient in spite of using passive components. When analyzing the strategies and approaches incorporated in smart city applications, IoT has definitely been fueling up the process for human involvement for efficient data and power transfer capabilities. Another essential field which has been gaining significant reach with regard to IoT is that of the medical arena and the evolving smart healthcare system. Internet of Medical Things (IoMT) has been of great advantage to the physicians and medical fraternity in order to ease out the tasks of monitoring the patients throughout and making recommendation-based decisions. On the other hand, smart grid and energy domains have been a part of IoT and are extremely useful in tracking and maneuvering different control elements pertaining to the traffic management system and other modules. Meanwhile, applications of machine learning (ML) have been using various IoT platforms like Microsoft Azure IoT services for implementing and executing various operations. In a world with fast evolving networking and communications requirements, IoT integrations with 5G and 6G networks would increase the efficiency and speed of data transfer manifold and also help in decentralization. Furthermore, the transportation sector has been extracting the benefits of IoT for the interconnection of different embedded sensors, objects, and other elements which are involved in the vehicular system. In fact, IoT has revolutionized to Internet of Vehicles (IoV) in the transportation sector. One of the other fields of major implementation is with regard to smart agriculture where IoT is being used for integrating various sensory aids which are essential in monitoring crops and farms. Along similar grounds lies another integral application of IoT which is weather forecasting. Various weather forecasting systems make use of IoT in order to measure the different environmental conditions in a particular location using the required sensors which can be interlinked with IoT. Last but not the least, IoT is very commonly used in the field of cyber security in order to preserve privacy and security of data which is involved during data transfer. Blockchain: Blockchain as inferred to earlier is a distributed ledger system which is one of the excellent ways to preserve the privacy and security of data by storing them in block like structures and linking them together in a chain like manner. One of the first applications of blockchain is with the integration of IoT devices with CPS as it helps in ensuring to move data through networks and modules in a safe and reliable format. In the field of industry 4.0 using IoT, blockchain is yet again significantly used in preserving the confidence and of the integrated and distributed ecosystem which helps in securing confidentiality and ownership of various records that are involved. Blockchain also plays an important role in cooperative robotics by securing the distributed and interconnected devices which involve in transfer of data. When it comes to the field of smart city applications, blockchain proves to be highly useful in interconnecting various local commerce solutions and for providing reliable services in terms of transactions and authentication. On the contrary, in few other walks of life called the smart healthcare system which has been evolving significantly over the years with key focus on IoT, blockchain also imparts a huge effect by spreading the essence of reliability and security of large data volumes which are to be handled. In fact, the conventional and old schooled approaches in the medical arena are embracing such emerging trends and techniques to transform into a smarter and intelligent realm. Blockchain also contributes in the fields of smart grid by committing to take care of the maintenance and transactions involved in the system. Apart from these, subsets of AI like ML also utilize blockchain for improvising the different existing algorithms catering to the analytical components involved in order to protect the inherent techniques. Networking and communication which have been recently inclined toward 5G and 6G use blockchain to address some of the privacy issues raised in the

AI, IoT, blockchain, and cloud computing Chapter

11

203

existing network systems. Similarly, blockchain is also effectively used in the arenas of smart transportation to maintain a chronological sequence of data in a sequential format and for orderly supervision and verification. On the other hand, just like how AI and IoT have crucial roles to play in smart agriculture, blockchain contributes in the development of distributed ledger technology and block farming for improvising and enhancing the agricultural supply chain activities. Weather forecasting, an essential application in today’s world, also makes use of blockchain to preserve the data related to climatic attributes in an immutable and preserved fashion. Finally, blockchain is stealthily used in the domain of cyber security in order to minimize the impact and frequency of various attacks including those of phishing, routing, sybil, and so on. Cloud computing: Cloud computing which involves the provision of computing services ranging from databases, to networking, to software, to analytics, and all the way to intelligence, this area has been on an increasing profile over the years. One of the applications where cloud computing is used is that of IoT integration with CPS as it provides an endless list of opportunities in creating and complementing the hybrid solutions. Cloud computing services are also essential in the revolution of industry 4.0 as it elevates the strategies of IoT and AI and advances their utilities to the next level. In cooperative robotics by integrating AL and IoT, cloud robotics is heavily used for offloading storage intensive tasks to the cloud base without any hassle. Smart city applications usually involve an extensive usage of cloud-based and IoT-related services, cloud computing is one of the significant models elaborating on the distribution of Internet-as-a-service technique. Cloud computing is also used in smart grids for providing a powerful foundation for curating a versatile system and environment. Under the broad umbrella of machine learning, cloud computation offers the provision to intelligent abilities and services for upskilling areas of specializations in data science and AI. One other such are where cloud computing services are majorly used is in the field of 5G and 6G networks for improvising the robustness and wireless communication techniques. In the transportation sector, cloud computation has brought in an evolutionary change in the way a company operates from various aspects. For example, cloud computing has replaced the traditional IT environment in a conventional vehicular environment for improving the flow of industrial data. Smart agriculture, on the other hand, uses cloud computational facilities for improvising the production of crops by monitoring sectors of cost control, efficiency tracking, equipment maintenance, etc. On similar grounds, it can be observed that cloud computation helps in weather forecasting too. Using cloud-deployed applications, sharing of data and integration of tools has become much easier and more profound. One of the other applications of cloud computing is in the field of cyber security which is the need of the hour considering the large number of privacy and security attacks taking place. Security provided using cloud services is also known as cloud computing security which mainly streamline its focus on safeguarding applications utilizing their services.

5. Research gaps in each applications In spite of the extensive research which has been conducted in each of the above-mentioned fields and their applications, they still do possess a few bottlenecks and issues which are yet to be addressed. These research gaps and issues are addressed in the session based on each of the domains as shown below: AI: From the above sections, it can be clearly observed that AI has had a huge impact in the development and implementation of various real-life applications which belong to different realms of life. However, with every significant boon comes a bane and in the case of these applications they are portrayed as research and innovation gaps. In applications where AI is used alongside IoT and other interconnected devices, extremely high communication overheads are involved. In applications like cooperative robotics and IoT in industry 4.0, there are cases where latency is a major challenge as there is a lot of delay involved in applying the different algorithms and transferring voluminous data. Further challenges are also faced due to caching and improper routing and network traffic controls. Apart from this, smart city applications and smart gridrelated domains face one of the other major concerns with regard to the security and privacy issues because curating a system is cent percent fool proof and resistive of external and internal attacks is still a vast field to be extensively researched on. In fact, the concern of security and privacy is also concerned with applications like smart agriculture and smart healthcare facilities. System complexity is one of the other challenges which is highly observed in applications like weather forecasting and cyber security [10]. IoT: IoT being one such domain which has acquired a huge reach over the years in various real-life application domains also has quite a few bottlenecks which are to be addressed and researched upon. Scalability is one of the major challenges in majority of the above listed applications be it weather forecast, cooperative robotics, IoT in industry 4.0, or even smart agriculture. Along with the concern of upskilling the different nodes and devices which are interconnected, the other challenge which is often faced is with regard to connectivity. Applications like cybersecurity, smart city development, smart grids, and transportation sector do face the issue of varying stability, compatibility, and longevity of the different nodes entangled in the respective IoT systems. Apart from these applications like smart agriculture, weather forecasting and cyber security are exposed to high energy consumption with high computational overheads and reduced security problems [11].

204 SECTION

A Evolution of distributed systems

Blockchain: Blockchain has been utilized in majority of the applications for preserving privacy and security and encrypting data. However, in applications like cyber security, smart city applications, and IoT in industry 4.0, blockchain cannot guarantee any sort of transactional privacy due to public availability of the keys used for each block. Similarly, certain applications, including those of transportation facilities, smart healthcare, and cooperative robotics, are many a times susceptible to attacks and malicious usage by selfish miners [12]. One of the other major issues and research gaps faced in applications like weather forecast, cyber security, and smart grids is closely related to the question of storage capacity and scalability in blockchain because in these applications the data always grows in an incremental manner and blockchain techniques may be unable to cope up with the rampant increase. Cloud computing: With researchers and developers opting for flexible and hassle-free options for data storage, management, transfer, etc., cloud computational services have been on demand. However, the services provided by cloud computing also has a few hinderances and challenges which may restrict the complete success of any of the above-mentioned applications. Lack of efficient data security and privacy of users poses a stealthy challenge in applications like cyber security, smart healthcare systems, and smart city applications. One of the other challenges which highly tends to resist the curation of a system is the organizational inertia while sharing and exchanging data via cloud platforms. In applications of smart grid, transportation sector, and industry 4.0, cost management and containment risks in cloud computing are one of the major issues followed by lack of sufficient resources and expertise [13]. Apart from these, applications like smart agriculture, weather forecasting, and networking technologies also face issues pertaining to governance and control of cloud computational services.

6. Future research directions toward the integration of AI-IoT-blockchain-based cloud systems Each of the four domains of AI, IoT, cloud computing, and blockchain have a massive scope for future research and implementation. There can be various developments on the existing applications for optimization and efficiency. They are discussed as shown below: AI: The impact of AI-related applications and implementations in our daily lives have emerged to a great extend such that almost every other sophisticated device in our surroundings involves some concept of AI in it. In fact, there are a plethora of opportunities for future research directions and enhancements in the field of AI. In applications of smart cities, industry 4.0, data analytics related concepts AI can surely act as a bridging factor between different components and elements of automation and precision. AI algorithms and strategies can further be developed to ensure safety and security for data protection and even prevent small-scale identity thefts with the help of appropriate AI and ML algorithms. One of the possible applications and research domains of AI with respect to the future would be the utilization of AI for performing vital and critical tasks so as to reduce the human interference required. Similarly, in the field of transportation, subjects of AI prove to be really helpful for curating self-driven cars, automated trains and jetliners, and so on. These are some of the major domains and applications which open up various opportunities for extensive research and analysis [14]. IoT: With almost every other device at homes, offices, and other environments being interconnected and linked to each other, IoT has been prominently visible in every major field. However, it also does possess a number of fields which can be further researched upon for improvisation and enhancement of the various IoT-related improvisations. Security and privacy of the large amounts of data which is generated by the nodes and devices in the framework must be protected from any sort of attacks and leakages and is of prime importance in the current world [15]. One of the other major research domains in IoT caters to that of maintaining the traffic congestion when transferring voluminous amounts of data between devices through networks. One of the other major concerns which needs to be looked into the high amount of energy consumption is required during the utilization of IoT services. Hence, researches and developments on efficiently managing energy requirements have huge scope for future works. Blockchain: Blockchain is one of the popular technologies of this era, gained popularity for its concepts and security benefits. However, one of the major challenges faced by blockchain which can be extensively researched upon is the storage requirements for accommodating larger volumes of data. This is mainly because the storage needs which involve the encryption and authentication factors incorporate the entire blockchain. On similar grounds, one of the other areas which call for massive research opportunities is that of minimizing the energy consumption while rapidly generating blocks for storing data [16]. One of the other major concerns which require research is with regard to the scalability of the blockchain for extending its associated applications in an efficient and reliable way. Improvising and enhancing the above-mentioned features would definitely provide a holistic perspective to blockchain.

AI, IoT, blockchain, and cloud computing Chapter

11

205

Cloud computing: The trend of utilizing cloud computational technologies for a plethora of applications and services has been on the rise for the past few years. However, this too faces a few challenges and bottleneck which offers a high scope for future research to upgrade the existing and available services. One of the ground-level concerns which requires maximum attention is that of security issues and privacy preservation. One of the other challenges is with regard to managing cost and maintaining the risk factors involved throughout the process. Similarly, the lack of sufficient resources/expertise pertaining to the cloud computation facilities due to increasing workloads being put in by individual organizations [17]. Last but not the least, the issue of managing and adhering to the needs of managing distributed and multiple clouds with efficient techniques is yet to be developed and researched upon. Note that readers/researchers can find several notable issues in machine learning, deep learning IoT, AI, IoT, etc., and importance of each emerging technologies like blockchain in digital forensics, etc., in [18–31]. From this work, the researcher will be able to find a research problem for themselves and required criteria for their research work.

7. Conclusions To conclude, it can be highly observed that AI, IoT, blockchain, and cloud computing are some of the domains which combine together to provide an influential and impactful essence for implementing different applications that benefit the society. The fact that for majority of the applications, the combination of AI, IoT, blockchain, and cloud computing can equally contribute to solve and uphold the different aspects of the solution is what makes these technologies the necessity of the future frameworks and implementations. Though each of these methods do possess some disadvantages and bottlenecks, the combination of the different technologies makes it rightly suitable for curating highly intensive yet innovative applications. Using AI will ensure that the application makes use of advanced algorithms yielding efficient outputs. IoT elements will be capable of connecting all the devices/nodes together and blockchain can be made use of for providing security and data protection. Finally, cloud computation would provide all the necessary storage and management services in massive amounts. Clubbing all these together, the future applications which are likely to transform the society and current environment would have the main technological pillars of AI, IoT, blockchain, and cloud computation.

Acknowledgment This work is written by Meghna Manoj Nair, and Amit Kumar Tyagi has approved this article for final publication.

Conflict of interest The authors declare that there is no conflict of interest regarding publication of this article.

References [1] Y. Duan, J.S. Edwards, Y.K. Dwivedi, Artificial intelligence for decision making in the era of Big Data–evolution, challenges and research agenda, Int. J. Inf. Manag. 48 (2019) 63–71. [2] S. Shakya, Survey on cloud based robotics architecture, challenges and applications, J. Ubiquit. Comput. Commun. Technol. 2 (2020) 10–18. [3] D. Panescu, M. Kloetzer, A. Burlacu, C. Pascal, Artificial intelligence based solutions for cooperative mobile robots, J. Control Eng. Appl. Inform. 14 (2012) 74–82. [4] A. Chowdhury, IoT and Robotics: A Synergy, 2017, https://doi.org/10.7287/peerj.preprints.2760v1. [5] M. Lopez Conde, I. Twinn, How Artificial Intelligence Is Making Transport Safer, Cleaner, more Reliable and Efficient in Emerging Markets, EMCompass; Note 75. License: CC BY 3.0 IGO, International Finance Corporation, Washington, DC, 2019. https://openknowledge.worldbank. org/handle/10986/33387. [6] H. El Bilali, F. Bottalico, G. Ottomano Palmisano, R. Capone, Information and communication technologies for smart and sustainable agriculture, in: M. Brka, E. Omanovic-Miklicanin, L. Karic, V. Falan, A. Toroman (Eds.), 30th Scientific-Experts Conference of Agriculture and Food Industry. AgriConf 2019. IFMBE Proceedings, Vol. 78, Springer, Cham, 2020, https://doi.org/10.1007/978-3-030-40049-1_41. [7] R.K. Kodali, A. Sahu, An IoT based weather information prototype using WeMos, in: 2016 2nd International Conference on Contemporary Computing and Informatics (IC3I), 2016, pp. 612–616, https://doi.org/10.1109/IC3I.2016.7918036. [8] I.H. Witten, E. Frank, Machine Learning Tools and Techniques. Second edition. 2005.Maxim Integrated Products. MAX220-MAX249 +5V-Powered and Multichannel RS-232 Drivers/Receivers, 2001. [9] A.L. Molthan, J.L. Case, J. Venner, R. Schroeder, M.R. Checchi, B.T. Zavodsky, A. Limaye, R.G. O’Brien, Clouds in the cloud: weather forecasts and applications within cloud computing environments, Bull. Am. Meteorol. Soc. 96 (8) (2015) 1369–1379. [10] I. Ahmad, et al., The challenges of artificial intelligence in wireless networks for the internet of things: exploring opportunities for growth, IEEE Ind. Electron. Magaz. 15 (2021) 16–29.

206 SECTION

A Evolution of distributed systems

[11] H. Saadeh, W. Almobaideen, K.E. Sabri, Internet of Things: a review to support IoT architecture’s design, in: 2017 2nd International Conference on the Applications of Information Technology in Developing Renewable Energy Processes & Systems (IT-DREPS), 2017, pp. 1–7, https://doi.org/ 10.1109/IT-DREPS.2017.8277803. [12] Z. Zheng, S. Xie, X.C. Hong-Ning, H. Wang, Blockchain challenges and opportunities: a survey, Int. J. Web Grid Services 14 (2018) 1–24, https:// doi.org/10.1504/IJWGS.2018.095647. [13] L. Wang, G. von Laszewski, A. Younge, et al., Cloud computing: a perspective study, New Gener. Comput. 28 (2010) 137–146, https://doi.org/ 10.1007/s00354-008-0081-5. [14] M. Haenlein, A. Kaplan, A brief history of artificial intelligence: on the past, present, and future of artificial intelligence, Calif. Manag. Rev. 61 (4) (2019) 5–14, https://doi.org/10.1177/0008125619864925. [15] S.K. Lee, M. Bae, H. Kim, Future of IoT networks: a survey, Appl. Sci. 7 (10) (2017) 1072, https://doi.org/10.3390/app7101072. [16] S. Porru, A. Pinna, M. Marchesi, R. Tonelli, Blockchain-oriented software engineering: challenges and new directions, in: 2017 IEEE/ACM 39th International Conference on Software Engineering Companion (ICSE-C), 2017, pp. 169–171, https://doi.org/10.1109/ICSE-C.2017.142. [17] J. Weinman, The future of cloud computing, in: 2011 IEEE Technology Time Machine Symposium on Technologies Beyond 2020, 2011, pp. 1–2, https://doi.org/10.1109/TTM.2011.6005157. [18] A.K. Tyagi, M.M. Nair, S. Niladhuri, A. Abraham, Security, privacy research issues in various computing platforms: a survey and the road ahead, J. Inf. Assurance Security 15 (1) (2020) 1–16. [19] A.K. Tyagi, M.M. Nair, Internet of everything (IoE) and internet of things (IoTs): threat analyses, possible opportunities for futures, J. Inf. Assurance Security 15 (4) (2020) 194–218. [20] R. Varsha, S.M. Nair, A.K. Tyagi, S.U. Aswathy, R. RadhaKrishnan, The future with advanced analytics: a sequential analysis of the disruptive technology’s scope, in: A. Abraham, T. Hanne, O. Castillo, N. Gandhi, R.T. Nogueira, T.P. Hong (Eds.), Hybrid Intelligent Systems. HIS 2020. Advances in Intelligent Systems and Computing, Vol. 1375, Springer, Cham, 2021, https://doi.org/10.1007/978-3-030-73050-5_56. [21] K.S. Reddy, K. Agarwal, A.K. Tyagi, Beyond things: a systematic study of internet of everything, in: A. Abraham, M. Panda, S. Pradhan, L. GarciaHernandez, K. Ma (Eds.), Innovations in Bio-Inspired Computing and Applications. IBICA 2019. Advances in Intelligent Systems and Computing, Vol. 1180, Springer, Cham, 2021, https://doi.org/10.1007/978-3-030-49339-4_23. [22] A.K. Tyagi, G. Rekha, N. Sreenath, Beyond the hype: Internet of things concepts, security and privacy concerns, in: S. Satapathy, K. Raju, K. Shyamala, D. Krishna, M. Favorskaya (Eds.), Advances in Decision Sciences, Image Processing, Security and Computer Vision. ICETE 2019. Learning and Analytics in Intelligent Systems, Vol. 3, Springer, Cham, 2020, https://doi.org/10.1007/978-3-030-24322-7_50. [23] A.K. Tyagi, T.F. Fernandez, S. Mishra, S. Kumari, Intelligent automation systems at the core of industry 4.0, in: A. Abraham, V. Piuri, N. Gandhi, P. Siarry, A. Kaklauskas, A. Madureira (Eds.), Intelligent Systems Design and Applications. ISDA 2020. Advances in Intelligent Systems and Computing, Vol. 1351, Springer, Cham, 2021, https://doi.org/10.1007/978-3-030-71187-0_1. [24] A. Pramod, H.S. Naicker, A.K. Tyagi, Machine learning and deep learning: open issues and future research directions for next ten years, in: Computational Analysis and Understanding of Deep Learning for Medical Care: Principles, Methods, and Applications, Wiley Scrivener, 2020. [25] S. Mishra, A.K. Tyagi, The role of machine learning techniques in internet of things-based cloud applications, in: S. Pal, D. De, R. Buyya (Eds.), Artificial Intelligence-Based Internet of Things Systems. Internet of Things (Technology, Communications and Computing), Springer, Cham, 2022, https://doi.org/10.1007/978-3-030-87059-1_4. [26] M.M. Nair, A.K. Tyagi, N. Sreenath, The future with industry 4.0 at the core of society 5.0: open issues, future opportunities and challenges, in: 2021 International Conference on Computer Communication and Informatics (ICCCI), 2021, pp. 1–7, https://doi.org/10.1109/ICCCI50826.2021. 9402498. [27] A.K. Tyagi, S.U. Aswathy, Autonomous intelligent vehicles (AIV): research statements, open issues, challenges and road for future, Int. J. Intell. Netw. 2 (2021) 83–102, https://doi.org/10.1016/j.ijin.2021.07.002. [28] A.K. Tyagi, Analysis of security and privacy aspects of blockchain technologies from smart era’ perspective: the challenges and a way forward, in: Recent Trends in Blockchain for Information Systems Security and Privacy, CRC Press, 2021. [29] A.K. Tyagi, G. Rekha, S. Kumari, Applications of blockchain technologies in digital forensic and threat hunting, in: Recent Trends in Blockchain for Information Systems Security and Privacy, CRC Press, 2021. [30] S. Kumari, A.K. Tyagi, S.U. Aswathy, The future of edge computing with blockchain technology: possibility of threats, opportunities and challenges, in: Recent Trends in Blockchain for Information Systems Security and Privacy, CRC Press, 2021. [31] I. Tibrewal, M. Srivastava, A.K. Tyagi, Blockchain technology for securing cyber-infrastructure and internet of things networks, in: A.K. Tyagi, A. Abraham, A. Kaklauskas (Eds.), Intelligent Interactive Multimedia Systems for e-Healthcare Applications, Springer, Singapore, 2022, https:// doi.org/10.1007/978-981-16-6542-4_1.

Chapter 12

Functional analysis of blockchain consensus algorithms Rajiv Pandeya, Mohd Sarfaraz Faiyazb, Gurudev Singha, and Zafar Uddina a

Amity Institute of Information Technology, Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India, b Amity University Uttar Pradesh, Lucknow,

Uttar Pradesh, India

1. Introduction The Internet has changed a lot of aspects of life, society, and commerce. However, the way people and organizations conduct business has not changed substantially through the years. Blockchain is viewed as the missing link in the Internet’s puzzle, making it more open, accessible, and trustworthy [1]. To comprehend blockchain, one must understand it from both a commercial and technological perspective. We explore it in the context of a commercial transaction to get a sense of “what” it is, and then delve into the technicalities to get a sense of “how.” A evolving technology, if solves a problem uniquely, it automatically captures the attention of the community. Blockchain is a distributed ledger system that enables individuals to trade value (not just money!) on a peer-to-peer basis [2]. This means that there is no need for a trusted intermediary, such as banks, brokers, or other escrow services, to operate as a trusted third party. Alternatively, we may state that blockchain is a distributed ledger system with security features to increase transaction trust and integrity. Read the statements below and do not be concerned if the concepts do not fit together adequately for your entire knowledge. You may want to return to it, but wait until you have finished this chapter. l l

l

l l l

Blockchain is a peer-to-peer value-transfer technology that reduces the need for trusted third parties. It is a decentralized, open, and shared ledger of transactions. A significant number of nodes are used to duplicate this ledger database. This ledger database is append-only and cannot be changed. That is, every entry is permanent. Any modifications made to it are reflected in all versions of the databases stored on different nodes. Trustworthy third parties do not need to act as mediators to verify, safeguard, and settle transactions. It is an additional layer that rests on top of the Internet and can coexist with other Internet technologies. Blockchain was developed to enable true decentralization, just the way TCP/IP was developed to provide an open system. To accomplish this, Bitcoin’s inventors released it open-source in the hopes that it will spawn a swarm of decentralized apps.

This section offers a description of typical blockchain features. Decentralization: Unlike a centralized architecture, which has issues such as scalability and a single point of failure, the blockchain employs a decentralized and distributed ledger [3] to pool the processing capacity of all blockchain network members, therefore reducing latency and eliminating single points of failure. Immutability: One of the blockchain’s most important properties is its ability to produce immutable ledgers, which preserves the integrity of transactions. Databases in conventional centralized systems can be changed, and trust with a third party is required to ensure information integrity [4]. Because each block in the distributed ledger connects to the preceding block, forming a chain of blocks, the blocks in blockchain technology are permanently stored and never altered as long as the participating user continues to maintain the network [5]. We will look at how cryptography and blockchain hashing make a blockchain immutable further in this chapter. Transparency: A blockchain provides a high level of transparency by sharing transaction data with all users engaged in those transactions [6]. There is no need for a third party in a blockchain setting, which enhances business friendliness and ensures a trustworthy workflow.

Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00005-X Copyright © 2023 Elsevier Inc. All rights reserved.

207

208 SECTION

A Evolution of distributed systems

Improved security: While security is an important concern for most new technologies, blockchain delivers better security since it has a public key architecture [7] that guards against unauthorized data changes [8]. Participants in the blockchain network place their confidence in the consensus mechanism’s integrity and security characteristics. Efficiency: A blockchain improves on the traditional centralized design by spreading database records across the blockchain network’s numerous users [9]. The dispersion of transactions makes it easier to check all of the entries in the database. In terms of cost, settlement speed, and risk management, blockchain is more efficient than traditional centralized architecture. Consensus: A consensus mechanism is a technique used in computer and blockchain systems to reach an agreement on a particular data value or a single network state across distributed processes or multi-agent systems like bitcoin [10,11]. The method of consensus is classified into two distinct classes: proof-based consensus algorithms, which require entities to show proof of effort or resource expenditure, and voting-based consensus algorithms, which require network participants to communicate their findings of validating new blocks or transactions before making a final judgment on new blocks.

1.1 Immutability Organizations spend trillions of dollars on cybersecurity solutions to keep prying eyes out of their personal information, however, they seldom must deal with the internal cybersecurity fight of ensuring that their data has not been tampered with, altered, or misrepresented by a company or its employees. They came to rely on systems such as private keys and user permissions to guarantee that data is correct in a variety of scenarios [12]. Neither systematically nor theoretically they can ensure that information in a traditional application database is completely tamper-proof. To ensure blockchain ledger’s ability to keep a permanent, indelible, and unalterable record of transactions, immutability, a unique characteristic of blockchain proponents, is emphasized as a key benefit [2,4]. Immutability has the potential to make audits more efficient and cost-effective, as well as boost trust and integrity in the data that businesses use and share regularly (Fig. 1).

How is immutability achieved We explore cryptographic hashing before discussing blockchain’s immutability. The basics of immutability are as follows: Cryptography: It is a security technique that consists of a mathematical set of rules and logic used to secure the communication between parties. In cryptography, a plaintext is converted into some hidden text using a logic known only to both the sender and the receiver. The objective of the cryptography technique is to send the information securely only to those who are authorized to see and read the information. Cryptography techniques are used in many ways, such as protecting information from theft or modification, providing authentication, and ensuring user and data access.

FIG. 1 Hierarchical structure of the proposed IP blockchain system.

Functional analysis of blockchain consensus algorithms Chapter

12

209

Hashing: A hashing technique is used to compact any arbitrary size input into a fixed-size output. The input can be given in any size and format such as integer, character, string, and binary. Hash functions work according to a specific data format, which is often called a hash table. This is used to map the input data values on stored values to produce the output. A hash function’s strength is that it is designed to be a one-way function, which means that a user cannot change the input back from a given output value. Undermentioned points enable to understand how a blockchain immutability achieved: l

l

l

A hash function takes the existing hash and creates a “Checksum”—a string of numbers and characters that serves as a digital signature. The Checksum will always relate to the exact data input—if two files change by one byte, the hashed outputs will be two completely different strings. This is analogous to the avalanche effect, in which a little change in input may have a large influence on the output. The primary advantage of the hashing process is that a hash cannot be reverse-engineered. In other words, it is impossible to discover the input data by working backward from an output string.

Hence, cryptography with blockchain hashing results immutability in a blockchain. Each transaction validated by the blockchain network is timestamped and integrated into a “block” of information that is cryptographically secured by a hashing process that it links to and contains the hash of the preceding block and joins the chain as the next chronological update. If data has been tampered with, then the blockchain will crash and the reason will be completely obvious. This functionality does not exist in traditional databases, where data may be readily updated or erased. Hence immutability prevents censor to restrict the information that has been broadcasted over the network and are not retroactively altered to fit a specific agenda.

1.2 Censorship resistance “Censorship resistant” systems try to stop censors from imposing a specific distribution of content across a system [13]. It is a property of a network that forestalls any party from altering information thereon. In crypto, if someone wants to transact on the network, the transaction is added to the distributed ledger following pre-set rules of the network protocol, the transaction is added and it is nearly impossible to alter with it, making it immutable. One of the main value prepositions of blockchain is censorship resistance. We know freedom is not the natural order of the world; we also know that bitcoin has an important history of circumventing censorship. The motive behind it is that data could be verified without relying upon an authority to ensure its decentralization or have such a power to control who can transact or store their wealth on the network which makes censorship resistance one of the greatest features of decentralized blockchain. Censorship resistance ensures that the laws that govern the network are not altered. While other financial institutions are owned by the government or private organizations, bitcoin is the first truly selfregulated currency. When a transaction is submitted to the network, it is relayed from node to node until it reaches most of the nodes. These nodes keep unconfirmed transactions in a database called the mempool, and miners gather transactions from the mempool to add the blocks, they decide to add to that blockchain. When a miner mines a block with the transaction in it, that transaction is considered confirmed and is removed from the mempool. This process has few checkpoints. Once an individual reaches a node on the network, they can broadcast a transaction and can trust that it will be confirmed. To prevent the attempts of the governments or any organization to censor transactions, Bitcoin developers have engineered many ways of broadcasting transactions, including over mesh networks, satellites, and HAM radio.

1.3 Peer-to-peer (P2P) network The P2P model is likewise at the center of blockchain innovation and has utilization with the coming of digital cryptocurrency. Peer-to-peer network also known as P2P is a distributed network application that goes back to the 80s, where they were first set for business purposes. Nonetheless, the idea was acquainted with the public in 1999 when Shawn Fanning and Sean Parker made a music-sharing service, Napster. This service immediately turned into a center for the unapproved sharing of copyrighted songs; after two years, Napster was closed by lawmakers because of a claim from the American music industry. This brought about another age of P2P administrations needing to make up for the shortfall and further the advancement of decentralized organizations. Today, the P2P model is utilized in web crawlers, online commercial centers, streaming stages, P2P blockchains, and the IPFS (Interplanetary File System) web convention [14]. Nonetheless, a dispersed network like blockchain where computers maintain a peer-to-peer model because each node holds a copy of the files, it acts as both a server and a client, the

210 SECTION

A Evolution of distributed systems

computers do not need a server or a central administrator. As a result, each node can either upload or download files for other nodes. Instead of using a central server, these nodes save their data on their hard drives. P2P networks are faster and more efficient [15] since each node has the same capabilities for storing, transmitting, and receiving files. A P2P network, unlike traditional designs, has no single point of failure, and has a distributed topology that makes it highly resistant to cyberattacks. In a P2P network, the communication model consists of a group of devices (nodes) that collectively store and share files where each node acts as a private peer. During this network, P2P communication is completed with no central administration or server, which suggests all nodes have equal power and perform an equivalent task. Peer-to-peer architecture is categorized as structured, unstructured, and hybrid P2P networks. In structured peer-to-peer systems, the nodes are organized, and each node can efficiently search in the network for the specified data. The unstructured P2P networks are formed by nodes randomly from connection to each other but are not as efficient as structured P2P models; then, we have hybrid models that are a mixture of P2P and client-server models, in comparison with the structured and unstructured P2P systems, these networks present improved performance.

P2P network in blockchain The blockchain takes advantage of the power of peer-to-peer networks to create a shared and trusted ledger of transactions [16]. As in blockchain, networks are managed by no centralized authority, and only the members can validate transactions among themselves. People and institutions can trust the output without having to trust the participants. This novel method of networked data storage and administration functions as a digital ledger that keeps track of all transactions and activities in real time. The notion of blockchain as a peer-to-peer network first gained traction in 2008 as part of a proposal for Bitcoin, designed to solve the age-old problem of trust. Satoshi Nakamoto [17], the developer of Bitcoin, described it as a “peer-to-peer electronic cash system” to create a P2P digital form of money free of banks. A blockchain’s data is formatted differently than that of a traditional database. A blockchain organizes data into blocks, whereas a database organizes data into tables. Each transaction on the network is added to these blocks, which have a limited storage capacity. Once a block is full, a new block is appended to the previously filled block to include new transactions, producing a blockchain [18]. As a result, blockchains are decentralized and do not store data in a central location. Instead, they are kept in network nodes or computers. Every node has a copy of the blockchain, which contains all the network’s transactions. As a result, every single node in the network is backing up the system. Although certain and unique blockchains can be held by several entities, no one owns the technology. Even though blockchain is most linked with Bitcoin, its origins may be traced back to the work of Stuart Haber and W. Scott Stornetta in 1991. However, as blockchain technology is a protocol, it does not matter who invented it. While you can claim ownership of a blockchain application, you cannot claim ownership of blockchain technology. Users can buy or sell crypto directly with another user on a peer-to-peer (P2P) exchange [16]. A user can browse the purchases and sell offers made by users on the platform. Each offer offers a different set of payment choices, a different rate, and in most cases, a minimum and maximum purchase quantity. A buyer might choose an offer and contact the seller to finalize the deal. If you’re a seller, you can specify the accepted payment method and any associated fees. To protect the platform’s security, most P2P crypto exchanges use an escrow account to deposit cryptocurrency or other collateral from users. In each transaction, the network nodes validate the transaction among themselves and reach an agreement in a P2P network, this general agreement of validating transaction in a blockchain is consensus.

2.

Consensus

Consensus is defined as finding a common ground between extreme agreement and utter disagreement. Individuals who have come together to agree on a particular topic are referred to as a consensus. A consensus has no winners or losers. Everyone understands why the final solution or option is the best alternative for addressing the problem. Hence, it is a win-win situation for everyone. For almost three decades, consensus methods in distributed systems have been a well-studied research issue [19]. Such techniques allow a group of remote nodes to reach an agreement on a common state/data. The requirement for a shared state gave rise to the concept of replicated database systems, which ensured network resilience in the face of node failures. When one or more nodes fail to perform as planned, such database systems ensure that data is not lost. To establish distributed node consensus, these nodes must all receive the same batch of messages in the same order (the phenomenon known as atomic broadcast). Establishing a protocol that enables timely dissemination and atomic broadcast of messages among

Functional analysis of blockchain consensus algorithms Chapter

12

211

nodes is essential since it influences how a distributed consensus is formed and maintained in many ways. As a result, a consensus protocol is a proper name for such a protocol. It is hard to design and maintain a consensus protocol as it must consider several key variables such as node resilience, node behavior, network partitioning, network latency, corrupt or out-of-order inputs, and so on. A consensus protocol should have three characteristics: consistency, availability, and fault tolerance. Within distributed systems, there are two primary fault-tolerance models: crash failure (or tolerance) and Byzantine failure [11,20,21]. The crash failure model addresses nodes that simply do not react owing to hardware or software problems. The Byzantine failure model, on the other hand, deals with nodes that misbehave because of software flaws or being penetrated by an attacker. A Byzantine node initially observed and formalized by Leslie Lamport in 1982 [22] might behave maliciously by randomly delivering misleading messages to others, thereby jeopardizing distributed system security. As a result, such nodes are primarily useful in applications with security considerations. Crash-tolerant consensus and Byzantine consensus are the two main types of consensus algorithms that can be used to address these two failure patterns [20]. We will address each of them briefly, along with their associated features. 1. Crash-tolerant consensus: This class of algorithms aims to ensure atomic broadcast (complete order) of messages within participating nodes in the event of a fixed number of node failures. These algorithms make use of the concept of perspectives or epochs, which refers to a time or occurrences. Each epoch has a leader who makes decisions about the atomic broadcast, and all other nodes follow those judgments. If a leader fails due to a crash, the protocol elects a new leader to take over. The most well-known algorithms in this class can continue to function if the following condition is met: t < n/2, where t denotes the number of malicious nodes and n denotes the total number of participating nodes [20]. Some well-known crash-tolerant consensus methods are Paxos [23,24], Viewstamped Replication [25], ZooKeeper [26], and Raft [27]. 2. Byzantine consensus: This class of algorithms seeks to establish an agreement in the presence of specific nodes that display Byzantine behavior. Such Byzantine nodes are considered to be under the control of an attacker and to act erratically with malevolent intentions. These protocols, like any crash-tolerant consensus protocol, use the idea of a leader election in a view/epoch for atomic broadcast, and other honest nodes are expected to follow the leader’s orders. Byzantine Fault Tolerant (BFT) consensus algorithms are consensus algorithms that may reach agreement in the presence of a given number of Byzantine nodes, with Practical Byzantine Fault Tolerant (PBFT) being one of the most well-known algorithms in this category [28]. The PBFT tolerance threshold is ƒ < n/3, where ƒ represents the number of Byzantine nodes in the network and n represents the total number of nodes [20].

2.1 Consensus taxonomy With the introduction and growth of various blockchain systems, several consensus algorithms have emerged, each with its unique set of characteristics and purposes. We must create evaluation criteria to compare these distinct sets of consensus methods. These assessment criteria are in the form of consensus property taxonomies. These features were culled from earlier research [20,21] and organized into a taxonomy in this chapter. The four major sets of qualities that comprise a consensus mechanism are structural, block and reward, security, and performance. Each of these characteristics is explored briefly below.

Structural properties Structural characteristics specify how various nodes in a blockchain network are organized to participate in a consensus method. As shown in Fig. 2, these characteristics may be subdivided into several groups. Each of these groups is briefly described below. l

l

l

Node types: It refers to the various types of nodes that a consensus algorithm must interact with to reach a consensus. The kinds will be determined by the specific consensus algorithm, which will be discussed in the later sections. Structure type: It refers to how different nodes within the consensus process are constructed utilizing the idea of a committee. There are two sorts of committees: single committees and multiple committees. Underlying mechanism: This refers to the precise method used by a consensus algorithm to choose a specific node. The process might be based on a lottery, the age of a certain coin (also known as coinage), or a voting system. A lottery can use a cryptography-based probabilistic method or other randomly generated processes. Voting can take place in a single or several rounds in a voting process. The coinage, on the other hand, makes use of a unique feature that is determined by how long a coin has been kept by its owner.

212 SECTION

A Evolution of distributed systems

CONSENSUS PROPERTIES

SECURITY PROPERTIES

BLOCK & REWARD PROPERTIES

STRUCTURAL PROPERTIES

PERFORMANCE PROPERTIES

FIG. 2 Properties of consensus mechanism.

Types of Committees l Single committee: A single committee is a subgroup of participating nodes who actively participate in the consensus process by creating blocks and growing the network. Each committee can have its own set of features, which are mentioned briefly below. l Committee type: A committee can be open or closed at any time. A closed committee is confined to a chosen set of nodes, whereas an open committee is open to all participating nodes. l Committee configuration: A committee can be set up in either a static or dynamic manner. (a) Static: In a dynamic static configuration, the members of the committee are pre-selected and fixed in a static arrangement. New members are not permitted to join and participate in the consensus process. (b) Dynamic: In a dynamic configuration, the committee members are specified for a time (known as an epoch), after which new members are added and old members are removed depending on certain criteria. In such a committee, nodes are chosen by a voting process, with voting taking place in either a single or several rounds. Some consensus methods, on the other hand, do not define a period, thus members can join or depart at any moment. In such arrangements, nodes are chosen using a lottery method that uses either a cryptography-based probabilistic technique or other randomized mechanisms. l Multiple committees: It has been found that as the number of members in a single committee grows, the time necessary to obtain consensus rises [21], lowering performance. To remedy this problem, several committees were formed, each of which was made up of different validators (special nodes tasked with generating blocks in a certain type of blockchain system, as explained later) [21]. A multi-committee might have several different qualities. We will have a look at two properties (a) Topology: The way various committees are organized is referred to as topology. For example, the topology might be flat to suggest that various committees are on the same level, or it can be hierarchical to show that the committees are on separate levels. (b) Committee Additionally, multiple committees, like a single committee, can be configured statically or dynamically.

Block and reward properties This type of property may be utilized as a quantitative metric to differentiate between different cryptocurrencies. The attributes are depicted in Fig. 3: genesis date, block reward, total supply, and block generation time. Although, except for the

Functional analysis of blockchain consensus algorithms Chapter

12

213

FIG. 3 Block & reward properties of consensus.

genesis date, most of these characteristics do not explicitly characterize separate consensus algorithms, they do have a direct and indirect impact on how consensus is reached in a cryptocurrency-based blockchain system. For example, incentivizes miners to operate in a certain way by solving a cryptographic problem, which is then used to reach an agreement. The following are the properties: l l l l

Genesis date: The timestamp when a blockchain system’s first block was produced is referred to as the genesis date. Block reward: The reward a node receives for generating a new block is referred to as block reward. Total supply: A crypto-complete currency’s supply is represented by total supply. Block time: The average block generation time of a blockchain system is represented by block time.

Security properties A consensus algorithm must meet several security characteristics, as illustrated in Figs. 3 and 4. Fig. 3 depicts several security characteristics, whereas Fig. 4 depicts various attack paths. The following are descriptions of the specified security characteristics and attack vectors: l

l l l

Authentication: This refers to whether or not nodes participating in a consensus process must be properly verified/ authenticated. Non-repudiation: Indicates whether or not a consensus protocol fulfills non-repudiation. Censorship: This indicates whether or not the associated algorithm can withstand any censorship resistance. Attack vectors: The attack vectors relevant to a consensus method are implied by this characteristic. There are three types of attack vectors: common, PoW attacks, and PoS attacks. We present the common attack vectors here because they are crucial to any consensus procedure. PoW and PoS assaults, as shown in Fig. 5, are, on the other hand, relevant to that specific family of consensus methods, we will talk about them in their section

FIG. 4 Security properties of consensus.

214 SECTION

A Evolution of distributed systems

ATTACK VECTOR PoW Attack

Common Attack

• • • • •

Sybll Double Spending DoS Spawn-Camping Eclipse



Selfish Mining

PoS Attack



Nothing At Stake (NAS)

• • • • •

Bribing Long-Range Accumulation Grinding Cartel

Adversary Attack

FIG. 5 Attack vectors of consensus.

(a) Adversary tolerance: The maximum number of Byzantine nodes supported/tolerated by the protocol. (b) Sybil: An attacker can clone his identity as needed in a Sybil attack [29] to gain dubious benefits. A Sybil attack in a blockchain system refers to a situation in which an attacker may create/control as many nodes as needed inside the underlying P2P network to affect the distributed consensus process and taint its conclusion in their favor. (c) Double spending: Any financial system, including cryptocurrencies, is vulnerable to a double-spending assault. A user of the relevant cryptocurrency might spend their cryptocurrency twice as a result of this assault [30]. (d) DoS (Denial of Service) and spawn-camping: An attacker can disrupt a blockchain system by launching DoS attacks. Adversaries can join together to undertake a spawn-camping attack, in which they continuously launch DoS assaults on the same network, rendering it useless for the relevant blockchain system [31]. (e) Eclipse: In an eclipse assault, an attacker tries to hide a blockchain (victim) node’s view of the blockchain [15]. Because the victim is ignorant of how the blockchain is growing, he or she may be targeted for additional attacks like as double spending and selfish mining [15].

Performance properties This group’s characteristics can be used to assess the quantitative performance of a consensus protocol. Each characteristic is described briefly below, with an illustration in Fig. 6. l

Energy consumption: It shows whether the algorithm (or the machine it is running on) consumes a considerable amount of energy.

FIG. 6 Performance properties.

Functional analysis of blockchain consensus algorithms Chapter

l

l l

l

12

215

Fault tolerance: The greatest number of defective nodes that a consensus system can accept is referred to as fault tolerance. Throughput: The number of transactions that the protocol can process in one second is referred to as throughput. Scalability: The capacity to expand in size and functionality without affecting the original system’s performance is referred to as scalability [32]. Latency (Finality): It is defined as “the time it takes from the moment a transaction is proposed to the time consensus is established on it” [21]. It is sometimes referred to as finality.

3. Proof of work (PoW) Dwork and Naor introduced the concept of PoW in a seminal essay published in 1993 [33]. They proposed that PoW be used to stop email spamming. According to their idea, an email sender would be required to solve a time-consuming mathematical puzzle and attach the solution to the email as proof of completion. Only if the solution can be satisfactorily confirmed will the email recipient accept it. Back et al. [34] If a certain amount of work must be completed before sending an email, then spamming a large number of individuals would need a significant amount of computation. This can aid in the prevention of email spam. Similarly, in blockchain, if some amount of compute-intensive work is performed before producing a block, it can help in two ways: first, it will take some time, and second, if a node is attempting to inject a fraudulent transaction in a block, rejection of that block by the rest of the nodes will be very costly for the one proposing the block. This is since the computation used to obtain the PoW will be worthless. Consider the difference between presenting a block without much effort and performing some hard work to be able to propose a block. If it was nearly effortless, then proposing a node with a fake transaction and being denied would not have been a major issue. People may simply keep proposing such blocks in the expectation that one will make it through and into the blockchain at some point. Putting forth some effort to propose a block protects a node from inadvertently inserting a fake transaction. Proposing a node with a false transaction and being refused would not have been a big problem if it had been done with effort. People may just continue to submit such blocks in the expectation that one of them would be accepted and put to the blockchain at some time. On the contrary, making the effort to propose a block prevents a node from accidentally adding a fake transaction. Hashcash is the first example of a PoW technique (Fig. 7) being used in a real system. Hashcash is meant to fight spam in the same way as Dwork and Naor’s proposal. Many PoW blockchain systems use a similar principle in which each PoW mechanism is tied

FIG. 7 How does PoW works [35].

216 SECTION

A Evolution of distributed systems

to a difficulty parameter. The prover would do the computational work in numerous rounds until a PoW matching the necessary threshold is created, and each round is referred to as a single proof attempt. Also, the complexity of the job should be changeable so that the pace at which the blocks are created may be controlled. You’re probably wondering what type of work we’re talking about if we’re talking about anything that takes some computation and time. It is a simple yet difficult task. An example might be useful here. Consider a situation in which you must discover a number whose hashed output begins with the letter “a.” How would you go about it? We’ve learned about hash functions and realized there are no shortcuts. So you’d just keep guessing (maybe take any number and increase it by one) and hashing the numbers to check if it meets the bill. If the difficulty level has to be raised, say it begins with three consecutive a’s. Finding a solution for something like “axxxxxxx” is easier than finding a solution for “aaaxxxxx” because the latter is more restricted. In the above example, if many nodes are attempting to solve such a computational problem, you will never know which node will solve it first. This may be used to choose a random node (really random because there is no method behind it) to solve the problem and propose the block. It is critical to highlight that in the case of public blockchains, the nodes who spend their computer resources must be rewarded for honest behavior; otherwise, such a system would be impossible to sustain. PoW has long been the most popular method for reaching a distributed consensus among participants on block order and chain state. The Sybil attack is deterred by this technique. To participate in a resource-intensive PoW mechanism during the block generation process in PoW, every mining node would have to make a large monetary commitment. An attacker’s monetary expenditure in initiating a Sybil attack will be proportional to the number of Sybil identities, which may outweigh any benefit received from conducting a Sybil assault. When a blockchain fork occurs, the PoW method is utilized as an input to a function that is then used to establish the needed distributed consensus [36]. Compute-bound PoW, memory-bound PoW, and chained PoW are the three primary kinds of PoW consensus methods. The following sections delve deeper into each of these topics.

3.1 Compute-bound PoW A compute-bound PoW, also known as a CPU-bound PoW, uses a CPU-intensive function to do the needed computational job by exploiting the processing units’ capabilities (e.g., CPU/GPU) rather than the system’s main memory. The Nakamoto consensus algorithm is a compute-bound PoW consensus method. It is based on Hashcash’s concept, but it is been tweaked to work in a blockchain environment. Understanding how Bitcoin works will help you comprehend the Nakamoto consensus. Within a P2P (peer-to-peer) network, there are two sorts of nodes: miners (who function as provers) and general nodes (acting as verifiers). Users usually use a generic node to transfer bitcoin throughout the network, while a mining node is a specialized node that generates (mines) bitcoins. To join the network, each node must first download the Bitcoin software. Each user creates an identity by using a wallet, which is a specific program that comprises a private/public key pair and a bitcoin address obtained from the corresponding public key. To send a bitcoin, the sender needs to know the receiver’s address. Bitcoin is traded between two parties using wallet software and the notion of a transaction. This transaction is broadcast to the network and is gathered by all miner nodes. Each miner node groups these transactions into a block and then collaborates with other miners to solve a cryptographic problem in multiple proof attempts until the answer is found. In each of these proof attempts, a miner attempts to produce a random number by applying a hash function to transactions and other data that meets the needed condition: the random number must be smaller than a value known as the difficulty goal. When a miner solves the problem successfully, that miner is considered to have created a legitimate block, which is subsequently spread throughout the network. Furthermore, before reaching the maximum number of Bitcoins, the Bitcoin protocol creates a set number of additional Bitcoins for each new valid block and pays the miner for their efforts. Other miners validate the freshly minted block before adding it to the network. Each new block refers to the preceding block in the chain, which in turn refers to the block before it, and so on. However, the very first block in the chain, known as the genesis block, does not have such a reference. Because of the decentralized nature of this mining process, several valid blocks may be created by various miners, resulting in multiple branches arising from the same blockchain. This is referred to as a fork on the blockchain. The primary objective of the corresponding consensus protocol is to resolve this fork such that only one branch remains and the other branches are eliminated. The Nakamoto consensus method, which is used in Bitcoin, has a simple rule: it allows the branches to develop. When one branch outgrows the others (more specifically, when one branch’s total cumulative computing effort surpasses the others), all miners choose the longest branch (or the branch with the highest computational

Functional analysis of blockchain consensus algorithms Chapter

12

217

effort), rejecting all other branches. This is referred to as the main branch, while the minor branches are referred to as orphan branches. Only miners on the main branch have the right to collect Bitcoin rewards. A distributed consensus arises in the network when a fork is resolved across the network. The use of CPU/GPU in the Nakamoto consensus opens up the possibility of significantly optimizing computation for quicker calculation utilizing application-specific integrated circuit (ASIC) rigs. This has sparked debate among cryptocurrency fans since general-purpose computers cannot be used to participate in the mining process, and so the mining process is mainly centralized within several mining nodes.

3.2 Memory-bound PoW One significant critique of any compute-bound PoW is that it encourages the use of ASIC-based mining equipment. Memory-bound PoWs have been offered as a counter-argument to this objection. A memory-bound PoW necessitates many accesses to main memory by the method [37]. As a result, it eventually constrains the algorithm’s performance within the constraints of access latency and/or bandwidth, as well as memory capacity. This limits the ability of ASIC rigs relying on memory-bound PoW to outperform their CPU/GPU-based equivalents. Furthermore, the profit margin of developing ASIC with memory and then manufacturing mining rigs with them is currently not practical for certain types of PoWs [38]. As a result, memory-bound PoWs are seen as a preferable substitute for compute-bound PoWs in terms of demonopolizing mining concentrations around select key mining nodes.

3.3 Chained PoW To achieve ASIC resistance, a chained PoW employs many hashing functions linked together in a sequence of successive stages [39,40]. Furthermore, it seeks to overcome a specific shortcoming of every compute-bound and memory-bound PoW algorithm: their reliance on a single hashing function. With the advent of quantum computing, the security of a certain hashing method may be jeopardized, jeopardizing the security of the related blockchain system. If this occurs, the old algorithm must be abandoned, and a new quantum-resistant hashing algorithm must be included in the relevant blockchain using a technique known as a hard fork, which is a mechanism used to impose a significant upgrade in a blockchain system. This is a complicated disruptive operation that has the potential to damage any blockchain system. In such cases, a chained PoW algorithm would keep running until all of its hashing functions were compromised.

3.4 Why PoW The primary advantages are the resistance against denial-of-service (DoS) attacks and the low impact of stake on mining options. Defend against denial-of-service (DoS) attacks. PoW imposes some restrictions on network activity. They will need a significant amount of effort to complete. A successful assault needs a significant amount of processing power as well as a significant amount of time to complete the computations. As a result, the attack is viable but somewhat pointless due to the enormous expenses. Possibilities for mining It makes no difference how much cash you have in your wallet. It is important to have a lot of computing power to solve the riddles and make new blocks. As a result, the owners of vast sums of money are not in command of the entire network’s actions. The primary drawbacks include high costs, calculations that are “useless,” and a 51% attack. Expenses are enormous. To perform the complex algorithms, mining needs extremely specialized computer gear. The expenses are uncontrollable. Mining is increasingly restricted to certain mining pools. This specialized equipment uses a lot of energy to run, which raises expenses. Large expenses pose a challenge to the system’s centralization, which has several advantages. In the case of Bitcoin, this is clear. If one is asked about the most popular and adopted consensus algorithm since the introduction of Bitcoin, then it is going to be proof of work, or we can say PoW. In PoW, the power of computers is used to win the right of adding new blocks to the blockchain. If a new block is detected and added to the network of blockchain, the node linked to that block is entitled to receive the predefined transaction fees. Computational power is used to solve a particular hash puzzle, the solution of which is included in the resulting block. The process of solving the puzzle is computationally intensive and nearly impossible for a human to do so. Finding a solution is like a miner discovering gold; hence, the hashing process is referred to as mining, and the node performing that hashing process is known as a miner. Any willing and interested entity can participate in mining by using its computing power and their electric energy too, which leads to PoW consuming an immense amount of energy. For example, the energy required to run the Bitcoin blockchain network and

218 SECTION

A Evolution of distributed systems

Ethereum blockchain networks are equivalent to powering 3.5 million households and 1 million households, respectively. Apart from the energy consumption, other benefits of proof of work include low throughput and decentralization. For an adversary to circumvent the PoW protocol and disrupt the consensus, it must accumulate greater computing assets compared to the combined computing asset of all honest mining entities distributed around the world. This is referred to as the 51% attack. People around the globe think that it is not possible to execute this kind of attack over a blockchain network because this does not seem economically feasible to arrange so much computational power at a time; however, the invention of mining pools and the use of application-specific integrated circuits (ASICs) have shown the possibility to make this kind of attack. Instead, most of the cryptocurrencies are based on proof of work. Bitcoin, Ethereum, Litecoin, and Dogecoin are live-running examples of this.

3.5 Limitations of PoW Starting with Bitcoin, the PoW (Nakamoto) consensus algorithm has received widespread acclaim for its breakthrough in the distributed consensus paradigm. It has provided the groundwork for further progress, which has resulted in various PoW algorithms and blockchain systems that enable cryptocurrencies, as mentioned in prior sections. Nonetheless, there are some major constraints. Following that, we will go through these restrictions briefly: (a) Energy consumption: Each PoW method necessitates the use of power to compute the hash. As the network’s difficulty increases, so do its energy usage. When measured throughout the whole network of ASIC/GPU mining rigs globally, the amount of energy consumed is substantial. According to Dichotomist, a website that analyzes Bitcoin and Ethereum’s electricity usage, the energy consumption of Bitcoin and Ethereum is around 40 TWh (terawatt-hour) and 10 TWh, respectively, [25] to put this in context, it is estimated that the electricity required by Bitcoin in a year could power 6,770,506 American households, which is much more than what the Czech Republic consumes in a year [41]. The use of such a massive quantity of power has prompted concerns about the long-term viability of PoW-based blockchain systems. (b) Mining centralization: As the difficulty rate of mining increases, miners in a PoW-based blockchain system must update the capabilities of their ASIC/GPU mining rigs to increase their chances of producing a new block. Nonetheless, it is becoming increasingly difficult for a single miner to participate in the mining process without a significant investment in the mining rigs. This pattern suggests that economies of scale have a significant influence on PoW algorithms. The benefit a producer can get by raising its output is referred to as economies of scale in economic theory [42]. This occurs because the supplier may spread the cost of per-unit manufacturing across a greater number of items, increasing the profit margin. This parallel also applies to PoW mining, as will be described further. A mining pool may be formed by aggregating the mining resources of many miners to enhance the likelihood of generating a new block. Once a mining pool receives payment for producing the next block, the reward is proportionately distributed to the miners that participated. Unfortunately, this has resulted in centralization issues, with the likelihood of block constructions progressively being confined to a small number of miners. According to [43] (a website that analyzes the hash-rate distribution of mining pools), just five mining pools control 75% of the network’s hash rate, and there is a chance of collusion, which may lead to a 51% attack. (c) The tragedy of commons: Many PoW algorithms suffer from the economic dilemma known as the Tragedy of the Commons. The tragedy of the commons happens in economic theory when each entity strives to maximize its profit from a dwindling supply without considering the well-being of those who share the same resource [44]. This occurs in a blockchain system where the reward mechanism is deflationary and has a finite quantity, such as Bitcoin. It has been suggested that when the incentive for producing a new block in Bitcoin reaches practically nothing, miners will be forced to rely exclusively on transaction fees to fund their expenditures. This might lead to an unhealthy rivalry among miners to include as many transactions as feasible to maximize profit. As a result, transaction fees will continue to fall, perhaps leading to a situation in which miners do not generate enough profit to continue mining. Eventually, more miners will abandon the mining process, perhaps leading to a 51% assault or other situations that might destabilize the Bitcoin network. (d) Absence of penalty & attack vectors: All PoW algorithms (both compute and memory restricted) are altruistic in that they reward good miners while penalizing bad ones. A miner, for example, may unlawfully increase its profitability by working with a gang of miners (a practice known as the selfish mining attack) [45]. A miner can potentially launch a denial-of-service attack by simply not sending any transaction or block over the network, or by spawn—camping. Any miner who engages in such purposeful misbehavior would be discouraged by a penalty mechanism.

Functional analysis of blockchain consensus algorithms Chapter

12

219

The probability of validating a new block is controlled by the size of a person’s stake.

Validators are not rewarded with new blocks; instead, they are rewarded with network fees.

Proof of stake systems are far more cost effective than proof of work systems, although they are less proven. FIG. 8 Proof of stake consensus mechanism.

4. Proof of stake (PoS) To address the limits of any PoW method, another consensus technique known as proof of stake (PoS) (Fig. 8) has been suggested. The first suggestion for a PoS algorithm was made on the bitcoin talk forum in 2011 [46]. Soon after, several projects began exploring the concept. Peercoin was the first blockchain cryptocurrency to use the PoS consensus method when it was introduced in 2012. The basic principle of PoS is that nodes that want to participate in the block generation process must first show that they hold a specific quantity of stake. Furthermore, to participate in the block generation process, they must deposit a specific quantity of their currencies, known as a stake, into an escrow account. The stake serves as an assurance that it will follow the protocol’s guidelines. In PoS terminology, the stakeholder, leader, forger, or minter is the node that escrows its stake in this way. If the minter misbehaves, it may forfeit the stake. When a shareholder escrows his or her investment, he or she becomes a member of an elite group. Only members of this exclusive group are allowed to participate in the block-making process. If a shareholder is allowed to construct a new block, he or she will be compensated in a specified way.

4.1 Various properties of PoS Advantages: It has been suggested that combining the incentive approach with any punitive mechanism can offer a security level comparable to any PoW algorithm. PoS can also provide several additional benefits. Following that, we will go through some of the advantages of using a PoS method. Energy Efficiency: In a PoS approach, no node is required to answer a resource-intensive cryptographic challenge. As a result, as compared to their PoW counterpart, such an algorithm saves a lot of energy. As a result, any PoS algorithm-based cryptocurrency is more likely to be long-term sustainable. Mitigation of centralization: Economies of scale have less of an influence on a PoS algorithm. There is no method to maximize profits by raising production because no mining gear is required to solve any resource-intensive cryptographic challenge. As a result, it is less vulnerable to the mining pool’s centralization problem. Explicit Economic Security: Any misbehaving assault, including spawn-camping, may be deterred by a wellconstructed punishment system in a PoS algorithm. Anyone who engages in such assaults will lose their stake and,

220 SECTION

A Evolution of distributed systems

depending on the protocol, may be barred from participating in any future block generation process. This will help to enhance the system’s security in the long run. Bootstrapping: One of the most difficult aspects of a PoS algorithm is generating the initial coins (cryptocurrencies) and distributing them equitably among the stakeholders so that they may be utilized as stakes. The bootstrapping difficulty is what we call this roadblock. The problem of bootstrapping can be approached in two ways: l

l

Pre-mining: A set of coins is pre-mined and sold before the system’s launch in an IPO (Initial Public Offering) or ICO (Initial Coin Offering). PoW-PoS transition: To properly divide the coins among the stakeholders, the system begins with a PoW mechanism. Then, it gradually transitions to a point-of-sale (PoS) system.

Reward Process: Another significant feature is the incentive system, which encourages stakeholders to participate in the minting process. Unlike other PoW systems, where a miner is paid with new coins for generating a valid block, there is no such incentive. Instead, inside a PoS algorithm, two sorts of reward mechanisms are possible to incentivize a minter: l l

Transaction Fee: Fees from transactions contained in the minted block can be collected by the minter. Interest Rate: The currency is set with a lower interest rate, allowing it to expand over time. As a reward for generating a valid block, the minter receives this interest.

Selection process: How to pick the shareholder who can mint the next block is a critical component in any PoS process. A miner is chosen in a PoW method depending on who can discover the resource-intensive desired hash. Because PoS does not use a hash to find the next block, there must be a way to choose the next stakeholder.

4.2 Types of PoS Chained, BFT, and delegated are the three methods of proof of stake currently available. Following that, we will take a look at these techniques.

Chained PoS The fundamental concept behind a chained PoS is to use a combination of PoW and PoS algorithms to reach any kind of agreement. As a result, inside the same blockchain system, there can be two sorts of blocks: PoW and PoS. To do this, the corresponding algorithm uses various ways to select/assign a certain miner for generating a PoW block or a group of validators for establishing a PoS block in various epochs or after a given amount of blocks has been generated. In principle, a chain-based PoS can pick a miner/stakeholder in one of three ways: l l

l

Randomized PoW mining: A miner is chosen at random who can solve the related cryptographic PoW puzzle. Randomized stakeholder selection: To choose the next stakeholder, a randomized PoS uses a probabilistic algorithm that takes into consideration the staked currency and other factors. The remaining parameters guarantee that a stakeholder is not chosen only based on the number of coins they have pledged and serves as a pseudo-random seed for the probabilistic algorithm. Coinage-based selection: A coin’s age is defined as the amount of time it has been held by its owner. The coinage of a coin may be defined as five coin-days if an owner gets a coin from a sender and keeps it for five days. Formally, Coinage ¼ coinholdingperiod

Stakeholders’ staked coins and their related coinage can be used to choose a stakeholder.

BFT PoS BFT PoS is a PoS algorithm with several rounds. In the first phase, a set of validators is chosen at random to propose a block. However, the consensus on adding this block to the chain is contingent on a + 2/3 quorum of the validators on multiple rounds. It inherits any BFT consensus characteristics and can withstand up to one-third of Byzantine behavior among nodes.

DPoS Delegated proof of stake (or DPoS) is a type of consensus algorithm in which reputation scores or other techniques are utilized to choose the set of validators [47]. Even though it has the moniker proof of stake, it differs from other PoS algorithms in terms of how validators are chosen within a system and the number of validators deployed.

Functional analysis of blockchain consensus algorithms Chapter

12

221

In DPoS, network users vote to pick a set of delegates (or witnesses) who are in charge of constructing blocks. Users select their delegates using reputation ratings or other means. Only delegates can propose additional blocks. Each round, a leader is chosen from among the delegates who can propose a block. The mechanism determines how such a leader is picked. The leader is rewarded for generating a new block, but it is penalized and removed from the set of validators if it is discovered to be misbehaving. The delegates compete with one another to be included on the validator list. As a result, each validator may provide varying amounts of incentives to voters who vote for it. For example, if a delegate is chosen to propose a block, it may share a portion of its reward to the people who voted for it. Because the number of validators is limited, the consensus finality may be achieved quickly. Each round, a leader is chosen from among the delegates who can propose a block. The system determines how such a leader is picked. The leader is rewarded for generating a new block, but it is penalized and removed from the set of validators if it is discovered to be misbehaving. The delegates compete with one another to be included on the validator list. As a result, each validator may provide varying amounts of incentives to voters who vote for it. For example, if a delegate is chosen to propose a block, it may share a portion of its reward to the people who voted for it. Because the number of validators is limited, the consensus finality may be achieved quickly.

4.3 PoS’s limitations Even though different variations of distinct PoS algorithms offer several important advantages, these algorithms nevertheless have a few drawbacks. These drawbacks are discussed more below. l

l

Collusion: If the number of validators is insufficient, colluding with other validators may make it simpler to execute a 51% assault on the corresponding consensus process. Wealth Effect: When a consensus algorithm or validators are chosen solely based on coin worth, it creates an atmosphere in which those with a high number of coins may exercise more influence.

Aside from these drawbacks, a few more attack routes for PoS algorithms have been identified: I. Nothing-at-stake (NAS) attack (proof of stake vs proof of work, 2015): During a blockchain fork, an attacker may attempt to add its freshly produced block to all forked branches to improve the likelihood of their block being included as the legitimate block. In any PoW algorithm, such a circumstance is unlikely to arise. This is because a miner would need to exchange resources to mine at various branches. Because of the resources shared by numerous branches, this would gradually reduce their chances of discovering a new block. The attacker is encouraged to do so since it costs nothing for a minter in a PoS algorithm to add blocks in numerous simultaneous branches. Punishment for such misbehavior might effectively address this issue. II. Bribery (short-range, SR) attack: An attacker attempts to double spend by generating a fork in this attack. The following is an example of such an assault [48]. The attacker makes a payment to the vendor to purchase a product. Before delivering the good to the attacker, the seller waits for a specific number of blocks (e.g., six blocks). Once the payment is made, the attacker forks the main chain at the block (e.g., six blocks back, which is quite short, hence the name). The attacker then pays additional minters to mint on the forked branch. It is always bribed for the attacker as long as the bribed amount is less than the price of the supplied product. The cooperating minter has nothing to lose if combined with their nothing-at-stake assault but can benefit from the bribery. Again, it may be addressed by establishing a punishment system for all offending parties. III. Long-range (LR) attack: After collaborating with the majority of stakeholders, an attacker attempts to construct an alternate blockchain starting from the very first blocks [31]. The reason might be comparable to double spending or other concerns that benefit the attacker as well as the colluding parties. As previously stated, if the colluding stakeholder can be combined with the nothing-at-stake assaults, the colluded stakeholder has nothing to lose. Check pointing is one of the techniques for dealing with it. Check pointing codifies a portion of the blockchain to make it non-forkable up to that point, thwarting the assault. IV. Coinage accumulation (CAC) attack: This attack is vulnerable to PoS algorithms that use an unlimited coinage option [31,49]. In this attack, the attacker waits for enough coinage to accrue before triggering a fork to exploit the mechanism for launching multiple spends. This assault can be countered by imposing a coinage restriction, which reduces the attack vector. V. Pre-computing (PreCom) attack: A pre-computing attack, also known as a stake-grinding attack, allows an attacker to improve the likelihood of producing following blocks depending on the information in the current block. If the PoS method lacks adequate randomness, the attacker can try to pre-compute upcoming blocks by fine-tuning the

222 SECTION

A Evolution of distributed systems

information in the current block [31,50]. If an attacker discovers that the chance of minting a few consecutive blocks is less than intended for a certain collection of information (e.g., a set of transactions), the attacker can alter the set of transactions to increase their likelihood of deciding the next few blocks. It is successfully addressed by incorporating a secure source of randomness into the algorithm. VI. Cartel formation (CAF) attack: In economic theory, an oligopoly market is dominated by a small group of entities that have more power or money than other firms. They can band together to control prices or restrict competition by creating a cartel. According to others, “blockchain architecture is mechanism design for oligopolistic marketplaces.” [51], which has an impact on both PoW and PoS algorithms. A cartel of this type can conduct 51% attacks on the PoS algorithm or use stakes to monopolize the PoS algorithm.

5.

Proof of contribution

Proof of contribution (PoC) (Fig. 9) is a consensus mechanism for public blockchains in which user actions and behaviors are defined and quantified using contribution values generated by an algorithm. The node with the greatest contribution value gets the privilege of generating a new block in each round of consensus. The number of points gained by a user, for example, they can be used to determine the contribution value in a credit-point-based application. In a distributed economy application, the rent paid by a user may be utilized to determine the contribution value [52]. Contribution values in various applications may be calculated using an algorithm and utilized in the PoC consensus process to guarantee that the user who has contributed the most in the current round is given the privilege to produce the next block. The creation of PoC seeks to achieve the goals of decentralization, hard fork resistance, fairness, and reasonableness, and most significantly, addressing the shortcomings of the existing consensus mechanism, [53] such as excessive computing overhead and centralization of rights. To make blockchain a viable technology for many applications, the ultimate objective is to build CMs that are not dependent on the concept of bitcoin. Intellectual property (IP) protection is a wonderful example of how blockchain technology may be used as a consensus mechanism. There has been an explosion in the number of IPs that can be quickly sent to the general public via the Internet, thanks to the rapid expansion of social networks and the simplicity with which anybody may generate information in a variety of formats. Unique content in the form of tweets, blogs, short films, and other forms of intellectual property rights has supplemented the form and meaning of intellectual property rights. As a result, there is a pressing need to safeguard and properly handle fragmented digital data. Meanwhile, numerous types of infringements, such as “image theft” and

FIG. 9 Proof of contribution consensus mechanism [54].

Functional analysis of blockchain consensus algorithms Chapter

12

223

“recreation without authorization,” have grown in commonplace, endangering the rights of the original artists and posing new problems to IP protection. As a result, a slew of blockchain-based IP protection solutions has surfaced. Some of these IP protection solutions are built on open platforms like Ethereum, while others are built on the consortium blockchain architecture. Most such systems have intrinsic flaws like high system needs, significant consensus delays, or limited user involvement due to the limits of the consensus process. Current IP protection techniques, such as data preservation, rely heavily on a central authority, which has drawbacks such as inefficient procedures, high prices, lack of transparency, and centralization. As decentralization, immutability, and traceability are technological aspects of blockchain technology and can solve the disadvantages of traditional IP protection techniques.

5.1 Consensus mechanism in PoC The consensus protocol allows a dispersed network of nodes to agree on the order in which particular input data arrive in terms of time. As we know, the consensus process in blockchain assists nodes in reaching an agreement, whether transactions should be accepted or denied, and in what sequence. However, a transaction refers to a change in the status of the blockchain. It will be included in a future block that will extend the blockchain if it passes the validity and verification checks, i.e., transaction validation [52]. The consensus process is critical to the blockchain system’s operation since it ensures the legitimacy and consistency of data. Proof of work (PoW) and proof of stake (PoS) have gained popularity at the consensus layer as a result of their use in public blockchains like Bitcoin and Ethereum. Some study has recommended that proof of X (PoX) be used to represent all proof-of-something alternatives (including PoW and PoS). To claim their position as a genuine miner, most PoX-based consensus techniques demand that participating nodes expend some effort or resources [55]. We will use PoW and PoS as examples to explain the PoX consensus technique. A miner must prove the legitimacy of PoW by demonstrating that sufficient work has been completed. It is cryptographic primitive that allows a verifier to be certain that the appropriate amount of computational effort has been invested, such as a plaintext message or a nonce, so that the verifier may easily confirm its authenticity. Nodes in the Bitcoin network, which utilizes the PoW consensus method, compete for the right to generate a new block by solving a computationally expensive problem that is difficult to calculate but simple to validate, known as mining. Because the nodes have different processing capacities, the node who solves the problem first gets the right to generate the new block, and therefore receives a bitcoin reward from the system [56]. At the moment, the Bitcoin network’s mining power is concentrated in a few “Mining pools,” posing the risk of centralization. PoW’s significant computing overhead has also resulted in resource waste, which is neither environmentally nor economically sustainable. The chosen nodes are thereafter in charge of block generation and are rewarded for their efforts. Nodes that break the regulations will have their contribution level reduced. As an incentive for users to join in the consensus, the IPChain issues a digital currency called “IPC.” A user’s contribution is made up of the number of coins held by the node and the amount of work performed on the blockchain by the node. The quantity and length of the IPC held by the user define the currency portion of the donation, while the work portion is decided by the effective work performed by the node on the blockchain. Low computing overhead, high consensus efficiency, simple asset circulation, and so on are all advantages of the DPoC consensus [56]. Participants vote on new blocks in PoS depending on their holdings in the inband investment, such as how much digital money they have in the blockchain. Stakeholders (participants) pick a leader by lottery, who subsequently add a new block to the blockchain and receive the reward as a consequence. When opposed to PoW, PoS has a lower calculation overhead. However, owing to the problems of “Nothing At Stake” and “Long-Range Attack,” the degree of decentralization is lowered, and there is a risk of forking. IPChain (Intellectual Property Chain) is a public blockchain project that uses a consensus technique called delegated proof of contribution (DPoC) to authenticate, trade, and preserve IP work. The IPChain’s DPoC is based on the cumulative contribution of the IPChain’s user nodes. In each round of consensus, each user node makes a deposit based on their contribution level to participate in the election of consensus nodes. The DPoC consensus has several flaws that are equally evident. On the one hand, DPoC employs the conventional incentive of issuing tokens, which, although beneficial to the circulation of IP rights, results in an infusion of capital that eventually leads to “speculation” and therefore deviates from the original goal of blockchain for IP protection. Alternatively, while the contribution in DPoC has a natural decrease design, it is a simple accumulation process in general, meaning that the bigger the number of blocks created by a node, the more likely it is that a new block will be generated by the same node. The notion of “stronger stays stronger” is not favorable to blockchain decentralization. The IPChain project has not been well welcomed in the field of IP protection due to the constraints of the DPoC consensus.

224 SECTION

A Evolution of distributed systems

5.2 The consensus process The suggested PoC consensus technique is linked to the registration and transaction of IP rights in the blockchain ledger. Because there is no data in the blockchain ledger at the start, additional processing is required when producing the genesis block. The genesis block is generated by the node that joins the network initially, according to the contribution method. Synchronization provides the genesis block to nodes that join the network later. The accounting node is decided by the contribution values of nodes using a contribution algorithm that ranks the contribution values of the nodes since the second block. In each round of consensus, the node with the highest contribution value receives the privilege of generating a new block.

Receiving transactions Each node keeps an eye on the blockchain network and receives transaction data that is disseminated across it. The node validates the content, signature, and other details of every new transaction it receives. The transaction data is briefly kept in the node’s transaction pool after verification. Other variables can be used to break ties among nodes with the same contribution amount.

Judging the block generation threshold The size of a block can have an impact on the blockchain network’s efficiency. A single block of the Bitcoin blockchain is about 1 MB in size, which provides a balance between storage and transmission efficiency. A single block in our blockchain system is likewise limited to 1 MB in size, enabling each block to hold around 1000 transactions. However, because the blockchain network’s size may be modest in the early days of operation, and the number of transactions in the system is too little to achieve the block creation threshold in a reasonable amount of time, a block generation timeout mechanism is added. Regardless of whether the block generation threshold has been achieved, the accounting action will be executed immediately after a defined period has passed since the last block was created.

Generating the new block The node with the highest contribution value creates a new block and inserts all of the transaction data from the transaction pool into it before broadcasting it to the blockchain. There is a window time for block creation to deal with severe circumstances such as node failures and non-response owing to network issues. During the window time, nodes on the blockchain will wait for the accounting node to produce and submit a new block. If no new block is received before the window time expires, the node with the next highest contribution value assumes block creation authority, and so on.

Receiving and verifying the new block A fresh block would be verified by each node. The new block technically becomes the newest block in the blockchain after verification, and the current round of consensus concludes. Step iii is repeated until the consensus process is complete if validation fails.

Determining the bookkeeping node When the block generation threshold is achieved or surpassed, or when a timeout occurs, each node uses the contribution algorithm to compute and update each node’s contribution value and then sorts the nodes by contribution values to choose the accounting node for the current consensus round. When two or more nodes have the same contribution values, the bookkeeping right will be chosen based on the contending nodes’ seniority, which is defined as the amount of time they have been connected to the blockchain system continuously. The more senior the node, the longer the link.

6.

Blockchain to IP protection

PoC consensus mechanisms, as a public blockchain consensus mechanism, can be designed as a universal mechanism to apply to various application areas that do not require cryptocurrency, particularly in applications where attributes such as credit points or contributions can be clearly defined based on user behaviors or actions in the continuous operation of the systems. Berdik et al. identified and explored various non-monetary blockchain use where proof of concept might be useful [57]. In a credit-related application, for example, the user’s collected points can be transformed into contribution values. The revenue earned by contributing resources can be measured as contribution values in a resource-sharing application.

Functional analysis of blockchain consensus algorithms Chapter

12

225

The difference in the price paid to acquire IP works might be converted into a contribution value in an intellectual property application, for example. Contribution values derived from the underlying applications can be used as the major parameter in the consensus method to assist choose the node for block formation, which improves the credibility and security of application data. In this work, we intend to evaluate the IP protection application and utilize it as the foundation for the construction of a PoC consensus mechanism that is devoid of cryptocurrencies. The Internet’s fast development has increased the rate at which information is disseminated. Zero-cost replication and rapid transmission have emerged as new forms of IP infringement, bringing more harm to IP creators. The revelation of private information on social networks and writing platforms might also jeopardize the protection of users’ intellectual property works [58]. Because of the fast spread and concealed nature of network infringement, information has become difficult to trace and simple to modify, making it impossible to replay the incident after it has occurred. As a result, preserving evidence in advance has become an effective way of safeguarding IP rights as well as defending rights once infringement occurs. In an IP dispute, there is frequently some disagreement regarding the content of the IP work, ownership of the right and time, and other issues. As a result, correctly documenting such information as content, right holders, time, and so on when things such as registration and transaction of IP works occur is critical in IP work protection. After registering certain information about an IP work, the user can utilize the data kept on the blockchain to show his or her ownership of the work, therefore protecting his or her legal rights in the case of an IP dispute. l

l

l

IP registration. At Time T1, user A generates an original IP work F1 and registers certain information about F1 on the IP protection blockchain. The blockchain is used to establish that F1 belongs to A by posting information on the blockchain about the creator and owner of F1 (i.e., A), the time of registration T1, and the hash value of F1. Every node in the blockchain may confirm the registration information since it is verifiable. The transfer of intellectual property rights, often known as an IP transaction. At time T2, user A transfers his or her entitlement to F1 to user B via a transaction. The right to F1 is then lawfully acquired by User B. The blockchain is used to authenticate that ownership of F1 has been transferred from user A to user B by storing information on the blockchain such as the owner (i.e., B) and creator (i.e., A) of F1, the time of transfer T2, the hash value, and some other information. The transaction data is verifiable and may be confirmed by any blockchain node. IP recording, i.e., evidence retrieval When a disagreement over the IP rights to F1 occurs, user A might utilize the IP blockchain to demonstrate that he is the owner of F1 at time T1. The blockchain should be able to locate the record about F1 in the blockchain ledger identifying the creator, owner, and other information at time T1, showing that user A owns F1 at T1.

7. Proof of service power in cloud manufacturing Cloud manufacturing has been incorporated into the manufacturing business in recent years, ushering in a whole new product idea and pattern. Based on cloud concepts, cloud manufacturing is a new service-oriented, networked, and intelligent manufacturing paradigm. It connects diverse industrial resources and capabilities to the cloud via cloud computing, the Internet of Things, service computing, artificial intelligence, and other technologies. It establishes a service cloud pool of manufacturing resources and capabilities, [59] maintains and runs them in a unified and centralized way, and allows users to access manufacturing resources and capabilities on demand over the network at any time to complete their manufacturing life cycles [60]. Several deep-seated difficulties that have been keeping organizations from shifting to the cloud are gradually becoming evident as a result of the constant marketing and in-depth usage of cloud manufacturing platforms. One of the restrictions in the cloud manufacturing platform’s dependable administration. There are still many pressing issues to be resolved, such as how to protect both trading partners’ credit while lowering transaction risk and cost. On the other hand, there are concerns about marketing fraud, an opaque commission system, a large accounts receivable, bad debts, and corruption in the cloud manufacturing platform. It is also critical to ensure that the marketing data utilized in the transaction process is open and transparent. Indeed, information opacity, transaction party distrust, and a lack of trust mechanisms [61,62] have impeded cross-enterprise sharing of product, demand, market, and customer data substantially. Blockchain is a non-tamper-able distributed ledger that is protected by a specific encryption technique. The notion of blockchain was initially suggested by Satoshi Nakamoto in 2008. Blockchain technology, with its characteristics of trustlessness, anti-tampering, traceability, and high transparency, can establish a trustless interaction method between untrusted and unknown entities, support distributed network structures, and eliminate the need for a central organization in cloud manufacturing architecture, providing an effective means for the trusted management of data. The blockchain’s unique data structure and encryption mechanism, on the other hand,

226 SECTION

A Evolution of distributed systems

effectively prevent data tampering and increase the cloud manufacturing system’s data security and system security. The consensus mechanism lies at the heart of the blockchain network. The security, transmission performance, and fault tolerance of a blockchain are all affected by the consensus method chosen. At the moment, blockchain technology’s use in the cloud manufacturing system is mostly focused on the system architectural level, with little study and application of particular technological specifics. The study on the consensus mechanism of blockchain for cloud manufacturing systems is, particularly behind the times. The following issues exist in the current popular blockchain consensus algorithm): l

l

A consensus election consumes a tremendous amount of energy. In the traditional blockchain consensus approach, nodes participating in the consensus election must incur considerable computer computational power and power consumption costs. On the one hand, it considerably raises the barrier to entry into the blockchain network for ordinary people; on the other hand, the aforementioned fees and thresholds do nothing to help industrial firms improve their production capacity and income. Manufacturing companies typically reject it, restricting blockchain’s use and growth in cloud manufacturing. A token dependence problem exists in the algorithm. In the traditional blockchain consensus technique, cryptocurrency is commonly used as an incentive. Tokens are expensive to get, and the quantity of tokens accessible is limited. In the process of production and sales, manufacturing companies require regular transactions. This generates a lot of cash, and the tokens on the blockchain network are not adequate for the task.

In response to the aforementioned concerns, a novel blockchain consensus method dubbed “proof of service power” (Fig. 10) is proposed. To begin, it proposes the concept of service power, which calculates service power based on past transaction data acquired in a cloud manufacturing system rather than the workload in PoW, resulting in a considerable reduction in energy consumption during the consensus election process. Second, the concept of credit is developed to address the incentive mechanism in blockchain and to provide a measurable basis for each participant in the trust evaluation of the cloud manufacturing system.

7.1 Consensus mechanism for proof of service power With the steady promotion and in-depth use of cloud manufacturing platforms, several deep-seated issues that have been preventing organizations from moving to the cloud are progressively revealed. The bottleneck issues include a lack of trust and security in cloud manufacturing systems. How to secure the credit of both trading parties while reducing transaction risk and cost are still pressing issues that must be addressed [63]. With the steady growth and maturity of blockchain technology in recent years, it has garnered broad attention in the industrial industry. This consensus technique calculates the

FIG. 10 Proof of service power consensus mechanism [57].

Functional analysis of blockchain consensus algorithms Chapter

12

227

service power of member nodes in a cloud manufacturing system using previous transaction information gathered by member nodes, substantially reducing energy usage in the proof-of-work (PoW) process.

7.2 Calculation method of service power In the cloud manufacturing environment, manufacturing resources, capabilities, and processes are virtualized and serviced to generate cloud manufacturing services, which make up the service cloud pool of manufacturing resources and capabilities. The cloud manufacturing platform is utilized for unified management to provide users with full manufacturing life cycle services that are always available, safe, dependable, high-quality, and low-cost. The cloud manufacturing system converts all transactions of diverse manufacturing resources and processing processes in the traditional manufacturing sector into transactions of cloud manufacturing services [59]. As a consequence, we suggest the following service power definition. Service power refers to the current service capabilities of member nodes in the cloud manufacturing service chain (SP). It can assess and characterize the cloud manufacturing service chain’s member nodes’ service capabilities. It may be computed using the historical transaction volume and total transaction amount of each member node in the cloud manufacturing service chain system. The service power is determined by multiplying the historical transaction volume of each member node by the time factor. In the cloud manufacturing system, the computation of each service provider’s service power is at the heart of the proof of service power [64]. When assessing the cloud service provider’s service power, it is important to look at both recent and historical transaction data. To analyze and evaluate the service provider’s total service power, multiple weights must be applied to transaction data from various periods at the same time. In this work, the proposed calculation formula for service power is as follows: SP ¼

Ilast X

Τwm  eIM Ilast

m¼ðIlastn + 1Þ

SP stands for the cloud service provider’s service power; Ilast denotes the height of the end block in the service chain; n denotes the number of blocks in the service chain to be investigated to calculate the service power of cloud service providers; Ilast  n + 1 denotes the initial block of the selected n service chain blocks; m denotes the mth block in the service chain; Τ wm denotes the total amount of cloud manufacturing service transactions recorded by the service provider in block m; Im is the height of the mth block in the service chain. The service chain is where the data from service transactions is stored so that service power may be calculated. The service chain keeps track of the details of each cloud manufacturing service transaction. The service transaction data for the cloud manufacturing service has non-tampering and traceability features since it is stored in the service chain. Simultaneously, after the transaction is complete, it must broadcast the transaction data to the whole network and upload it in real time, assuring the validity and real timeliness of service transaction data in the cloud manufacturing system. As a result, service providers’ service power is assumed to be legitimate and real-time. Only the most recent n blocks in the service chain are examined to determine service providers’ service power, allowing new service providers to participate in consensus election and become elected nodes while taking into account the most recent growth of the system and companies. It increases the desire of new service providers and fast-growing businesses to participate in the upkeep of the service chain system. On the other side, it can prevent the development of super nodes, increase the decentralization of the system, and improve the security of the system by preventing the SP value of individual accounts from growing indefinitely. Furthermore, it can minimize the amount of computation required in the SP calculation process, which helps to enhance algorithm performance. The n must choose an acceptable value. When n is too little, transactions are not sampled broadly enough, and the examination of service capacity is too one-sided, failing to adequately reflect the service provider’s competency and lowering the SP value’s objectivity. When n is too large, it increases the amount of calculation in the SP calculation process on the one hand, but due to the attenuation of the time factor, it also lowers the contribution of transactions to SP. The service power has the following properties, according to the above calculation formula: l

The service provider’s service power is directly connected to the value of the service provided by the service provider in the cloud manufacturing system, forcing the service provider to focus more on enhancing the value and quality of its services.

228 SECTION

l

8.

A Evolution of distributed systems

Real-time services contribute far more to service power than historical services. It analyzes the most recent types of company growth while measuring and evaluating service providers’ talents from a worldwide perspective.

A lightweight blockchain consensus mechanism

We know blockchain is a distributed digital ledger with tamper-resistant and privacy-protecting features that might offer secure IoT and other applications. However, most devices in these scenarios have limited computing storage, bandwidth, and other resources, making the blockchain consensus process and subsequent blockchain ledger storage difficult to bear. As a result, in a resource-constrained device context, the construction of a lightweight blockchain is necessary. A network of computer devices connected to the Internet is referred to as the Internet of Things (IoT). The items are little communication devices with limited storage, computation, and energy [65]. These Internet of Things devices generate, analyze, and share a massive amount of data, including the transmission of security-critical real-time data via the Internet without human interaction. Because of the high number of linked devices, the system is intelligent, fault tolerant, and dependable. IoT may be utilized to increase consumer comfort and management efficiency and control dependability in a range of industries, including transportation, smart homes, public e-health, smart education, logistics, and the energy sector. The bulk of IoT devices’ resources is dedicated to important operations including data collection, processing, and transmission, as well as operating system management and critical system services. However, to convey sensitive information, data and communications must be encrypted. To meet security requirements like integrity, authentication, and availability, demand techniques employ heavyweight cryptographic primitives. Existing techniques are incompatible with today’s IoT devices, which are resource-restricted. Transactional privacy, user authentication, and scalability are all lacking in a centralized IoT. Traditional security protocols (IBE, ABE, and so on) rely on a centralized paradigm in which network nodes communicate with one another via a centralized body [66]. This causes network congestion by increasing network latency and increasing the number of interactions. The network has a single point of failure, leaving it vulnerable to DDoS attacks, Sybil attacks, and other types of attacks. Furthermore, conventional security methods are inadequate for the IoT environment in terms of computational overhead and energy usage. IoT demands privacy, scalability, minimum resource usage, and decentralized operation to secure the network and devices. Blockchain [1] provides a decentralized method for storing shared information that is hard to manipulate or control due to inherent properties such as distributed nature, message integrity, communication transparency, node authentication, and message availability. It has the potential to be an effective security solution in the IoT context. It eliminates the requirement for trust, which is necessary for database collaboration and coordination by a single organization. It provides security through hashing, signatures, time stamping, and consensus methods. There are two sorts of environments provided by a blockchain. In a non-cooperative situation, any node can join the network and transact without authorization. Any node has access to the ledger. A consensus mechanism is used to update the ledger, in which nodes compete with one another to update a block on the ledger. A block is a collection of data about many transactions that nodes must verify. Mining is the term for this type of activity. Winner nodes get the ability to mine using proof of work (PoW), proof of stake (PoS), and other ways. An environment that encourages collaboration: Each peer must first get authorization or authenticate themselves before joining the network. Mining nodes are chosen at random or through cooperative techniques like PoET and Raft, etc. In a trust-less distributed system, we require a way to validate exchanged communications between IoT devices. Blockchain can be utilized on the Internet of Things for device identity, secure communication, decentralized authentication, network scalability, and device availability. It may also be used to keep stored dispersed databases transparent, consistent, and immutable. In the blockchain, when multiple devices reach a collective agreement without the intervention of a trusted third party, a consensus technique is required. Any device in the network can employ the consensus procedure. The consensus mechanism is used to determine which device is allowed to update the blockchain ledger with confirmed transactions. This ensures that the ledger is updated accurately and promotes transparency. Consensus techniques are divided into two categories: probabilistic and absolute. To mine a block, miners using probabilistic consensus methods like PoW and PoS must compete with one another. The possibility of immutability and durability increases as a transaction block moves deeper down the chain. When a proposed transaction is included in a block, absolute consensus techniques consider it finished immediately. The block is validated and updated by a leader, who might be a miner chosen at random or a faction of the mining committee. The following is the suggested strategy: PoEWAL provides a common agreement across devices in a non-cooperative trust-less IoT setting. Without putting their limited computation, storage, or battery capacity to the test, the participating devices reach an agreement.

Functional analysis of blockchain consensus algorithms Chapter

12

229

9. PBFT One of the most used consensus algorithms in blockchain, Practical Byzantine Fault Tolerance (PBFT) (Fig. 11). It comes into play when the number of defective nodes is fewer than 1/3, PBFT may be able to guarantee blockchain performance because the communication complexity of PBFT is O(n2), [67] blockchain devices will need a lot of communication resources. Because the bandwidth resources held by devices in a lightweight blockchain are restricted, the PBFT algorithm’s high bandwidth needs to limit its adoption on resource-constrained devices. The bulk of IoT devices’ resources is dedicated to important operations including data collection, processing, and transmission, as well as operating system management and critical system services. However, to convey sensitive information, data and communications must be encrypted. To meet security requirements like integrity, authentication, and availability, demand techniques employ heavyweight cryptographic primitives. Existing techniques are incompatible with today’s IoT devices, which are resourcerestricted [68]. Furthermore, because the PBFT algorithm requires a high degree of trust in nodes to ensure long-term proper operation, the presence of aberrant nodes would reduce the program’s efficiency substantially.

9.1 Voting-based primary node election strategy Using the PBFT technique, any node in the blockchain may become the major node. A rogue primary node might cause frequent view changes, putting the system at risk of security breaches. This article employs a voting-based primary node election technique to avoid this situation. The election is a process in which all valid nodes in the blockchain vote to select a primary node from among the contenders. Valid nodes are not malicious, whereas candidate nodes are those that have a trusted or normal status. Let E represent the set of nodes with a higher score than Se, and M represent the set of nodes with a higher score than Sinit. The legitimate nodes are represented by E, whereas the candidate nodes are represented by M. Each valid node can vote once for each candidate node during each voting period, denoted by vji  {1,0,1}, where j E is the valid node serial number. uji ¼ 1 indicates a legitimate node j vote for node i, uji ¼ 1 indicates a negative vote, and uji ¼ 0 indicates no vote. Each eligible node can only vote for or against each candidate node once in each round of voting. Votei denotes the vote outcome for node i which may be expressed as: Votei ¼

Ne X j¼1

FIG. 11 PBFT algorithm [69].

vji

230 SECTION

A Evolution of distributed systems

After the voting, the candidate node with the greatest vote result is chosen as the primary node. When there are many candidate nodes with the same voting outcome, the node with the highest status score is selected. Algorithm 2 demonstrates the pseudo-code for a voting-based consensus primary node election method.

10.

Summary

The chapter aims to explore and consolidate the consensus algorithms, prevalent in a distributed ledger environment. The use case and further implementation can be found at Refs. [70–74]. Blockchain is a peer-to-peer distributed ledger system that allows people to transfer data/information among themselves. This eliminates the need for trusting an intermediary third party, such as banks, brokers, or escrow services. Blockchain must be understood from both a business and technical point of view to comprehend it completely. To ensure security within a blockchain network, it creates an immutable ledger. Immutability has the potential as well as the confidence to ensure the integrity of the data that a node (user) uses and shares on a daily basis. To prevent malicious nodes’ hostile activity of tampering with the data on the network, companies spend hefty lumps of money on cybersecurity solutions. They seldom have to deal with the internal cybersecurity issue to make sure their data has not been tampered with, manipulated, or misrepresented, which is not a matter of concern in blockchain due to its ability to create decentralized, distributed ledgers. Resilience censorship is an attribute possessed by blockchain that prevents sensors from imposing certain content distribution over the network. It is one of the most important characteristics of a decentralized blockchain. Consensus is generally defined as finding a common ground between extreme agreement and utter disagreement. The core concepts of block verification in the blockchain are represented by a consensus mechanism. It defines the constraints that nodes and validators must meet in order for new blocks to be added to the blockchain. Consensus has become a significant aspect of the integration of computer processing into our daily lives during the last thirty years. It is the underlying notion of the whole cryptocurrency sector. It establishes a protocol that enables timely dissemination and atomic broadcast of messages among nodes and is essential as it influences how a distributed consensus is formed and maintained in many ways but they all serve as the theory underpinning blockchain technology’s core characteristics: a decentralized, distributed, public ledger. PoW is a consensus algorithm first used by the Bitcoin network; initially, it was meant to prevent e-mail spamming put forward by Dwork and Naor. The proof-of-work (PoW) mechanism is tied to the difficulty of the prover’s task. The prover (node) would solve a time-consuming computational mathematical problem as work in numerous rounds until a PoW matching the threshold is created. Each round is referred to as a single proof attempt, and the complexity of the job should be changeable. PoW has long been the most popular method for reaching a distributed consensus among participants on block order and chain state. It is critical to highlight that in the case of public blockchains, the nodes who spend their computer resources must be rewarded for honest behavior. To participate in a resource-intensive PoW mechanism, every node would have to make a large monetary commitment. The first suggestion for a proof-of-stake (PoS) algorithm was first introduced in the bitcoin talk forum in 2011. The basic principle of PoS is that nodes that want to participate in the block generation process must first show that they hold a specific collateral quantity of stake. When a shareholder escrows his or her investment, he or she becomes a member of an elite group. Proof of contribution (PoC) is a consensus mechanism for public blockchains that defines and quantifies user actions and behaviors. In each round of consensus, the node with the highest contribution value is given the opportunity of generating a new block. Decentralization, hard fork resistance, justice, and rationality are all aims of PoC. Digital data that may be shared and the Internet is being protected with blockchain-based IP protection solutions. Traditional IP protection methods rely significantly on a centralized authority, which includes downsides including inefficient procedures and excessive costs. The technological components of blockchain technology that can solve IP protection challenges. Proof of service power (PoSP) in cloud manufacturing is a new paradigm in manufacturing that is service-oriented and intelligent. It uses cloud computing, the Internet of Things, artificial intelligence, and other technologies to link various industrial resources and capabilities to the cloud. Many critical concerns remain to be answered, such as how to preserve the credit of both trade partners. The current common blockchain consensus algorithm has a token reliance concern. POSP is presented in answer to the mentioned challenges. Lightweight consensus is the need of the hour as the majority of devices have limited processing storage, bandwidth, and other resources, making the blockchain consensus process and subsequent blockchain ledger storage challenging. As a result, the creation of a lightweight blockchain is required in a resource-constrained device scenario.

Functional analysis of blockchain consensus algorithms Chapter

12

231

Practical Byzantine Fault Tolerance (PBFT) is one of the most often used consensus methods in the blockchain. The communication complexity of PBFT is O(n2), it can ensure blockchain performance when the number of defective nodes is less than 1/3rd of the total nodes.

References [1] D. Berdik, S. Otoum, N. Schmidt, et al., A survey on blockchain for information systems management and security, Inf. Process. Manag. 58 (2021). [2] D. Puthal, S.P. Mohanty, P. Nanda, et al., Proof-of-authentication for scalable blockchain in resource-constrained distributed systems, in: 2019 IEEE International Conference on Consumer Electronics (ICCE), IEEE, 2019, pp. 1–5. [3] J. Wang, L. Wang, W.C. Yeh, et al., Design and Analysis of an Effective Securing Consensus Scheme for Decentralized Blockchain System, 2020. [4] E. Politou, et al., Blockchain Mutability: Challenges and Proposed Solutions, 2019, Available: https://www.researchgate.net/publication/ 334507225_Blockchain_Mutability_Challenges_and_Proposed_Solutions. [5] U.K. Chopra, A.K. Rathore, R. Pandey, Rendering blockchain immutability in chatserver: a node.js approach, in: Decision Analytics Applications in Industry, 2020. [6] T.T.A. Dinh, R. Liu, M. Zhang, G. Chen, B.C. Ooi, J. Wang, Untangling blockchain: a data processing view of blockchain systems, IEEE Trans. Knowl. Data Eng. 30 (7) (2018) 1366–1385. [7] N. Rifi, N. Agoulmine, N. Chendeb Taher, E. Rachkidi, Blockchain technology: is it a good candidate for securing iot sensitive medical data? Wirel. Commun. Mobile Comput. 2018 (2018) 1–11. [8] W. Hao, S. Xiangfu, K.E. Junming, X.U. Qiuliang, University S, Blockchain and privacy preserving mechanisms in cryptocurrency, Netinfo Security, 2017. [9] M. Iansiti, K.R. Lakhani, The truth about blockchain, Harv. Bus. Rev. 95 (1) (2017) 118–127. [10] D. Ongaro, J. Ousterhout, In search of an understandable consensus algorithm, in: USENIX, 2014, pp. 305–320. [11] A. Baliga, Understanding blockchain consensus models [online], 2017, April. Available: https://www.persistent.com/wp-content/uploads/2017/04/ WP-Understanding-Blockchain-consensus-models.pdf. [12] O. Novo, Blockchain meets IoT: an architecture for scalable access management in IoT, IEEE Internet Things J. 5 (2) (2018) 1184–1195. [13] S. He, Q. Tang, C.Q. Wu, X. Shen, Decentralizing IoT management systems using blockchain for censorship resistance, IEEE Trans. Ind. Inf. 16 (2019) 715–727. [14] S. King, S. Nadal, PPCoin: Peer-To-Peer Crypto-Currency with Proof-Of-Stake [Online], 2012, August 19. Available: https://peercoin.net/assets/ paper/peercoin-paper.pdf. [15] E. Heilman, A. Kendler, A. Zohar, S. Goldberg, Eclipse attacks on bitcoins peer-to-peer network, in: 24th USENIX Security Symposium USENIX Security, 15, 2015, pp. 129–144. [16] C. Liu, K.K. Chai, X. Zhang, Y. Chen, Peer-to-peer electricity trading system: smart contracts based proof-of-benefit consensus protocol, Wirel. Netw. 27 (2019) 4217–4228. [17] S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, 2008. https://bitcoin.org/bitcoin.pdf. [18] A. Sahai, R. Pandey, Smart contract definition for land registry in blockchain, in: 2020 IEEE 9th International Conference on Communication Systems and Network Technologies (CSNT), 10–12 April 2020, 2020. [19] L. Nolan, Distributed Consensus Algorithms for Extreme Reliability, USENIX Association, 2015. Available at: https://www.goquorum.com/. (Accessed 20 November 2020). [20] C. Cachin, M. Vukolic, Blockchains Consensus Protocols in the Wild, 2017. arXiv preprint arXiv:1707.01873. [21] S. Bano, A. Sonnino, M. Al-Bassam, S. Azouvi, P. McCorry, S. Meiklejohn, G. Danezis, Consensus in the Age of Blockchains, 2017. arXiv preprint arXiv:1711.03936. [22] L. Lamport, R. Shostak, M. Pease, The byzantine generals problem, ACM Trans. Program. Lang. Syst. 4 (3) (1982) 382–401. [23] L. Lamport, The part-time parliament, ACM Trans. Comput. Syst. 16 (2) (1998) 133–169. [24] L. Lamport, Paxos made simple, SIGACT News 32 (4) (2001) 51–58. [25] B.M. Oki, B. Liskov, Viewstamped replication: a new primary copy method to support highly- available distributed systems, in: Proc. 7th ACM Symposium on Principles of Distributed Computing (PODC), ACM, 1988, pp. 8–17. [26] P. Hunt, M. Konar, F.P. Junqueira, B. Reed, ZooKeeper: wait-free coordination for internet-scale systems, in: Proc. USENIX Annual Technical Conference, vol. 8, 2010, p. 9. [27] D. Ongaro, J.K. Ousterhout, Search of an understandable consensus algorithm, in: Proc. USENIX Annual Technical Conference, 2014, pp. 305–319. [28] M. Castro, B. Liskov, Practical byzantine fault tolerance and proactive recovery, ACM Trans. Comput. Syst. 20 (4) (2002) 398–461. [29] J.R. Douceur, The sybil attack, in: International Workshop on Peer-To-Peer Systems, 2002, pp. 251–260. [30] C. Natoli, V. Gramoli, The blockchain anomaly, in: IEEE 15th international symposium on network computing and applications (NCA), 2016, pp. 310–317. [31] J. Choi, Ethereum Casper 101 [Online], 2017, October 22, Available: https://medium.com/@jonchoi/ethereum-casper-101-7a851a4f1eb0. (Accessed 10 July 2019). [32] M.S. Ferdous, K. Biswas, M.J.M. Chowdhury, N. Chowdhury, V. Muthukkumarasamy, Integrated platforms for blockchain enablement, in: Advances in Computer, Elsevier, 2019.

232 SECTION

A Evolution of distributed systems

[33] C. Dwork, M. Naor, Pricing via processing or combatting junk mail, in: Annual International Cryptology Conference, 1992, pp. 139–147. [34] A. Back, Hashcash-a Denial of Service Counter-Measure, 2002. [35] H. Centieiro, Bitcoin Proof of Work — The Only Article You Will Ever Have to Read, 2021, May. Available: https://levelup.gitconnected.com/ bitcoin-proof-of-work-the-only-article-you-will-ever-have-to-read-4a1fcd76a294. [36] K. Finlow-Bates, A Lightweight Blockchain Consensus Protocol [Online], 2017, August. Available: http://www.chainfrog.com/wp-content/uploads/ 2017/08/consensus. [37] M.J. Seigen, N.T. Nieminen, A.M. Juarez, CryptoNight Hash Function [Online], 2013, March. Available: https://cryptonote.org/cns/cns008.txt. [38] G. Bertoni, J. Daemen, M. Peeters, G. Van Assche, Keccak, in: In: Annual International Conference on the Theory and Applications of Cryptographic Techniques, 2013, pp. 313–314. [39] Cryptocurrency Mining Hash Algorithms [Online], 2019. July 24. Available: http://www.bitcoinlion.com/cryptocurrency-mining-hash-algorithms/. [40] First Impressions from the Baikal Mini Miner ASIC [Online], Available: https://cryptomining-blog.com/tag/quark-asic-miner/. [41] Bitcoin energy consumption [Online], Available: https://digiconomist.net/bitcoin-energy-consumption. [42] Wikipedia entry on Economies of scale [Online], Available: https://en.wikipedia.org/wiki/Economies_of_scale. (Accessed 10 July 2019). [43] Bitcoin hashrate distribution [Online], Available: https://blockchain.info/pools. [44] Wikipedia entry on Tragedy of the commons [Online], Available: https://en.wikipedia.org/wiki/Tragedy_of_the_commons. (Accessed 10 July 2019). [45] I. Eyal, E.G. Sirer, Majority is not enough: bitcoin mining is vulnerable, in: International Conference on Financial Cryptography and Data Security, March, 2014, pp. 436–454. [46] Quantum Mechanic, Proof of stake instead of proof of work, 2011. July 11. [47] J.P. Buntinx, What is delegated proof-of-stake? [Online], 2017, April 20. Available: https://themerkle.com/what-is-delegated-proof-of-stake/. [48] Proof of Stake versus Proof of Work [Online], 2015. September 13. Available: http://bitfury.com/content/5-white-papers-research/pos-vs-pow-1.0.2. pdf. [49] I. Bentov, A. Gabizon, A. Mizrahi, Cryptocurrencies without proof of work, in: International Conference on Financial Cryptography and Data Security, 2016, pp. 142–157. [50] Proof of Stake FAQ [Online], Available: https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ. (Accessed 5 August 2019). [51] V. Zamfir, The History of Casper - Chapter 4 [Online], 2016, December 12. Available: https://medium.com/@Vlad_Zamfir/the-history-of-casperchapter-4-3855638b5f0e. [52] G.R. Carrara, L.M. Burle, D.S. Medeiros, C.V.N. de Albuquerque, D.M. Mattos, Consistency, availability, and partition tolerance in blockchain: a survey on the consensus mechanism over peer-to-peer networking, Ann. Telecommun. 75 (3) (2020) 163–174, https://doi.org/10.1007/s12243-02000751-w. [53] A. Savelyev, Copyright in the blockchain era: promises and challenges, Comput. Law Secur. Rev. 34 (3) (2018) 550–561, https://doi.org/10.1016/j. clsr.2017.11.008. [54] H. Song, N. Zhu, R. Xue, J. He, K. Zhang, J. Wang, Proof-of-Contribution consensus mechanism for blockchain and its application in intellectual property protection, 2021, Available: https://www.sciencedirect.com/science/article/abs/pii/S0306457321000170. [55] S. King, S. Nadal, Ppcoin: Peer-to-Peer Crypto-Currency with Proof-of-Stake, 2012, Self-published Paper https://cdn.bitturk.com/whitepaper/ppc. pdf. (Accessed 13 January 2021). [56] F. Yang, Y. Shi, Q. Wu, F. Li, W. Zhou, Z. Hu, N. Xiong, The survey on intellectual property based on blockchain technology, in: Proceedings of the 2019 IEEE International Conference on Industrial Cyber Physical Systems, IEEE, 2019, pp. 743–748. [57] D. Berdik, S. Otoum, N. Schmidt, D. Porter, Y. Jararweh, A survey on blockchain for information systems management and security, Inf. Process. Manag. 58 (1) (2012), 102397, https://doi.org/10.1016/j.ipm.2020.102397. [58] G. Wang, Z.J. Shi, M. Nixon, S. Han, Sok: sharding on blockchain, in: Proceedings of the 1st ACM Conference on Advances in Financial Technologies, ACM, 2019, pp. 41–61. [59] Z. Jifeng, Y. Xifan, Software servitization for cloud manufacturing, Mod. Mach. Tool Autom. Manuf. Tech. 2 (2016) 157–160. [60] B.H. Li, L. Zhang, S.L. Wang, F. Tao, X.D. Chai, Cloud manufacturing: a new service-oriented networked manufacturing model, Comput. Integr. Manuf. Syst. 16 (1) (2010) 1–7. [61] L. Zhang, Y. Luo, F. Tao, B.H. Li, L. Ren, X. Zhang, et al., Cloud manufacturing: a new manufacturing paradigm, Enterprise Inf. Syst. 8 (2) (2014) 167–187. [62] C. Zhao, L. Zhang, B. Li, J. Cui, L. Ren, F. Tao, Research on Evolution and Simulation of Transaction Process in Cloud Manufacturing, 2016. [63] Y. Zhang, Z. Lin, Y. Liu, X. Luo, Proof of Service Power: A Blockchain Consensus for Cloud Manufacturing, 2021. [64] L.I. Bo-Hu, Z. Lin, R. Lei, C. Xu-Dong, T. Fei, L. Yong-Liang, et al., Further discussion on cloud manufacturing, Comput. Integr. Manuf. Syst. 17 (03) (2011) 449–457. [65] R. Mahmud, R. Kotagiri, R. Buyya, et al., Fog computing: a taxonomy, survey and future directions, in: Distributed, Parallel, and Cluster Computing, 2018, pp. 103–130. [66] C. Oham, R.A. Michelin, R. Jurdak, et al., B-FERL: blockchain based framework for securing smart vehicles, Inf. Process. Manag. 58 (1) (2021). [67] X. Xu, G. Sun, L. Luo, et al., Latency performance modeling and analysis for hyperledger fabric blockchain network, Inf. Process. Manag. 58 (1) (2021). [68] J. Thakker, Y. Park, Resilient and efficient blockchain consensus protocol for internet-of-things, in: 2020 IEEE International Conference on Consumer Electronics (ICCE), IEEE, 2020.

Functional analysis of blockchain consensus algorithms Chapter

12

233

[69] C. Li, J. Zhang, X. Yangb, L. Youlong, Lightweight blockchain consensus mechanism and storage optimization for resource-constrained IoT devices, Inf. Process. Manag. 58 (2021), 102602. [70] A. Sahai, R. Pandey, Smart contract definition for land registry in blockchain, in: 2020 IEEE 9th International Conference on Communication Systems and Network Technologies (CSNT), 2015, https://doi.org/10.1109/CSNT48778.2020.9115752. [71] C. Umesh, R. Pandey, Rendering blockchain immutability in chatserver: a node.js approach, in: Decision Analytics Applications in Industry. Asset Analytics (Performance and Safety Management), Springer Nature, Singapore, 2020, pp. 147–155, ISBN: 978-981-15-3643-4. [72] G. Sam, S. Chand, C. Pranesh, K. Nizam, R. Asneel, P. Rajiv, Blockchains for supply chain management networks, in: Blockchain Technologies, Applications and Cryptocurrencies, 2020, https://doi.org/10.1142/9789811205279_00. [73] V. Chitresh, P. Rajiv, An implementation approach of big data computation by mapping Java classes to MapReduce, in: 2016 3rd International Conference on Computing for Sustainable Global Development (INDIACom), IEEE, 2016, pp. 282–287. [74] P. Mrinal, P. Rajiv, JSON and its use in semantic web, Int. J. Comput. Appl. 164 (11) (2017) 10–16.

This page intentionally left blank

Section B

Blockchain architecture and security

This page intentionally left blank

Chapter 13

Blockchain and forensics Anupam Tiwari Computer Science Department, GD Goenka University, Gurugram, Haryana, India

1. Introduction Each novel technology brings with it a wave of early adopters who are keen to explore potential societal and economic benefits that may be exploited by leveraging the technology, while also at the same time, few seek to apply the technology as a means to enable nefarious activities. Bitcoin with its onset in 2009 is one such early attraction for cyber criminals who adopted it for malicious and illegal activities like the silk route in 2011 onwards [1]. That just is the start; it was followed by similar multiple endeavors by other criminals in the form of ransomware, gambling sites, ponzi schemes, crypto jacking, inperson cryptocurrency muggings etc. to mention a few. Today after a decade plus of existence of widely known bitcoin cryptocurrency, there are 5000 plus cryptocurrencies, and the most interesting thing is that all these currencies though have more or less the same function they work differently. With the advent of Ethereum further in 2014 enabling smart contracts in distributed network, the scope of criminals further increased full throttle. While communities were still playing and toying with the possible application scenarios, criminals enjoyed the field day wherein they could do anything to their advantage. Such routine scenarios globally across multiple domains realized the need of forensics in blockchain. This brings in focus the need and requirement of digital forensic experts to keep pace with these new genre technologies to ensure that relevant objective evidence can be brought forward to throw light on investigations. The world of cryptocurrencies brings in absolute technical challenges for traditional digital forensic professionals. Unlike the traditional broken HDD, SDD or DVD or RAM etc., the blockchain-enabled cryptocurrency ecosystem requires these professionals to be updated with the mechanics behind. They should be conversant with the world of public keys, encryptions, blocks and chains of all multitudes of blockchain platforms. The unique scenario offered by blockchain is that everything is immutable, everything is available and transparent but still identification becomes difficult till such time the working architecture is clearly understood. Exploiting these transparent characteristics of bitcoin blockchain, one of the most well-known works by Dr. Sarah Meiklejohn titled “A Fistful of Bitcoins: Characterizing Payments Among Men with No Names” [2] shows how clustering techniques and use of tools like Chainalysis and Elliptic [3] have enabled the unmasking of the ownership of large numbers of bitcoin addresses including many associated with the Silk Road, something that had antecedently thought to be impossible. A very important aspect while we begin a discussion on blockchain forensics is the need for investigators to understand the mechanics of blockchain, which is not supposedly an easy task. The blockchain ecosystem is evolving fast and multiple variants of blockchains and affected applications are arriving. Though the overall derivation of functions is peculiar to exploiting characteristics of blockchain, i.e., like transparency, immutability, security, privacy etc., each of these blockchains is different from each other. This is what makes the situation more difficult and challenging for the investigators who find relatively limited function tools and thus mostly find cyber criminals having a field day in the world of cybercrimes. This signifies the importance of understanding the nuts and bolts of technology running each of these blockchains. COTS tools can be helpful for peculiar tasks and problems but cannot take it all at the pace the crimes are growing. This chapter endeavors to bring an overview understanding of blockchain mechanics peculiar from an investigation and forensics perspective. While all the blockchains have different mechanics and designs, this chapter will build and discuss the understanding peculiar to bitcoin blockchain. This chapter will assume that the reader is relatively versed with the blockchain mechanics terminologies and will thus focus on the forensics part majorly.

2. Wallets Cryptocurrency wallets [4] facilitate as a medium to do transactions with the blockchain while storing the private-public keys of the owner. Simply said, a crypto wallet provides an interface for the legitimate owner to facilitate and conduct Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00016-4 Copyright © 2023 Elsevier Inc. All rights reserved.

237

238 SECTION B Blockchain architecture and security

transactions, view his transactions, balance etc. Besides the transactions and storage of private-public keys, the extended functions of modern generation wallets include signing information, encrypting/decrypting keys and deploying smart contracts. The onset of the wallets started with the arrival of the bitcoin in 2009 as simple software to interact and conduct bitcoin transaction. However, with the increased interest and adoption of thousands of cryptocurrencies, simple wallet software has evolved into a separate ecosystem altogether. If you browse https://bit.ly/1gfYNgg, readers will be able to get a brief overview of the wallet huge ecosystem that includes not just traditional software bases wallets but also hardware, mobile, desktop kinds with multiple variants for different platforms. Today there not just multiple thousands of software wallets, but there are different types of wallets as discussed in brief in the following: l

l

Software Wallets: These types of wallets are traditional software applications which need to be downloaded, installed and used for exploiting the functions. These have been further classified into three kinds:  Full Node Wallet: This kind of wallet requires a full blockchain downloaded in the owners PC wherein all the transactions are locally verified and processed prior to transmission to the peers vide the gossip protocol.  Thin Node Client: This kind of wallet does not require the complete blockchain download but connects with another full node client blockchain for processing and interacting with the blockchain.  Online Wallet: These wallet interfaces do not need any download and installation but are simple web interfaces, which are hosted by companies with the full blockchain at the back end. Few globally well-known web wallets include https://www.binance.com/en, https://www.coinbase.com/, https://blockstream.com/green/ https://www.gemini.com/ and https://www.coinsmart.com/  Mobile Wallets: This has become the most common way to conduct transactions in major blockchains owing to ease of mobility and access. Exodus, Electrum, Mycelium, Ledger Nano X etc. are well-known mobile crypto wallets for accessing multiple cryptocurrency blockchains. Hardware Wallets: These wallets are physical devices [5] inheriting the same kind of function as a usual software wallet will do but with much limited functionality. These store private-public keys and account transactions with balances. These are relatively secure compared to software wallets which have inherent vulnerabilities and are prone to online threats. But again, lost hardware wallets being accessed by some cyber criminals can be disastrous for the owner who stands vulnerable to losing all his coins. Few sample pictures of different hardware wallets are seen in Fig. 1.

FIG. 1 Types of hardware wallets.

Blockchain and forensics Chapter

l

l

13

239

Cold Wallets: Wallets do not store blockchains, but they only facilitate ease of access and doing peculiar cryptocurrency transactions. Thus, if the owner of a currency writes it down on a piece of paper or stores it in a notepad encrypted in a USB drive or an external HDD without any connection to the internet, it is termed as cold storage or simply a cold wallet. Paper Wallets: These are yet another form of offline cold storage wherein users store their private-public keys in a printed form, which is usually seen as a QR code. These QR codes can be generated online with any wallet generator site. https://www.bitaddress.org/, https://walletgenerator.net/, https://kimbatt.github.io/btc-address-generator/ etc. But at the same time, the users should also emphasize that all online generators have their pros and cons since in past wellknown online wallet generators have been compromised leading to undesired situations for the users. Few sample pictures of different formats of paper wallets are seen in Fig. 2.

3. Why wallets for forensics? While blockchain applications have expanded domains from just cryptocurrencies to multiple domains in healthcare, Internet of things (IoT), cyber physical systems (CPS), smart cities, smart buildings, logistics etc. to mention a few, irrespective for any blockchain interactions, wallets are critical. Thus, for any crime investigations and deciphering the transaction chain, access to the wallet becomes significantly important. From an investigating perspective, if investigators get access to the wallet, it would be as good as the crime solved in most cases.

FIG. 2 Paper wallets.

240 SECTION B Blockchain architecture and security

It is pertinent to mention that the traditional digital forensics methods including data collection, examination, analysis and reporting are important, but the main artifacts are stored in the blockchain, i.e., flow of transactions. Thus, it is deemed from a professionally sound blockchain forensics investigator to be well versed in blockchain storage of information. Forensics associated with wallets is discussed in the following: Software Wallets: Traditional in-practice methods would initiate the disk imaging and similar patterns followed by forensic software for reconstructing the metadata and logs of deletion and installed applications with respective time stamps. It will be significant from an investigation perspective to find out when the wallet was installed and deleted to connect with possible transactions. Once this has been established, the rest of the investigations will be peculiar to extracting data from blocks manually in an offline blockchain or any online blockchain explorer. Another key aspect from an investigation perspective will be to know which wallet was used to identify some immediate info. Each of these wallet software’s has different ways and means to store keys. So while few may be dependent on the security of the OS/platform on which they are installed, others may be available with their own security modules for key storage. Hardware Wallets: As seen in Fig. 1, investigators conversant with the make and type of hardware wallets are bound to observe an expedited progress in investigations. Let’s take an example of a hardware wallet Trezor make. While this wallet is setup by the user, it seeks a PIN from the user and also prompts for recovery words, which are unique to all Trezor make wallets. In investigations, if the hardware wallet is found and the suspect refuses to reveal the PIN, investigators can make way to private keys if they have access to these recovery words. This will require that investigators are conversant with the concept and retrieval of words. A sample recovery word list for a temporary wallet created from Metamask software wallet is seen in Fig. 3.

4.

Wallet import format (WIF)

While a typical private key is a 64-character key, it is usually difficult to write it down by users not only just because of the length but also owing to the existence of characters like I,1,i,O,0 etc., which in worst of cases may even lead to loss of coins. Thus comes the utility inform of Base58, which when applied on the private key reduces the key length to 58 and removes characters that can be mistaken. One example is discussed in the following with a private key. Private Key to WIF l Step 1: 64-character key C02055780EF9A26D3105AED23E57E8B04303B5CFBAD503F5212C87D1F12B180B

FIG. 3 Secret backup phrase in Metamask wallet.

Blockchain and forensics Chapter

l

l

l

l

l

l

13

241

Step 2: Add 080 byte to the front 80C02055780EF9A26D3105AED23E57E8B04303B5CFBAD503F5212C87D1F12B180B Step 3: SHA-256 of step 2, we get 30F7314E568818D78468B641360D756C2A76AF2A50C257A8A4452046D2CCB1F0 Step 4: Another SHA-256 of step 3, we get 006A23DCD3FE7A91312DDFEFC56103FA34A63D492817F2D33EDB2428DB3A9796 Step 5: Identifying the first 4 bytes from step 4, we get 006A23DC Step 6: Appending step 5 at the end of step 2 80C02055780EF9A26D3105AED23E57E8B04303B5CFBAD503F5212C87D1F12B180B006A23DC Step 7: Base58 encoding of step 6 5KGuByi7qyHDV2Qn5yqLKWpZssWy7iLa8GwTawnZnHEeBUk1HJs

WIF checksum checking If the investigator gets hold of one key and wants to check if this is a legitimate private key, he can check the same with the following steps: l

l

l

l

l

l

l

Step 1: WIF received as mentioned previously 5KGuByi7qyHDV2Qn5yqLKWpZssWy7iLa8GwTawnZnHEeBUk1HJs Step 2: Converting WIF as Base58 string to byte array 80C02055780EF9A26D3105AED23E57E8B04303B5CFBAD503F5212C87D1F12B180B006A23DC Step 3: Dropping the last 4 checksum bytes from 2 80C02055780EF9A26D3105AED23E57E8B04303B5CFBAD503F5212C87D1F12B180B Step 4: SHA-256 hash of output at step 3 30F7314E568818D78468B641360D756C2A76AF2A50C257A8A4452046D2CCB1F0 Step 5: SHA-256 hash of output at step 4 006A23DCD3FE7A91312DDFEFC56103FA34A63D492817F2D33EDB2428DB3A9796 Step 6: First 4 bytes of step 5 output, the calculated checksum is 006A23DC Step 7: Take the last 4 bytes of step 2 output, the original checksum is 006A23DC

Now, if the outputs of steps 6 and 7 are the same, the private key is legitimate to be investigated. These reverse steps can be useful to key out and confirm the most critical facet in any investigation, i.e., private key. For readers interested in doing practice and process automated, these steps are available at https://gobittest.appspot.com/PrivateKey

5. Information inside blocks of blockchain All the blocks peculiar to each blockchain adhere to a peculiar block header format. This block header format will be different for different blockchains and each such block, in a typical bitcoin blockchain, has fields like block size, block header, transaction counter and transactions. Each of these fields has a fixed size and a peculiar function as seen in Table 1.

6. Let’s check the genesis block The genesis block is the first block of any blockchain and is little different from the rest of the blocks in the blockchain since fields like previous block hash or Merkle root [6] are absent, and thus, there will be null values. In order to access the genesis block, users interested in doing it themselves are advised to download bitcoin blockchain, which at the time of writing this chapter stands at around 380 GB. Once downloaded, users can get into the folder .bitcoin/blocks and see the populated blocks. The listing will look like as seen in Fig. 4 which lists the top files with the head switch in listing top 10 files. The first blk file, i.e., blk00000.dat is fetched here for analysis, and the following command is run to fetch the first 1000 bytes in a separate file derived as genesis.dat dd if=blk00000.dat of=genesis.dat bs=1000 count=1

In this command, if is the input file which is to be truncated from blk00000.dat and genesis.dat is the desired output file of, which contains the genesis block details in hexa decimal form. bs represents the number of bytes to be copied into the new thesis.dat file, while count defines the number of times 1000 bytes have to be copied, i.e., one times here. Once this

242 SECTION B Blockchain architecture and security

TABLE 1 Block header format. Field name Block Header

Description

Size (bytes)

This includes all other fields like version, previous hash, Merkle root, time stamp, difficulty target and nonce

80

Version

4

Previous hash

32

Merkle Hash

32

Time Stamp

4

Difficulty Target

4

Nonce

4

Block Size

4

Transaction Counter

1–9

FIG. 4 Listing files in .bitcoin/blocks directory.

FIG. 5 Listing files genesis.dat file.

file genesis.dat is populated as seen in Fig. 5, it can be opened with any hex editor. For the purpose of exploring it, we will open it with winhex editor as seen in Fig. 6 and read the data as per headers in Table 1.

7.

Reading from a genesis.dat file

Extract from genesis.dat is produced in the following:

Blockchain and forensics Chapter

13

243

FIG. 6 Reading genesis.dat file with winhex editor.

F9BEB4D91D010000010000000000000000000000000000000000000000000000000000000000 0000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1 E5E4A29AB5F49FFFF001D1DAC2B7C01010000000100000000000000000000000000000000 00000000000000000000000000000000FFFFFFFF4D04FFFF001D0104455468652054696D65 732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F6620 7365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000 434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649 F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000 000

The analyzed output of the previously mentioned hexadecimal is discussed in the following: l l

l l

l

l

l

l l l l l l l

l l

4 bytes at the beginning, i.e., F9BEB4D9 represent the magic number in hexadecimal format. Next 4 bytes, i.e., 1D010000 depicts the blocksize means 285 bytes (decimal equivalent); thus, here it is 570 (UINT32LittleEndian(DCBA)) Next 4 bytes, i.e., 01000000 is the version number The preceding 32 bytes as seen in the hexadecimal output, i.e., 000000000000000000000000000000000000000000000 0000000000000000000 is the previous hash. Zero in case of the first block 3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A is the Merkle root which is visible on all bitcoin explorers. The swapped endian derived, i.e., order or sequence of bytes, from this is 4A5E1E4BAAB89F3A32518A88C31BC87F618F76673E2CC77AB2127B7AFDEDA33B. 29AB5F49 is the time stamp (swap endian to 495fab29 to get the time); we get Saturday, January 3, 20096:15:05 PM. This can be also calculated online with any website like https://www.epochconverter.com/timezones FFFF001D depicts the difficulty/bits, i.e., endian reverse in the form of 1D00FFFF; converting this hex value to decimal, we get 486604799. 1DAC2B7C is the nonce converted to UINT32-LittleEndian (DCBA) as 2083236893 01 is the number of transaction 01000000 is the version 01 is the number of input 0000000000000000000000000000000000000000000000000000000000000000FFFFFFFF is the previous output 4D is the script length, i.e., 77 04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E6365 6C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73 is the scriptsig. scriptsig comprises of all elements to linked UTXO and is used to solve the transaction malleability FFFFFFFF is the sequence 01 is the number of output counter. One in the genesis block

244 SECTION B Blockchain architecture and security

l

l

l l

l

l

l

l

l

00F2052A01000000 represented in 8 bytes shows the release of 50BTC to miner (swap endian we get 000000012A05F200 and then convert this hexadecimal to decimal equivalent, i.e., 5000000000, i.e., 50  108, i.e., 50BTC is the award to the miner) 434104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CE F38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC is the output bytes (which will be used later in next step while calculating Merkle root) 00000000 is the lock time (Called nLockTime in the bitcoin Core source code) The next step is to calculate the hash, version number onwards till the end of hexadecimal length, i.e., 01000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF4D04FFFF001 D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B20 6F66207365636F6E64206261696C6F757420666F722062616E6B73FFFFFFFF0100F2052A01000000434104678AF DB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC 112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC00000000 The version number onward SHA-256 hash as previously mentioned is generated as 27362e66e032c731c1c 8519f43063fe0e5d070db1c0c3552bb04afa18a31c6bf Again SHA-256 hash is applied on this hash; we get 3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3 888a51323a9fb8aa4b1e5e4a This hash is further converted with swapped endian value as 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b. This is the final hashed form of the transaction also known as the transaction ID(TXID) and is the Merkle root Next hashing the header of the block by appending together in sequence fields including version number, previous hash, Merkle root, time stamp, difficulty bits and nonce, we get 01000000000000000000000000000000000000000000 00000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f 49ffff001d1dac2b7c which is further SHA-256 hashed to derive hex-encoded output as af42031e805ff493a07341e2f74ff58149d22ab9ba19f61343e2c86c71c5d66d This output is again SHA-256 hashed, and the derived hash is 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 whose swapped endian is the block hash derived as equal to 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

The previously mentioned analysis of the genesis block gives a brief peak into the information that is available inside a block. Such information can be of huge value to forensic investigators.

8.

Deriving bitcoin address from a block

Let’s read another block at height 533,909. One extract from this block is produced in the following and 01000000012ad07447509a4fa9f3b45d3bde74b774b46b569dfa1d0728120c355b7b26312f000020 006a473044022100edf664ebfc12a3998d242fbdd8a1a44c13e4e7f6d7dbddde9ae5610bfd2c9c380 21f74ec1e2eca7310baa17c60cbaaffa0503cee680f13fd9a10fd04f2910958c901210348666996200 8e0713660b6d69117a65fcecd221d06c1e5077b4d9cd477c0cf98feffffff02102700000000000017a9 144c8045932c5a4e57316e6e9c465fc1fba32d6ac38768380000000000001976a9144f6d76f02a55 53617ec71820e9036afdcbf7d93c88ac693b0800

Version: 01000000 Input counter: 01 means one input script Txnoutputhash: 2ad07447509a4fa9f3b45d3bde74b774b46b569dfa1d0728120c355b7b26312f Big Endean: 2f31267b5b350c1228071dfa9d566bb474b774de3b5db4f3a94f9a504774d02a Txout index: 0002000 (first output in the output of previous hash) Script length: 6a, i.e., 106 bytes Input script: 473044022100edf664ebfc12a3998d242fbdd8a1a44c13e4e7f6d7dbddde9ae5610bfd2c9c38021f74ec1e2eca7310baa 17c60cbaaffa0503cee680f13fd9a10fd04f2910958c9012103486669962008e0713660b6d69117a65fcecd221d06c 1e5077b4d9cd477c0cf98. Sequence: feffffff Breakup of input script: Length of data: 47, i.e., we get 71 bytes in decimal

Blockchain and forensics Chapter

13

245

Signature: 3044022100edf664ebfc12a3998d242fbdd8a1a44c13e4e7f6d7dbddde9ae5610bf d2c9c38021f74ec1e2eca7310baa17c60cbaaffa0503cee680f13fd9a10fd04f2910958c901 Length of public key: 21 Hexa to Decimal: 33 bytes: 66 chars Public key: 03486669962008e0713660b6d69117a65fcecd221d06c1e5077b4d9cd477c0cf98 To derive the bitcoin address from this public key, the following steps will be used: l

l

l

l

l

l

l

l

Step 1: SHA-256 hash of public key AF1A74E378749900AB079315E518DFD27196193CA139F1E8A037E5851F8A5ECB Step 2: RIPEMD-160 hash of previously mentioned CFCC2CE2D8FC82B2B0837B6C1775D5EDCFFC107F Step 3: Adding network bytes to previously mentioned output RIPEMD-160 hash 00CFCC2CE2D8FC82B2B0837B6C1775D5EDCFFC107F Step 4: SHA-256 hash of previously mentioned gives the output as: 65428339C3CCA9ADC5577C2D2F9CD0C92F3BEA1D0E9AE986EF7AC73B1A71B893 Step 5: SHA-256 hash of 4 79CCB53D787D2C54087CA095504D92EE2AD2BC93A0986EF9D19A017EF8232CDD Step 6: First four bytes of 5 79CCB53D Step 7: Adding 7 at the end of step 3 output 00CFCC2CE2D8FC82B2B0837B6C1775D5EDCFFC107F79CCB53D Step 8: Base58 encoding of step 7 1KwjU4UknzbXh1rnP1jAKz9wwjcuYwe9AC

Step 8 gives us the bitcoin address which can be queried and searched on bitcoin explorer at https://www.blockchain.com/ btc/address/1KwjU4UknzbXh1rnP1jAKz9wwjcuYwe9AC. From the information seen on the bitcoin explorer, as seen in Fig. 7; transactions are seen and other details of “from” and “to” addresses come handy for investigations. It is also seen that this address has transacted 5 times on the bitcoin blockchain. It has received a total of 0.01326883 BTC ($626.88) and has sent a total of 0.01326883 BTC ($626.88). While from the transaction hash we were able to get the public key, checking it further on the bitcoin explorer gave us important addresses, too for assisting investigations.

9. Understanding mempool Mempool [7] is a kind of waiting room for transactions which are awaiting final indexing inside a block or simply said unconfirmed transactions. One excellent viewer of transactions in mempool is available at https://bitnodes.io/dash board/bitcoind/. The site dynamically populates transactions in mempool. At first glance, after few seconds on site, one screenshot of the populated mempool is seen in Fig. 8. In this figure, there are shades of light to dark boxes which basically represent fees by users. A lower fees than usual is depicted by dark color, and higher fees than usual fees in last one hour are seen relatively lighter in color. The transactions in the mempool can, at time, be useful for investigators to bracket times of transactions. While the actual times cannot be deciphered since a transaction with a low fees could float in mempool for hours till such time, it is indexed inside some

FIG. 7 Info retrieved for address 1KwjU4UknzbXh1rnP1jAKz9wwjcuYwe9AC.

246 SECTION B Blockchain architecture and security

FIG. 8 Snapshot from mempool.

FIG. 9 Queried result for transaction hash from mempool.

block. If any transaction from this mempool is queried for rank as per the transaction fees accorded, it can be derived with the API which gives an output like seen in Fig. 9. .

10.

Information from addresses

Addresses are cardinal to each transaction [8] and can be of great assistance in investigations l

l

l

l

P2PKH(Pay-to-public-key-hash): Also known as legacy addresses, these represent the standard transaction in the bitcoin ecosystem and the ones which are used utmost. These addresses begin with “1”. Few examples of P2PKH addresses are:  15TcDCacMgAJgvjzAjj6KfdTvp7eAkFho3  1PHqhqPeThCo9gX4hQ2LPnXf8KSwDtPoTi  1NwThouEBZgccWnfwYUDDLarszYpBMmU1R These addresses involve the most expensive transaction fees for coordinating transactions. Most of the traditional wallets have not moved beyond these addresses and are limited to these addresses only. Pay to Witness Public Key Hash (P2WPKH) in a Pay to Script Hash (P2SH-P2WPKH) or Nested SegWit Addresses: These addresses are prefixed by “3” and represent multisignature transaction. Compared to legacy addresses, they incur up to 40% less transaction fees in bitcoin transactions. Examples are:  3GnZiWXaUxuLgxRhanjZtjN9xZiKvmHm9Y  3QcLariiXSgXzDUcFHoUY7WWhA8mN7Q3zw  3LUxQUGMhZ8LZJSFBfAmfC98WXSLRDKAqc Pay to Witness Public Key Hash or Native SegWit [9] Bech32 “bc1” Addresses: These are new generation ways of address system, and the addresses start with bc1. Examples are:  bc1q2mztj6pyrzuqjvdmn4tgc7fz8gzafajy22p29v  bc1qsw8najvz63jrxrv3m7fa92sqkslvfzgxdnfevc  bc1qa56lzf7d05ttur003zmuzwrgl3x0qau5zm2qzn Ethereum Addresses: The addresses in Ethereum blockchain transactions start with “0x” and are followed by a series of 40 random characters. Examples are:

Blockchain and forensics Chapter

13

247

 0x1f5584fd2fe1f0a2bc89699652df8b51985f07d1  0x8fecebc888edb60f7a5c9fd4de6b4f38a8b945a1 So the previously mentioned only are few examples of the uniqueness of addresses and how a simple address may be able to give valuable cues to investigators. If an investigator is just not able to make out of which crypto the key is or the address is, it inherently leads to inevitable undesired delays.

11. Opensource tools in cryptocurrency blockchain forensics While the ecosystem of blockchain itself is evolving still, crypto crimes have been observing an increasing trend. Thus, the need of forensics peculiar to blockchain becomes significant. Although for an investigator, the mechanics and knowhow of how one specific blockchain works is of significant importance, tools available are of huge assistance for expediting the pace of investigations. Authors here again emphasize that if investigators are primarily dependent on tools only, it retards the pace and limits the scope of view since tools encompass limited features only for peculiar crimes, while the criminals are seen exploiting new ways and means to bypass the forensics. Few of the opensource tools that can impart deep insights into investigations are discussed in the following: l

l

MATBEA: It is one absolute unique opensource service, based in UK, that facilitates to find out owners of bitcoin and addresses. A simple search in the search tab with the address immediately brings out the transactions in which the address has been mentioned under heads of ALL, SENT and RECEIVED. Address 15SdoFCiwaoUN4grnhPCoDWxWLcY6ZT68V on being searched at this site gives an immediate output as seen in Fig. 10, which can give significant leads to the investigators. It is seen that immediately it reflects a total of 44 transactions and these 44 transactions have 21 SENT transactions, while 23 transactions are seen under RECEIVED tab. Keen readers should checkout the website at https://matbea.net/ to get a hands on experience and understanding. As per the website info, it already has a database of 60,000,000 plus addresses. Blockchain Explorers: From just being an API to see transactions, blocks, time stamps etc. kind of details, new generation blockchain explorers [10] have evolved with more powerful analytics and graphical visualizers to bring all statistics at the click of a button. While most of the traditional blockchain explorers feature mempool sizes, unconfirmed transactions, mined blocks, miners, transaction hashes, recently mined blocks etc., new generation blockchain explorers offer more analytics enabled on this data in real time. These features further include few of the following information:

FIG. 10 Queried result address 15SdoFCiwaoUN4grnhPCoDWxWLcY6ZT68V.

248 SECTION B Blockchain architecture and security

      

l

Checking an address and its owners Address interactions and transaction visualizations Riskiness in addresses Comprehensive bitcoin blockchain overview with the most recent statistics User-friendly format for bitcoin address, transaction and block details Interesting visualization of bitcoin blockchain enabled with easy data-sharing features Few pertinent to mention blockchain explorers for good insights into blockchains are mentioned in the following: - Blockchain explorer at https://www.blockchain.com/explorer - BTC explorer at https://btc.com/ - Blockchair explorer at https://blockchair.com/ - Block explorer at https://www.blockexplorer.com/ - CryptoID at https://chainz.cryptoid.info/ - Blockcypher at https://www.blockcypher.com/ - SoChain at https://chain.so/ - BitInfoCharts at https://bitinfocharts.com/ - Etherscan at https://etherscan.io/ - OXT at https://oxt.me/ - Blockonomics at https://www.blockonomics.co/ - Crystal explorer at https://crystalblockchain.com/ Blockchain visualizers: Though new blockchain explorers mostly come inbuilt with a variety of visualization options, there are few other peculiar explorers which exclusively offer visualizations. Few of these include the following:  Maltego at https://www.maltego.com/  Bitnodes at https://bitnodes.io/  Bitnodes live map of bitcoin at https://bitnodes.io/nodes/live-map/  Bitcoin transaction visualization at http://bitcoin.interaqt.nl/  Ethereum visualizer at https://ethplorer.io/  Ethereum viewer at http://ethviewer.live/  Bitcoin visuals at https://bitcoinvisuals.com/  Multiple crypto visualizer at https://txstreet.com/  Daily blockchain at https://dailyblockchain.github.io/

12.

Information about an address

While crypto addresses [11] can be searched on blockchain explorers as discussed previously, it will be surprising for investigators to know how these addresses will be inadvertently mentioned in other places too like: l l l l l

Social media platforms Discussion forums Software sharing websites Blogs and websites Twitter

Such mentions invariably come when the suspects ask for payments from victims in other cases. So while an address like 1PHqhqPeThCo9gX4hQ2LPnXf8KSwDtPoTi is put in Google search, the output is something like seen in Fig. 11, which majorly is fetched from blockchain explorers. Thus, to derive a search with an added “not” identifier, the results are different and more peculiar for investigations.

13.

Summary recommendations for investigators

Blockchain forensics [12–15] is a huge domain in itself, and perhaps not just a chapter but an exclusive book may justify the assimilation and understanding. Table 2 brings out in brief the minimum expectations from an investigator’s perspective to dive into the domain from a professional front.

Blockchain and forensics Chapter

FIG. 11 Querying an address.

TABLE 2 Investigator expected knowhow. Ser No.

Knowhow of subjects/domain knowledge

(a)

Awareness of the mechanics of blockchain

(b)

Technology internals of blockchain being investigated

(c)

Remain updated on new forks and improvement proposals like Ethereum improvement proposal (EIP), Bitcoin improvement proposal (BIP), etc.

(d)

Awareness of traditional forensics

(e)

Using blockchain explorers for peculiar functions, features and info extraction

(f)

Wallets and platform challenges

(g)

Private and public keys and cryptography

(h)

Hex-Dec-Bin conversions and calculations

(i)

Clustering techniques for crypto addresses

(j)

Updated on new crimes and investigations happening globally and details.

(k)

Learning from established and proven research papers like “A fistful of Bitcoins: characterizing payments among men with no name” by Sarah Meiklejohn and likes.

13

249

250 SECTION B Blockchain architecture and security

14.

Conclusion

This chapter discussed an overview of blockchain forensics. Blockchain is still an evolving field while also growing into multiple domains other than the erstwhile limited finance and cryptocurrency domain. But the need of blockchain forensics has emerged owing to the increasing trend seen in crypto crimes globally [16]. While traditional forensics focuses on the chain of custody, it would be apt to say that in the case of blockchain forensics the analysis starts after chain of custody has concluded vide loads of information available on blockchain explorers and visualizers. The discussions in this chapter have been limited to extracting information out of blocks in blockchains, transaction hashes etc. peculiar to bitcoin blockchain, interpreting useful information from explorers, but this seems to be just the tip of iceberg. On the other hand, a real-time scenario of crypto crime might encompass any other blockchain which will have its own mechanics of storage, encryption, hashing etc. making it further complex. Thus, a truly professional crypto currency investigator is expected to be conversant with all popular blockchain platforms and the mechanics rather than majorly relying upon COTS-purchased tools.

References [1] B. Sa´ndor, D.J. Feher, Examining the relationship between the bitcoin and cybercrime, in: 2019 IEEE 13th International Symposium on Applied Computational Intelligence and Informatics (SACI), 2019, pp. 121–126, https://doi.org/10.1109/SACI46893.2019.9111568. [2] S. Meiklejohn, M. Pomarole, G. Jordan, K. Levchenko, D. McCoy, G.M. Voelker, S. Savage, A fistful of Bitcoins: characterizing payments among men with no names, Commun. ACM 59 (4) (2016) 86–93, https://doi.org/10.1145/2896384. [3] X.F. Liu, X.-J. Jiang, S.-H. Liu, C.K. Tse, Knowledge discovery in cryptocurrency transactions: a survey, IEEE Access 9 (2021) 37229–37254,https://doi.org/10.1109/ACCESS.2021.3062652. [4] S. Suratkar, M. Shirole, S. Bhirud, Cryptocurrency wallet: a review, in: 2020 4th International Conference on Computer, Communication and Signal Processing (ICCCSP), 2020, pp. 1–7, https://doi.org/10.1109/ICCCSP49186.2020.9315193. [5] A.G. Khan, A.H. Zahid, M. Hussain, U. Riaz, Security of cryptocurrency using hardware wallet and QR code, in: 2019 International Conference on Innovative Computing (ICIC), 2019, pp. 1–10, https://doi.org/10.1109/ICIC48496.2019.8966739. [6] J. Kan, K.S. Kim, MTFS: Merkle-tree-based file system, in: 2019 IEEE International Conference on Blockchain and Cryptocurrency (ICBC), 2019, pp. 43–47, https://doi.org/10.1109/BLOC.2019.8751389. [7] M. Saad, L. Njilla, C. Kamhoua, J. Kim, D. Nyang, A. Mohaisen, Mempool optimization for defending against DDoS attacks in PoW-based blockchain systems, in: 2019 IEEE International Conference on Blockchain and Cryptocurrency (ICBC), 2019, pp. 285–292, https://doi.org/10.1109/ BLOC.2019.8751476. [8] H. Hellani, H. El Ghor, A.E. Samhat, C. Maroun, A. Serhrouchni, On BlockChain Technology: Overview of Bitcoin and Future Insights, 2018, https://doi.org/10.1109/IMCET.2018.8603029. [9] A. Hafid, A.S. Hafid, M. Samih, Scaling blockchains: a comprehensive survey, IEEE Access 8 (2020) 125244–125262, https://doi.org/10.1109/ ACCESS.2020.3007251. [10] H. Kuzuno, C. Karam, Blockchain explorer: an analytical process and investigation environment for bitcoin, in: 2017 APWG Symposium on Electronic Crime Research (eCrime), 2017, pp. 9–16, https://doi.org/10.1109/ECRIME.2017.7945049. [11] Y. Lin, P. Wu, C. Hsu, I. Tu, S. Liao, An evaluation of bitcoin address classification based on transaction history summarization, in: 2019 IEEE International Conference on Blockchain and Cryptocurrency (ICBC), 2019, pp. 302–310, https://doi.org/10.1109/BLOC.2019.8751410. [12] S. Zollner, K.R. Choo, N. Le-Khac, An automated live forensic and postmortem analysis tool for bitcoin on windows systems, IEEE Access 7 (2019) 158250–158263, https://doi.org/10.1109/ACCESS.2019.2948774. [13] B. Shanmugam, S. Azam, K.C. Yeo, J. Jose, K. Kannoorpatti, A critical review of bitcoins usage by cybercriminals, in: 2017 International Conference on Computer Communication and Informatics (ICCCI), 2017, pp. 1–7, https://doi.org/10.1109/ICCCI.2017.8117693. [14] Y. Wu, et al., A bitcoin transaction network analytic method for future blockchain forensic investigation, IEEE Trans. Netw. Sci. Eng. 8 (2) (2021) 1230–1241, https://doi.org/10.1109/TNSE.2020.2970113. [15] Y. Wu, A. Luo, D. Xu, Forensic analysis of bitcoin transactions, in: 2019 IEEE International Conference on Intelligence and Security Informatics (ISI), 2019, pp. 167–169, https://doi.org/10.1109/ISI.2019.8823498. [16] B. Sa´ndor, D.J. Feher, Examining the Relationship between the Bitcoin and Cybercrime, in: 2019 IEEE 13th International Symposium on Applied Computational Intelligence and Informatics (SACI), 2019, pp. 121–126, https://doi.org/10.1109/SACI46893.2019.9111568.

Chapter 14

Cryptography in blockchain Anupam Tiwari Computer Science Department, GD Goenka University, Gurugram, Haryana, India

1. Introduction Blockchain is emerging as one the most promising and revolutionary technologies globally around. Though blockchain [1] at the onset was majorly associated with financial domain, after the arrival of Ethereum and smart contracts in 2014 [2], the applications just expanded in multiple domains. This expansion into other domains emphasizes on the trust and advantages that accrue out of possible association with blockchain. While blockchain will be able to offer the characteristics in all the domains, it will primarily bank on the cryptographic protocols that mechanize the blockchain internals. It will not be wrong to say that the blockchain in entirety banks upon the strong mathematical foundations of cryptography. Whether it is the proof of work mechanics or the digital signatures or encryption part, the complete ecosystem of blockchain is entirely dependent critically on cryptography. This chapter will focus on the role of cryptography in blockchain and will discuss the cryptography mechanics peculiar to Bitcoin blockchain and thereafter discuss the same assisted with few practical on-hands examples.

2. Set/group/field/order/prime fields Although this chapter pertains to cryptography and blockchain, readers might get surprised with inclusion of this section right at the onset. But this small section encompassing basics of finite field mathematics will be key enabler for elliptic curve cryptography on which two major blockchains, i.e., Bitcoin and Ethereum, are based on. The key definitions of important terms in this section are discussed below: l

l l

l

l

l

Set: Refers to a collection of distinct and unique objects. For example, A ¼ {1,2,3,4,5,6,7,8}. Elements not found inside a defined set A will not be part of the set. Order: Number of elements inside a set defines the cardinal parameter or the order of the set. Group: Refers to an algebraical system comprising of one operation, an identity element, a set, and its inverse operation. For example, if B refers to a group ¼ (S, O, I), then S can be a set of integers, O will refer to the operation, which can be addition/multiplication, etc., and I will be the identity element. Ring: Refers to an algebraical system comprising of a set, two operations, an identity element, and the inverse operation of the first operation. For example, Ring R ¼ (S, Op1, Op2, I), wherein S can be a set of real numbers, Op1 and Op2 can be two different operations, and I as the identity element zero (0). Field: Refers to an algebraical system comprising of a set, two operations, an identity element for each operation, and respective inverse operations. For example, Field F ¼ (S, Op1, Op2, I1, and I2), wherein S can be a set of real numbers, Op1 and Op2 can be two different operations, and I1/I2 as the identity element zero (0) and identity element one (1) Finite field: Also known as Galois field, refers to a field with a finite set of elements. Finite fields are widely known as a key essential to elliptic curve cryptography (ECC) to resolve discrete log problems.

3. Cryptography Cryptography as a subject has undergone a huge transformation over last few decades since advent and proliferation of internet and web enabled interfaces and APIs. Various subsets of the domain have emerged and seen evolving to peculiar requirements like key management protocols, non-repudiation, encryption, or authentication protocols. Cryptographic primitives [3] are low-level proven cryptographic standards, well-founded, that are often used to enable other cryptographic protocols for security systems in an IT-enabled ecosystem. A simple taxonomy of the subsets encompassed under Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00011-5 Copyright © 2023 Elsevier Inc. All rights reserved.

251

252 SECTION B Blockchain architecture and security

cryptographic primitives is seen in Fig. 1. So majorly, the cryptography domain is classified in two categories of symmetric and asymmetric cryptography. This chapter will largely focus on asymmetric cryptography but with a brief prelude introduction to the foundations of the symmetric cryptography.

4.

Role and function of cryptography

Cryptography enables the mechanics of three pillars of information security, i.e., confidentiality, integrity, and authentication [4]. l

l

l

5.

Confidentiality: Cryptography assists enabling the confidentiality of subject message under transfer or share. Thus, even when the transmission mode or storage has been compromised, the compromised message cannot be decoded to information owing to scrambled/cipher format. Integrity: Cryptography enables integrity of information exploiting the hashing algorithms and message digests functions. Even a small modification in the message brings in an avalanche effect in the output of the message digest. Authentication: Cryptography enables non-repudiation and authentication with functions of digital signatures, certificates, and public key infrastructure (PKI).

Symmetric and asymmetric cryptography

5.1 Symmetric cryptography Also known as shared key cryptography [5], as the name infers, there exists symmetry in this kind of cryptography between the encryption and decryption keys, i.e., these both are the same. The key with which the message in plain text has been encrypted will also be the key with which it will be decrypted, which is unlike asymmetric encryption, discussed ahead in separate section. Thus, two persons who communicate and use this encryption method must hold the common key to be used for respective encryption/decryption. Fig. 2 shows a simple plain text first being encrypted with a secret key to be converted into a scrambled/encrypted text. Subsequently with the same secret key, the scrambled/encrypted text is decrypted too. While any third person who gets hold of the encrypted text, he will not be able to recover any information out of this text unless he has access to the secret key. The secret key can be a combination of numbers and alphabets or it could simply be generated with random number generation process (RNG) which renders a random combination of alphabets and numbers that cannot be fairly augured. A further extension of RNG comes in the form of random hardware random-number generators (HRNGS), which return random numbers enabled on a mathematical function of current value of a physical environment property that is incessantly altering in a way that is practically difficult to resolve. Pseudorandom number generators (PRNGS) [6] are yet another way

FIG. 1 Cryptographic primitives.

Cryptography in blockchain Chapter

14

253

FIG. 2 Encryption-decryption in symmetric cryptography.

to get numbers that appear random though are actually deterministic, and can be calculated back if the credentials of the PRNG are known. To attain bank grade encryption, symmetric encryption keys are created using RNG certified as per specifications laid down by Federal Information Processing Standards (FIPS). As seen in Fig. 1 classification, symmetric cryptography is further divided into three types: l

l

l

MACs: Referred in expanded form as message authentication code (MAC), also known as tag, is the checksum applied on the data under transfer or share between two parties. This allows the parties to ensure that in no circumstances either erroneously or maliciously, the message remains unmodified and tampered with at the sender and the receiver end. Stream ciphers: These refer to encryption algorithms, wherein the plain text messages are applied with encryption on a bit-by-bit basis using keystream. Keystream refers to a sequence of pseudorandom characters applied along with the plain text message to deduce an encrypted message, i.e., the cipher text. These are further classified into asynchronous and synchronous stream ciphers. Asynchronous stream ciphers refer to keystreams which are dependent on the encrypted message data while synchronous stream ciphers are only dependent on the shared secret key. Block ciphers: The block ciphers divide the data into chunks of equal blocks and these blocks are further applied with the encryption algorithms. Feistel cipher design model, enabled on confusion and diffusion cryptographic properties, is the basis for most of the derived encryption algorithms like DES which again uses same algorithm for encryption and decryption. Block ciphers mode of operation include:  Counter (CTR) mode  Output feedback mode (OFB)  Cipher blockchaining mode (CBC)  Electronic code book (ECB)

Block ciphers in cryptographic hash mode are used to facilitate compression function to output a hash of plaintext. Two widely known block ciphers, Triple DES (Data Encryption Standard) and AES (Advanced Encryption Standard) [7], are discussed ahead.

5.2 Data encryption standard Introduced by National Institute of Standards and Technology, USA in 1980s, DES was a widely known standard encryption algorithm. Block cipher DES encrypts data in 64-bit sizes, i.e., 64 bits of message to be encrypted are taken as input, applied with DES which outputs 64 bit of cipher text. DES got prone to brute force attacks owing to advancing technologies over times and 56-bit key DES was broken in July 1998 by the Electronic Frontier Foundation (EFF) using EFFDES cracker machine, also known as the deep crack. Thus arrived an improved DES inform of Triple DES or 3DES.

5.3 Advanced encryption standard (AES) Cryptographers Vincent Rijmen and Joan Daemon invented the Rijndael algorithm in 2001 that was later standardized with minor modifications as AES by NIST. Compared to DES, AES is six times quicker in applications. The improved 3DES

254 SECTION B Blockchain architecture and security

over DES was good enough from security perspective but was very slow. The key characteristics of AES are mentioned below: l l l l l l l l

128-bit group encryption with 192/256-bit keys Provide full specification and design details Stronger and faster than Triple DES Symmetric key symmetric block cipher requiring only one decryption and encryption key Software implementable in C and Java Ease of implementation Global ease of access Block encryption implementation

5.4 Checking on a Linux terminal: AES OpenSSL is open-source robust, commercial-grade, and full-featured tool to experiment with all the ciphers for Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols. This chapter includes separate sections for each explanation with limited command line executes for better assimilation by users. Few command line executes at a Linux terminal with OpenSSL to encrypt-decrypt a file with AES are shown in Table 1:

5.5 Asymmetric cryptography Also known as public key cryptography [8], the encryption and decryption keys in this type are different, i.e., the key with which the message in plain text has been encrypted will not be the key with which it will be decrypted, which is unlike symmetric encryption, discussed in earlier separate section. Unlike the shared secret key being referred to in case of symmetric key cryptography, herein in asymmetric cryptography the keys are termed public and private key as seen in Figs. 3 and 4. Accountability & non-repudiation: Both these terms have high significance in the security perspective. While accountability digitally ensures that the person, who claims he is actually, is the person he claims to be, non-repudiation is a digital assurance that someone cannot back track on the origin source and integrity of data. Digital non-repudiation makes it hard to refuse where the message originated from enabled with integrity. Public key cryptography thus offers encryption, decryption, identification, digital signatures, and key establishment in the security mechanism ecosystem.

TABLE 1 Encryption with OpenSSL AES: Command line steps and description. Command

Output

$ echo scopus chapter test file > scopus.txt

Description Write a file with a small text “scopus chapter test file.” File named scopus.txt

$ more scopus.txt

scopus chapter test file

Checking the written message inside scopus.txt file

$ openssl enc -aes-256-cbc salt -in scopus.txt -out myfile.enc

enter aes-256-cbc encryption password: Verifying - enter aes-256-cbc encryption password:

Encrypting the file scopus.txt with AES encryption. The terminal asks for password and verifies it by typing again.

$ ls

myfile.enc scopus.txt

Listing the new encrypted file and seen as myfile.enc

$ openssl enc -d -aes-256cbc -in myfile.enc -out scopus_decoded.txt

enter aes-256-cbc decryption password:

Decrypting the file myfile.enc with AES encryption. The terminal interface asks the password.

$md5sum scopus_decoded. txt scopus.txt

6f52834a2d9e5675a1985e3b5b248cbd scopus_decoded.txt 6f52834a2d9e5675a1985e3b5b248cbd scopus.txt

The command checks the md5sum hash of the original file scopus.txt and the derived file from myfile.enc to decoded.txt. The hash is same thus rightly decrypted.

Cryptography in blockchain Chapter

14

255

FIG. 3 Public key encryption.

FIG. 4 Digitally signing a message.

6. Elliptic curve cryptography (ECC) ECC [9] is a simple way to generate private-public key set introduced by Neal Koblitz and Victor Miller in the year 1985. ECC is the main algorithm for generating public-private key sets for each transaction in Bitcoin and Ethereum blockchain implementations. Major advantages derived from ECC are discussed below: l l

ECC algorithm uses a relatively shorter key for encryption viz-a-viz other algorithms. Shorter key deems a much lesser computing power and thus makes the execution faster.

A basic comparison of the scale of short sizes of ECC keys with RSA [10] is seen in Table 2. ECC curves and mechanics per se are not ellipses in the true form and are represented by curves which are quadratic (x2) and always cubic (x3). An international consortium named “The Standards for Efficient Cryptography Group” (SECG) is responsible for developing commercial-grade standards for interoperable and effective cryptography. The advised set of ECC parameters by SECG are referred to with letters {p, a, b, G, n, h}, which is collectively known as the elliptic curve domain parameters (ECDP). These letters are inserted in the standard sec256k to name and define the standard. For example, both Ethereum and Bitcoin use secp256k ECDP standard. This secp256k ECDP standard uses the elliptic curve equation as seen in Eq. (1). y2 ¼ x3 + ax + b

(1)

The parameters defined by the standard are {a ¼ 0} and {b ¼ 7} which makes the Bitcoin equation derived from Eq. (1) as y2 ¼ x3 + 7

(2)

256 SECTION B Blockchain architecture and security

TABLE 2 RSA vs ECC standard. Key length RSA

Key length ECC

Parameter/ECC standard

1536

192

Secp192k1

1536

192

Secp192r1

2048

224

Secp224k1

2048

224

Secp224r1

3072

256

Secp256k1

3072

256

Secp256r1

7680

384

Secp384r1

15360

512

Secp512r1

FIG. 5 Bitcoin equation curve.

The derived plot from Eq. (1) with parameters {a ¼ 0} and {b ¼ 7} is seen in Fig. 5. Eq. (2) has three peculiar characteristics as follows: l l l

If “Q” and “P” are two points intersected by a line, then there will be a definite third point “R” which will lie on the curve The line will intersect a third point on the curve, if this line is tangent to the curve All lines vertical will intersect the curve at infinity.

6.1 How the public-private keys generate in ECC? To understand this, we will envisage a scenario, wherein two users “N” and “C” have an arbitrary number “G” which they can share over network in plain text. Let both the researchers at their respective ends think of two secret keys n and c and they do not share with this any one at all as seen in Fig. 6. As the first step, they take the arbitrary number G and raise it to the power n/c to get some result Hn and Hc User “N” gets Gn 5Hn

Cryptography in blockchain Chapter

14

257

FIG. 6 Sharing keys between users.

and User “C” gets Gc 5Hc Now they exchange the H’s and get User “N” gets Hnc 5S and User “C” gets Hcn 5S Now here, why the values of Hnc and Hcn will be same and equal to “S” is owing to simple mathematics, i.e., User “N” ¼> Hnc 5(Gc)n 5Gcn 5S User “C” ¼> Hcn 5(Gn)c 5Gnc 5S It looks that both the users have been able to get the same message vide these equations, but at the same time, it is to be noted that since these have been exchanged over a network, if there is any compromise of the keys, it will be very easy for anyone to decipher the message with simple mathematics equating 2x ¼ 16, i.e., anyone can find the value of x. To make this difficult for the adversary or the one attempting man in the middle attack (MITM), discrete log problem is created as seen in Fig. 7, i.e., 2x mod 17 ¼ 16 This will be impossible to solve since one will never be able to make out how many times the modulo function is wrapped around to derive this value. To dwell upon the clarity here of why it cannot be derived is explained with an example. Suppose a person starts doing a task at 1100 h and completes the task at 1600 h. If some is asked to imply how many hours he worked, the answer can be straight 5 h or 17 h or 29 h or anything that keeps adding to the 12-h cycle. Applying Diffie Hellman key exchange method: User “N” ¼> Gn mod (p) 5 Hn User “C” ¼> Gc mod (p) 5 Hc Thereafter, the keys are again exchanged over the network and

FIG. 7 Sharing keys between users (discrete mod).

258 SECTION B Blockchain architecture and security

User “N” gets Hnc mod (p) 5 S and User “C” gets Hcn mod (p) 5 S So the requirement is counter to each other in real word which deems “Keys have to be larger” for more rugged security, and at the same time, “Keys have to be smaller” since maximum devices requiring passing secret information like mobile or desktops or Internet have limitations w.r.t the computing and processing power. It is here that the ECC comes to rescue which can tune to both the requirements. The elliptic curves have this unique property that if we take two points on the elliptic curve “P” and “Q,” and when a line joins them if extended will touch a third point “R” on the curve as depicted in Fig. 8. While we drop a mirror point on the other side of x-axis, we get a point “R’” which if joined with the original source point “P” will give another third point “A” as seen in Fig. 8. At this point “A,” if we further join with P and extend to drop a mirror point on the other side of x-axis, we get point another point. This sequence goes on with the peculiarity of ECC curve. Representing this curve in an equation form, we get. nA ¼ Ewhere nA represents A dot A dot A….{continues} This equation is known as “elliptic curve discrete log problem” [11]. Modifying this equation and applying the ECC algorithm equation, we get User “N” ¼> nG 5 Hn and User “C” ¼> cG5Hc This is referred to as the elliptic curve Diffie Hellman equation (ECDH). Comparing the two algorithms between “Diffie Hellman” and “ECDH” vide the bit size effect, we observe in Table 3 that for a 2380-bit Diffie Hellman mechanics, the equivalent computing to generate keys in ECDH is just 228 bit.

FIG. 8 Reflected points on ECC curve.

TABLE 3 Diffie Hellman vs ECDH. Diffie Hellman

ECDH

Represent secret as a number

Represent secret as a point on the graph

Gn mod (p) 5 Hn

nG 5 Hn

m * m * m….

P dot P dot P…..

2380 bit

228 bit

Cryptography in blockchain Chapter

14

259

TABLE 4 OpenSSL for encryption-decryption. Command

Outputa

openssl ecparam -name secp256k1 genkey -noout -out personA_private. pem openssl ec -in personA_private.pem pubout -out personA_pub_key.pem

Generate a private key for person A

read EC key writing EC key

openssl ecparam -name secp256k1 genkey -noout -out personB_private. pem openssl ec -in personB_private.pem pubout -out personB_pub_key.pem

Description

Generate public key out from private key for person A Generate a private key for person B

read EC key writing EC key

Generate public key out from private key for person B

openssl pkeyutl -derive -inkey personA_private.pem -peerkey personB_pub_key.pem -out personA_shared_secret.bin

Generate a shared key with Person A private key and Person B public key, i.e., personA_shared_secret.bin

openssl pkeyutl -derive -inkey personB_private.pem -peerkey personA_pub_key.pem -out personB_shared_secret.bin

Generate a shared key with Person B private key and Person A public key, i.e., personB_shared_secret.bin

base64 personA_shared_secret.bin

mDIAw8ZoAYn84KVPgMesDpH0vHxN8yJAcN/ eqQsQMEw¼

Check the base 64 value of personA_shared_secret.bin

base64 personB_shared_secret.bin

mDIAw8ZoAYn84KVPgMesDpH0vHxN8yJAcN/ eqQsQMEw¼

Check the base 64 value of personB_shared_secret.bin

echo ’I love you cryptography’ > plain_file.txt

Create a text file named plain_file.txt

openssl enc -aes256 -base64 -k $(base64 personA_shared_secret. bin) -e -in plain_file.txt -out encrypted.txt

Encrypt file plain_file.txt with person A shared key generated above, i.e., personA_shared_secret.bin and name it encrypted.txt

openssl enc -aes256 -base64 -k $(base64 personB_shared_secret.bin) -d -in encrypted.txt -out plaintext_check.txt

Decrypt the file encrypted.txt and name it plaintext_check.txt

md5sum plaintext_check.txt plain_file.txt

8c608244a74d2c49b6e647936144a4d6 plaintext_check.txt

Compare the hashes of the same.

8c608244a74d2c49b6e647936144a4d6 plain_file.txt a

Note: For readers who would attempt to practice this command at their end on any Linux terminal, the output column would be giving different results owing to the fact that each of the attempts by all readers would generate a unique private key for Person “A” and Person “B”.

6.2 Checking on a Linux terminal: ECC Few command line executes at a Linux terminal with OpenSSL to encrypt-decrypt a file with ECC are shown in Table 4.

7. Digital signatures Digital signatures [12] enable to associate the origin of the file with authentication and non-repudiation. The following operations explain the step wise process for signing a simple text file.

260 SECTION B Blockchain architecture and security

## Generates a Private key $ openssl genrsa -out private_sign.pem 4096 ## Generates a Public key from Private key derived above $ openssl rsa -in private_sign.pem -outform PEM -pubout -out pubkey_sign.pem ## Creates a file for sharing and signing $ echo "Cryptography in blockchain chapter" >simple_text.txt ## Signs the file simple_text.txt and gives an output signed.simple_text.txt $ openssl dgst -sha256 -sign private_sign.pem -out signed.simple_text.txt simple_text.txt ## Now this signed.simple_text.txt is unreadable, so it needs to be converted to readable base 64 format $ openssl enc -base64 -in signed.simple_text.txt -out signed.simple_text.txt.base64 ## Now we now get a readble signature file as signed.simple_text.txt.base64. This is sent along with the file and public key to recipient who checks the signature with public key and the recipient first converts from base 64 to normal signed form $ openssl enc -base64 -d -in signed.simple_text.txt.base64 -out signed-1.sha256 ## and then checks the file with public key $ openssl dgst -sha256 -verify pubkey_sign.pem -signature signed-1.sha256 simple_text.txt ## The md5sum is checked for the derived file signed-1.sha256 with original signed file signed.simple_text.txt md5sum signed-1.sha256 signed.simple_text.txt 7b122ff9e4c924530ee6bd32767dbaf6 signed-1.sha256 7b122ff9e4c924530ee6bd32767dbaf6 signed.simple_text.txt and the file received i.e signed-1.sha256 message displayed as verified ok

8.

Hash functions

Hashing algorithms [13] are designed to produce a unique, fixed-length string which is known as the hash value, or “message digest” for any given input. This input can be any file that exists in the cyber ecosystem which can be an audio file, video file, any document, or for that matter any extension or non-extension file. Applying the hash on any such file will output a unique fixed digit hash. Hashes are not like encryption algorithms which can derive back the contents with decryption but are a one-way function only. One example of the file is shown below on a Linux terminal applying MD5 and SHA256 hash algorithm.

$ echo ’I love you cryptography’ > plain_file.txt [press enter] $ md5sum plain_file.txt [press enter] 8c608244a74d2c49b6e647936144a4d6 plain_file.txt $ sha256sum plain_file.txt [press enter] 5ef2fa97406dc1c39ea60b4750175377a16ab423781a50afa5178c516112b372 plain_file.txt

8.1 Hash characteristics Every hash algorithm possesses the following characteristics: l

l

l

Deterministic: This characteristic simply means that the output “H” of any hash when applied to a file “A” will always remain “H” irrespective applied on any platform of Android, Windows, Linux, etc. Pre-image resistance: This characteristic interprets to the key requirement that the hash output “H” will never be capable to decipher the input file “A” contents, i.e., it should ensure that it becomes computationally infeasible to get to the original content in any form. Quick computation: Any hash function when applied to any format file should be capable to quickly compute the fixed digit out while satisfying other characteristics conditions.

Cryptography in blockchain Chapter

l

14

261

Second pre-image resistance: The hash function should be able to satisfy another key condition that it should be computationally infeasible to identify another file with the same hash “H”

Bitcoin blockchain is primarily dependent on SHA-256 hash algorithm for immutability checks across the blocks. The history of hashing algorithms evolves from message digest family including MD-4, MD-5, etc., to SHA-0, SHA-1, SHA-2, SHA-3, RIPEMD, and Whirlpool to mention a few. Hash functions have wide application areas that include the following: l

l

l

l

l

l

Hash maps: Also known by the name hash tables, hash maps indicate data structures used to store keys/value pairs vide an associative array abstract data type. Bloom filters: Probabilistic structures of data that are used to ascertain a specific data element queried in a large set inside a constant time. Simple file integrity checks: This application is the most common and widely exploited one that involves ensuring absolute integrity checks in file transfers. In almost all blockchain architectures, the mathematical connection of blocks banks upon this key feature. Immutability and integrity of transactions stored inside a Bitcoin blockchain exploits this key feature of hash algorithms. Peer-to-peer file sharing: Another key application of hashing is seen in blockchains and distributed ledgers that operate on P2P networks. It can be best understood by observing that all the transactions occurring in Bitcoin P2P network are populated across all nodes in near real time and the block hashes being populated across these participating nodes use the integrity check feature of hashes. Virus fingerprinting: Malwares, viruses, ransomware, etc., the complete ecosystem of the cyber threats is a globally recognized nuance effecting smooth working in multiple domains and applications. Same variant of viruses and malwares are replicating under multiple names and it is here that hash algorithms play a key role in identifying same threats owing to unique hash generations. Thus irrespective that an erstwhile cyber threat arrives with a new name, the identification is easier. Newer generation cyber threats are though evolving by day and are coming up with re-shuffling viruses that change their program’s instructions every time they multiply. Distributed storage protocols: Evolving newer protocols like IPFS, Swarm, Storj, Cassandra, etc., all enable their working mechanics on different hashing algorithms. In these protocols, while the file to be shared distributed is divided into multiple parts, each of these parts is stored at geographically apart locations with metadata as respective hash values and only recalled with respective hashes vide DHTs.

While peculiar to blockchains, hash functions are used in the following functions and discussed ahead. l l l l l

Merkle trees Digital signatures Blockchain “Chains Proof of work consensus Patricia trees

Merkle trees: Merkle trees exploit the power of hashes to bring the feature of immutability to blockchains. When it comes to blockchains, we see a number of blocks, and then, these blocks are connected with the concept of hash values. Every block will have transactions and this can be one transaction or thousands of transactions. While these transactions are stored inside the block and there is a need to take the complete hash of the block, either the hash of the complete block is taken or hash of each transaction is calculated. In Bitcoin blockchain, each transaction hash is calculated but then storing each of the hash value will need the required storage also. So to resolve the issue of storing each hash of the transaction, one single root hash is calculated which takes into account each of the thousands of transaction hashes. If we consider the example of Bitcoin blockchain, Fig. 9 shows a small code that takes input of all the 52 transaction hashes of block 697127. Thus, even if one transaction in the block is attempted to be modified or corrupted the entire Merkle root hash will be effected. The complete code for deriving the Merkle root for block 697127 populated with 52 transaction hashes and mined on mined on 2021-08-23 10:56 can be accessed at IPFS address available at https://ipfs.io/ipfs/ QmXAtmPRigWbCUfSs2HmfdrUo44HGXJRAPXwhbeBbkjFDL. This script while simply run on a Linux terminal will give the following output: $ python merkle_697127.py [press enter] a110a775db19ab8c03eb4149089cfba0ac4eaeaa494e3cc38ff1571155fefb92

262 SECTION B Blockchain architecture and security

FIG. 9 Merkle root derived from 52 transaction hashes of block 697127.

l

l

l

Digital signatures: Digital signatures again bank upon hashes as cardinal requirement which ascertain non-repudiation and that the message transferred or exchanged has not been altered. Thus, all the nodes doing transactions are enabled with backend hash functions to rely on integrity and non-repudiations in transactions. Blockchain “Chains”: The cryptographically connected blocks forming a chain derive the immutable characteristic enabled by absolute specific hash functions. Proof of work consensus: The basic working mechanics of proof-of-work consensus is based on finding nonce in such a manner that the output hash of the message being computed is prefixed by a certain number of zero’s. As on date the desired number of zeros prefixing a hash is 19 zeroes. Thus, the complete mining farms and globally spread infrastructure of ASICs and processors trying to solve and find nonce are all based on hash algorithms.

8.2 Popular hash functions in blockchains Hash functions are the backbone behind the immutability characteristic of all blockchains. Multiple hashing algorithms are available and few of the pertinent one’s are discussed below:

Cryptography in blockchain Chapter

l

14

263

SHA-256 [14]: Published in the year 2001, belonging to the SHA-2 cryptographic hash functions family and designed by the US National Security Agency (NSA), SHA-256 is based on the Davies–Meyer structure from a specialized block cipher. SHA-256 converts input of any length into a fixed-size string of 256 bits or 32 bytes or 64 digits. A Linux terminal output of the SHA-256 will look as seen below: $ echo "Cryptography in blockchain chapter" >simple_text.txt [press enter] $ sha256sum simple_text.txt [press enter] 56ed7d91a74ab1f82f065a7d0ee6d3ac80177dae5fb5f1ea873cbf71065b58ff simple_text.txt

In the above example, simple_text.txt file is generated with the echo command and sha256sum is the command hash function applied on the same to derive a 64-digit output hash. l

RIPEMD-160: Stands for RACE Integrity Primitives Evaluation Message Digest [15], and was developed by Hans Dobbertin, Antoon Bosselaers, and Bart Preneel in 1992. RIPEMD, represented with 40-digit hexadecimal numbers, is based on another weak hash function MD4 derived to work with 32-bit processors. RIPEMD-128, RIPEMD-160, RIPEMD-256, and RIPEMD-320 are different types of hash functions in the RIPEMD family. A Linux terminal output of the RIPEMD-160 will look as seen below with input command openssl rmd160 and output in next line. $ openssl rmd160 simple_text.txt [press enter] RIPEMD160(simple_text.txt)¼ ed904797a40a374fc50217fb781ea1ca3f18cd0e

l

KECCAK-256: Belongs to the sponge functions family that has SHAKE128 and SHAKE 256 as standards. KECCAK256 [16] generates a 32-byte hash and is one of the hashes which is not designed by NSA. It got official recognition as SHA-3 in one NIST competition in 2012 and is famous for being used in cryptocurrency Monero. In Monero, KECCAK hash is not used for consensus and proof of work but is used for applications in public address checksum, random number generator, ringCT, multisignatures, stealth addresses, etc.

9. Deriving a bitcoin blockchain address Bitcoin address is deduced from the private key after being processed with a number of steps as seen below. ## Step 0 - Private ECDSA Key 5D1C218F70C114E7111A8241584F876E30391CEF6EEE21E05A264CCEA15DD20B ## Step 1 – Deriving public ECDSA Key from Step 0 04E6658B3AA7FD4933B10169E1C5EB9EF3186BD6F24C0ECA3B454BC18547A98105DE0B4969AC325E0CD179BF06ED AC2B59BAAB6D9E90D25B35069AFF446E9E6286 ## Step 2 – Taking SHA-256 hash of Step 1 output CEA6907DD909E3E8FFEFB2E267EDFE84E67FF72404DBBE21511C2A147F1A247B ## Step 3 – Taking RIPEMD-160 Hash of Step 2 output F9A1C008E5926571124727FE070E0D9F406D5C65 ## Step 4 – Now add network bytes to Step 3 output 00F9A1C008E5926571124727FE070E0D9F406D5C65 ## Step 5 – Taking SHA-256 hash of Step 4 output 6E0008E0686318F6F6DD5944899F6A64CF4154B8F94F52E53202B78C9D178D59 ## Step 6 – Taking another SHA-256 hash of Step 5 output 6D669EB0462BC36EC9AB4F1AC6BA601950D87D7E611B0932073C3BC1CAEBF4DD

264 SECTION B Blockchain architecture and security

## Step 7 – Take first four bytes of Step 6 output 6D669EB0 ## Step 8 – Now adding Step 7 at the end of Step 4 output 00F9A1C008E5926571124727FE070E0D9F406D5C656D669EB0 ## Step 9 – Taking Base58 encoding of Step 8 gives the final Bitcoin blockchain address 1Pkw2N1YucyhAbbdaJrS89ADxLoSSc5Bxb

10.

Future blockchain systems

This section is peculiar to few new generation technologies which are still evolving though but see promising applications in future blockchain ecosystems: l

l

l

Homomorphic encryption [17]: Refers to a type of encryption that admits computation on cipher texts, generating an encrypted result which when decrypted matches the result of the operations as if they had been performed on the plaintext. First, “fully homomorphic encryption” (FHE) was introduced by Craig Gentry in 2009. A true FHE scheme will be able to execute encrypted inputs without decryption and produce an encrypted result too without compromising its confidentiality. Thus in a FHE schema, any untrusted party will never be able to know the contents of information under exchange. Applying or envisaging a scenario in context of Bitcoin blockchain, the data between nodes will be not just enabled with pseudonymous identity but will be encrypted enabled by FHE. Signcryption: Refers to an amalgamation mechanics of encryption and digital signatures in one single logical step. While in the traditional setup both encryption and digital signatures are considered as distinct and independent cryptography building blocks, signcryption [18] combines the two to effectively enable decreased communication overheads and computational costs. Zero knowledge proofs (ZKP): While transparency, immutability, and decentralization are cardinal to blockchain characteristics, it is privacy which lacks among all. Encryption scheme known as ZKP [19,20] is one kind, wherein one person “A” can prove the true state of one specific dataset to another person “B” without divulging any other extra data. ZKP’s enabled in blockchain promise absolute private transactions, more secure private messaging applications, and relatively less complex documentation procedures. A successful use case of ZKP in blockchain brings the example of Zcash, wherein “Zero-Knowledge Succinct Non-Interactive Argument of Knowledge” [21].

11.

Conclusion

This chapter brings a concise overview of how cryptography forms an inherent part of the internals of blockchain technology and further enables its various functions like deriving a Bitcoin address to signing transactions to connecting blocks with hashes and ensuring transaction integrity with hashes, etc. Strong mathematical foundations thus enable the mechanics of all blockchains to impart the characteristics of immutability, consensus, transparency, security, etc. This chapter has though taken examples based mostly of Bitcoin blockchain, but it is pertinent to mention that cryptography ecosystem is much bigger when we consider all other blockchain platforms which have exploited different other variants of hashes, encryption, and cryptography types. New emerging applications from blockchain technology like NFTs are again interlaced with strong multiple cryptography foundations. Increasing penetration of blockchain in multiple domains of health, logistics, governance, banking, supply chains, etc., has made the role of cryptography even more critical and important.

References [1] T. Ahram, A. Sargolzaei, S. Sargolzaei, J. Daniels, B. Amaba, Blockchain technology innovations, in: 2017 IEEE Technology & Engineering Management Conference (TEMSCON), 2017, pp. 137–141, https://doi.org/10.1109/TEMSCON.2017.7998367. [2] S. Wang, Y. Yuan, X. Wang, J. Li, R. Qin, F. Wang, An overview of smart contract: architecture, applications, and future trends, in: 2018 IEEE Intelligent Vehicles Symposium (IV), 2018, pp. 108–113, https://doi.org/10.1109/IVS.2018.8500488. [3] S.J. Knapskog, New cryptographic primitives, in: 2008 7th Computer Information Systems and Industrial Management Applications, 2008, pp. 3–7, https://doi.org/10.1109/CISIM.2008.64. [4] V. Monev, Defining and applying information security goals for blockchain technology, in: 2020 International Conference on Information Technologies (InfoTech), 2020, pp. 1–4, https://doi.org/10.1109/InfoTech49733.2020.9211073.

Cryptography in blockchain Chapter

14

265

[5] B. Mandal, S. Chandra, S.S. Alam, S.S. Patra, A comparative and analytical study on symmetric key cryptography, in: 2014 International Conference on Electronics, Communication and Computational Engineering (ICECCE), 2014, pp. 131–136, https://doi.org/10.1109/ICECCE.2014.7086646. [6] S.E. Borujeni, Cryptography by pseudo random number generator, in: Proceedings First International IEEE Symposium Intelligent Systems, vol. 1, 2002, pp. 244–247, https://doi.org/10.1109/IS.2002.1044262. [7] S. Srilaya, S. Velampalli, Performance evaluation for DES and AES algorithms – an comprehensive overview, in: 2018 3rd IEEE international conference on recent trends in electronics, Information & Communication Technology (RTEICT), 2018, pp. 1264–1270, https://doi.org/10.1109/ RTEICT42901.2018.9012536. [8] J.N. Gaithuru, M. Bakhtiari, M. Salleh, A.M. Muteb, A comprehensive literature review of asymmetric key cryptography algorithms for establishment of the existing gap, in: 2015 9th Malaysian Software Engineering Conference (MySEC), 2015, pp. 236–244, https://doi.org/10.1109/ MySEC.2015.7475227. [9] A.K. Yadav, Significance of elliptic curve cryptography in blockchain IoT with comparative analysis of RSA algorithm, in: 2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS), 2021, pp. 256–262, https://doi.org/10.1109/ ICCCIS51004.2021.9397166. [10] M. Bafandehkar, S.M. Yasin, R. Mahmod, Z.M. Hanapi, Comparison of ECC and RSA algorithm in resource constrained devices, in: 2013 International Conference on IT Convergence and Security (ICITCS), 2013, pp. 1–3, https://doi.org/10.1109/ICITCS.2013.6717816. [11] M. Wang, G. Dai, H. Hu, L. Pen, Selection of security elliptic curve based on evolution algorithm, in: 2009 International Conference on Computational Intelligence and Natural Computing, 2009, pp. 55–57, https://doi.org/10.1109/CINC.2009.205. [12] R. Kaur, A. Kaur, Digital signature, in: 2012 International Conference on Computing Sciences, 2012, pp. 295–301, https://doi.org/10.1109/ ICCS.2012.25. [13] S. Debnath, A. Chattopadhyay, S. Dutta, Brief review on journey of secured hash algorithms, in: 2017 4th International Conference on Opto-Electronics and Applied Optics (Optronix), 2017, pp. 1–5, https://doi.org/10.1109/OPTRONIX.2017.8349971. [14] A.L. Selvakumar, C.S. Ganadhas, The evaluation report of SHA-256 crypt analysis hash function, in: 2009 International Conference on Communication Software and Networks, 2009, pp. 588–592, https://doi.org/10.1109/ICCSN.2009.50. [15] M. Knezzevic, K. Sakiyama, Y.K. Lee, I. Verbauwhede, On the high-throughput implementation of RIPEMD-160 hash algorithm, in: 2008 International Conference on Application-Specific Systems, Architectures and Processors, 2008, pp. 85–90, https://doi.org/10.1109/ASAP.2008.4580159. [16] M.A. Patil, P.T. Karule, Design and implementation of keccak hash function for cryptography, in: 2015 International Conference on Communications and Signal Processing (ICCSP), 2015, pp. 0875–0878, https://doi.org/10.1109/ICCSP.2015.7322620. [17] N.N. Kucherov, M.A. Deryabin, M.G. Babenko, Homomorphic encryption methods review, in: 2020 IEEE Conference of Russian Young Researchers in Electrical and Electronic Engineering (EIConRus), 2020, pp. 370–373, https://doi.org/10.1109/EIConRus49466.2020.9039110. [18] M. Dutta, A.K. Singh, A. Kumar, An efficient signcryption scheme based on ECC with forward secrecy and encrypted message authentication, in: 2013 3rd IEEE International Advance Computing Conference (IACC), 2013, pp. 399–403, https://doi.org/10.1109/IAdCC.2013.6514258. [19] X. Sun, F.R. Yu, P. Zhang, Z. Sun, W. Xie, X. Peng, A survey on zero-knowledge proof in blockchain, IEEE Netw. 35 (4) (2021) 198–205, https://doi. org/10.1109/MNET.011.2000473. [20] W.J. Buchanan, 11 zero-knowledge proof (ZKP) and privacy preserving, in: Cryptography, River Publishers, 2017, pp. 337–368. [21] J. Kim, J. Lee, H. Oh, Simulation-extractable zk-SNARK with a single verification, IEEE Access 8 (2020) 156569–156581, https://doi.org/10.1109/ ACCESS.2020.3019980.

This page intentionally left blank

Chapter 15

Ethereum blockchain platform Jesu´s Rosa-Bilbao and Juan Boubeta-Puig UCASE Software Engineering Research Group, Department of Computer Science and Engineering, University of Cadiz, Ca´diz, Spain

1. Introduction Blockchain [1] is a cutting-edge technology present in different fields such as cybersecurity [2, 3], supply chain [4], e-health [5], e-learning [6], and e-voting [7]. This technology can be defined as an immutable, secure, transparent, traceable, and distributed database, where data are stored in blocks [8]. This technology is based on a distributed ledger, where blocks are linked and encrypted to protect the security and privacy of transactions. In particular, a cryptographic hash links the previous block to the current block. Blockchain [9] combines cryptography and mechanisms to ensure the verification, execution, and recording of transactions on the network. There are many blockchain platforms [10]. However, one of the most widely used is Ethereum [11]. Ethereum is an open-source blockchain platform, where smart contracts can be deployed and executed by their users. These contracts are written in the form of code and describe an agreement between several agents. Specifically, this chapter proposes step-by-step learning of the Ethereum blockchain network from scratch, that is, all the fundamental concepts to understand the network, as well as its operation, are given in detail. It is also explained how to simulate a real environment using Ethereum and how to interact with it through different technologies and making use of smart contracts. Although this chapter presents a specific case study to explain how to simulate a real environment with Ethereum, it can be also applied to other domains. Therefore, everything explained in this chapter can be addressed for many other case studies and not only for the one explained here. Therefore, the main purpose of this chapter is to describe how Ethereum currently works and envision the next steps of this platform, which will be updated in the coming months and promises to be a revolution compared to what we know today. The rest of the chapter is structured as follows. Section 2 describes Ethereum. Section 3 presents fundamental concepts on blockchain. Then, Section 4 discusses some of the current tools for the Ethereum platform. A simulation of a real environment with Ethereum is explained in Section 5. Afterward, Section 6 shows Ethereum’s future directions. Finally, Section 7 presents the conclusions drawn from this chapter.

2. Ethereum Ethereum is an open-source platform based on blockchain technology. It was founded in 2015 by Vitalik Buterin with the conception of a tool to create decentralized and collaborative applications. It is hosted on computers spread around the world, that is, it is a decentralized technology. Each of the computers participating in the network has a complete copy of the blockchain network. Also, there must be a generalized agreement before applying any change within the network (consensus). Ethereum has thousands of nodes around the world and its design means that the more nodes joined the network, the more secure the stored data. In other words, every piece of data found in the network has to be verified by consensus, so 51% of the nodes must agree that the information is correct before adding it to the Ethereum network. Attacking a system with these characteristics is a really difficult task since it would require controlling most of the nodes of the whole network. So, this type of attack has a very high cost that makes it meaningless. Ethereum blockchain network has some similarities to Bitcoin [12]. Bitcoin is a cryptocurrency and a payment system with no central bank or single administrator. However, Ethereum has a differentiation advantage: it allows the creation of software to manage transactions and automate outcomes, that is, smart contracts. For example, an Ethereum user could create a smart contract to send a quantity of money to another person in the network on a specific date. These requirements will be written in code and recorded on the blockchain so that when the contract is completed, that is, reaches the agreed Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00006-1 Copyright © 2023 Elsevier Inc. All rights reserved.

267

268 SECTION

B Blockchain architecture and security

date, the money will be sent automatically. In addition, smart contracts eliminate the delays and costs associated with these types of transactions performed manually. This same idea can be applied to other types of operations since the limit is in the imagination of each person. Some of the sectors in which blockchain has been successfully applied are insurance [13], real estate [14], financial services [15], legal services [16], and microfinance [17]. Smart contracts have several additional features: l l l l

There are no intermediaries. They provide the user with total control. They minimize the high costs of certain operations. The time and effort required for manual processes are reduced.

It should be noted that smart contracts are a novel idea that also presents some problems. That is, the developed code is translated literally, so any error during the definition of the smart contract will cause undesired results that cannot be modified after deployment. In addition, Ethereum allows the developers to create and deploy decentralized applications. It is also possible to transform already centralized services into decentralized ones using the Ethereum platform. These applications have enough power to be able to change all the current collaborations between enterprises and customers. On the other hand, Ethereum allows users to be able to track in a completely transparent way the origins of the products they are buying. This network is not regulated by any central authority such as banks or governments. This ability to evolve and innovate is one of Ethereum’s greatest features. For each Decentralized Application (DApp), the network keeps track of each user’s balance and smart contract code. All nodes in this network are based on the Ethereum Virtual Machine (EVM) [18] using the rules established in the smart contracts written by the developers. The EVM uses a byte coding language; however, the developers can write the smart contracts in high-level languages such as Solidity [19]. Another use of the Ethereum platform is to build Decentralized Autonomous Organizations (DAOs). These operate in a completely transparent and independent manner as they do not have a leader. They are managed by a collection of smart contracts developed and deployed on the blockchain network. They are designed to eliminate the requirement for a central person or group of people to take control of an organization. Moreover, DAOs are owned by the people who purchase the tokens, although the number of tokens purchased does not equal the number of shares owned.

2.1 Advantages and disadvantages Ethereum has many advantages as follows: l l l l l l l

It is a universally accessible platform on which complex smart contracts can be executed within the blockchain network. It eliminates the need for third-party services. It serves as a platform for other products and services. It has a huge community that makes it have a roadmap for the future years. It is undergoing continuous improvement. It has the support of many companies for its study and development. Along with Bitcoin, it is the most widely supported network in the blockchain industry today.

However, Ethereum also has several disadvantages: l l l l l

It is not designed to be a cryptocurrency only, so this is more flexible but less optimized. It concerns Ethereum’s upcoming major changes. It lacks comprehensive documentation for the developers. Its documentation is outdated or basic. It has complexity for the development of smart contracts.

2.2 Ether Ether is the cryptocurrency that uses the Ethereum blockchain platform. To carry out any transaction on the platform, some of this currency will be required for users. Also, it is called gas because each transaction requires an amount of Ether and the larger and more complex it is the more gas it will consume. Ether uses a shared digital ledger, where all transactions are recorded. It is publicly accessible, completely transparent, and impossible to modify. This digital ledger is built through the process of data mining.

Ethereum blockchain platform Chapter

15

269

Ethereum network miners are in charge of verifying transactions to form blocks and encode them by solving complex algorithms. These algorithms can be more or less difficult. In addition, miners are in charge of preventing misuse of the network, such as someone trying to perform the same operations more than once to spend more money. The blocks formed through the mining process are linked to the previous block and the miner receives a reward. This reward is variable depending on the price of the coin. Let’s see an example of how it works. We need a service for our business, the service costs 1 Ether. In a traditional contract, we pay the money and wait for the service from the company. With Ethereum, the transaction will be done through a smart contract in which if the company performs the service for us, 1 Ether will be sent. It is a simple transaction but it guarantees that we will receive the report, otherwise the company will never receive the money.

2.3 Examples of real applications of Ethereum Ethereum has a lot of potentials to bring the concept of DApp even to people with a little technical background. This could be a great revolution for blockchain technology that will enable its adoption on a massive scale. Currently, access to the Ethereum network is very easy through tools like MetaMask [20], which provides an easy interface and wallet for storing and trading Ether. In addition, the users can write, manage, and implement smart contracts. The Ethereum platform has the potential to change every industry that currently relies on centralized control such as insurance or finance. Currently, the platform is being used to create DApps for a wide range of industries [21]. Therefore, let’s consider a list of some of the most important ones: l

l

l l l

l l l

l

Gnosis [22]: It is a decentralized prediction marketplace that allows the users to vote on anything. For example, the weather or election results. EtherTweet [23]: It is an application that works similar to Twitter, providing users with completely uncensored communication. Etheria [24]: It is similar to the Minecraft game, but hosted on the Ethereum blockchain. Weifund [25]: An open platform for crowdfunding campaigns that implement smart contracts. Uport [26]: It allows to collect verifications, log in without passwords, digitally sign transactions, and interact with applications within Ethereum. Augur [27]: An open-source prediction and forecasting marketplace where correct predictions are rewarded. Alice [28]: A platform for bringing transparency to social financing through blockchain technology. Bitnation [29]: The world’s first virtual nation. It contains many functions similar to a traditional nation, for example, insurance, education, and identification. Ethlance [30]: A platform where freelancers can exchange work for Ether.

Note that a complete list of all existing DApps can be found through the official DApps status website [21]. Currently, there is a total of 2856 DApps.

3. Fundamental concepts This section shows the fundamental concepts necessary to understand how the Ethereum blockchain network works, such as the consensus algorithm, smart contracts, and DApps.

3.1 Consensus algorithm In blockchain systems, the mining process is essential to ensure the reliability, decentralization, and security of the network. Ethereum behaves in the identical way and miners invest their hardware, software, time, and energy resources in this process. This contribution is known in Ethereum as proof of work (PoW) and the computing system is mining. Rewards guarantee that there will be always miners willing to mine. For each transaction made in Ethereum, a commission is paid in gas to compensate for the work of these miners. In addition to the gas, it is feasible to offer a portion of the Ether that is sent to make the transaction faster. PoW works through the Ethcash algorithm, which was designed to find solutions to mathematical problems that have to be solved for successfully mining the network. To solve these problems, the miners must use high-performance equipment to be the fastest, find a solution, and receive the reward.

270 SECTION

B Blockchain architecture and security

3.2 Smart contracts Ethereum is structured to allow transactions to take place as long as some conditions are met. These rules are defined through smart contracts. A smart contract is invariant. Moreover, the transactions performed are characterized by the fact that they do not require trust, that is, it is not necessary to trust the other person since the smart contract assures that if the terms of the contract are not fulfilled, it will not be executed. This allows us to have a decentralized and dehumanized network, so that we can guarantee operation independently of people’s interpretations. For example, the insurance company AXA has started to implement smart contracts for compensation for flight delays [31]. This leaves no room for interpretation. If we have this type of contract with the insurer, we will not have to take any actions to claim as the smart contract will be invoked automatically.

3.3 DApps DApps are programs that use blockchain technology. Unlike traditional applications, they do not need intermediaries for their proper functioning. Because of the novelty of the concept, it is difficult to have a precise definition for this term. However, one of their main characteristics is that they are decentralized. These DApps are executed on blockchain networks. The founders of Ethereum intend that users design and develop their applications based on this concept. That is why Ethereum has developed the Solidity high-level programming language, which allows us to program and develop DApps. This language can be compared to some of the most common languages such as JavaScript. Among other advantages, Solidity supports inheritance, libraries, and complex userdefined types. In addition, DApps aim to replace traditional applications based on centralized servers, such as social networks, emails, or banks.

3.4 DApps vs. smart contracts DApps are decentralized applications based on Ethereum and share some features with smart contracts. However, they also present some important differences. Like smart contracts, DApps are interfaces that connect a user to a provider’s service through a decentralized network but, while smart contracts need a fixed number of participants to be created, DApps have no user limit. Moreover, unlike smart contracts, DApps are intended for many more purposes, for example, new types of money, digital assets, uncensurable web applications, and decentralized organizations.

4.

Tools

This section introduces some available tools for communicating with the Ethereum blockchain network. In addition, they allow users to define, compile, deploy, execute, and test smart contracts, among other things. Remix [32] is an open-source, web-based development environment. It encourages a rapid development cycle and has a large number of plug-ins with graphical user interfaces. Remix enables a complete environment for smart contract development, which allows learning Ethereum easily and intuitively. Remix, which is based on JavaScript, facilitates the development of smart contracts in the Solidity language directly from the web browser. Among other things, Remix allows us to implement, test, debug, and deploy smart contracts. MetaMask [20] is a software that allows the end users to interact with applications developed for Ethereum directly through the web browser without requiring to run a full blockchain network. It provides a user interface for managing multiple accounts and signing transactions. It also allows access to certain services and to integrate the Ethereum web3 API into websites. MetaMask uses a security policy that permits users to keep local keys encrypted, so that even the applications themselves cannot access them. Remarkably, it has the support of the entire community of developers who are constantly maintaining its source code. Etherscan [33] is a blockchain explorer and analyzer for Ethereum. It allows user to monitor all network transactions of user accounts and smart contracts. Among other things, it facilitates to monitor the gas costs of transactions, rewards miners receive for mining blocks, and number of transactions per block. In addition, Etherscan provides an API that may be accessed by users to integrate it with other applications and have a greater monitoring of all transactions taking place on the Ethereum network.

Ethereum blockchain platform Chapter

15

271

Ganache [34] is a software that provides a personal blockchain for Ethereum. It allows fast and easy development, deployment, and testing of smart contracts and DApps in a secure and deterministic environment. It is possible to run it from the command line or with a graphical interface. The graphical interface allows users with less knowledge to use Ganache in a user-friendly way.

5. Simulating a real environment with Ethereum To simulate a real production environment in Ethereum and to interact with it, the following tools are proposed in this chapter: Remix and MetaMask. We propose a case study that consists of an auction contract where anyone can submit bids during the set period. As part of the bid, money (Ether) is sent to bind the bidders to their bids. If the current (highest) bid is outbid, it will be returned to its owner so that he/she can get his/her money back. After the bidding period, the contract has to be called manually by the beneficiaries to get their money back. The smart contract code used in this case study can be downloaded from Ref. [35]. Next, the creation of a DApp is shown step by step as a tutorial: starting with the installation of the necessary tools until the communication with the Ethereum network, verifying that the transactions have been correctly deployed on the blockchain. First of all, we must install the MetaMask tool. In our case, we will install it as a browser extension for Google Chrome. To do this, we download and install it from Ref. [20]. Once we have the extension downloaded and installed, we must create an account. For this, we go to the MetaMask options and click on “Crete Account” (see Fig. 1). Note that when installing the extension, MetaMask may generate 12 words to identify your wallet. It is necessary to keep these 12 words in a secure place because if you lose them, it will not be possible to recover all the accounts you have in this wallet. The Ropsten [36] test network should be chosen as the Ethereum network on which we want to create our account. Next, we will get a window where we will be asked to enter the name of the account to be created (see Fig. 2). Once we have already created our account, we must get Ether to be able to communicate with Ethereum. To do this, as we use a test network, we can request Ether for free (see Fig. 3). The Ether, which we receive in the account, can come from another account of ourselves by making a transfer or through certain platforms that provide us with test Ether to be able to use it. We ask one of the existing platforms to send us test Ether to be able to continue using it (see Fig. 4).

FIG. 1 Option to create account from MetaMask interface.

272 SECTION

B Blockchain architecture and security

FIG. 2 Creating an account on Ethereum’s Ropsten test network.

FIG. 3 MetaMask account overview.

Once we have accessed the website, we will see an option to request 1 Ether test to our account (see Fig. 5). Due to high demand, the MetaMask faucet [37] platform may be saturated with requests. In that case, we request the Ether from another faucet that can be accessed from Ref. [38]. Once we have successfully requested a trial Ether, it will be a matter of time before it appears in our account. In addition, our first transaction, in which we have received the Ether previously requested, should already appear (see Fig. 6). Once we have our test Ether, we can access the Remix platform and install the required extensions to conduct this case study. To do this, we will access the left side and we will look for the one-click DApp extension and will activate it (see Fig. 7). Now let’s create our first smart contract which will be called “SimpleAuction.sol” and insert the smart contract solidity code that we have obtained from Ref. [35] (see Fig. 8). The next step is to compile the smart contract to syntactically validate that everything written in it is correct. In our case, this step is somewhat simple because the code has been obtained from the official Solidity source. In this step, we must go to the palette and click on the icon of the compilation plug-in (see Fig. 9). As we can see it has not been compiled yet, so we must manually indicate to compile our smart contract. In this step, we must verify some elements like the language of compilation and the version of the same one; by default, they are correctly detected. Once the compilation was chosen, we can observe that it worked without errors and that certain information of the smart contract was generated already (see Fig. 10).

FIG. 4 MetaMask option for requesting test Ether from faucet.

FIG. 5 Requesting test Ether from the MetaMask faucet.

FIG. 6 MetaMask account with test Ether received.

274 SECTION

B Blockchain architecture and security

FIG. 7 Installing the one-click DApp extension in remix tool.

FIG. 8 Creating the smart contract that supports the case study.

FIG. 9 Remix compilation window for the smart contract.

Ethereum blockchain platform Chapter

15

275

FIG. 10 Smart contract compiled correctly.

Once we have checked that our smart contract has compiled correctly, let’s deploy it to Ethereum’s Ropsten blockchain network. To do this, we should open the smart contract deployment plug-in in the Remix palette. Before continuing, we need to change the “environment,” choosing the Ropsten network we have in MetaMask and the account we created in the previous steps (see Fig. 11). Once we have changed the mentioned options, we must fill in the parameters that the smart contract builder receives so that it can be deployed. In this example, it is the auction duration time (in seconds) and the recipient (public address of the user who will receive the money when finishing). When we click on deploy, MetaMask will open a confirmation window to check the approximate cost of deploying the smart contract on the network. As we agree, we will click on the confirm option (see Fig. 12). When the contract has been successfully deployed (this process can take several seconds), Remix will display the public address assigned to it as well as all the functions that we have defined in it and that can be called directly from the tool (see Fig. 13). We have already managed to deploy our smart contract on the Ethereum network. The next step is to create a DApp to support this smart contract and to be capable of invoking its functions in a user-friendly way through a website. To do this, we will choose the module “one-click DApp” previously installed in the Remix palette (see Fig. 14). In this step, we must enter the public key of our smart contract obtained in the previous steps. We must simply click on “Generate Dapp” so that the web, which will support our smart contract, is created automatically (see Fig. 15). We can find some elements in the web created with our DApp such as the address of the contract and two buttons: “Read” and “Write” referring to the read and write functions of our smart contract. If we query the read functions, we will be shown how much is left in the auction, who is the owner, or which is the highest bid (see Fig. 16). However, if we want to see the write functions, that is, the functions that will invoke a transaction on the Ethereum network, we should click on the “Write” button. In this context, we will see some functions such as bidding to outbid the current highest bid or withdrawing our bid in case it has been outbid (see Fig. 17).

FIG. 11 Compiled smart contract deployment window.

FIG. 12 Ropsten smart contract deployment confirmation window on Ropsten network from MetaMask.

Ethereum blockchain platform Chapter

15

277

FIG. 13 Smart contract deployed correctly.

FIG. 14 DApp deployment window to support the deployed smart contract.

Afterward, we should invoke a transaction from this generated DApp. For this, we proceed to bid by pressing the button “Submit” in the box corresponding to the bid function. After clicking, it will ask us again for a confirmation from MetaMask to check if we agree with the approximate costs of the transaction. When we confirm it, the DApp will show us that our bid function has been executed correctly (see Fig. 18).

278 SECTION

B Blockchain architecture and security

FIG. 15 DApp deployment window to support the deployed smart contract.

FIG. 16 Reading functions through the DApp.

FIG. 17 Writing functions through the DApp.

Ethereum blockchain platform Chapter

15

279

FIG. 18 Successfully executing the bidding function from DApp.

Finally, if we would like to see all the transactions transparently of any user within the network or any smart contract, we could access the Etherscan platform. On this occasion, we query the transactions of the account previously created where we will be able to obtain some transactions, such as the test Ether we received or the deployment of the smart contract we made through the Remix platform (see Fig. 19). In conclusion, we have successfully carried out the application of the blockchain technology, specifically, the use of Ethereum in the field of simple auctions. We have made a complete tour, from the creation of the wallets, request for test credits, development environment creation until the definition, implementation, and deployment of the smart contract with its respective DApp. In addition, it has been publicly verified through the Etherscan platform. Thanks to the use of a public blockchain network, such as Ethereum, we have transparency, integrity, immutability, and data security. Finally, this stepby-step guide is just a particular example of the application of Ethereum to a specific domain; however, this technology can be used in a large number of other domains.

6. Ethereum’s future Ethereum is the second highest-rated blockchain platform in the world behind Bitcoin. However, Ethereum might become the first reference with the release of a new version, Ethereum 2.0 (also called as Ethereum Serenity), whose improvements are efficiency, scalability, and number of transactions per second. In addition, Ether mining is not taken into account in this new version.

FIG. 19 Querying in Etherscan the public address of the created account.

280 SECTION

B Blockchain architecture and security

6.1 Ethereum 1.0 vs. Ethereum 2.0 The fundamental difference between Ethereum and Ethereum 2.0 is the consensus algorithm that allows new blocks to be added to the network. While the current version makes use of the so-called PoW, Ethereum 2.0 will use the proof of stake (PoS) algorithm. The new PoS-based philosophy does not rely on miners, but transaction validators who must have a certain stake in the system to verify transactions, that is, they must hold a certain amount of Ether to be eligible. These validators are selected when proposing a block based on their participation in the network and the length of time they have been on the network. When enough validators confirm the block, it can be added to the network and these validators will be rewarded. The selected validator nodes will not contend with each other but will be assigned to them the blocks to validate, having also a maximum corresponding to 18.1% of the blocks. Those nodes that do not have enough Ether to be eligible can be added to a pool where they will receive a proportional part of the rewards obtained according to their contribution. The main advantage of using PoS is that it consumes much less energy than PoW. In addition, it makes it possible to guarantee the security of the blockchain in a much more efficient way. Ethereum 2.0 requires a minimum of 16,384 validators for each transaction, much more than other networks that also make use of PoS. Therefore, the decentralization is much greater and also even more secure. Ethereum 2.0 aims for a radical change as it will be able to achieve up to 100,000 transactions per second, which may help to buy with Ether in our society. Another important change introduced in Ethereum 2.0 is the fragmentation of the blockchain into smaller chains. These chains will work independently processing their transactions. The main objective of this fragmentation is to provide a higher transaction processing capacity per second. Although the chains operate independently, communication is necessary since transfers can be made between these fragmented blockchain networks. Note that all these produced changes made should not affect the ability of smart contracts to be executed on the Ethereum network.

6.2 Problems solved with Ethereum 2.0 Scalability is the main problem currently facing the Ethereum network along with other blockchains. It currently can process between 12 and 20 transactions per second, which causes an easy saturation of the network. This translates into high costs in the fees charged on each transaction. Therefore, Ethereum 2.0 proposes the following improvements: l

l

l

l

Ethereum raiden: It allows for the creation of a new layer within the Ethereum blockchain network without registration. Users can create this new layer of their own volition and operate within it at high speed. When closed, users’ final balances are verified and posted to the blockchain. Ethereum sharding: It modifies how Ethereum works. Currently, blockchain is based on a large united chain, where each block depends on the previous one. What is proposed is the division of this chain into smaller ones. Each fragment will validate its transactions independently and create its blocks apart from the rest of the divisions. Ethereum beacon chain: A beacon chain is added to manage the different fragments and validator nodes. It can be considered as an entity in charge of controlling the correct functioning of the network. In addition, it cannot manage accounts or smart contracts. Beacon chain brings to a fragmented blockchain features such as security, scalability, and sustainability. Energy efficiency: Ethereum mining currently requires expensive hardware and high-power consumption. Ethereum 2.0 proposes to reduce consumption to a fraction of the current level by changing consensus. It will move from solving complex PoW-derived calculations to a simple system with validator nodes, which will be assigned to create the blocks by the PoS algorithm.

6.3 Implementation phases The whole process of integrating all the elements to obtain Ethereum 2.0 is neither easy nor fast. Before its implementation on the main network, the code is executed on test networks. This is done to prevent any problems in the source code or errors in its implementation from affecting the actual functioning of Ethereum. Therefore, three distinct phases are proposed to reach a final version of Ethereum 2.0: l

Phase 0: The necessary elements for the transition to the new consensus and distributed chain system are introduced in Ethereum. In addition, the new beacon chain is implemented, which stores and manages the register of validator nodes. It should be noted that the current Ethereum blockchain is still active for data continuity. This update took place on December 1, 2020.

Ethereum blockchain platform Chapter

l

l

15

281

Phase 1: The network begins to be deployed, initially with 64 times more capacity and transactions per second than the current Ethereum network. This phase should imply a growth in the number of transactions validated per second. This phase is also planned to manage the definitive transition to PoS consensus. This deployment is planned for the second half of 2021. Phase 2: The process of switching to Ethereum 2.0 is completed. The current Ethereum blockchain is merged with the new one and consensus via PoW is deactivated to activate consensus via PoS. The blockchain must be fully functional and compatible with smart contracts. This will allow adding Ether accounts and enable transfers and withdrawals from the cryptocurrency. The deployment of this latest update is scheduled for the end of 2022.

6.4 Ethereum 2.0 impact The adaptation of the network toward Ethereum 2.0 should not have any impact on the smart contracts, tokens, DAOs, and other elements already created in the current Ethereum network. The operation of Ether and gas will not be affected. These adjustments will have a high positive impact on the DApps, which will have an improvement in their performance. In addition, it is also expected to enhance the performance of Ethereum solutions applied to the industry due to its improved reliability, scalability, and security. The move toward Ethereum 2.0 should lead to an increase in the price of Ether in the face of high demand. It is unlikely that anything can fail, as before this time this new version will be verified in a test network and run in all kinds of scenarios, from the most common to the least likely.

7. Conclusions In this chapter, we proposed a detailed explanation of the Ethereum blockchain platform from scratch. Specifically, we described what Ethereum is, which advantages and disadvantages have and what Ether is. Then, the fundamental concepts on blockchain networks were detailed like the consensus algorithms such as PoW and PoS, smart contracts, and DApps as well as the differences between them. Additionally, several examples of real Ethereum applications, such as DApps, were presented. The Ethereum platform is one of the most widely used today. This is why there are several solutions for different areas within the network. Remix, Ganache, MetaMask, and Etherscan are some of the tools proposed in this chapter that supports different functions within the Ethereum network. For example, by using Remix it is possible to define, compile, deploy, and operate with smart contracts on Ethereum. In addition, we can monitor the public addresses of users or smart contracts on the Ethereum network through the Etherscan platform. All concepts explained in this chapter were successfully applied to a real environment through a case study on an open public auction. More specifically, a step-by-step tutorial was given to describe how to successfully carry out this case study starting with the installation of the necessary tools until the user interaction with the different functions of the smart contract through a DApp. Several lines of future work on the current Ethereum platform were presented toward the new version Ethereum 2.0. In particular, one of the most expected and significant improvements is the change of the PoW consensus mechanism to the PoS one to achieve greater scalability and security. A drastic change in the number of transactions per second is intended to reach up to 100,000 transactions per second. In addition, the problems that Ethereum 2.0 intends to solve in the current version are discussed. Finally, the phases to be implemented to reach the new version of a fully operational Ethereum are given.

Acknowledgments This work was supported by the Spanish Ministry of Science and Innovation and the European Regional Development Funds under project AwESOMe (grant number PID2021-122215NB-C33).

References [1] D.J. Yaga, P.M. Mell, N. Roby, K. Scarfone, Blockchain technology overview, NIST, Gaithersburg, MD, 2018, pp. 1–66, https://doi.org/10.6028/ NIST.IR.8202. Technical Report 8202. [2] D. Puthal, N. Malik, S.P. Mohanty, E. Kougianos, C. Yang, The blockchain as a decentralized security framework [future directions], IEEE Consum. Electron. Mag. 7 (2) (2018) 18–21, https://doi.org/10.1109/MCE.2017.2776459.

282 SECTION

B Blockchain architecture and security

[3] Z. Su, H. Wang, H. Wang, X. Shi, A Financial data security sharing solution based on blockchain technology and proxy re-encryption technology, in: 2020 IEEE 3rd International Conference of Safe Production and Informatization (IICSPI), 2020, pp. 462–465, https://doi.org/10.1109/ IICSPI51290.2020.9332363. [4] M. Du, Q. Chen, J. Xiao, H. Yang, X. Ma, Supply chain finance innovation using blockchain, IEEE Trans. Eng. Manage. 67 (4) (2020) 1045–1058, https://doi.org/10.1109/TEM.2020.2971858. [5] A. Azaria, A. Ekblaw, T. Vieira, A. Lippman, MedRec: using blockchain for medical data access and permission management, in: 2016 2nd International Conference on Open and Big Data (OBD), 2016, pp. 25–30, https://doi.org/10.1109/OBD.2016.11. [6] D.S.W. Ting, L. Carin, V. Dzau, T.Y. Wong, Digital technology and COVID-19, Nat. Med. 26 (4) (2020) 459–461, https://doi.org/10.1038/s41591020-0824-5. [7] J. Rosa-Bilbao, J. Boubeta-Puig, RectorDApp: decentralized application for managing university rector elections, in: 2021 IEEE International Conference on Service-Oriented System Engineering (SOSE), IEEE, Oxford, UK, 2021, pp. 161–165. https://doi.org/10.1109/SOSE52839.2021.00024. [8] A. Preukschat, Blockchain: la Revolucio´n Industrial de Internet, Gestio´n 2000, Barcelona, 2017 (May). [9] J. Boubeta-Puig, J. Rosa-Bilbao, J. Mendling, CEPchain: a graphical model-driven solution for integrating complex event processing and blockchain, Expert Syst. Appl. 184 (2021) 115578, https://doi.org/10.1016/j.eswa.2021.115578. [10] X. Xu, I. Weber, M. Staples, Architecture for Blockchain Applications, Springer International Publishing, Cham, Switzerland, 2019, https://doi.org/ 10.1007/978-3-030-03035-3. [11] Ethereum Foundation, Ethereum, 2021. (Accessed 13 October 2021) https://ethereum.org. [12] S. Nakamoto, Bitcoin: a peer-to-peer electronic cash system, 2009. Cryptography mailing list at: https://metzdowd.com. [13] Z. Zheng, S. Xie, H. Dai, X. Chen, H. Wang, An overview of blockchain technology: architecture, consensus, and future trends, in: Proceedings— 2017 IEEE 6th International Congress on Big Data, BigData Congress 2017, 2017, pp. 557–564, https://doi.org/10.1109/BigDataCongress.2017.85. [14] S. Daley, 21 Blockchain companies boosting the real estate industry, 2021. (Accessed 14 October 2021) https://builtin.com/blockchain/blockchainreal-estate-companies. [15] IBM, Blockchain for financial services, 2021. (Accessed 14 October 2021) https://www.ibm.com/blockchain/industries/financial-services. [16] Consensys, Blockchain in the legal industry, 2021. (Accessed 14 October 2021) https://consensys.net/blockchain-use-cases/law/. [17] P. Coli, C. Pflueger, T. Campbell, Blockchain Uses for Microfinance Institutions in the Water and Sanitation Sector: Pilot Study, Inter-American Development Bank, 2021, p. 43. [18] Ethereum, Ethereum virtual machine (EVM), 2021. (Accessed 14 October 2021) https://ethereum.org/en/developers/docs/evm/. [19] Solidity, Solidity documentation, 2021. (Accessed 27 September 2021) https://docs.soliditylang.org/en/v0.8.7/. [20] MetaMask, 2021. (Accessed 27 September 2021) https://metamask.io/. [21] State of the DApps, 2021. (Accessed 28 September 2021) https://www.stateofthedapps.com/platforms/ethereum. [22] L. Rain, Gnosis, 2021. (Accessed 14 October 2021) https://gnosis.io/. [23] E. Yilmaz, EtherTweet, microblogging on the Ethereum blockchain, 2021. (Accessed 14 October 2021) http://ethertweet.net/. [24] C. Adkisson, Etheria, 2021. (Accessed 14 October 2021) https://etheria.world/. [25] B. Eden, WeiFund, 2021. (Accessed 14 October 2021) http://weifund.io/. [26] A. Junge, uPort has evolved, 2021. (Accessed 14 October 2021) https://www.uport.me/. [27] F. Foundation, Augur: your global, no-limit betting platform, 2021. (Accessed 14 October 2021) https://augur.net/. [28] Alice SI Ltd, Alice: the future of impact finance, 2021. (Accessed 14 October 2021) https://alice.si/. [29] S.T. Tempelhof, Bitnation: the internet of sovereignty, 2021. (Accessed 14 October 2021) https://tse.bitnation.co/. [30] J. Urgo, M. Lestan, Ethlance: the future of work is now, 2021. (Accessed 14 October 2021) https://ethlance.com/. [31] AXA, AXA goes Blockchain with fizzy, 2021. (Accessed 14 October 2021) https://www.axa.com/en/magazine/axa-goes-blockchain-with-fizzy. [32] Remix, Welcome to Remix documentation!, 2021. (Accessed 13 October 2021) https://remix-ide.readthedocs.io/en/latest/. [33] Etherscan, 2021. (Accessed 13 October 2021) https://etherscan.io. [34] Truffle Suite, Ganache, 2021. (Accessed 13 October 2021) https://www.trufflesuite.com/docs/ganache/quickstart. [35] Solidity, Solidity documentation—simple open auction, 2021. (Accessed 27 September 2021) https://docs.soliditylang.org/en/v0.8.7/solidity-byexample.html#simple-open-auction. [36] M. Neto, Get Ropsten Ethereum—the easy way, 2021. (Accessed 13 October 2021) https://medium.com/bitfwd/get-ropsten-ethereum-the-easy-wayf2d6ece21763. [37] MetaMask, Test Ether Faucet—MetaMask, 2021. (Accessed 28 September 2021) https://faucet.metamask.io. [38] DeFi Karen, Ropsten Ethereum Faucet, 2021. (Accessed 28 September 2021) https://faucet.ropsten.be.

Chapter 16

Hyperledger Fabric blockchain platform Marı´a J. Peregrina-P ereza, Jesu´s Lagares-Gala´na, and Juan Boubeta-Puigb a

School of Engineering, University of Cadiz, Ca´diz, Spain, b UCASE Software Engineering Research Group, Department of Computer Science and Engineering, University of Cadiz, Ca´diz, Spain

1. Introduction Blockchain is a disruptive technology present in many fields such digital identity and supply chain [1, 2]. It consists of a distributed database, where the data are stored in blocks guaranteeing its traceability, immutability, and security. In particular, blocks (data) are encrypted and linked keeping the privacy of the information. Blockchain combines hashing, cryptography, and mathematical mechanisms to ensure the security and registration of transactions on the network. There are many blockchain types and platforms. An example of platform is Hyperledger Fabric [3], an open-source permissioned distributed database with highly modular and configurable architecture and supports smart contracts (a.k.a. chaincode) implemented in programming languages such as Go and Java. The main aim of this chapter is to explain what Hyperledger Fabric is and how this platform currently works, and to provide step-by-step tutorials to get started with this permissioned blockchain. The rest of the chapter is structured as follows. Section 2 describes Hyperledger Fabric and all the concepts needed to understand how the platform works. Section 3 presents three use cases in which this platform has been applied successfully. Then, Section 4 describes two step-by-step tutorials. The first one helps to understand how a Fabric network works and the other defines the necessary steps to setup a network. Finally, Section 5 presents the conclusions drawn from this chapter.

2. Hyperledger Fabric Hyperledger Fabric is an open-source permissioned platform present in a wide range of sectors such as health care, supply chain, banking, finance, and Internet of things (IoT). It provides a highly modular and configurable architecture and supports smart contracts implemented in programming languages such as Go and Java. Hyperledger Fabric enables confidentiality, scalability, and security in business environments due to its confidential transactions and its ability to be programmed. Within the information that can be transferred in a blockchain network, we can find private data. Private data mean any personal, personally identifiable, financial, sensitive, or regulated information that can involve an individual. If private data need to be shared in a blockchain, then permissioned networks are the best option to control who can access the information. Hyperledger Fabric has a certificate authority (CA) [4]. CA consists of both a server and a client component, providing Hyperledger Fabric with some features such as certificate renewal and revocation, issuance of enrollment certificates, registration of identities, or connection to a Lightweight Directory Access Protocol (LDAP) to quickly query user’s registry information. A permissioned network is a type of blockchain network that defines access rights within the network due to previously established roles. Each participant of this network type has a unique identity, which enables the use of policies and access to the transaction details. By using channels [5], an organization can use or participate in multiple separate blockchain networks. Channels is one of the characteristics provided by Hyperledger Fabric. A channel is a way that allows sharing information between parts maintaining the privacy of the data in the network. A distributed ledger technology (DLT) is a protocol that allows us to secure a decentralized database. In a DLT, there is no a central authority that verifies the system. This function is done by all the participants of the network (peers), increasing transparency and making any type of manipulation very difficult. Peers [6], or peers nodes, are a fundamental element of a blockchain network. This type of node host makes copies of ledgers and smart contracts to host them. A peer can be created, started, stopped, reconfigured, and deleted. For example, in Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00014-0 Copyright © 2023 Elsevier Inc. All rights reserved.

283

284 SECTION B Blockchain architecture and security

a blockchain network where there are three peers (P1, P2, and P3), one distributed ledger (L1) and one smart contract (S1), each peer holds a copy of S1 and a copy L1 of the distributed ledger. In Hyperledger Fabric, there is a relevant service known as ordering [7] in charge of managing the order of all transactions. This service is necessary because, on a distributed network, peers may be run far away from each other and not have a common view of when a transaction was created. Note that a consensus on the order of transactions is a costly process which would create overhead for peers. A chaincode (a.k.a. smart contract) is a program, implemented in a language such as Java, Node.js, Go, or Solidity, that includes a set of rules previously defined to govern a blockchain transaction. It is executed automatically as part of a transaction and is stored on the blockchain. Its purpose is to provide security when a transaction is done. A chaincode can take input information and act based on the previously defined rules. For example, we can define a chaincode for a mortgage where funds would release if the terms of the debtor and purchase are favorable. Note that a chaincode has the possibility to be run in a Docker container by the peer process. A policy is each of the conditions that make a smart contract. For example, we can create a policy in a smart contract to unlock money to a foundation when a certain date is reached.

3. Use cases Hyperledger Fabric can be used in numerous use cases as explained here.

3.1 Trade financing and business Within the world of trading, there are a lot of payments and transactions. Currently, there are many companies that are using blockchain-based trade finance solutions to improve their processes. A permissioned blockchain solution can help to process trade payments in seconds and track all the data in real time. In addition, it increases the transparency and traceability of transactions. Mizuho Financial Group [8] is a real-world example that is collaborating with IBM to conduct all their trade transactions on Hyperledger Fabric. This implementation will bring down the trade transaction and processing costs.

3.2 Education Blockchain can be also used to improve education in different ways. By using a blockchain network, students can obtain a better way to handle their work assignments, qualifications, or get certifications that can be accessed from anywhere. As an example, Sony Global Education [9] has identified the global need to create a more open and trusted system for recording and achieving education credentials. These credentials allow people to enroll in higher education. Each credential requires a different process for being validated. So, Sony Global Education has a vision to create a new Hyperledger Fabricbased system for saving this data and controlling access to this registered information.

3.3 Supply chain There is no doubt that supply chain will be one of the most benefit areas in which blockchain can be applied, since this technology improves the whole chain by introducing transparency, immutability traceability, and security to the final consumer. In addition, blockchain improves the quality of the product transport. Circulor [1] is a company that provides first-ever mine-to-manufacturer traceability of a conflict mineral by using the Hyperledger Fabric platform. They developed the UK-based Circulor, a blockchain-based system to trace tantalum. This solution was launched in three mines and an ore-sorting facility in Rwanda.

4. Tutorials This section consists of two tutorials to get started with Hyperledger Fabric. First, we propose running the test network provided by Hyperledger Fabric. It will help you to understand how Fabric networks work. Once you are familiar with the basics, we propose a guide to setup a Fabric network using Fabric CA. Before starting, you need to install the required software: Git, cURL, Docker, Fabric Samples, and Go [10]. Since these tutorials were tested on Ubuntu, we recommend following the guide of Linux installation [10]. Apart from these software, we also recommend using Portainer for the management of Docker environments [11].

Hyperledger Fabric blockchain platform Chapter

16

285

Note that, in case of problems installing Go in Linux, the script in [12] might be useful. Be aware that it always points to the latest version of Go.

4.1 Test network After the installation is completed, we start with the first tutorial. It is based on scripts, created by Hyperledger Fabric, that can be found on the fabric-samples repository [13]. The target of these scripts is to demonstrate how to deploy the test network. Considering the network as a guidance for the user, any modification is not advised because it could break the network [14]. Specifically, the network consists of three organizations in total. Two of them will have only one peer, whereas the last one has an orderer. In Hyperledger Fabric, we have a node called an orderer (ordering node). Orderers do transaction ordering and control the access to channels. An orderer node with other orderer nodes forms an ordering service [15]. The orderer service implementation is Raft, because other implementations are deprecated since v2.X [16]. There is no TLS CA, so all certificates are provided only by the root CA. The network will be deployed with Docker Compose [17], and it is not possible to connect with other Fabric nodes. The first step is to go to the test-network directory in fabric samples, where all the scripts can be found. To access this folder, you can either open a new terminal from the directory or open a new terminal from the repository and then executing as follows: Note: To open a new terminal from the directory, right click on the folder and select Open in Terminal from the popup menu. In this directory, there is a script named network.sh. It brings up a Fabric network using the Docker images on your local machine. But before running it, in case of any previous run, execute the following command to remove the data created: Now, you can bring up the network by running the following command:

Remember to be in the same directory as the script to not have problems. As a result, you should see the logs of the nodes generated (see Fig. 1). If that is not the case and you see Docker errors, check your Docker version and try again. To see the components running on the test network, run the following command:

This is a list of all of Docker containers that are running on your machine. As you may see, every component has its own organization. That is because each node and user that interacts with a Fabric network have to belong to an organization in order to participate in the network. In this network, there are two organizations with only one peer, and an ordering organization. The next step is to use the script to create a channel for Org1 and Org2, so they will be able to make transactions with one another. To do so, the script network.sh has a mode called createChannel, which is the one we will use. Run the following command to create the channel:

FIG. 1 Logs of the nodes created.

286 SECTION B Blockchain architecture and security

FIG. 2 Channel created successfully.

Note: As we did not specify the name of the channel, the mychannel name will be used by default. After executing the command, you should see a message as follows: “Channel ‘mychannel’ joined” (see Fig. 2). In case you want to create a channel with another name, you only need to use channel flag -c. Below is the example of creating a channel with the name channel1:

You can create as many channels as you want, but always assuring that the name of the channel enforces the restrictions mentioned by Hyperledger Fabric [14]. Besides, if you want to bring up the network creating a channel in one command, you can use both modes at the same time as follows:

Then, we start a chaincode on the channel executing the network script (see Fig. 3). The deployCC subcommand will install the chaincode on both peers (see Fig. 4). In this case, the chaincode is asset  transfer (basic). Then, it will deploy the chaincode on the channel defined by the channel flag (if not specified will be mychannel). The other flag (-l) is to set the version of the chaincode (in this case, Go language). With the test network running, you may use peer CLI. It allows you to upload smart contracts, invoke smart contracts, and update channels, among others. From the test-network directory, add the peer binaries to your CLI Path. Notice that they are in the bin folder from the fabric-samples repository. Moreover, set the FABRIC_CFG_PATH to point to the core.yaml file. To operate the peer CLI as Org1, set the environment variables (see Fig. 5). Both, CORE_PEER_TLS_ROOTCERT_FILE and CORE_PEER_MSPCON FIGPATH environment variables, are mapped to the Org1 crypto material in the organizations folder. Since we used the command ./network.sh deployCC -ccl go, you now can invoke the InitLedger function of the chaincode. It will initialize a list of assets on the ledger (see Fig. 6). The output of the command should indicate that it was successful. After initializing the assets, you may query the ledger from your CLI (see Fig. 7). The output is a list of six assets with their information (ID, name, color, size, owner, and value). Since chaincodes are invoked to transfer or change an asset on the ledger, we will now see an example. Invoke the assettransfer chaincode to change the owner of an asset on the ledger (see Fig. 8). The chaincode invoke command includes both peers; the reason behind it is in the endorsement policy defined for the chaincode. According to the policy, transactions require to be signed by both organizations. Furthermore, the command also references the TLS certificate for each peer because TLS is enabled.

FIG. 3 Output command deployCC.

Hyperledger Fabric blockchain platform Chapter

16

287

FIG. 4 Output command deployCC.

FIG. 5 Binaries and environment variables for Org1.

FIG. 6 Command invoke.

FIG. 7 Result of the query.

FIG. 8 Change owner of asset.

FIG. 9 Environment variables for Org2.

The next step is to check the change of the asset. Considering we did the change with Org1, this guide proposes to query the chaincode running on the Org2 peer. Therefore, set the following environment variables to operate as Org2 (see Fig. 9). Then, check the owner querying the chaincode running on the peer in Org2. The result will show that the new owner of “asset6” is Christopher (see Fig. 10).

288 SECTION B Blockchain architecture and security

FIG. 10 Check owner of asset.

When finishing the use of the test network, bring it down with the following command:

This command will stop and remove all data generated during this tutorial. That includes the crypto material, nodes, chaincode containers, and the chaincode images from Docker Registry [14]. Once this first tutorial is finished, now you should be familiar with some concepts related to the network. If you want to keep learning, we recommend doing the next tutorial presented in this chapter.

4.2 Fabric CA operations guide This guide is based on Fabric CA Operations Guide from Hyperledger Fabric [18]. It shows how to setup a Fabric network using Fabric CA. More specifically, this guide explains how to setup a blockchain network, which contains three organizations, and how to generate the cryptographic material necessary for every identity on the network. Therefore, all identities will be able to verify themselves against trusted authorities. This guide is based on the official guide of Hyperledger Fabric and a medium article by Tam [19]. The medium is also based on the guide of Hyperledger Fabric, but some things are rearranged into clearer steps with illustrations and updated to the new version of Hyperledger Fabric. A simplified version of the official topology of this Fabric network can be seen in Fig. 11. This example will use Docker containers and presume that all containers are in the same network. If that is not the case with your deployment, you will need to change some network configurations [18]. Taking a closer look, you can see how the three organizations and the TLS CA. The TLS CA is used to provide TLS certificates. These certificates are required to secure the communications.

FIG. 11 Topology fabric network.

Hyperledger Fabric blockchain platform Chapter

16

289

The rest are CAs for each organization. The CA will create all identities and issue public and private keys to each of them. These keys allow all your nodes and applications to sign and verify their actions and to be recognized by other members of the network. Nevertheless, when all identities are created and all cryptographic material is issued, these CAs are not required in daily operation. They do not participate in operations like deploying chaincode or invoking their functions. They are only required when new identities want to join the network, such as peers, orderers, or users. In that case, they will have to generate certificates for them. In this case, the users will be the three admins (admin-org0, admin-org1, and admin-org2), and the network components are the orderer and peers. Before starting, we have to prepare the directory and some files that will be required later as follows:

Inside this directory, the next step is to define the docker-compose file with all the containers. Hyperledger Fabric provides the file to be used [20]. Nevertheless, some changes need to be made, so we highly recommend using Tam’s template [21]. Then, depending on which file you use, change the following: l

l

If you decided to use Tam’s docker-compose file, there is an error you need to change. In line 61 (command of rcaorg2), change /bin/bash to sh and save the file. If you preferred to use the template from Hyperledger Fabric, notice the image version from each of your containers. As you can see in the official file, 1.4 is defined, although Hyperledger Fabric has been updated to version 2.x. To avoid version errors, change 1.4 to latest, as in Tam’s file version.

In addition, we propose a change to both files, because these guides work with the tmp folder. We either recommend using another folder that saves data on disk or changing the tmp cleanup frequency. In the case of this tutorial, we used a directory from the disk. Another file needed is configtx.yaml. It has the information required to build a channel configuration. That configuration is stored on the ledger and details different aspects of the network. For instance, which organizations compose the channel, which ordering nodes can add blocks, and policies to control channel updates [22]. As before, the original file is provided by Hyperledger Fabric [23]. Nonetheless, as with the docker-compose file, some changes need to be made to work with the new version. In this version, configtxgen does not create default policies, hence they must be specified in configtx.yaml [24]. Furthermore, we must define the capabilities section and channel, among others. For these reasons, we will work with the version presented by Tam [25]. The last files are related to Node Organizational Units Roles (Node OU Roles). This is a list of organizational units whose members are part of the organization represented by the MSP [26]. To define these files, we propose following the example presented in the official documentation with the names of your own certificates for each organization. As an example, we propose the one done by Tam [21]. Once that all files are ready, we proceed to set the path for fabric binaries, in this case, fabric-ca-client. In the fabricsamples folder, execute the following command:

To check if fabric-ca-client is reachable, use:

It should return the path to the binary, ending with fabric-samples/bin/fabric-ca-client (see Fig. 12). Now, we can move to the second part of this guide: bringing up all CAs. Following the insight presented in the guide of Tam, we also propose to group the commands, provided by Hyperledger Fabric, in scripts.

FIG. 12 Path set.

290 SECTION B Blockchain architecture and security

FIG. 13 Code for script ca-tls.

First, bring up the TLS-CA in the terminal and execute the following commands:

Note: In case of permission problems, try the following:

Check on Portainer that the container is up and running. If so, the next step is to prepare and run the script ca-tls.sh (see Fig. 13). Remember to change the path to yours. Then, to make the file executable, execute in the terminal as follows:

To run the script:

The explanation of the functionality of the script is explained here: l l l l l

l

l

The TLS-CA home directory is mapped to (your docker-compose path)/tls-ca/crypto/ of localhost. Fabric-CA-Client (client) is used in localhost. The TLS-CA Root Certificate (tls-cert.pem) is extracted and keep it in FABRIC_CA_CLIENT_TLS_CERTFILES. The home directory is set to (your docker-compose path)/tls-ca/admin. The crypto material will be kept in this directory. The Bootstrap ID name is tls-ca-admin and the secret is tls-ca-adminpw. It was also defined in the docker-compose file, specifically in ca-tls command. Then, Fabric-CA-Client enrolls an admin on TLS-CA (https://0.0.0.0:7052), with this bootstrap ID name and secret. The result is stored in the home directory (your docker-compose path)/tls-ca/admin. This is the identity for an admin. The admin has the capacity to register new identities. In this case, we register five networks components. For each register, we define the unique name of the identity by -id. name. It is secret by -id.secret and its type with -id.type (e.g. “peer, app, user”) (default “client”).

With the identities registered on the TLS CA, we continue setting up the each organization’s network. Anytime we require to get TLS certificates for a node, we will refer to this CA. Then, we have to bring up the rest of the CAs, one for each organization. First, run the following command:

Since the process is the same as with TLS-CA, we will bring up all the CAs with one script [27]. Remember to change the path (if not working with tmp folder) and remove the part of TLS-CA because we already did it. When the script is ready, make it executable and run it. Once all the CAs are running, we can start enrolling all the entities of each organization [28]. Below is the explanation of what the script does: l

The first part is the preparation. It consists on creating the directories that will store the certificates of RCA-ORG0 and TLS-CA. Those directories are orderer/assets/ca/ and orderer/assets/tls-ca/. In the ca folder, we will store the certificate of the RCA-ORG0, and in tls-ca the certificate of TLS-CA. This step is important because these two CA certificates are required when accessing RCA-ORG0 and TLS-CA with TLS. So, they will be specified in FABRIC_CA_CLIENT_TLS_CERTFILES.

Hyperledger Fabric blockchain platform Chapter

16

291

FIG. 14 Configtxgen outputs. l

l

l

l

Then, we enroll orderer1-org0 by specifying the org0/orderer/ as the Fabric-CA-Client home directory, hence the result will be stored in this directory. After that we specified the org0-ca-cert.pem in FABRIC_CA_CLIENT_TLS_ CERTFILE, as mentioned earlier. Then, we specify msp/ to hold the result, and enroll it in RCA-ORG0. We continue with enrolling orderer1-org0 with TLS. The commands are similar to enrolling orderer1-org0 with identity. Only this time we use the TLS-CA certificate and we specify tls-msp/ to hold the result. For admin-org0, we repeat the same commands as for identity with orderer1-org0 but we must specify the org0/admin/ as the Fabric-CA-Client home directory. Finally, we create directory org0/msp/, which includes the following directories and contents. It is used when the fabric network configuration is being built: – admincerts – cacerts – tlscacerts – users

As for ORG1 and ORG2, it is the same but enrolling two peers and one admin. After executing that last script, we have generated all required cryptographic material for our network. Therefore, CAs are no longer needed unless we add more components, such as orderers or peers. The next step is to prepare channel artifacts. We are preparing the three artifacts: one consortium genesis block, one channel transaction, and one anchor peer update. Remember to change the directory for the one you chose (see Fig. 14). Then, bring up the rest of the components execute in the terminal the following command:

The remaining components of the network are now up and running (see Fig. 15). With all components up, now we create and join a channel. For that, we need two terminals, one for organization 1 and the other for organization 2. To be able to work with them, we also need to define the necessary environment variables. For convenience, we recommend using the files created by Tam terminalorg1 and terminalorg2 [29].

FIG. 15 All components up.

292 SECTION B Blockchain architecture and security

FIG. 16 Creation of channel and peers join.

Open a new terminal in the folder where terminalorg1 is, then execute: Do the same with terminalorg2: Afterwards, in the terminal for Org1 create the channel genesis block and join peers of Org1 to mychannel (see Fig. 16). Do the same with ORG2 in terminal 2 (see Fig. 17). Once all the peers have joined the channel, we update the anchor peer of Org1 in terminal 1. The corresponding command is the first one of Fig. 18. Since all the peers have joined the same channel, they should have the same ledger. To check if it is correct, we will use the getinfo peer channel. It will return the blockchain height and current block hash, which should be the same in both terminals (see Figs. 18 and 19). Currently, the last version of Hyperledger Fabric is v2.3. From v1 to v2, some changes have been made to the process of deploying a chaincode. According to the official documentation, to install and define a chaincode there are four steps to follow [30]: 1. 2. 3. 4.

compress the chaincode into a single file; also known as packaging; install the chaincode on the peers; ratify the chaincode for your organization; and commit it to the channel.

These are the steps we will do to deploy the Abstore, which is a default chaincode provided by Hyperledger Fabric. Before packaging the chaincode, access the directory and set an environmental variable of Go (see Fig. 20). Then, proceed packaging the chaincode (see Fig. 21). Note: If the GO111MODULE¼on go mod vendor command gives you an error on “go command not found,” export the binary to the go bin using export PATH¼$PATH:/usr/local/go/bin/. The next step is to install the chaincode to peer1-org1 and peer1-org2. It will return an ID (chaincode code package identifier), which will be useful to approve the chaincode (see Figs. 22 and 23). Now approve it in both organizations (see Figs. 24 and 25). Remember to use your own package ID. To finish all the steps of the lifecycle chaincode, we commit it to the channel (see Fig. 26).

FIG. 17 Peers of Org2 joining the channel.

Hyperledger Fabric blockchain platform Chapter

FIG. 18 Terminal org1, same ledger.

FIG. 19 Terminal org2, same ledger.

FIG. 20 Set environmental variables.

FIG. 21 Packaging chaincode.

FIG. 22 Installing chaincode in Org1.

FIG. 23 Installing chaincode in Org2.

FIG. 24 Approve from Org1.

16

293

294 SECTION B Blockchain architecture and security

FIG. 25 Approve from Org2.

FIG. 26 Commit chaincode to channel.

FIG. 27 Initialization ledger and queries from terminal 1.

FIG. 28 Change of value and query from terminal 2.

Since we are working with abstore, we can invoke the init() function in both terminals. So, initialize the ledger and query the values. The result must be 100, since we gave that value to “a” (see Fig. 27). Now, change the value of “a” and check again in both terminals (see Fig. 28).

5. Conclusions In this chapter, we proposed a detailed explanation of Hyperledger Fabric as well as concepts related to this platform, such as chaincode and CAs. We also explained other general concepts, such as private data and permissioned networks. Moreover, we provided three use cases in which this platform has been successfully applied: trade financing and business, education, and supply chain. Health care and IoT are other application domains in which Hyperledger Fabric can be considered as a good candidate. In addition, we proposed two tutorials in this chapter. The first one is focused on practicing the concepts explained previously. Concretely, it relies on the Test Network, which was created by Hyperledger Fabric to help to understand how the network works. Meanwhile, the second tutorial aims to explain how to use Fabric CA to setup a Fabric network. As a result, the user will learn the steps necessary to create their own network without having major problems.

Acknowledgments This work was supported by the Spanish Ministry of Science and Innovation and the European Regional Development Funds under project AwESOMe (grant number PID2021-122215NB-C33).

Hyperledger Fabric blockchain platform Chapter

16

295

References [1] The Linux Foundation, Circulor Achieves First-Ever Mine-to-Manufacturer Traceability of a Conflict Mineral With Hyperledger Fabric, 2021. https://www.hyperledger.org/learn/publications/tantalum-case-study. [2] J. Boubeta-Puig, J. Rosa-Bilbao, J. Mendling, CEPchain: a graphical model-driven solution for integrating complex event processing and blockchain, Expert Syst. Appl. 184 (115578) (2021), https://doi.org/10.1016/j.eswa.2021.115578. [3] The Linux Foundation, Hyperledger Fabric, 2021. https://www.hyperledger.org/use/fabric. [4] The Linux Foundation, Fabric CA User’s Guide, 2021. https://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html. [5] The Linux Foundation, Smart Contracts and Chaincode, 2021. https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract. html#channels. [6] The Linux Foundation, Peers, 2021. https://hyperledger-fabric.readthedocs.io/en/latest/peers/peers.html. [7] The Linux Foundation, Using the Fabric test network Hyperledger Fabric, n.d. 2022. https://hyperledger-fabric.readthedocs.io/en/latest/test_ network.html. [8] The Linux Foundation, How we.trade Helps Businesses Grow With Digital Smart Contracts Powered by Hyperledger Fabric, 2021. https://www. hyperledger.org/learn/publications/wetrade-case-study. [9] The Linux Foundation, Sony Global Education Chooses Hyperledger Fabric for a Next-Generation Credentials Platform, 2021. https://www.hyper ledger.org/wp-content/uploads/2017/12/Hyperledger_CaseStudy_Sony.pdf. [10] Hyperledger Fabric, Prerequisites—Hyperledger-Fabricdocs Main Documentation n.d. 2022. https://hyperledger-fabric.readthedocs.io/en/latest/ prereqs.html. [11] Portainer.io, Container Management j Kubernetes GUI j Docker Swarm GUI j Portainer, 2022. https://www.portainer.io. [12] coffekid, Trouble Installing Go Correctly on Ubuntu, n.d. https://stackoverflow.com/questions/31484085/trouble-installing-go-correctly-on-ubuntu. [13] Hyperledger Fabric, Hyperledger Fabric Samples, Hyperledger, 2021. https://github.com/hyperledger/fabric-samples. (October). [14] Hyperledger Fabric, Using the Fabric Test Network—Hyperledger-Fabricdocs Main Documentation, n.d. https://hyperledger-fabric.readthedocs.io/ en/latest/test_network.html. [15] The Linux Foundation, The Ordering Service,n.d. 2022. https://hyperledger-fabric.readthedocs.io/en/latest/orderer/ordering_service.html. [16] Hyperledger Fabric, The Ordering Service—Hyperledger-Fabricdocs Master Documentation,n.d. 2022. https://hyperledger-fabric.readthedocs.io/en/ release-2.2/orderer/ordering_service.html#raft. [17] Docker, Overview of Docker Compose, 2021 (October) https://docs.docker.com/compose/. [18] Hyperledger Fabric, Fabric CA Operations Guide—Hyperledger-Fabric-Cadocs Main Documentation, n.d. 2022. https://hyperledger-fabric-ca. readthedocs.io/en/latest/operations_guide.html#topology. [19] K.C. Tam, Rework: A Companion Guide to Fabric CA Operation Guides for Fabric v2.2, 2020. https://kctheservant.medium.com/rework-a-com panion-guide-to-fabric-ca-operation-guides-for-fabric-v2-2-7886e8037427. [20] Hyperledger Fabric, —Hyperledger-Fabric-Cadocs Main Documentation, n.d. 2022. https://hyperledger-fabric-ca.readthedocs. io/en/latest/docker_compose.html. [21] K.C. Tam, fabric-ca-tutorial-v2, 2021. https://github.com/kctam/fabric-ca-tutorial-v2/blob/b6846bd3c71bbca12e465ecaceb4e9d0aa49bdd6/org0config.yaml. [22] Hyperledger Fabric, Using configtx.yaml to Build a Channel Configuration—Hyperledger-Fabricdocs Main Documentation, n.d. 2022. https://hyper ledger-fabric.readthedocs.io/en/latest/create_channel/create_channel_config.html. [23] Hyperledger Fabric, —Hyperledger-Fabric-Cadocs Main Documentation, n.d. 2022. https://hyperledger-fabric-ca.readthedocs.io/en/ latest/configtx.html. [24] Release v2.0.0 · Hyperledger/Fabric, n.d. 2022. https://github.com/hyperledger/fabric/releases/tag/v2.0.0. [25] K.C. Tam, fabric-ca-tutorial-v2, 2021. https://github.com/kctam/fabric-ca-tutorial-v2/blob/b6846bd3c71bbca12e465ecaceb4e9d0aa49bdd6/con figtx.yaml. [26] Hyperledger Fabric, Membership Service Provider (MSP)—Hyperledger-Fabricdocs Main Documentation, n.d. 2022. https://hyperledger-fabric. readthedocs.io/en/latest/membership/membership.html?highlight¼node%20ou#node-ou-roles-and-msps. [27] K.C. Tam, fabric-ca-tutorial-v2, 2021. https://github.com/kctam/fabric-ca-tutorial-v2/blob/b6846bd3c71bbca12e465ecaceb4e9d0aa49bdd6/ allCAnReg.sh. (August). [28] K.C. Tam, fabric-ca-tutorial-v2, 2021. https://github.com/kctam/fabric-ca-tutorial-v2/blob/b6846bd3c71bbca12e465ecaceb4e9d0aa49bdd6/enroll AllOrg.sh. [29] K.C. Tam, fabric-ca-tutorial-v2, 2021. https://github.com/kctam/fabric-ca-tutorial-v2/blob/b6846bd3c71bbca12e465ecaceb4e9d0aa49bdd6/enroll AllOrg.sh. [30] Hyperledger Fabric, Fabric Chaincode Lifecycle—Hyperledger-Fabricdocs Main Documentation, n.d. 2022. https://hyperledger-fabric.readthedocs. io/en/latest/chaincode_lifecycle.html.

This page intentionally left blank

Chapter 17

An in-depth look at blockchain technology: Architecture and security concerns Ananya Banerjee Department of Computer Science, Kalyani Government Engineering College, Kalyani, West Bengal, India

1. Introduction All data administration and control in today’s world is based on a client–server network architecture, in which data is kept on a centralized server. Despite its advantages, the conventional database system has several serious flaws, such as the probability of single-point failure. Because all data is kept centrally, it costs more and exposes users to security and privacy issues, as well as longer access times to data for users who are far away from the server. Data can be changed or even erased if the authority’s security is breached. Side by side, blockchain is a decentralized and distributed ledger that records data such as individual transactions. Because of its decentralized structure, the system is extremely safe, as there is no single point of failure. This means that we do away with the need for third-party intermediaries and middlemen to handle our transactions. In reviewing the literature, the author [1] has already covered the idea of blockchain definition, blockchain functionalities and implications, blockchain and smart contracts, and blockchain applications and future trends in an article titled Blockchain in 2017. The author [2] of the article Blockchain: Blueprint for a New Economy has previously addressed the benefits and drawbacks of the technology, as well as its potential to solve problems in the financial sector. It also explored the benefits of using the technology to create new markets and economies. The author [3] of the article Blockchain technology: Beyond Bitcoin discussed the background, working principle, existing market, and applications of technologycompelling use cases in both financial and non-financial areas. The author [4] attempted to present in-depth research on blockchain applications, challenges, and possibilities in the article A survey of blockchain from the perspectives of applications, challenges, and opportunities. The author [5] of the article A Survey on the Security of Blockchain Systems attempted to focus on areas such as overview of blockchain technologies, risks to blockchain, attack cases, security enhancements, and future directions in his work. Based on a comprehensive literature review [6], albeit only a portion of it. Some of the research questions came to mind that would answer what part of this technology is still unknown and what needs to be explored in the future.

1.1 Background The major goal of this chapter is to show how great the blockchain’s potential is, both as a cryptocurrency system and as a development platform. There is a lot of theoretical discussions out there, but when people want to get in and start using it to develop the next generations of apps that everyone is talking about, things become confusing. The majority of the documentation available is fragmentary, inconsistent, and out of date. Even if you do get it out, the tools themselves are quite basic, as is their development environment. That is, after all, one of the main goals of this chapter. This chapter will guide any reader through the concept development process, and it will make every attempt to keep all of the contents relevant as new languages and technologies become available. A blockchain is a collection of data-encrypted blocks. A group of experts devised this way to timestamp digital documents so that they could not be backdated or tampered with in 1991 [7]. It sat unused until Satoshi Nakamoto used it to create the digital currency Bitcoin [8]. A blockchain is a distributed ledger that everyone can view. They have an intriguing property: Once data is saved on a blockchain, it is exceedingly impossible to change it. Encryption is at the heart of this technology. When a sender begins a transaction, he signs it with his private key and encapsulates and encrypts all of the Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00023-1 Copyright © 2023 Elsevier Inc. All rights reserved.

297

298 SECTION B Blockchain architecture and security

transaction’s information. The encrypted output is then sent across the world, and the transaction is included in a block after being verified by miners. Miners use their hardware and computational algorithms to attempt to discover a random value called a nonce value that met predefined conditions relating to the block’s hash value while utilizing [9] Proof of Work. So, let us look at a real-life scenario that will help readers understand why blockchain is so essential in the 21st century. Everyone, for example, uses paper money. When we receive a bill, we have faith that it is genuine. If, for example, we received an email stating, “Here is the bill,” we should be concerned. We probably would not put our faith in it. However, whether we use an ATM to transfer money or pay with a deposit card, we do pretty much the same thing. In digital communication, we are transferring money. These messages pass through a few trustworthy banks that maintain track of everything to ensure that no one is cheating or transferring money they do not have. The banks keep track of how much money each person has and subtract the appropriate amount for each transaction. However, when there are a million transactions per minute all across the world, this becomes prohibitively costly. We can save a lot of money by using blockchain since it allows us to transmit money just like an email. Instead of transmitting a large amount of payment information through a few servers, blockchain makes use of thousands of internet-connected personal computers. All transactions are replicated and cross-checked across all computers in a systematic accounting book called the ledger, which becomes extremely secure as the chain of blocks grows. Blockchain not only allows us to establish secure online money, but it also allows us to safeguard any type of digital data. This may include online identification cards, voter registration, contracts, and a variety of other legal documents, bringing bureaucracy into the 21st century. The blockchain, which is at the heart of Bitcoin [8], has recently gotten a lot of attention. Blockchain acts as an immutable record that allows decentralized transactions to take place. Blockchain-based applications are gaining traction in a variety of industries, including financial services, reputation management, and the Internet of Things (IoT), among others. Blockchain is a peer-to-peer [10] network that is open to everyone and does not need users to give personal information to be authorized. A consensus, as well as a public ledger, is used to overcome the security and trust issues. The consensus mechanism used by public blockchains like Bitcoin and Ethereum is known as proof-of-work (PoW). Blockchain technology is a rapidly developing technology. Every reader must have one question: why is this technology so essential, or what are the fundamental flaws in the existing system that blockchain will address. To address this issue, we must first understand what a centralized system is and how decentralized, distributed systems outperform centralized architectures in certain areas. In a centralized design, each node connects to the central coordination system, and whatever information they wish to exchange is shared through this central coordination system. And there is an issue with this platform in that if the central coordinating platform fails, all of these separate nodes would become disconnected. In a nutshell, centralized systems are plagued by single-point failure, scaling difficulties, network connectivity dependencies, and server maintenance issues. As a result, we will transition from a centralized [11] to a decentralized system. So, instead of a single coordinator, there are a few coordinators in this decentralized system, and all of these coordinators collaborate and the individual nodes that are linked to this coordinator. So, in this design, if one or more nodes fail, coordinators can link to other nodes and share information, as well as conduct operations utilizing the available coordinators. As a result, with this particular decentralized design, many failures may be tolerated until the network becomes disconnected. As a result of many simultaneous failures, the decentralized design operates on top of a network, and if the network is partitioned or disconnected, the individual nodes will be unable to communicate with one another. As a result, we move on to the next design, which we term the entire distributed architecture, to tackle this problem. So, in a fully distributed architecture, there is no such thing as a centralized coordinator, and all nodes participate in the computation, information sharing, or application development processes, where they coordinate with one another and jointly develop the application or jointly share information. So those are the respective benefits and drawbacks of a decentralized and distributed platform vs a centralized one. The possible distinctions between centralized, decentralized, and distributed systems are depicted in Table 1. Moreover, due to its scalability and single-point failure, robustness concerns, centralized systems are no longer used in current architecture. As a result, contemporary architecture favors decentralized and distributed systems, which are more resilient than centralized systems. So, blockchain is a platform that helps to enable this type of decentralized or distributed platform where people can share information in a very secure way. Now, there will be a discussion on the applicability of blockchain in various areas and how the decentralized feature of blockchain benefits these sectors. Each of these sectors represents a unique manner in that blockchain will impact the globe in the next years. As a result, the reader will gain a sense of the wide range of blockchain applications [12] and the enormous potential that this technology has for the world. So, let us begin with the banking industry. The internet of money “Bitcoin” is commonly referred to as the blockchain. The dominant cryptocurrency is the first use of blockchain technology. Cryptocurrencies allow users to securely keep their money and make payments without the use of a middleman such as a bank. Money transfers and purchases become considerably easier, quicker, and less expensive as a result of this. As a result, blockchain provides excellent infrastructure, such as safe money storage, eliminates intermediaries, and makes the system simpler, quicker, and less expensive. In other words, it may

An in-depth look at blockchain technology Chapter

17

299

TABLE 1 Centralized vs. decentralized vs. distributed. Centralized vs. decentralized vs. distributed Parameter

Centralized system

Decentralized system

Distributed system

Architecture

Single-server multiple client-based systems.

Multiple coordinators multiple client-based systems.

Every node connects and collectively works for a specific role without any coordinator.

Topology

Mesh/star

Region-based coordination between coordinators and nodes.

Discrete multiple nodes connect themselves by a local and global copy of data.

Network dependency

Highly dependent

Independent

Highly independent

Type of development

Small and quick development

Suitable for a large amount of data handling, storage, maintenance, etc.

Best suited for large and time-consuming development.

Robustness

less

high

highest

extensibility

limited

high

highest

Fault tolerance

Susceptible to single-point failure

Tolerate multiple numbers of failures until the network gets disconnected.

Complete distribution is at its highest level of fault tolerance.

Data replication/ data backup.

Data is not replicated. It is only stored in a centralized server.

Data is replicated and backed up.

Replication of data is present and consistency is also maintained.

Intermediaries

present

absent

absent

Example

Wikipedia, Google Docs,

BitTorrent

Google search

Application development time

Less time-consuming

Time-consuming

Highest time-consuming.

Data consistency maintainer

Server/centralized coordinator.

Network

Special node/validator node that maintains the consistency between a local and global copy of data.

be used to store and transport money effectively. However, this use case may be expanded to cover all types of financial and real assets, such as stocks, bonds, derivatives, commodities, and real estate, which can all be maintained and transacted far more effectively on blockchain than traditional systems. Supply chain management is another excellent application of blockchain.

2. Problem statement Based on the literature review, the problem statement for this chapter is built around the current research status of blockchain technology, application development in this field, research gaps in prior research. This chapter’s methodology will be based on a practical, theoretical approach to blockchain technology, and it will be an incremental study for future research in this field. The major goals of this chapter are to emphasize the actual development environment while also providing essential theoretical information. The major goal of this chapter is to give a practical evaluation of various areas such as relevant environmental requirements and how these architectural elements of blockchain technology may be effectively suited to real-world problem solutions. This will encourage future researchers to work on this technology beyond the theoretical aspects, allowing the blockchain era to begin seamlessly.

2.1 Blockchain technology So, let us discuss what the blockchain is, which is a great question. This section will go through the definition of blockchain in further detail. so that readers may comprehend on a deeper level than simply the surface. Now, only for the sake of the

300 SECTION B Blockchain architecture and security

readers, this section’s blockchain explanation will be centered on the Bitcoin blockchain. Readers will be able to grasp how other blockchains operate after they have a better understanding of how this one works. Other blockchains, on the other hand, have their peculiarities, but the foundations are mostly the same. The blockchain [10] is a public ledger that records all Bitcoin transactions going back to the first one. As a result, blockchain technology is constantly developing. As more blocks are added, it continues to expand. It is crucial to understand that computers execute the transactions that are uploaded to the blockchain. These devices are referred to as nodes since they are networked. These nodes currently exist all over the world. They are not centrally placed since they are a decentralized technology [13]. Furthermore, keep in mind that each block is added to the chain in the order in which it was received. Now, simply to touch on the Ethereum applications while keeping in mind why Bitcoin was developed as a currency alternative. However, it is now being referred to as “digital gold.” With the Ethereum blockchain, they aimed to build a system that would not need users to rely on third-party services such as Google, Apple, or Facebook. One can utilize a decentralized source to make their code open-source, therefore increasing user confidence. The cryptocurrency ether drives the Ethereum blockchain network. The blockchain has now been referred to as a component of web 3.0 in general. The following important sectors that have connective intelligence, connective data idea applications, and eventually are dying to people are referred to the web 3.0. Now the reader might be wondering where the blockchain was mentioned. But it is the blockchain that facilitates all of this and propels it forward. William Mougayar, a well-known Bitcoin expert, compares [14] the blockchain to Google Docs. So, if you know how Google Docs works, you will know how the blockchain works as well. According to his remarks, the conventional method of sharing documents with collaboration is to send a Microsoft Word document to another receiver and ask them to make changes. The difficulty with that scenario is that you have to wait until you get the returned copy before you can look at it or make any changes. Because one is prevented from modifying it until the other has completed it. That is how databases are used nowadays. Two people cannot be working on the same record at the same time. This is how banks keep track of their cash balances and transactions. They take a quick check at the access, make a transfer, and then update. When the other party reopens access to Google Docs, both parties have access to the same document at the same time, and the single version of the document is always available to both parties. It is similar to a ledger that everyone has access to. However, it is a document that is shared. When a group of individuals is sharing something, the dispersed part is activated. The problems with shared documents are ideally solved by blockchain technology. As a result, in a blockchain network, each user owns a copy of the document, and they can write to their document at the same time, with the blockchain network in the middle ensuring that information consistency is preserved across the documents that each party has separately. As a result, this is a great use case in which blockchain technology is suitable. So, this blockchain platform that spans the network will aid in this sort of coordination where everyone has their copy of the document and can independently write their copy. The blockchain [15] platform will then guarantee that the data they enter into the document is synced with each other, allowing them to see the most recent copy or update over the most recent copy over time. As a result, blockchain technology has an advantage over centralized architectures or architectures in which many parties have access to a shared copy. As a result, this is a unique and widespread use of blockchain technology. As a result, the blockchain fills the gap, replacing the network and allowing both parties to view and create documents at the same time, and the benefit that has been suggested is that they do not need to rely on the internet or that they are not dependent on a server breakdown. As a result, a blockchain may be defined as a decentralized database platform with high consistency support. As a result, whatever information the participants individually enter into the document is synced through the network. So, let us have a look at a very simple blockchain architecture. Fig. 1 depicts the simple blockchain architecture. In a traditional blockchain design, each node keeps a local copy of the blockchain. There are many internet nodes connected, and each one keeps a local copy of the global data sheet. The system’s job now is to make sure that all of these separate copies are consistent with one another. The term “consistency” refers to the fact that every node’s local copies are identical, and that these copies are constantly updated depending on global information. That is if this node wants to contribute data to the blockchain. As a result, all copies of the blockchain owned by each node will be updated with this information. This is the blockchain’s architectural platform, which ensures that the local replicas or local information held by each node are consistent. As a result, we called this local information a public ledger. The concept of a public ledger is a crucial word in the context of blockchain. As a result, everyone has their copy of data on the public ledger. So, if we consider a database system, a database is nothing more than a collection of historical data that is open to the public. The public ledger functions similarly to a database in that it stores past data that is accessible to anyone and may be used for future calculations. A financial transaction is an example of a public ledger. One is to maintain financial transactions in the public ledger, and the transactions that are already there are mostly used to validate new transactions. In a traditional banking system, we have a passbook, and the bank acts as a centralized authority, storing all of our transaction information. When someone goes to the bank or makes a transaction, the bank confirms everything with the consolidated information it possesses. In the case of blockchain, the public ledger is now built on a decentralized architecture. In a decentralized banking system, each individual has their own synchronized and

An in-depth look at blockchain technology Chapter

17

301

Node 1

Node 6

Node 2

Node 5

Node 3

Node 4

FIG. 1 Simple blockchain architecture.

consistent copy of global transactions, and whenever one or another tries to make a new transaction at the same time, the new transaction is validated against the old transactions that are already present inside the public ledger. The term “blockchain” currently refers to a distributed ledger. However, when using the concept of a public ledger to implement blockchain, several key aspects must be ensured, such as a commitment rule that assures that every legitimate transaction from clients is committed and included in the blockchain within a specified time frame. There will also be a common agreement, known as consensus, that assures consistency between local and global copies, as well as correct handling of all copy updates. Data must be tamper-resistant, and security is contingent on there being no data modification. Moreover, during the transaction, privacy and authenticity must be guaranteed. Here, a process diagram in Fig. 2 illustrates the overall blockchain working principle using a simple financial example. Let us take an example where two persons are engaged to transfer some amount of money through the blockchain platform. So, person A wants to send money to B. First, this message as a transaction is hashed to maintain confidentiality and then digitally signed by A’s private key to achieving non-repudiation. For example, if person A has thousand rupees then along with A’s public ledger every node in the peer-to-peer network gets this information as A has thousand rupees initially. Then, if A wants to send B five hundred rupees similarly all nodes along with A’s initial amount can get updated with the information. Then, the network checks for consistency either all nodes have the same public ledger information or not. If all the local copies are identical to each other and A’s have sufficient balance, then A- > B:500. This transaction can be accepted by the process of consensus and transaction is added to a block and this new block can be added to the existing chain of blocks with its hash and previous hash value. Thus, the A to B transaction is completed. According to the formal definition of blockchain, it is an open distributed ledger that can effectively and permanently record transactions between two parties. Table 2 summarizes the meaning of commonly used keywords and their advantages according to this definition. Consider a lot of legal papers that should be shared in this manner rather than being passed about and losing track of versions and being out of sync with each other. Why can’t all business documents be shared instead of being passed around from one person to another? The answer to this question is found in some key aspects of this domain, such as the fact that these types of legal contracts are extremely vulnerable to hacking, necessitating a high level of security and accessibility of these documents, which necessitates the use of authentication and authorization. Data breaches cannot be allowed in the legal and litigation industries, and the entire system is complicated and reliant on a central authority. All of these concerns are easily handled by blockchain technology, which eliminates the problem of data tampering and manipulation through decentralized data storage. The blockchain network itself serves as a platform for asymmetric key cryptography-based authentication and authorization. When certain criteria are satisfied, a smart contract on top of the blockchain network securely manages the data flows. However, because this technology is still in its early stages and there has not been a

302 SECTION B Blockchain architecture and security

FIG. 2 Working principal of blockchain.

TABLE 2 Benefits of blockchain technology. Blockchain technology Keywords

Supported features

Benefits

Open

Peer-to-peer network

There is no requirement for a central authority. Individual nodes are utilized to access the data; thus, there is no need for a costly server. Because each individual establishes their rights for the data they are ready to share, there is no need for specialized personnel such as network specialists. If one node fails, the network as a whole will not be affected, i.e., highly fault-tolerant.

Distributed ledger

Data availability

Transparent, safe, tamperproof, and unchangeable. The entries in distributed ledgers take place in the database without the intervention of a third party. No one else can change records once they have been put into distributed ledgers. As a result, the records cannot be altered until the ledgers are disseminated. Decentralized by nature inherent decentralized nature of distributed ledgers offers another degree of protection. It is difficult to attack the database since it is distributed globally.

Efficient

Fast and scalable

The information must be efficient, and the protocol must be efficient; therefore, the protocol must be quick and scalable.

Verifiable

Consensus

Everyone in the network should be able to double-check the accuracy of the information. As a result, it is said to as verifiable, and it is managed by the consensus method.

An in-depth look at blockchain technology Chapter

17

303

TABLE 2 Benefits of blockchain technology—cont’d Blockchain technology Keywords

Supported features

Benefits Without the use of a third-party middleman, a consensus method allows the blockchain to validate and approve transactions and activities.

Permanent

Immutability

Permanent information is persistent information or tamper-resistant when it is entered into the blockchain. So, tamperproof implies that once information has been entered into a blockchain, it will not be possible to modify or amend that information in the future. So, if one wishes to update that transaction, one must enter a new one that states that the previous one is invalid and that the new one is legitimate. However, whatever transactions have already been committed will never be able to be turned back, and no one will be able to modify that transaction.

Data backup

Decentralization

Backups on the blockchain can be used to verify if data has changed (or has not changed). For example, blockchain generates a certificate for each file if you want to verify whether or not your backups have changed. This certificate may be used to determine whether or not the file has been modified. This is accomplished through the use of timestamps and the maintaining of change history. Blockchain backups also aid in the support of many copyright claims, which may be extremely beneficial to visual and musical artists.

Secure

Encryption

Cryptography protects blockchain transactions as well. A private key is used to sign each transaction, which may subsequently be confirmed with a public key. The signature becomes invalid if the transaction data changes. As a result, the block will be overlooked and will not be added to the chain.

Authentication/ authorization

Asymmetric key cryptography

Authentication is achieved through digital signature. Before transmitting a message, a node encrypts it using its private key, and then encrypts it again with the aid of another node’s public key, resulting in double encryption. When another node receives that message, it will first decrypt it using its private key, and then use the sender node’s public key to decrypt it once again. And that is it; the message has been received, and we have achieved two goals: secrecy and authentication. Because the communication is encrypted with asymmetric key cryptography, other nodes will be unable to decrypt it.

lot of application-based research done yet. Here, Table 3 [6,10,16–20] represents a literature review summary up to which extent on blockchain technology research is already done. Industries, where high security is critical, have not put their faith in this pilot study, although blockchain technology has many advantages.

Blockchain components This part will cover the theoretical and practical aspects of blockchain, such as blocks, distributed ledgers, consensus, and mining, as well as how to design these components in various environments. Blocks Blocks are used to store records on the blockchain. Because it is a record, a block will naturally contain data inside it. For example, it might just be a string of words. It then has a value, which is referred to as a previous hash. It will then have a value, which is its hash, which acts as a fingerprint for this block. It is as if you take the first two elements, the data, and the previous hash, and find a number that reflects that data. As a result, a compressed version of the data was just sixty-four characters long. The preceding hash is utilized to connect the blocks in this case. The Genesis block is the first block on the blockchain. It is known as the Genesis block because, after the blockchain is set up, that block will always be number one, forever and ever and ever. That will never change. No other block will ever approach this block; it will always be the first.

TABLE 3 Literature review. Author/ date

Topic/focus/questions

Concept/ theoretical model

Paradigm/method

Context/setting sample

Findings

Future research

Dylan Yaga, Peter Mell, Nik Roby, Karen Scarfone, October 2018

This document gives a technical overview of blockchain technology at a high level. It examines the technology’s components and includes pictures and examples. It also addresses some of the common misunderstandings regarding technology. The document outlines several factors that companies should consider while researching the technology.

In response to public feedback, this paper has undergone significant modification. It is a basic document that serves as an introduction to blockchain technology.

Detailed description on blockchain technology in sections like introduction, blockchain categorization, components, etc.

Not applicable

This document gives a technical overview of blockchain technology at a high level. The goal is to explain how blockchain technology works to readers.

Permissioned use cases Permission fewer use cases Blockchain platforms

Jesse YliHuumo, Deokyoon Ko, Sujin Choi, Sooyong Park, Kari Smolander, October 3, 2016

What are some of the academic areas that have been addressed in recent blockchain research? What are some of the applications that have been created with and for blockchain technology? What are the current research gaps in the field of blockchain? What are the research directions for blockchain in the future?

According to a review of current research into the scalability and privacy elements of the blockchains, many of the proposed solutions lack tangible evidence of their effectiveness. According to the researchers, many additional issues, such as throughput and latency, have gone unstudied.

For this study, a systematic mapping study was used as the research approach.

Only select papers that are relevant to the research question according to the research topic

Researchers are given recommendations for future research directions based on the findings of this study.

Continue to discover new difficulties and suggest ways to solve the technology’s obstacles and limits. More research should be done on blockchain scalability concerns. Beyond Bitcoin and other monetary systems, create additional blockchainbased apps. Use objective assessment criteria to assess the efficacy of the offered solutions.

Matthias Mettler, 2016

This research focuses on blockchain technology in the healthcare sector.

This paper seeks to demonstrate the effects, ambitions, and potentials associated with this disruptive technology by using examples from public healthcare administration, user-oriented medical research, and medication counterfeiting in the pharmaceutical industry. The majority of the study is based on exploratory research in the healthcare field.

Detailed description on blockchain technology in healthcare sections like Introduction Bitcoins as a starting point for the development of blockchain Blockchain potential extends far beyond the financial sector Smart healthcare management for the benefit of the patient, etc.

Not applicable

Blockchain technology overview, history, blockchain technology suitable for another sector beyond financial sector-main discussion takes place for the healthcare sector. How blockchain solves common problems relating to healthcare such as counterfeiting drug issues.

Application of healthcare system using a blockchain platform.

Philip Treleaven, Richard Gendal Brown, Danny Yang, 2017

Blockchain technology in the financial sector specifically how this technology solves the traditional banking systems’ common vulnerabilities.

It is a basic document that serves as an introduction to blockchain technology in financial, i.e., in the banking system.

A detailed description of blockchain technology in the financial sector discussion takes place here as blockchain basics, common issues relating to the financial sector, etc.

Not applicable

Overview on blockchain technology, the financial sector as a use case for blockchain technology, issues relating to the traditional financial system, and how blockchain platform is suitable for this sector is found out through this document.

Application of decentralized financial system using a blockchain platform.

Continued

TABLE 3 Literature review—cont’d Author/ date

Topic/focus/questions

Concept/ theoretical model

Paradigm/method

Context/setting sample

Findings

Future research

Tareq Ahram, Arman Sargolzaei, Saman Sargolzaei, Jeff Daniels, Ben Amaba, 2017

Blockchain technology is being used in a variety of industrial applications. The ideas may be used in a variety of industries, including banking, government, and manufacturing, where security, scalability, and efficiency are required.

The majority of the research is centered on exploratory research into how blockchain may be used in banking, government, and manufacturing.

A detailed overview of blockchain technology, including how it is efficient, secure, and scalable in industries such as banking, government, and manufacturing.

Not applicable

This article provides an overview of blockchain technology, as well as use cases for blockchain technology in the banking, government, and manufacturing sectors, as well as difficulties with existing mentioned systems and how the blockchain platform is suited for this industry.

Blockchain application development in sectors such as banking, government, and manufacturing will improve security, scalability, and efficiency.

Archana Sahai, Rajiv Pandey, 2020

The document explains how the country’s land records are kept up to date and how new land is registered. It stresses the need of using blockchain to implement smart contracts for land registries.

Exploratory study

Land registration utilizing blockchain technology is discussed in-depth, and the legal contractual component is handled using smart contracts. The advantages of the blockchain land registry platform are further discussed using an incremental model.

Not applicable

1. This report emphasizes concerns such as lack of openness, accountability, and inconsistent data sets from several government departments about the same piece of property, as well as delays in the existing land registry administration procedure.

Blockchain application development in land registration.

2. The document covers the country’s existing land record maintenance and registration process. 3. It stresses the significance of smart contracts for land registers using blockchain technology. Mahtab Kouhizadeh, Sara Saberi, Joseph Sarkis, January 2021

The challenges to blockchain adoption for long-term supply chain management are investigated. The study is based on the technology– organization–environment paradigm and force field theories. Blockchain and sustainable supply chain obstacles are dominated by technological barriers. Propositions for additional research serve as a guide for future inquiry.

The majority of the research is centered on exploratory research into how blockchain may be used in the supply chain.

To explore blockchain adoption obstacles, researchers used the technology– organization–environment framework and force field theories.

The hurdles are investigated utilizing a technical, organizational, and environmental— supply chain and external—framework, as well as input from academics and industry experts, before being evaluated using the DEMATEL tool.

This research uncovers the relative relevance and interrelationships of hurdles that must be overcome, both conceptually and practically, for blockchain technology to be used in a sustainable supply chain context. It lays the groundwork for theoretical observations on blockchain technology’s application in longterm supply networks.

Propositions for additional research serve as a guide for future inquiry.

308 SECTION B Blockchain architecture and security

FIG. 3 Block structure.

That is where it all began. One may contain information. Because this is the Genesis block, it does not include any prior hashes. The only block without a preceding hash is this one; all other blocks have their hash, previous hash, and data. With this prior hash, each block is linked to its predecessor. As a result, a blockchain is referred to as a “chain of blocks” [10,21]. Through these hashes, the blocks are cryptographically connected. Every block has its fingerprint, which is a hash, as well as a reference to the prior block’s fingerprint. So, theoretically, if anybody tampered with any block, the block hashes would no longer match, and the chain would be invalid. The chain would indicate that something is amiss. Here in Fig. 3 shows a schematic diagram of what is present inside a block. a block has two component one is block header and second one is list of transactions. and block metadata contains previous block hash, mining statistics, and Merkle tree root. A hash tree, often known as the Merkle tree, is used to efficiently and securely encode blockchain data. It enables the peer-to-peer blockchain network to quickly verify blockchain data as well as transport enormous volumes of data from one computer node to the next. Creation of blocks Hands-on block creation is possible here. Here, a well-known blockchain platform, Ethereum, and block generation using Nodejs will be covered, along with the environment setup and methods to create a block. Prerequisites for Ethereum Step 1: Installation of Ethereum on the operating system For example, installation of Ethereum in the Ubuntu operating system will be like this $ sudo apt-get install software-properties-common $ sudo add-apt-repository -y ppa:ethereum/ethereum $ sudo apt-get update $ sudo apt-get install ethereum Step 2: Accounts creation for Ethereum private network Before the accounts creation first, we have to make a directory. For example, $ mkdir test In addition, to change the directory to test the command will be $ cd test Account creation $ geth –datadir ./datadir account new Output Here, Fig. 4 depicts the output of account creation. Creation of Genesis file Genesis block is the starting point of blockchain. It holds all the properties of blockchain. Properties like chainid, gaslimit, difficulty, and alloc.chained define unique identification for chain.gaslimit indicates total amount of gas a block can be used, and difficulty defines the block mining difficulty, i.e., how mining can be more critical for miners, and alloc is used to create ether for already created accounts in Ethereum network. Here, Fig. 5 illustrates the entire process of genesis file creation. Data directory instantiation We must first create the data directory before we can start the blockchain. The data directory is the location where blockchain-related data is stored. Run the following command to create the data directory: $ geth –datadir ./myDataDir init ./genesis.json

An in-depth look at blockchain technology Chapter

17

309

FIG. 4 Account creation.

FIG. 5 Genesis file creation.

FIG. 6 Outputs for data directory instantiation.

Output Here, Fig. 6 defines the output for data directory instantiation using above command. Now that the data directory has been created, we may begin the blockchain. Starting of Ethereum private network

Command to start Ethereum private network $ geth –datadir ./myDataDir –networkid 1114 console 2>> Eth.log We are sending all of the logs to a separate file named Eth.log using the command above. If the file is not discovered, Geth will generate a new one. Below Fig. 7 describes the process with output to start Ethereum private network. Output Prerequisites for Node.js

Step 1: Directory creation Step 2: To set up the project in node, the following commands must be required $ npm init –y Step 3: Installation of development server Nodemon. Nodemon is a tool that will focus on source code and restart the server if anything changes. Nodemon is a live development server for the node engine.

310 SECTION B Blockchain architecture and security

FIG. 7 Outputs for starting of the private network.

Command for Nodemon installation in Linux $ npm i nodemon –save-dev Block creation Step 1: To create a block in Nodejs, first a JavaScript file must be created, and then, the declaration of a class is needed. Each black has three attributes: hash, last hash, and timestamp. After the creation of a JavaScript file such as block.js, the JavaScript code will be the following. Here, Fig. 8 depicts the block creation using Nodejs. Genesis block Every blockchain begins with a “Genesis block,” which is the first block used to establish the chain. Fig. 9 illustrates the Genesis block creation process.

FIG. 8 Block creation.

An in-depth look at blockchain technology Chapter

17

311

FIG. 9 Genesis block using node.

2.2 Byzantine general problem In 1982, a computer science study introduced the Byzantine generals issue. The paper’s challenge is that trustworthy computer systems must be able to function effectively in the face of defective components that may convey conflicting information to various sections of the system. Each unit is led by a general, and they must collectively devise a synchronized plan of attack. Due to the presence of disloyal generals, deceptive communications may be issued in an attempt to derail any planned plan of action, whether it be an attack or a retreat. The Byzantine army must discover a means to coordinate operations, one way or another, to find a successful solution to this problem.

Consensus The term “consensus” [22] refers to a large group of people who agree on something. The fundamental challenge in distributed computing is how to ensure overall system dependability when a lot of defective processes are present. In a distributed or decentralized multi-agent platform, the consensus is a process for reaching a shared accord. It is crucial for the message passing system. Information sharing and negotiation among processes in a distributed context necessitate a variety of coordinating methods. One of them is consciences, which is used to reach consensus across distributed processes and systems before performing any application-specific actions. We require a consensus mechanism to assure overall system dependability and fault tolerance. A distributed system is one in which the state of the system is distributed among several machines. It may be described in two ways: one in terms of software and the other in terms of hardware. In terms of hardware, a distributed environment is defined as a collection of heterogeneous autonomous processing components that communicate, or better put, are connected through the network, and function as a single coherent system (in software perspective).

312 SECTION B Blockchain architecture and security

Although distributed systems offer many advantages, such as being more resilient and scalable, they also have certain drawbacks, such as the lack of a global clock, which makes synchronization difficult, and the lack of global memory, which causes the system to act inconsistently. The second important word is fault-tolerant. Determining which user distributes the next block is an essential feature of blockchain technology. This can be solved by implementing one of several different consensus models. In permissionless blockchain systems, several broadcasting nodes compete for the right to broadcast the next block at the same time. To make this work, blockchain technologies employ consensus mechanisms, which allow a group of people that share a shared mistrust to collaborate. When a user creates a blockchain system, they choose the system’s initial state. To ensure the extension of the global ledger, the consensus is used to get the majority of the network to agree on a singlestate update (the blockchain). A good consensus method guarantees a durable transaction ledger with two essential properties: durability and liveness, which are both critical in blockchain networks. Regardless of the methodology, each block must be legitimate and may thus be independently validated by each blockchain system user. Users can agree on the current state of the blockchain by combining the early state with the ability to confirm every block since then. After then, the following features are in place: l l

The structure’s initial condition is agreed upon. Users choose the consensus methodology through which blocks are added to the system, and they may independently authenticate each block.

To determine who adds the next block to the chain, use a consensus approach. In general, as trust grows, so does the demand for resource utilization. This section’s aim is not limited to discussing what consensus is and how it works. The main objective is to implement consensus using the developer’s viewpoint. The processes and environments required to implement consensus on a distributed blockchain platform are explained here. Here, below figures describe how to validate a chain of blocks and how to replace a chain of blocks with a valid chain. A cryptographic nonce is a self-assured number that can only be used once. A cryptographic nonce can be used with data to produce a variety of hash digests: digest ¼ hash (information + nonce). Changing the nonce esteem is a simple way to get different summary characteristics while maintaining the same information. The verification of work consensus model employs this technique. Chain validation When there are numerous contributors to the blockchain, chain validation guarantees that incoming chains are not corrupt. Check that the chain begins with the Genesis block to ensure that it is legitimate. Also, make sure the hashes are created correctly. Fig. 10 shows the chain validation using output. Chain replacement Replace the current chain with the incoming one if another blockchain contributor provides a valid chain. Only chains that are longer than the present chain should be replaced. Use the “replaceChain” method in the “Blockchain” class to do this. Fig. 11 depicts the chain replacement with output. Mining Bitcoin’s proof of work was the first practical implementation of the Byzantine Fault Tolerance method. The “generals” in this case are bitcoin network nodes, often known as “miners.” A network node is a connecting point on a network that can receive, generate, store, and send data. Every computer on a blockchain is a distinct node. The essential notion to comprehend in the context of the Byzantine Fault Tolerance algorithm is that these mining nodes start with the premise that no one else on the network can be trusted. Even in the presence of non-compliant nodes, proof of work ensures network consensus. That is, even if certain Byzantine generals are not operating in the best interests of the country. That is, coordinated action may be done even if some byzantine generals are not operating in the army’s best interests. Bitcoin is a peer-to-

An in-depth look at blockchain technology Chapter

FIG. 10 Output for chain validation.

FIG. 11 Output for chain replacement.

17

313

314 SECTION B Blockchain architecture and security

peer network in which users do all transactions using suitable software and hardware. Making transactions, receiving transactions, verifying, and sending transactions are all examples of these tasks. This is the point at which we need to introduce the term “mining.” Mining is a network activity that involves proof of work and is carried out by network participants. As a reward for the miner who completed this proof of work first for each new block, new coins are generated. Proof of work necessitates a large number of computer calculations targeted at solving cryptographic hash problems. These are the same problems that enable the network to function and continue exchanging transaction messages with other network members as mentioned previously. New transaction data is collected and aggregated by mining nodes. Each node independently validates each transaction against a broad set of criteria, including monitoring the source of the digital money being spent, after receiving such data. As miners race to be the first to create a new valid block, they must ensure that their mempool transactions have not previously been included in valuable blocks. The miner must build the block header after gathering and organizing confirmed transactions in a candidate block, a summary of the candidate block’s transaction details. A parent block is a connection to the preceding block in the chain. A timestamp specifying when the block was created, as well as verifiable proof of work. Mining system This section is all about mining hardware, and there will be a discussion on the many types of mining hardware that miners use to solve cryptographic hash problems. CPU The CPU stands for central processing units, which is the main microchip inside laptops or computers that is where everything goes through, where all the commands go through, and where they get executed. It is like the computer’s command center, and as one can imagine, it has to be very versatile because it has to deal with a wide range of situations, so it is very general. It is extremely strong and capable of doing extremely complex tasks, but it is also general. So, because it is not specialized to a single task, it can surely solve the sha256 hash. It can compute quite quickly compared to humans, but it is restricted to around 10 M hashes per second. So, 10 million hashes per second seem like a lot, but in terms of the bitcoin network’s overall hash rate, it is not. Taking the bitcoin network as an example, the hash rate is around 22 million trillion hashes per second, so it is not that much. Then, we will move on to more specialized components, which will lead us into the world of specialized devices. GPU Graphics processing unit (GPU) is a term that refers to a computer’s ability to It is specialized because it is meant to deal with visuals and operations that are specialized for matrix operations. It is the unit that is the video card or graphics card in laptops/computers. So matrix operations are needed for movies to work and visuals to show, and the graphics on the GPU are particularly designed to solve matrix operations. The hash computation already benefits from matrix multiplications and other matrix operations that specializations provide. As a result of this specialization, the GPU can solve hash calculations more quickly. Here, GPU performance may reach one GigaHash per second. GPU mining is superior to CPU mining. It costs more, but it has a greater hash rate. If you want to mine Bitcoins, Monero, Tron, or any other cryptocurrency, AMD graphics cards are ideal. ASICs Within the Bitcoin community, there are mining pools where people pool their resources. Some PoW miners employ application-specific integrated circuits (ASICs). Mining various cryptocurrencies has become economically unfeasible for most players without access to the newest ASICs, local sources of cheap electricity, or other unique benefits due to the tendency toward mining pools and specialized ASICs. Some PoWs claim to be resistant to ASICs, suggesting that the efficiency increase of an ASIC over commodity hardware, such as a GPU, is well under an order of magnitude. ASIC resistance has the benefit of making mining on commodity hardware affordable, but it also contributes to the associated costs. Bitcoin, Litecoin, Dash, and other currencies based on these algorithms are best mined with ASICs. Because it is custom-built for a single hash method, ASIC miners are regarded as more efficient and powerful than CPU and GPU miners. This, however, implies that you will need to purchase a separate ASIC for each coin you wish to mine. ASIC-enabled mining equipment can outperform conventional mining equipment in terms of performance. Proof of work A client distributes the next block in the proof of work (PoW) [22] paradigm by being the first to solve a computationally escalating problem. The “verification” that they have done work is the answer to this riddle. A common puzzle method is to make the hash summary of a block header not precisely equal to the target value. Hash functions take data and turn it into a fixed string of characters that may be used as a digital fingerprint or identification. In

An in-depth look at blockchain technology Chapter

17

315

proof of work, hash functions are extremely essential. In a hash function, the only method to find an unknown random variable is to attempt alternative values for the unknown one by one, given all the other known parameters. Hashing the block header is often a computationally-intensive process. After some time, the goal value may be changed to vary the difficulty (up or down) and therefore the frequency with which blocks are delivered. For example, Bitcoin, which uses the proof of work paradigm, changes the puzzle difficulty every 2016 block to affect the block divisibility. To implement proof of work, following steps will be maintained such as In this stage, we must conduct the following operations: l l l l l

Proof of work implementation and the 51% attack Proof of work implementation and the nonce Functionality testing of the nonce Calculation of dynamic block difficulty Difficulty adjustment testing

Tables 4 and 5 [23–25] compare and contrast consensus algorithms such as proof of work (pow), proof of stake (pos), and the new genre of consensus algorithm hedera, as well as the distinctions between bitcoin and hedera blockchains.

TABLE 4 PoW vs. PoS vs. Hedera. Parameter

Proof of work (POW)

Proof of stake (POS)

Hedera

Definition

The initial consensus algorithm in a blockchain network is proof of work (PoW). The algorithm confirms the transaction and adds another block to the chain. Minors (a group of individuals) work against each other to finish the network transaction in this method.

Proof of stake protocols is a type of blockchain consensus method that selects validators based on their cryptocurrency holdings. PoS systems, unlike proof-of-work protocols, do not encourage excessive energy use.

Hashgraph is a distributed ledger system that has been termed a “blockchain alternative.” The Hashgraph technology is presently patented, and Hedera Hashgraph is the only approved ledger. HBAR is the Hedera Hashgraph system’s native cryptocurrency.

Programming language

Different programming languages like Node, JavaScript, Python, Go.

Different programming languages

Java and Lisp

Block Addition

The amount of computing effort done by the miner determines block mining.

The size of a stake in a person has an impact on block validation.

Based on the Gossip protocol and virtual voting. Cryptographic time stamping is used to serialize transactions.

Incentive/ reward

The first miner to solve each block’s cryptographic challenge receives a reward.

The validator does not get a block reward; instead, they are paid a network charge.

There is no incentive mechanism in place.

Malicious block

To introduce a malicious block, hackers would require 51% of computing power.

Hackers would need to control 51% of the network’s cryptocurrency. This is practically unattainable.

Safe from denial of service attack (DDoS)

Energy efficiency

Less energy efficient

More energy efficient

Energy efficient

Cost

Less costly

More costly

Cheap and efficient

Proven

More proven

Less proven

Specialized equipment requirement

To maximize processing power, specific equipment is required.

It is more than enough to have a servergrade unit.

Not needed.1 GB of storage is enough to work with.

Cryptocurrency

Bitcoin

EOS (EOS), Tezos (XTZ), Cardano (ADA), Cosmos (ATOM), Lisk (LSK)

HBAR

316 SECTION B Blockchain architecture and security

TABLE 5 Blockchain vs. Hedera. Category

Blockchain

Hedera

Definition

Blockchain is an immutable digital distributed ledger that allows people to interact and share information through the internet. A blockchain’s transactions are kept in chronological sequence and are secured by powerful cryptographic hash algorithms. By hashing the preceding block, the encrypted blocks are linked to the previous blocks.

Hedera is the only public distributed ledger that uses the Hashgraph consensus process, which is quick, fair, and safe. Hedera’s governance is entirely decentralized, with up to 39 term-limited and highly varied major organizations and companies making up the board of directors.

Technology

Distributed Ledger Technology (DLT)

Distributed Ledger Technology (DLT)

Throughput

Seven to 10 transactions per second or vary up to 100 to 10,000 transactions per second vary from platform to platform.

250,000 transactions per second or vary up to 5,00,000.

Fairness

The sequence of transactions in each block is determined by miners. Less fair.

Timestamps are used to serialize transactions. Much fairer than blockchain.

Storage

In the blockchain, anyone may make a transaction. The transaction record is kept in the ledger indefinitely. Blockchain software requires 60 GB of storage capacity to run.

Within minutes, everyone has access to the transaction. Eventually, the transaction record will be deleted. The amount of storage necessary to keep live ledgers up to date would be less than 1GB.

Work approach

Data is linearly stored in blocks on the blockchain.

Hashgraph, on the other hand, makes use of a directed acyclic graph to store and retrieve data.

Security mechanism

Cryptographic technologies are used in blockchain to protect the security of data stored and transmitted on the network. Malicious actors will not be able to modify the integrity of the data since the digital blocks are tamperproof.

Asynchronous Byzantine Fault Tolerance (aBFT) is used by Hashgraph to protect the network from malicious actors. Each event is accurately captured, and the method ensures that no data is tampered with, even if the network contains malicious actors.

Secure from

51% attack

Denial of service attack (DDoS)

Consensus

There is no one way to consensus on the blockchain. It is determined by the cryptocurrency or platform in question. In the blockchain, there are a variety of prominent consensus algorithms. Proof of work, proof of stake, proof of elapsed time, and so on are a few of them. Delegated Byzantine Fault Tolerance is used by NEO, another prominent blockchain solution. It is a better consensus method that takes PoF and PoS into account.

Hedera Hashgraph, on the other hand, achieves network consensus through virtual voting. Hashgraph is a consensus algorithm in and of itself.

Efficiency

The block method of blockchain makes it difficult for miners to operate on a block. As a result, the mining community must now choose one block and reject the other. In the end, the miners’ efforts are squandered, resulting in a less efficient network. Efficiency is less than 100%.

Because of this methodology, Hashgraph is 100% efficient.

Cost

To handle transactions, blockchain uses a costly method.

As it does not use proof of work (PoW) as the method of consensus. It is cheaper and efficient.

Software accessibility

Open-source

Patented

Use case

Payments, tokenized assets, fraud mitigation, identity, data compliance, a solution that is owned by a private company, time-sensitive enterprise solution, gaming, etc.

Transfer of assets, secure data storage, supply chain, crowd funding, counterfeiting drugs, disease surveillance, financial sectors, health data management, authentication authorization making, etc.

Block mining To mine the blocks, one will need to create a function that will produce a block based on some specified “data” to store and a given “last block,” and then call it “mineBlock.” Because it requires computing power to “mine” a block, it is likened to an act of mining (Fig. 12).

An in-depth look at blockchain technology Chapter

17

317

FIG. 12 Output for block mining.

2.3 Digital assets Understanding the differences between digital assets, cryptocurrencies, and tokens is important in the context of blockchain and cryptocurrency. While these words are sometimes used interchangeably, they vary in several important ways. A non-tangible item that is generated, traded, and kept in a digital format is referred to as a digital asset. Cryptocurrency and crypto tokens are examples of digital assets in the context of blockchain. Cryptocurrency and tokens are a type of digital asset that uses cryptography, an advanced encryption technology that protects the legitimacy of crypto assets by preventing counterfeiting and financial irregularities. The primary distinction between the two types of digital assets is that tokens, such as the numerous ERC-20 [26] tokens that make up the Ethereum ecosystem, are created as part of an existing blockchain platform, whereas cryptocurrencies, like the many ERC-20 tokens that make up the Ethereum ecosystem, are created as part of an existing blockchain platform.

Cryptocurrency A cryptocurrency is a blockchain network’s primary asset that may be exchanged, used as a means of exchange, and stored of value. Cryptocurrencies are frequently used not just to pay network transaction fees, but also to incentivize users to maintain the cryptocurrency’s network safe. Typically, cryptocurrencies are used as a means of trade or a store of wealth. Cryptocurrencies, on the other hand, rely on code to handle issuance and transactions. To safeguard the cryptocurrency’s core structure and network infrastructure, it employs cryptography. Token Tokens, often known as crypto tokens, are digital units of value created by blockchain-based organizations or initiatives on top of existing blockchain networks.

318 SECTION B Blockchain architecture and security

While they frequently have extensive compatibility with the network’s cryptocurrencies, they are a whole distinct digital asset class. Tokens are created by platforms that build on top of blockchains, whereas cryptocurrency is a blockchain technology’s natural asset. Ether, for example, is the Ethereum blockchain’s native token (ETH). While ether is the primary coin of the Ethereum network, the Ethereum blockchain is also home to some other tokens. In the context of blockchain, value transfer refers to the peer-to-peer transmission of digital assets over the internet. When one transfers a digital asset, which is a piece of information, that information is permanently and immutably recorded on a blockchain. Furthermore, the transaction is recorded on a distributed blockchain. Thousands of clones of that blockchain exist all across the world. Cryptography is used to safeguard all of the data. Now, it is abundantly obvious that a digital asset may be transferred via the internet. The title of a property, such as a house or a work of art, is an example. How can something be done via the internet? One method to accomplish this is to use a colored coin. A colored coin is used to provide more information to a bitcoin or other cryptocurrency’s value. This data is referred to as metadata, and it is added to a transaction to reflect the ownership of an asset. Colored coins have not taken off as they should. Blockchain tokens are another name for digital tokens. A digital token is a digital asset that may be used to represent anything. Securities, loyalty points, and real-world assets are just a few examples. As a result, there are a few applications for digital tokens. The audio coin is one of these. It is a cryptocurrency and digital token designed specifically for the music business. For example, an artist may provide a specific quantity of audio currency with one of his albums. This implies that when someone buys his CD, they also get a specific quantity of audio currency. These audio coins have their worth, and they may be sold and exchanged for monetary compensation. Golem is another digital token. It is a highly interesting new way of looking at computers since it allows you to outsource your computer’s computational power. It is a cryptocurrency in which one may be rewarded for allowing others to use their computer to execute computing apps. As a result, it is a method to be rewarded for allowing others to use your computer at home. Vechain is another digital token. It is a blockchain-based coin for tracking supply networks. The supply chain is a popular use of blockchain nowadays since it allows users to trace an asset’s complete journey from raw materials to completion. Steemit is a digital currency for content creators to compensate them for their work. It is possible to get rewarded for generating content by utilizing this digital token. Steemit is a digital currency for content creators to compensate them for their work. It is possible to get rewarded for generating content by utilizing this digital token. Another intriguing application of digital tokens is crypto kitties, which entails acquiring and rearing digital cats in exchange for compensation. Audiocoin—Cryptocurrency for the music industry. l l l l

Golem—Shared economy computing power. Vechain—Track supply chains on blockchain. Steemit—Rewards platform for content publishers. Cryptokitties—Collecting and breeding digital cats is a fun way to pass the time.

Types of token Cryptocurrency tokens are exchangeable digital assets that may be used as a medium of exchange (traded) inside the ecosystem of a blockchain project. Tokens may be thought of as the nutrients that sustain blockchain-based ecosystems. Because a token may be classified into several categories, these groupings are not mutually exclusive. Types of tokens are as follows. Platform Token—Platform tokens are used to provide decentralized applications (dApps) for a variety of purposes using blockchain technology. Decentered applications (dApps) created on the blockchain are supported by platform tokens. Security Token—security on-chain representations of real-world securities or tokens that serve a similar role for blockchain initiatives and/or digital assets are known as crypto tokens. Similar to a share of stock, security tokens might represent ownership of an off-chain asset such as real estate, equipment, outstanding bills, or a corporation. The legal ownership of a physical or digital asset is represented by security tokens. Transactional Token—Transactional tokens are monetary units that may be used to buy and sell products and services. These tokens work similarly to regular currencies, although they may offer extra benefits in some circumstances. Users can perform transactions without a central authority using decentralized cryptocurrencies like Bitcoin and Dai, for example. Transactional tokens are used as accounting units and are traded for products and services. Utility Token—Utility tokens, unlike security tokens, are not designed for direct investment, but they can be used to pay for services. A platform and a utility token have a synergistic connection. Dai, for instance, is part of Axie Infinity, a digital pet universe with a player-owned economy. Utility tokens are tokens that are incorporated into an existing system and used to access the protocol’s services.

An in-depth look at blockchain technology Chapter

17

319

Governance Token—All stakeholders may cooperate, discuss, and vote on how to administer a system using on-chain governance. Governance tokens are used to express support for proposed changes in blockchain-based voting systems. MKR is the governance token in the Maker protocol. Blockchain-based voting systems are powered by governance tokens. Initial coin offering/initial token offering (ICO/ITO) The second application of a digital token is initial coin offerings, which is one of the most common ways that digital tokens are being used right now (ICO) [26]. Initial token offers are another name for it (ITO). Both the words ICO and ITO are being utilized. In 2017, these initial coin offerings raised $6.22 billion. These ICOs let you go to the market and raise funds from investors. People may invest in new projects and businesses that they have ideas for, and these initial coin offerings would be used to raise cash. People would purchase digital tokens to support the initiative. These ICOs raised $7.8 billion in 2018. The initial coin offering (ICO) is a new type of investment that was not possible before the invention of digital tokens. Ethereum is the world’s second-largest cryptocurrency and one of the most successful initial coin offerings of all time. In its most basic form, blockchain technology underpins cryptocurrencies. As a result, blockchain businesses have mostly relied on ICOs. For example, a person may start a business based on his published material. He will create his digital coin instead of distributing shares to investors. That is what investors will be purchasing during his much-anticipated initial coin offering. Buyers of this digital token may either exchange it for other cryptocurrencies or utilize it on their site. To get venture capitalists to release a white paper outlining their business model, investors can then decide whether or not they wish to participate.

Smart contract Smart contracts are simple programs that execute when predefined criteria are satisfied and are recorded on a blockchain. They are generally used to automate the execution of an agreement so that all parties may be confident of the conclusion right away, without the need for any intermediaries or time waste. They can also automate a workflow, starting the following step when certain circumstances are fulfilled. Smart contracts are written in code, which is subsequently executed by a computer network. Simple “if/when/then” statements on a digital ledger known as a “blockchain” [27,28] are used to make them operate. A smart contract can be created using a web-based template or by a developer. Here, Table 6 depicts the differences between traditional contracts and smart contracts. TABLE 6 Traditional contracts vs. smart contract. Parameter

Traditional contract

Smart contract

Time

The establishment of a contract between parties and their willingness to follow established business logic takes a long time, thus the entire contract creation process is lengthy.

Contract creation and negotiation time may be shortened to a few minutes when using a primed contract platform with smart contracts. Such systems include Ethereum, Hyperledger Fabric, and others.

Execution

The contract settlement between parties can be done manually if the established business logic of the contract is met.

Smart contracts are self-executing, which means that when the business logic is fulfilled, the smart contract’s code is performed automatically.

Cost

Contact execution necessitates the involvement of a third party, such as a lawyer, to monitor the legal litigation process, which increases the overall cost.

The elimination of third parties reduces the total cost of the system.

Security

Traditional contracts are paper-based, which can lead to errors and data manipulation owing to redundant paperbased storage.

Because smart contracts may be executed on a blockchain platform, data-level security can be achieved through cryptographic hash functions, and the blockchain’s type aids authentication and authorization. As a result, secrecy, immutability, and non-probability are accomplished.

Remote operation

If two parties are present in different locations to agree on a contract, both parties must sign the contract, implying that both parties must be physically present.

This issue of repudiation may be easily solved by using a digital signature in a smart contract, which eliminates the requirement for the physical presence of the parties.

Storage

Because traditional contracts are paper-based, data storage necessitates space, money, time, administration, and oversight.

Smart contract data is securely recorded, verified, and maintained on the blockchain in a timeproof and transparent manner, without the need for excessive time, money, or third-party involvement.

320 SECTION B Blockchain architecture and security

Development environment for smart contract Programming language Smart contracts may be programmed in a variety of computer languages. Solidity is, by far, the most well-known and wellmaintained one at the time. Solidity—Solidity is a high-level object-oriented language for creating smart contracts. The language of solidity is written in curly brackets. It is inspired by C++, Python, and JavaScript, and was created with the Ethereum Virtual Machine in mind (EVM). Solidity allows creating contracts for voting, crowdfunding, blind auctions, and multi-signature wallets, among other things. Solidity programming can be written in a notepad, text editor, or visual studio. Smart contract creation using REMIX ide. Online-integrated development tool Remix is available to write solidity code. To use REMIX ide, one can visit remix.ethereum.org To write solidity code in this ide first solidity compiler and deploy and run transaction plugin must be activated. The next step is to create a solidity file. First, go to the file explorer then click on the crate new file icon, and then give the name of the file and put the extension as sol. Here, the following screenshots depict the above steps one by one. Here in the below screenshots, the above steps will be shown. Fig. 13 shows the environment where to write a smart contract using REMIX ide and creation of .sol extension file. Next step is to write the required solidity code to the already created file like mycontract.sol. Then click on the solidity compiler tab to compile the code. After compilation, one has to click on the deploy and run transaction tab and in that tab at environment tab must select injected web3 to connect MetaMask account. Fig. 14 depicts the output for smart contract deployment. Here, Fig. 15 shows a simple example of smart contract code written in REMIX ide. MetaMask is a cryptocurrency wallet that interacts with the Ethereum network through software. It lets users utilize a browser extension or a mobile app to access their Ethereum wallet, which can subsequently be used to engage with decentralized apps. Fig. 16 depicts how to connect MetaMask account to deploy smart contract and after successful deployment of smart contract, ether can be sent from one account to another. After successful smart contract deployment using MetaMask wallet, one can check account details for successful ether transfer entire statement using etherscan. Successful smart contract deployment and ether transfer through the smart contract. Fig. 17 depicts the account details for successful ether transfer through etherscan.

FIG. 13 Smart contract creation using Remix.

An in-depth look at blockchain technology Chapter

FIG. 14 Output for deploy and run transaction.

FIG. 15 Sample smart contract code creation.

FIG. 16 Smart contract deployment and ether transfer using MetaMask.

17

321

322 SECTION B Blockchain architecture and security

FIG. 17 Account details for successful ether transfer through etherscan.

To check the account details of recipient, etherscan can be used for detail description. Here, Fig. 18 depicts the account details of the recipient using etherscan. After successful deployment of smart contract using MetaMask receiver account successfully accept the ether from sender account to check the detail statement, etherscan can be used. Here, Fig. 19 depicts the process of checking recipient successful ether acceptance through etherscan.

2.4 Blockchain security When it comes to blockchain security, four words spring to mind: secrecy, integrity, non-repudiation, and authenticity. Asymmetric key cryptography provides secrecy, Merkle tree data structure provides integrity, digital signature provides non-repudiation, and blockchain types provide authenticity. In the blockchain, security [29–31] is achieved at three levels: data structure, identity, and transactional.

FIG. 18 Account details of the recipient.

An in-depth look at blockchain technology Chapter

17

323

FIG. 19 Recipient account ether receive output.

Data structure level security Merkle tree: A Merkle tree, also known as a Merkle Patricia tree, is a form of data structure on the blockchain that consists of numerous hashes or timestamps. It is a hash-based technique of storing data on the blockchain. This technique is wonderful since it eliminates the problem of duplicate entries in the chain and ensures that all transactions are validated at all times. Instead, one may manually check all of their transactions at any moment. Binary hash trees, a form of data structure frequently used in computer science, are also known as Merkle trees. Work: Let us look at how Merkle trees work in association with blockchain. One must start with an initial hash or timestamp of the provided data to protect data within a Merkle tree for the blockchain. Merkle trees use this approach to assist remove duplicate or erroneous transaction entries from a blockchain. A Merkle tree adds up all of the transactions in a given block. Merkle trees are constructed by periodically hashing pairs of nodes until only one hash remains. Advantage Merkle tree has the benefit of proving the membership of a data node efficiently and simply by presenting this data node and all of its ancestor nodes on their upward journey to the root node. By computing hashes on the path and comparing the hash value to the root, Merkle tree membership may be confirmed in logarithmic time.

Decentralized identifier Users join up for a self-sovereign identification and data platform, for example, to generate and register a DID. The user generates a pair of private and public keys throughout this process. If public keys associated with a DID are hacked or cycled for security reasons, they can be stored on-chain. To preserve scalability and compliance with privacy rules, additional data linked with a DID, such as attestations, can be anchored on-chain, but the complete data itself should not. A DID is a pseudo-anonymous identification for a person, organization, item, or other entity. In addition, depending on the context and intended use, non-attested data such as surfing histories or social media postings might be connected with DIDs by the owner or controllers of such data.

Transaction level security l

Transaction validation

The Bitcoin network’s creativity is addressing the problem of double-spending, or, to put it another way, establishing a monetary system that does not rely on third parties (banks) to validate transactions. The system is described as “trustless.” Miners are computers that are devoted to the network and are responsible for validating all transactions and preventing rogue actors. Users make cryptographically safe transactions and broadcast them to the network of miners. Miners compile

324 SECTION B Blockchain architecture and security

as many transactions as possible into a block, then validate the block and add it to the chain of previous blocks using a mathematical procedure. For donating their computational power to the network, miners are paid with newly minted bitcoin l

Transaction ordering

The main issue with blockchain is that the order of the blocks does not always correspond to the order in which transactions were completed. When a user makes a transaction, it is sent to an unconfirmed pool, where it is confirmed and validated before being added to the blockchain. There would be two difficulties as a result of this. If transactions are not in any specific order, the block might have many branches because several miners would mine transactions and add them to the block concurrently, leading to debate over which chain block is the correct one. Double spending—using the same transaction reference, one can construct two or three transactions, all of which will travel to the unconfirmed pool, where it will be mined and included in various blocks by different miners. Every block in the blockchain has a mathematical problem attached to it. To add transactions to the block and extend the chain, it must be solved. This puzzle is known as nonce and is solved through cryptography. A block is made up of the following elements: a unique block identification (the outcome of a mathematical puzzle), a previous block reference, a list of transactions, and a nonce or random guess. SHA256 is the encryption function used by the Bitcoin blockchain. Because this puzzle is so difficult to solve, it is unlikely that two or more miners would solve blocks at the same time. When a new block is mined, the longest chain in the Bitcoin network is generally the trusted link, and every one changes to it right away. When a new block is mined, the longest chain in the Bitcoin network is generally the trusted link, and every one changes to it right away. If the block is added to the longest path, the longest path becomes the confirmed link, and the transactions on the other paths are simply returned to the unconfirmed pool. Because these transactions have not yet been verified, this might result in double-spending. To deal with the second issue, customers often pay a fee to have their transactions validated first. This is not much, and it is not usually required.

3.

Implication

The use of blockchain technology is not restricted to cryptocurrencies. Instead, the concept of a decentralized ecosystem and a public ledger may be extended to a variety of other sectors. Accordingly, this chapter aims to fill the research gap that exists due to a lack of usability research. Usability was mostly considered from the user’s perspective, rather than from the developer’s perspective, in the literature. As a result, this chapter attempts to include a significant study into blockchain technology, which will undoubtedly pave the way for future research in this domain.

References [1] M. Nofer, et al., Blockchain, Bus. Inf. Syst. Eng. 59 (3) (2017) 183–187, https://doi.org/10.1007/s12599-017-0467-3. [2] M. Swan, Blockchain: Blueprint for a New Economy (NOTE! Poor Quality), O’Reilly Media, Inc., 2015. [3] H. Baars, H.-G. Kemper, Integration von Big Data-Komponenten in die business intelligence, Controlling 27 (4–5) (2015) 222–228, https://doi.org/ 10.15358/0935-0381-2015-4-5-222. [4] H. Wang, et al., Blockchain challenges and opportunities: a survey, Int. J. Web Grid Services 14 (4) (2018) 352, https://doi.org/10.1504/ ijwgs.2018.10016848. [5] A.A. Monrat, O. Schelen, K. Andersson, A survey of blockchain from the perspectives of applications, challenges, and opportunities, IEEE Access 7 (2019) 117134–117151, https://doi.org/10.1109/ACCESS.2019.2936094. [6] J. Yli-Huumo, et al., Where is current research on blockchain technology?—a systematic review, PLoS One 11 (10) (2016), e0163477, https://doi.org/ 10.1371/JOURNAL.PONE.0163477. [7] L. Lamport, Time, clocks, and the ordering of events in a distributed system, Commun. ACM 21 (7) (1978) 558–565, https://doi.org/10.1145/ 359545.359563. [8] R. Chatterjee, R. Chatterjee, An overview of the emerging technology: blockchain, in: Proceedings - 2017 International Conference on Computational Intelligence and Networks, CINE 2017, October, 2018, pp. 126–127, https://doi.org/10.1109/CINE.2017.33. [9] T.T.A. Dinh, et al., Untangling blockchain: a data processing view of blockchain systems, IEEE Trans. Knowl. Data Eng. 30 (7) (2018) 1366–1385,https://doi.org/10.1109/TKDE.2017.2781227. [10] D. Yaga, et al., Blockchain Technology Overview, NISTIR, 2019, https://doi.org/10.6028/NIST.IR.8202. [11] Centralized vs Decentralized vs Distributed Systems, Berty Technologies, Available at: https://berty.tech/blog/decentralized-distributed-centralized/ . (Accessed 26 October 2021). [12] P. Tasatanattakool, C. Techapanupreeda, Blockchain: challenges and applications, in: International Conference on Information Networking, 2018–January (January 2018), 2018, pp. 473–475, https://doi.org/10.1109/ICOIN.2018.8343163. [13] S.S. Sarmah, Understanding Blockchain technology, Comput. Sci. Eng. 8 (2) (2018) 23–29, https://doi.org/10.5923/j.computer.20180802.02.

An in-depth look at blockchain technology Chapter

17

325

[14] william mougayar blockchain coindesk, Google Search, Available at: https://www.google.com/search?q¼william+mougayar+blockchain +coindesk&rlz¼1C1YTUH_enIN974IN974&sxsrf¼AOaemvJkTjg-GSU3NCRstlvA2BqOEvx4ow%3A1635271075074&ei¼o0F4YZiFBOOV4EPuN6Z-A8&oq¼william+mougayar+blockchain+coindesk&gs_ lcp¼Cgdnd3Mtd2l6EAEYADIHCCMQsAMQJzIHCCMQsAMQJzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIH CAAQRxCwAzIHCAAQRxCwA0oECEEYAFAAWABgzwxoAXACeACAAQCIAQCSAQCYAQDIAQjAAQE&sclient¼gws-wiz. (Accessed 26 October 2021). [15] harvard business review on blockchain, Google Search, Available at: https://www.google.com/search?q¼harvard+business+review+on +blockchain&rlz¼1C1YTUH_enIN974IN974&oq¼H&aqs¼chrome.1.69i60j69i59j69i57j69i60l5.1533j0j7&sourceid¼chrome&ie¼UTF-8. (Accessed 26 October 2021). [16] M. Mettler, Blockchain technology in healthcare: the revolution starts here, in: 2016 IEEE 18th international conference on e-health networking, applications and services, Healthcom 2016, 2016, https://doi.org/10.1109/HEALTHCOM.2016.7749510. [17] S. Youn, H.C. Cho, Blockchain technology in finance industry, Trans. Korean Inst. Electr. Eng. 68 (12) (2019) 1601–1606, https://doi.org/10.5370/ KIEE.2019.68.11.1601. [18] T. Ahram, et al., Blockchain technology innovations, in: 2017 IEEE Technology and Engineering Management Society Conference, TEMSCON 2017, 2017, pp. 137–141, https://doi.org/10.1109/TEMSCON.2017.7998367. [19] A. Sahai, R. Pandey, Smart contract definition for land registry in blockchain, in: Proceedings 2020 IEEE 9th International Conference on Communication Systems and Network Technologies, CSNT 2020, 2020, pp. 230–235, https://doi.org/10.1109/CSNT48778.2020.9115752. [20] S. Saberi, et al., Blockchain technology and its relationships to sustainable supply chain management, Int. J. Prod. Res. 57 (7) (2018) 2117–2135,https://doi.org/10.1080/00207543.2018.1533261. [21] F.X. Olleros, M. Zhegu, Research handbooks on digital transformations, in: Research Handbooks on Digital Transformations, 2016, pp. 1–462, https://doi.org/10.4337/9781784717766. [22] Z. Zheng, et al., An overview of Blockchain technology: architecture, consensus, and future trends, in: Proceedings - 2017 IEEE 6th International Congress on Big Data, BigData Congress 2017, 2017, pp. 557–564, https://doi.org/10.1109/BIGDATACONGRESS.2017.85. [23] blockchain vs hedera, Google Search, Available at: https://www.google.com/search?q¼blockchain+vs+hedera&rlz¼1C1YTUH_enIN974IN974& oq¼blochain+vs+heder&aqs¼chrome.1.69i57j0i13j0i8i13i30.12815j1j7&sourceid¼chrome&ie¼UTF-8. (Accessed 27 October 2021). [24] pow vs pos, Google Search, Available at: https://www.google.com/search?q¼pow+vs+pos+&rlz¼1C1YTUH_enIN974IN974& sxsrf¼AOaemvI9vDcMIEpD_6TC75novrN0Re56Rw%3A1635273429012&ei¼1Up4YbMV8oTj4Q_1jYnICg&ved¼0ahUKEwjz0Ke3OjzAhVywjgGHfVGAqkQ4dUDCA8&uact¼5&oq¼pow+vs+pos+&gs_ lcp¼Cgdnd3Mtd2l6EAMyBAgjECcyBAgjECcyBAgjECcyBQgAEJECMgUIABCRAjIFCAAQgAQyBQgAEIAEMgUIABCABDIFCAAQgAQy BQgAEIAEOgcIIxCwAxAnOgcIABBHELADSgQIQRgAUINFWJVPYJBXaAFwAngAgAH1C4gB6CqSAQswLjEuNi0xLjIuMZgBAKABAcg BCcABAQ&sclient¼gws-wiz. (Accessed 27 October 2021). [25] Hedera, What is hashgraph consensus? Available at: https://hedera.com/learning/what-is-hashgraph-consensus. (Accessed 27 October 2021). [26] J. Rohr, A. Wright, Blockchain-based token sales, initial coin offerings, and the democratization of public capital markets, Hastings Law J. (2018) 70. Available at: https://heinonline.org/HOL/Page?handle¼hein.journals/hastlj70&id¼463&div¼&collection. (Accessed 27 October 2021). [27] M. Giancaspro, Is a “smart contract” really a smart idea? Insights from a legal perspective, Comput. Law Secur. Rev. 33 (6) (2017) 825–835, https:// doi.org/10.1016/j.clsr.2017.05.007. [28] D. Lo, X.D. Le, Institutional Knowledge at Singapore Management University Smart Contract Development : Challenges and Opportunities, 2019. [29] D. Dasgupta, J.M. Shrein, K.D. Gupta, A survey of blockchain from security perspective, J. Bank. Financ. Technol. 3 (1) (2019) 1–17, https://doi.org/ 10.1007/s42786-018-00002-6. [30] I.C. Lin, T.C. Liao, A survey of blockchain security issues and challenges, Int. J. Netw. Secur. 19 (5) (2017) 653–659, https://doi.org/10.6633/ IJNS.201709.19(5).01. [31] R. Zhang, R. Xue, L. Liu, Security and privacy on blockchain, ACM Comput. Surv. 52 (3) (2019), https://doi.org/10.1145/3316481.

This page intentionally left blank

Chapter 18

Blockchain-based IoT security solutions Sandeep Srivastava, Brijesh Kumar Chaurasia, and Deepak Singh Department of Computer Science, Indian Institute of Information Technology, Lucknow, Uttar Pradesh, India

1. Introduction IoT devices generate, process, and exchange vast amounts of security and safety-critical data as well as sensitive information (privacy), and become targets of various cyberattacks. Many network IoT devices are low energy and lightweight which must devote most of their available energy and computation power to execute core application functionality, making the task of supporting security and privacy quite challenging [1]. Traditional security methods are expensive for IoT in terms of energy consumption and processing. Moreover, some of the security frameworks are highly centralized and are not suited for IoT due to the difficulty of scale, many-to-one traffic, and a single point of failure. To protect user privacy, existing methods often either reveal noisy data or incomplete data, which may potentially hinder some IoT applications from offering personalized services [2]. Consequently, IoT needs a lightweight, scalable, and distributed network which safeguards security and privacy. The blockchain technology has the potential to overcome the security and privacy challenges as a result of its distributed, secure, and private nature. Blockchain users, that are known by a changeable public key (PK), generate and broadcast transactions to the network. These transactions are pushed into a blockchain by users. Once a block transaction is completed, the block is added to the blockchain by performing a mining process. To mine a block, some systems defined specific nodes known as miners compete to solve cryptographic puzzle, and the node that solves the puzzle first mines the new block to the blockchain. This mining algorithm is termed as proof of work (POW) [3]. It is observed that adopting blockchain technology in the IoT has several significant challenges such as huge resource requirement for solving the POW, long latency for transaction confirmation, and low scalability as a result of broadcasting transactions and blocks to the entire network. The blockchain framework relies on hierarchical and distributed structure to maintain BT security and privacy while making it trusted for IoT network [3]. Ideas in the context of a smart home can be studied, where framework is application centric and can be applied in IoT network.

2. Internet of Things (IoT) Today’s IoT solutions rely on a centralized design, which connects IoT devices to cloud servers via the Internet. One disadvantage is that the extensively deployed IoT-based infrastructure could result in a single point of failure. More relevant solutions must be proposed, and this chapter provides an overview of a framework for IoT device access control that would employ blockchain, decentralized technology. Great transparency, greater security, improved traceability, high efficiency, low costing, and no third-party involvement are the major advantages of the blockchain. Although the Internet of Things (IoT) has progressed over time, there have been significant issues over security risks. It is difficult to envision the Internet without technologies that bridge the gap between the real and digital worlds. There are different protocols used in IoT ecosystem: l l l l l l

MQTT COAP AMQP Rest XMPP Stomp

IoT devices include wireless sensors, wearable and other smart devices that have an impact on various aspects like health care, transportation, and other human ecosystems. Because the Internet of Things is so closely linked to humans, security becomes a huge issue. In this chapter, we will be understanding on “REST: Web paradigm” which underlines the model of Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00020-6 Copyright © 2023 Elsevier Inc. All rights reserved.

327

328 SECTION B Blockchain architecture and security

REST and enumerates how it uses the features of HTTP and CoAP. Further, “CoAP: Supporting the REST,” which helps us to understand how CoAP extents the functional demand of REST and also deliberates of the transactional model. Lastly, “MQTT: Publish and subscribe” which will explain the significance of MQTT model and the role of the broker in ensuring communication.

2.1 REST: Internet of Things REST stands for representational state transfer. It relies on stateless, client-server, cacheable communication protocol which is being deliberated in connection with CoAP, thus terms may be interchangeable and interrelated. Representational state means that transferring some representation state of the resource to a client, e.g., if a server has a client X (Temp Sensor, or function/temp) then if we can make a representational state Y of resource X and transferring if over the web. The sensor shall input the value of 250C through the “/Temperature” resource at the server. The client X shall request the temp through GET/Temperature and the server shall send the response “200 ok 25°C” signifying that the response is application/text and the payload is 25°C (representational state). REST APIs can be developed using virtually any programming language and support a variety of data formats. Fundamental REST design principles—also known as architectural constraints—are mentioned below: Uniform interface. All API requests for the same resource should look the same, no matter where the request comes from. The REST API should ensure that the same piece of data, such as the name or email address of a user, belongs to only one uniform resource identifier (URI). Resources should not be too large but should contain every piece of information that the client might need. Client-server decoupling. In REST API design, client and server applications must be completely independent of each other. The only information the client application should know is the URI of the requested resource; it cannot interact with the server application in any other ways. Similarly, a server application should not modify the client application other than passing it to the requested data via HTTP. Statelessness. REST APIs are stateless, meaning that each request needs to include all the information necessary for processing it. In other words, REST APIs do not require any server-side sessions. Server applications are not allowed to store any data related to a client request. Cacheable. When possible, resources should be cacheable on the client or server side. Server responses also need to contain information about whether caching is allowed for the delivered resource. The goal is to improve performance on the client side, while increasing scalability on the server side. Layered system architecture. In REST APIs, the calls and responses go through different layers. As a rule of thumb, do not assume that the client and server applications connect directly to each other. There may be a number of different intermediaries in the communication loop. REST APIs need to be designed so that neither the client nor the server can tell whether it communicates with the end application or an intermediary.

2.2 CoAP (constrained application protocol) The constrained application protocol is a protocol designed for use in low-power embedded environments like home automation systems. CoAP brings a web-like architecture to a highly constrained environment: an “Internet of Things” in which a lot of small, cheap computers communicate over a low-capacity network. COAP is specialized web transfer protocol for use with constrained nodes and constrained networks in the Internet of Things. CoAP is designed to enable simple, constrained devices to join the IoT even through constrained networks with low bandwidth and low availability. It is generally used for machine-to-machine (M2M) applications such as smart energy and building automation.

Blockchain-based IoT security solutions Chapter

18

329

CoAP functions similar to HTTP for restricted devices, which enables equipment such as sensors or actuators to communicate on the IoT. These sensors and actuators are controlled and contributed by passing along their data as part of a system. The protocol is designed for reliability in low bandwidth and high congestion through its low power consumption and low network overhead. In a network with a lot of congestion or limited connectivity, CoAP can continue to work where TCP-based protocols such as MQTT fail to exchange information and communicate effectively. Furthermore, the efficient and widely used CoAP features enable devices with poor signal quality to safely transfer data. CoAP employs default DTLS parameters and is similar to 128-bit RSA keys in terms of security, may also sustain networks with billions of nodes.

2.3 CoAP messages model CoAP message has a unique ID; this is useful to detect message duplicates. A CoAP message is built by these parts: l l l

A binary header A compact option Payload

the CoAP protocol uses two kinds of messages: l l

Confirmable message Nonconfirmable message

A confirmable message is a message that can be trusted. In CoAP, a confirmable message is utilized to get a trustworthy message (CON). When employing this kind of communication, the client may be sure that the message will reach the server. A confirmable message is sent continuously until the other party provides an acknowledge message (ACK). In the ACK message, the ID of the confirmable message is repeated (CON). Nonconfirmable (NON) messages do not require the server to acknowledge them. They are messages that are not trustworthy, or messages that do not contain critical information that needs to be delivered to the server. Messages containing sensor values are a good example.

A CoAP request consists of the method to be applied to the resource, the identifier of the resource, a payload and Internet media type (if any), and optional metadata about the request [4]. CoAP codes that determine the functionality and the also the vulnerability in some cases are: Ø GET,POST,PUT,DELETE Ø Types: l CON: confirmable where the recipient responds. l NON: confirmation not desired l ACK: acknowledgement returned against a confirmable request. l RESET: signifies that the CoAP client is not interested in further communication.

2.4 CoAP exhibits the following structural vulnerabilities l

l

CoAP being a plain text protocol thus sniffing and eavesdropping a threat. Hence, an additional security wrapper DTLS is required. Spoofing RESET is a security challenge.

330 SECTION B Blockchain architecture and security

l l l

IoT does not have any built-in support for authorization. DTLS based PSK, RPK & certificate security Protocol header includes a token id that can be used to map the request response state and can be handled at proxy level for stateful responses.

2.5 MQTT (constrained application protocol) MQTT is a machine-to-machine (M2M) protocol that is widely used in the Internet of Things (IoT). The MQTT protocol is a lightweight message-based protocol that is widely used in the Internet of Things. Almost all IoT platforms support MQTT for sending and receiving data from smart objects. MQTT uses publish/subscribe paradigm. It sends and receives data using binary messages with a minimal latency. The MQTT protocol also uses the TCP stack as a communication substrate. Paradigm. “MQTT is bandwidth efficient, data agnostic, and has continuous session awareness. It helps minimize the resource requirements for your IoT device, while also attempting to ensure reliability and some degree of assurance of delivery with grades of service.” Publish/subscribe is event-driven and enables messages to be pushed to clients. The central communication point is the MQTT broker as shown in figure.

A topic is a type of virtual channel that connects a publisher with subscribers which is managed by a MQTT broker. The publisher is detached from the subscribers via this virtual channel, and MQTT clients (publishers or subscribers) do not need to know each other to exchange data. The MQTT broker utilizes the subject to filter the MQTT clients who will receive the message while dispatching messages. Dotted line is indicative of subscription to the topic temperature, and nondotted line is indicative of published to the topic temperature. MQTT protocol uses a publish/subscribe paradigm contrary to CoAP over HTTP request/response paradigm. Publish/ subscribe is event-driven and on occurrence of the event the message is published to all clients those have subscribed to the relevant topic. The task of registering the clients to a topic and publishing messages on the subscribed topic is controlled by a central hub called the MQTT broker. The subscribe and the publish record of a given topic therefore is the routing table of the broker. The paradigm is largely scalable where clients can be added and can subscribe a given topic, each client follows a large level of abstraction and is unaware of the other clients. Only the broker has the info of the authorized clients. Since the IOT devices are constrained and are on light-weighted protocols, it is pertinent to have minimal amount of data sent over the network to reduce the size of data sent over the network, each bit in the control packets is carefully designed. An MQTT Control Packet consists of up to three parts l l l

Fixed header, present in all MQTT Control Packets. Variable header, present in some MQTT Control Packets Payload, present in some MQTT Control Packets

Blockchain-based IoT security solutions Chapter

18

331

MQTT ensures reliability depending upon importance/priority of the message using QoS (quality of service) mentioned in the packet headers. l l l

QoS Being 0 means that the message is sent only once and no acknowledgement is desired. QoS Being 1 means that the message is continuously till acknowledgement is received. QoS Being 2 means that the message will be send only once.

MQTT exhibits the following security features that make it more preferred as compared to CoAP. l l l

l l l

Uses TLs for endpoint encryption thus overcoming MITM attacks Provides user to enter user name and password, therefore ensuring authorization Server authentication ensures that no unwanted topic can be published to the device and avoiding attacks like Ping of Death Though two-way authentication of client and server, IP spoofing attacks can be mitigated Permissions assigned to topics can restrict clients to publish/subscribe to only topics that they are authorized to. Brokers may incorporate authentication based on certificates.

2.6 Need for blockchain in IoT solutions l

l

Because of the difficulty to ensure that data is not changed before being shared, sold, or utilized by third parties for their own gain, IoT cannot be entirely trusted outside of the data owner’s realm. For example, self-driving car start-ups and ride-hailing companies like Uber and Ola do not have a way to share reliable mapping or ride data. Instead, they collect and store equivalent datasets in their servers on their own. The following are some of the current IoT solutions’ limitations which can be resolved using blockchain:  Data integrity/ownership issues  Highly centralized architectures  Vulnerable to a variety of cyberattacks  Single point of failure  Unattended environments

3. Blockchain The blockchain was first introduced in 2009 by Satoshi Nakamoto [4]. Bitcoin was the first widely used implementation of peer-to-peer trustless electronic cash. Henceforth, many other forms of electronic cash (call cryptocurrencies) have been created using similar structures. Simultaneously, many applications using blockchain have been developed over the years to implement other business use case beyond cryptocurrencies. New concepts, such as smart contracts and smart properties, have been introduced by Ethereum. Smart contracts are set of protocols that enable to verify or enforce the negotiation or performance of a contract which has been agreed between parties [5]. They provide feature to track and execute complex agreements between parties without human interaction and can be validated using consensus. Further, smart properties are agreements whose ownership is controlled via the blockchain, using contracts. The potential uses of blockchain technology are beyond cryptocurrency and can be implemented in various domains.

3.1 Properties of blockchain Blockchain technology has the following properties: (I) Decentralized control: A decentralized control is network where no central body completely owns control. (II) Data transparency and audibility: A full copy of all transactions executed in the system is stored in the blockchain and is public to all the peers. (III) Distribute information: All network node stores a copy of the blockchain and no centralized authority privately keeps all that information. (IV) Decentralized consensus: The transactions are validated using consensus algorithm by all the nodes of a network. This breaks with the paradigm of centralized consensus. (V) Secure: The blockchain is secure and cannot be manipulated by malicious actors. Any discrepancy can be easily detected by validating using multiple copies.

332 SECTION B Blockchain architecture and security

A variety of consensus algorithms can be used in blockchains. Proof of work (PoW), proof of stake (PoS), proof of storage, proof of burn, and proof of capacity are among them. The PoW of each block ensures a specific level of difficulty in generating a new block, and the blockchain’s decentralized consensus enforces the validity of every block. If there is consensus to accept a new block, it will be added to the blockchain and all miners will have to begin mining with that block as a reference. Once a block has been added to the blockchain, it is computationally impractical to change it because the entire blockchain would have to be regenerated. PoS is an alternative to PoW that has been proposed. PoS is based on the idea that only those with assets in the system can participate in the blockchain’s consensus process. While the PoW method requires miners to repeatedly run expensive hashing algorithms to validate transactions, the PoS method requires users to demonstrate ownership of a certain amount of currency.

3.2 Components of a blockchain architecture Here are the main components of a blockchain architecture (Fig. 1). l

l

l

l

l l l

A blockchain consists of a series of so-called blocks that are used to store information related to transactions that occur on a blockchain network. Each of the blocks contains a unique header, and each such block is identified by its block header hash individually. A Genesis block is the name given to the first block a cryptocurrency, such as Bitcoin, ever mined. Node—A computer in the blockchain architecture (each node has an independent copy of the entire blockchain ledger) Transaction—A data record that has been verified by blockchain participants and serves as an almost immutable confirmation of the legitimacy of a financial transaction or contract. Block—A sealed data compartment that contains: (1) a native hash code that identifies the block, (2) the hash code from the previous block in the sequence of blocks, and (3) a set of timestamped transactions Chain—A ordered sequence of blocks Miners—Nodes that validate blocks before adding them to the blockchain structure Consensus (protocols)—A set of rules and agreements for performing blockchain operations which can use different mechanism as proof of work, proof of stake, delegated proof of stake (DpoS), Practical Byzantine Fault Tolerance (PBFT), proof of burn, proof of capacity, proof of elapsed time

Blockchain Header # of Prev. Block Header

Nonce

Timestamp

Hash3

Msg3

Hash2

Msg2

Hash1

Msg1

Hash0

Msg0

Hash23

Msg_Root Hash01 Transaction

Content Name Data Validator Provider CS Smart Contract

Transaction N

FIG. 1 Blockchain architecture.

Blockchain-based IoT security solutions Chapter

18

333

3.3 Blockchain security A blockchain consensus protocol must protect against two concerns that are frequently discussed, i.e., Byzantine Fault Tolerance, Sybil strikes. There are, however, many other issues contributing to the hesitation of widespread adoption of Bitcoin and other public blockchains, including: the threat of attacks by an anonymous majority or powerful individual, lack of sustainability and wastefulness, low transaction rate, lack of control over the monetary supply, and extreme volatility in currency value.

3.4 Cryptographic protocols and primitives Elliptic curve cryptography Cryptographic protocols were specified over multiplicative groups of finite fields until Koblitz and Miller introduced Elliptic Curve (EC) cryptography and the Elliptic Curve Discrete Logarithm Problem (ECDLP) in 1985. The efficiency and speed of EC arithmetic, as well as the lack of any subexponential time algorithms to calculate the discrete logarithm in an EC group, are all advantages of employing EC groups rather than finite fields.

ECDSA The Elliptic Curve Digital Signature Algorithm (ECDSA) is used to authenticate transactions in blockchain systems like Bitcoin and Ethereum. ECDSA signatures are made up of two parts: (r, s).

Zero-knowledge proofs In 1985, Goldwasser et al. proposed “zero-knowledge proof of knowledge” techniques. The zero-knowledge proof (ZKP) of knowledge allows a party to demonstrate to a verifier that they are aware of certain secret information (represented below as x) without exposing anything about the secret.

Random oracle model A random oracle (RO) is commonly thought of as a “black box” that accepts inputs and generates really random outputs. The outputs matching to each input requested are recorded by the random oracle; therefore, the same input will always return the same outcome. The random oracle model assumes that a random oracle exists that produces really random results.

Group signature The idea behind a group signature is that a trusted group master or manager is in charge of forming a “group” of users (not to be confused with the abstract mathematical structure of groups—we simply mean a collection of scheme users) who can then sign messages on behalf of the entire group without revealing their individual identities.

Ring signatures Ring signatures were designed in reaction to the constraints of group signatures, and they provide “unconditional anonymity” to honestly participating members without requiring a group manager or a complicated setup procedure. Users must just be a part of an existing public key infrastructure.

3.5 IoT and its integration with blockchain IoT can operate offline, and require fastest data transmission mechanism in terms of latency and security. IoT devices must be able to communicate with one another, which usually entails discovery and routing mechanisms [6]. Only a portion of IoT data is stored in blockchain, and IoT interactions occur without the use of blockchain (Fig. 2). This approach would be useful in scenarios involving reliable IoT data and IoT interactions with low latency. All interactions in this approach are routed through blockchain, resulting in an immutable record of interactions. This method ensures that all of the selected interactions are traceable because their details can be queried in the blockchain, and it increases the autonomy of IoT devices. All IoT data associated with these transactions, on the other hand, should be stored in a blockchain as well.

334 SECTION B Blockchain architecture and security

FIG. 2 Blockchain Interaction with IoT devices.

Finally, a hybrid design in which only a portion of the interactions and data are stored in the blockchain and the remainder is shared directly between IoT devices (Fig. 3). One of the challenges in this approach is determining which interactions should go through the blockchain and providing a way to do so in real time. Because it leverages the benefits of blockchain and real-time IoT interactions, a perfect orchestration of this approach would be the best way to integrate both technologies. To supplement the limitations of blockchain and IoT, fog computing and even cloud computing could be used in this approach. In a typical IoT deployment, low-resource devices serve as end nodes, communicating with a gateway, which is in charge of forwarding sensor data to higher layers (cloud or server). If end nodes must interact with the blockchain during integration, cryptographic functionality could be provided in IoT devices [7]. This is essential to achieving IoT autonomy, which requires more sophisticated hardware and higher computational costs. Integrating gateways into these solutions, as in

FIG. 3 Blockchain interaction with three layered architecture.

Blockchain-based IoT security solutions Chapter

18

335

traditional deployments, is also possible; however, the advantages of using blockchain in this manner are limited. Despite blockchain’s growth, it makes no sense to use it in many applications where databases update accordingly. When it is worthwhile to use a blockchain, it will be determined primarily by the software’s requirements. When high performance is required, for example, blockchain alone may not be the best solution; however, a hybrid approach could be used to optimize it.

To bridge the gap between IoT and blockchain, well-known companies have formed alliances, such as the Trusted IoT Alliance. EthEmbedded allows Ethereum full nodes to be installed on embedded devices such as the Raspberry Pi, BeagleBone Black, and Odroid [7]. Raspnode and Ethraspbian both support the installation of full nodes for Bitcoin, Ethereum, and Litecoin on a Raspberry Pi. The Antrouter R1-LTC is a Wi-Fi router that can also mine Litecoin. As a result, this router type could be installed in smart homes as part of a fog computing ecosystem [4]. Raspnode supports wallets for Bitcoin and Litecoin. Mining can be done on IoT devices, according to Raspnode, but it is pointless. Mining has become a specialized task for specific hardware (ASIC chips), and attempting it on IoT devices is pointless. That is the primary reason why there is so little work on IoT device mining. There is still much research to be done in order to enable widespread integration of IoT devices as blockchain components. For full validation of transactions and blocks, full nodes must store the entire blockchain (currently more than 150 and 46 GB in Bitcoin and Ethereum, respectively); hence, their adoption in IoT devices may be limited. Mining, as previously indicated, would be ineffective in the IoT due to its unique requirements. Although the consensus protocol might be altered to allow for the integration of IoT devices, this could jeopardize the blockchain’s security. This could be utilized in consortium blockchains with less stringent consensus processes. The authenticity of transactions is checked without having to download the full blockchain when lightweight nodes are deployed; as a result, they can contribute to the blockchain and are simple to run and maintain in IoT devices. Nodes can connect IoT devices to the blockchain network, bridging the gap between the two technologies (Table 1). To validate transactions and blocks, this must always be backed up with full nodes. However, many blockchains, like Ethereum, which is still in development, do not yet allow lightweight nodes. In any scenario, blockchain might be utilized to provide secure and dependable storage as an external service.

336 SECTION B Blockchain architecture and security

TABLE 1 Blockchain address Internet of Things (IoT) challenges. Challenge

Explanation

Potential blockchain solutions

Susceptibility to manipulation

Information is likely to be manipulated and put to inappropriate uses

Decentralized access and immutability: malicious actions can be detected and prevented Devices are interlocked: if one device’s blockchain updates are breached, the system rejects it

Deficient architecture

Each block of IoT architecture acts as a bottleneck or point of failure and disrupts the entire network; vulnerability to distributed denial-of-service attacks, hacking, data theft, and remote hijacking also exists

Secure messaging between devices: the validity of a device’s identity is verified, and transactions are signed and verified cryptographically to ensure that only a message’s originator could have sent it

Costs and capacity constraints

It is a challenge to handle exponential growth in IoT devices: by 2020, a network capacity at least 1000 times the level of 2016 will be needed

No need for a centralized entity: devices can communicate securely, exchange value with each other, and execute actions automatically through smart contracts

Cloud server downtime and unavailability of services

Cloud servers are sometimes down due to cyberattacks, software bugs, power, cooling, or other problems

No single point of failure: records are on many computers and devices that hold identical information

3.6 IoT blockchain platform architecture

IoT blockchain platform conceptual architecture This architecture depicts the IoT blockchain platform’s hypothetical scenario, which includes a large number of IoT devices, user devices, data storages, local bridges, and servers connected via a peer-to-peer blockchain network. It is made up of all modules that organize common services in order to deliver various blockchain technology capabilities such as: l l l l

Managing your identity Unanimity Peer-to-peer (P2P) networking Distributed Ledger

The distributed ledger is a consensus of replicated, shared, and synchronized digital data that is spread over the blockchain network and owned by network users. It provides a secure storage space for recording the device’s composition as well as

Blockchain-based IoT security solutions Chapter

18

337

sensing data from physical sensors. Within seconds, any modifications to the ledger are reflected in all copies of the blockchain network. If anybody or only approved members can run a peer to validate transactions, the ledger can be permissioned or permission less.

Application layer The application layer is the top layer, which requires multiple interfaces to display data from physical devices, as well as manipulate and control them.

Internet of Things (IoT) server The IoT server is a service provider that can interact with local bridges and the blockchain network to provide a wide range of services to end users, including sending commands to operate actuators, collecting sensing data from the bridge, querying data, and storing data to the blockchain network’s storage space, among other things.

Cloud data storage Environmental data acquired by sensors, physical device profiles, and device owner profiles can all be stored in the blockchain network’s data storage. It can be either a software storage device, such as a database, or a hardware device, such as a hard drive.

User client End users can read and publish data to the blockchain network using a user client, which can be any terminal device like as smartphones, laptops, or PCs.

Protocols of communication Developers can use a variety of communication protocols for IoT goods and systems, including Bluetooth, ZigBee, WiFi, and 2G-3G-4G cellular. Local bridges perform as the service agent for a cluster of IoT devices by connecting them to the server via these communication channels. Embedded devices, such as the Raspberry Pi, can now directly consume web services by invoking representational state transfer application programming interfaces, thanks to advancements in hardware technology (REST APIs).

Internet of Things (IoT) and blockchain security Sensors collect environmental data such as temperature and communicate it to servers for further processing, whereas actuators conduct actions (e.g., turn on the light) in response to commands received from end users. Blockchain technology has the potential to tackle these problems quickly, safely, and effectively. With a set of attributes and complicated relationships that can be recorded and kept on the blockchain distributed ledger, blockchain can be used to register and give identification

IoT device lifecycle security management.

338 SECTION B Blockchain architecture and security

to connected IoT devices. As shown in the below figure, blockchain also provides a reliable decentralized administration, governance, and tracking at every stage in the supply chain and lifecycle of an IoT device.

Data authentication and integrity Data communicated by IoT devices connected to the blockchain network is always cryptographically proofed and signed by the genuine sender, who has a unique public key and GUID, assuring authentication and integrity. Furthermore, all transactions done to or by an IoT device are recorded on the blockchain global ledger and can be securely tracked.

Authentication, authorization, and privacy Smart contracts on the blockchain can offer decentralized authentication rules and logic to an IoT device, allowing for single and multiparty authentication. When compared to standard authorization protocols, smart contracts can give more effective authorization access rules to linked IoT devices with far less complexity.

Secure communications By design, IoT application communication protocols like HTTP, MQTT, CoAP, or XMPP, as well as routing protocols like RPL and 6LoWPAN, are not secure. To ensure secure communication, such protocols must be wrapped within other security protocols such as DTLS or TLS for message and application protocols. IPSec is also commonly used to offer security for RPL and 6LoWPAN protocols in routing. In terms of computation and memory needs, DTLS, TLS, IPSec, and even the lightweight TinyTLS protocols are heavy and complex, and complicated by a centralized management and governance of key management and distributes utilizing the popular PKI protocol.

4.

Conclusion

In many aspects, blockchain can help ease the security and scalability challenges connected with IoT, since the distributed ledger in a blockchain system is tamper-proof, removing the need for trust between the parties involved. The massive volume of data created by IoT devices is beyond the control of any single organization and using blockchain to store IoT data would provide another degree of protection that hackers would have to get beyond in order to gain access to the network. The blockchain technology provides a far higher level of encryption, making it nearly difficult to delete existing data entries. Anyone with permission to access the network can follow prior transactions on the blockchain, which can give a reliable mechanism to determine the source of any data leakages and take rapid corrective action. Blockchain technology can facilitate the processing of transactions and the coordination of billions of connected devices. The distributed ledger technology provides a realistic option to facilitate the processing of enormous numbers of transactions as the number of interconnected devices grows. Blockchain can help IoT organizations cut costs by reducing the processing overheads associated with IoT gateways by providing a means to facilitate trust among stakeholders.

References [1] M. Conti, A. Dehghantanha, K. Franke, S. Watson, Internet of things security and forensics: Challenges and opportunities, in: Future Generation Computer System, vol. 78, 2018, pp. 544–546. [2] X. Wen, Z. Guan, D. Li, H. Lyu, H. Li, A blockchain-based framework for information management in internet of vehicles, in: 8th IEEE International Conference on Cyber Security and Cloud Computing (CSCloud)/2021 7th IEEE International Conference on Edge Computing and Scalable Cloud (EdgeCom), 2021, pp. 18–23. [3] Z. Zheng, S. Xie, H.-N. Dai, X. Chen, H. Wang, Blockchain challenges and opportunities: a survey, Int. J. Web Grid Serv. 14 (4) (2018) 352–375. [4] S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System (Online), 2008, pp. 1–9. Available at: https://bitcoin.org/bitcoin.pdf. [5] N. Atzei, M. Bartoletti, T. Cimoli, A survey of attacks on ethereum smart contracts SoK, in: In 6th International Conference on Principles of Security and Trust, vol. 10204, 2017, pp. 164–186. [6] A. Reyna, C. Martı´n, J. Chen, E. Soler, M. Dı´az, On blockchain and its integration with IoT. Challenges and opportunities, Future Gen. Comput. Syst. 88 (2018) 173–190. [7] CoinMarketCap, Top 100 Cryptocurrencies by Market Capitalization (Online), Available at: https://coinmarketcap.com/. (Accessed 13 May 2019).

Blockchain-based IoT security solutions Chapter

18

339

Further reading Ethereum Community, Ethereum Homestead Documentation (Online), Available at: http://ethdocs.org/en/latest/index.html. (Accessed 10 May 2019). A.M. Antonopoulos, Mastering Bitcoin Unlocking Digital Cryptocurrencies, second ed., O’Reilly Media, Inc., USA, 2018. A. Hafid, A.S. Hafid, M. Samih, Scaling blockchains: a comprehensive survey, IEEE Access 8 (2018) 125244–125262. B. Zhong, H. Wu, L. Ding, H. Luo, Y. Luo, X. Pan, Hyperledger fabric-based consortium blockchain for construction quality information management, Front. Eng. Manag. 7 (2020) 512–527. S.N. Khan, F. Loukil, C.G. Guegan, E. Benkhelifa, A. Bani-Hani, Blockchain smart contracts: applications, challenges, and future trends, Peer-to-Peer Netw. Appl. 14 (2021) 2901–2925. L. Lamport, R. Shostak, M. Pease, The byzantine generals problem, ACM Trans. Progr. Lang. Syst. (TOPLAS) 4 (3) (1982) 382–401. A. Banafa, IoT and Blockchain Convergence: Benefits and Challenges (Online), 2017, Available at: https://iot.ieee.org. The top 5 enterprise blockchain platforms you need to know about, Online available at: https://www.hfsresearch.com/blockchain/top-5-blockchain-plat forms_031618/. A. Sahai, R. Pandey, Smart contract definition for land registry in blockchain, in: 9th IEEE International Conference on Communication systems and Network Technologies, 2020.

This page intentionally left blank

Chapter 19

Cryptoeconomics Malobika Bosea and Naela Jamal Rushdib a

Amity University Uttar Pradesh, Lucknow, Uttar Pradesh, India, b IILM Academy of Higher Learning, Lucknow, Uttar Pradesh, India

A formal discipline that studies protocols that govern the production, distribution, and consumption of goods and services in a decentralized digital economy. Crypto economics is a practical science that focuses on the design and characterization of these protocols. Zamfir [1]

1. Introduction The blockchain technology is rooted in the concept of crypto economics. Often, when we are referring to blockchain technology, we are more focused on the cryptography part of the equation rather than the economics part. Since blockchain is involved in asset creation, we cannot ignore the economics part of crypto economics. To understand it better, we first explore the concept of blockchain, its evolution, cryptography, and thereafter, how it uses the principles of economics to create asset value. Blockchain is perhaps one of the most disruptive and intriguing innovations of this decade that has revolutionized both academia and industry. Cryptocurrency which is rooted in the concept of blockchain has changed the way we once looked at money. In October 2008, Satoshi Nakamoto (an individual or group of individuals or a consortium, no one really knows!) challenged the very fundamentals of “fiat money” and released a paper laying the foundations of the cryptocurrency, Bitcoin [2]. With the frequent global economic meltdowns and unstable economic environment, it was very evident that the financial loss incurred was, by the common man and small-time investors, often their life’s savings and not to financial institutions since across the world, the governments were always ready to bail out these financial institutions. The European Sovereign Debt Crisis (2010), the Subprime crisis of USA (2008), the Dot Com Bubble (2000–2002), the Asian Financial crisis (1997), and so on are indicators that we are living in highly unstable economic environment and no financial institution can guarantee the safety of the investor’s money. To counter this situation, Satoshi Nakamoto engineered the concept of cryptocurrency using the conceptual framework of blockchain technology with a publicly distributed, immutable, and decentralized ledger system so that there can be no manipulation of the system and every change initiated in the system is simultaneously cross communicated to all the participants of the system making it independent from the existing central banking systems that are present globally. It was the result of loss of faith in the institutions of banking and investment system across the world since they failed to protect investor’s interest. Blockchain uses a distributed database of the record of transactions which is validated and maintained with all the participants (nodes) of a network of computers globally. It is a decentralized system where the records are stored, maintained, and supervised by all participants rather than a central authority like bank. As opposed to conventional databases, blockchain restricts any alteration in the information without the consent of all system participants. Thus, any attempt to change the data in the blocks is treated as an attack on the system and the transactions further will not be validated. The distributed structure of the blockchain allows all users to access each other’s entries, thus making it impossible for any one participant to gain complete control of the system. When a new entry for transactions is initiated, it enters the network where system algorithms authenticate the transaction after which it is linked to the previous transaction resulting in a series of validated transactions. This series forms a chain that is known as blockchain.

1.1 Evolution of blockchain The advent of blockchain technology can be traced back to the early 2000s when torrents had become a popular means for peer-to-peer sharing of data files. The torrent websites allow participants to share files with each other over a decentralized Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00007-3 Copyright © 2023 Elsevier Inc. All rights reserved.

341

342 SECTION

B Blockchain architecture and security

network. The concept was that once a file has been downloaded by a participant, they would keep on seeding the file, i.e., continue to share the file over the network allowing other users to download it. The more the number of seeders, faster would be the downloading process for other users. This system was based on mutual benefit and a code of honor among system participants, meaning it was expected that if you have downloaded a file, you would seed it too. The problem was that seeding consumes data (data was expensive during the early 2000s when torrents were introduced), and therefore, the seeders would continue to incur costs for making files available for downloads on the torrent network. With no economic incentives linked with the system, it worked as a deterrent for the participants to continue seeding once the data file was downloaded. The blockchain system overcame the above problem by providing economic incentives and circumventing the Byzantine General’s Problem [3]. First, let us understand what the Byzantine Generals Problem is. Byzantine Generals’ Problem is a game theory problem that describes a situation where several Generals (i.e., “Byzantine Generals”) have surrounded the city of Byzantium and want to besiege it. They can only win when all of them attack together at the same time. If they attack at different times, they will lose. To plan and execute a well-coordinated attack, the Byzantine Generals must establish a system of communication between themselves which is secured against the risk of being intercepted and manipulated by the Byzantium’s defenders. So how do the Byzantine Generals solve the issue of arriving on consensus? This challenge is equivalent to the one faced by participants of a decentralized system where the reliability and validity of information is questionable as there is no way to verify the authenticity of the message received from other participants. The Byzantine Generals Problem, therefore, exists in all decentralized systems. Lamport et al. in their paper explored how consensus can be formed between independent actors who share an objective or goal of securing their interests against a common enemy in the face of uncertainties. Byzantine fault in a computer network occurs when it presents different symptoms to each of the participants in the system. For example, to some participants it shows that the network system is functioning error free, while to the others, it may appear to have glitches due to interception of communication by hackers. This results in a Byzantine failure, i.e., loss of network service or sever system failure. For the system to work faultlessly, an agreement or consensus is required among all users regarding any transaction taking place in the system. Blockchain eradicates this problem by operating on a distributed ledger system. “Blockchain networks…, are equipped crypto economic mechanisms that allow the decentralized network to simultaneously maintain a universal state layer, support peer-to-peer settlement, and incentivize collective action” [4]. For example, in a blockchain like Bitcoin, since all the participants and nodes share distributed ledgers, and are equal in hierarchy, all participants must approve and reach an agreement regarding the verification of transaction thereby neutralizing any corrupt or misleading exchange of information/data by hackers or external malicious actors. Overcoming the Byzantine fault also solves the double spending problem in a blockchain. With the growth in ecommerce and online transactions globally, the entire payments system is heavily dependent on digital payments in the form of digital tokens. Since digital money is in the form of bits, it can be easily hacked into, copied, and used elsewhere for payments. This is the problem of double spending. For a digital money to work efficiently, this threat must be eliminated. Let us take an example and see how this problem is eliminated in blockchain by using distributed ledger systems. Assume that there are four participants A, B, C, and D in a blockchain network (refer to Fig. 1). Consider that four transactions are taking place in the chronological order of 1, 2, 3, and 4. In the first transaction, A has digital money worth $100

FIG. 1 Transaction schematics in cryptocurrency.

Cryptoeconomics Chapter

19

343

(DM ¼ $100) and it transfers the same to B. In the second transaction, B transfers $50 to C, and in the third transaction, C transfers $15 to D. Since blockchain is a decentralized distributed ledger system, let us see how the ledger would look like to all participants after the first three transactions (refer to Table 1). The fourth transaction in which A tries to transfer $100 to D will generate an “attack variable” in the network since A has already transferred all its $100 to B and the account balance of A in the ledgers of all participants at the time of initiating the transfer to D was $0. Since a consensus is not reached about A having $100 in its account, A’s transaction of $100 dollars to D is not validated by the other participants in the system and, therefore, is not executed. This information of transactions is stored in the form of blocks and a chain is created among these blocks which also contains the information of the history of past transactions linking all the transactions together. Since each transaction is simultaneously updated at the time of transaction in the ledger of all participants uniformly, therefore the transactions cannot be duplicated, and thus, the problem of double spending is eliminated. To understand, how economic incentives are generated in blockchain, we need to understand how cryptography creates economic value in blockchain.

1.2 Concepts related to cryptography and economics In early 1976, the concept of distributed ledger system was proposed in the paper published titled “New Directions in Cryptography” [5]. The paper discussed the problem of breach of privacy due to the absence of secured system protocols allowing unauthorized access and extraction of information over unsecured communication networks. Encrypting the information would allow the parties communicating with each other to send the information securely to each other without corrupting it. This could be done with the help of cryptography. The paper suggested that a “public key cryptosystem” can be created which acts as a “multiple access cipher,” it means that any user in the system can send an enciphered message to another user such that only the receiver can decipher the message. The system therefore has two components: an enciphering key and a deciphering key. The enciphering key can be accessed publicly, while the deciphering key is secretly held by each user. The enciphering key formed the basic construct of the distributed ledger system of blockchain. Therefore, we can say that the distributed ledger system is the equivalence of the public enciphering key which is publicly accessible to all TABLE 1 Representation of a distributed ledger. Transaction no.

Ledger of A

Ledger of B

Ledger of C

Ledger of D

0

A ¼ $100

A ¼ $100

A ¼ $100

A ¼ $100

B ¼ $0

B ¼ $0

B ¼ $0

B ¼ $0

C ¼ $0

C ¼ $0

C ¼ $0

C ¼ $0

D ¼ $0

D ¼ $0

D ¼ $0

D ¼ $0

A ¼ $0

A ¼ $0

A ¼ $0

A ¼ $0

B ¼ $100

B ¼ $100

B ¼ $100

B ¼ $100

1

2

3

C ¼ $0

C ¼ $0

C ¼ $0

C ¼ $0

D ¼ $0

D ¼ $0

D ¼ $0

D ¼ $0

A ¼ $0

A ¼ $0

A ¼ $0

A ¼ $0

B ¼ $50

B ¼ $50

B ¼ $50

B ¼ $50

C ¼ $50

C ¼ $50

C ¼ $50

C ¼ $50

D ¼ $0

D ¼ $0

D ¼ $0

D ¼ $0

A ¼ $0

A ¼ $0

A ¼ $0

A ¼ $0

B ¼ $50

B ¼ $50

B ¼ $50

B ¼ $50

C ¼ $35

C ¼ $35

C ¼ $35

C ¼ $35

D ¼ $15

D ¼ $15

D ¼ $15

D ¼ $15

344 SECTION

B Blockchain architecture and security

channel users. Public key distribution system can eliminate the need for “secure key distribution channel” by using the concept of Merkle tree. David Lee Chaum [6] in his doctoral thesis laid down the foundation of the blockchain protocol. Chaum is also known as the “father of digital currency” and created the first digital currency in the year 1995 called “eCash” using the cryptographic “blind signature protocol.” Haber and Stornetta [7] explored another dimension of cryptography—“timestamping.” Almost all information today is available in digital form and therefore is exposed to the risk of unauthorized modification. Therefore, it is imperative that we create a system where it is possible to verify when a particular data was created or modified. The paper conceptualized the procedure of “digital time stamping” which did not allow any user to either backdate or forward-date any document even with a “collusion of the time-stamping service.” Adam Back [8] came up with the concept of “hashcash” which initially provided measures to control spam emails, but over the years, hashcash became more synonymous with the concept of proof of work (PoW) which is used in blockchain to the create economic value of cryptocurrency. In 2009, Satoshi Nakamoto released an opensource program which contained the above-mentioned concepts of cryptography and implemented a blockchain system which created the first Bitcoin. Let us see some of the cryptographic functions used in the blockchain technology. 1. Hashing: It is used to generate a value or set of values using a mathematical algorithm. Hashing [9] is a type of encryption function that helps to secure a message during transmission over a public network when the message is intended to be delivered and deciphered by a particular user only. The algorithm that generated the hash protects it from being tampered with during transmission. A hash function maps an input to a fixed length output and this output is called hash. This means large amounts of data can be easily associated with a single hash. The output is unique for every input and is like fingerprinting of data. Cryptographic hash functions must contain certain properties for it to be secure. The following properties are required for a hash function’s security: (a) Deterministic: This means consistency in the output result, irrespective of the number of times a string is run through a hash algorithm. This is critical because if the output varies every time, then it will be impossible to keep a track of the input string. (b) Quick Computation: This means that the system must be efficient in returning the hash of an input as fast as possible. (c) Collision Resistant: It should be infeasible for the hash generated for two different inputs to be equal or same. In other words, two different passwords should not hash to the same input or enciphered string. (d) Non-predictable: It should be infeasible to predict the hash value from the password. (e) Avalanche Effect or Diffusion: If the original password is changed even slightly, then the output generated for the enciphered string should change significantly and give a completely unpredictable output. (f) Non-reversibility, or One-way Function, or Pre-image Resistant: It should be infeasible to construct the original password or value of the input from the hash. Hashing and Data Structures: The data structure depicts the way in which the data is organized and stored in the system so that it can be efficiently retrieved and used. With respect to blockchain, there are two important data structures to be considered, linked lists and hash pointers. Fig. 2 shows how the data structure looks like in a simple linked list. Linked lists are blocks of data, arranged sequentially such that each block of data is connected to the next block by a pointer. The pointer

FIG. 2 Simple link list data structure with pointers.

Cryptoeconomics Chapter

19

345

contains the address of the next node in sequence which allows the blocks to connect with each other. The last node with null pointer has no value, indicating that the sequence of blocks ends there. The pointer inside each block contains the address for the next block. Now, in a blockchain instead of a simple pointer which can be modified, we have a hash pointer which is encrypted and cannot be modified making it secure and tamper proof. Fig. 3 shows the structure of a blockchain data. It shows that the block is divided into two parts: the block header and transaction. Table 2 describes the various components which are a part of the block header. The sequence and information regarding each transaction in the blockchain is stored in the hash. A Merkle tree (or hash tree) is a very important component of hash function. It has two functions: data verification and data synchronization. Merkle tree helps to overcome the problem of data tampering in a decentralized system which is possible due to the presence of multiple nodes from where data can be copied. It helps to share, authenticate, and validate the data in a blockchain.

FIG. 3 Blockchain data structure with hash pointers.

TABLE 2 Components of a block header. Block header 1. Version: The version number is used to track software (protocol) updates, the software version used for mining by the miner, and the block validation rules followed. 2. Previous Block Hash: The previous block’s hash reference which means it maintains the order of the creation of blocks, i.e., it prevents the order of the blocks from being changed without affecting the current and subsequently all blocks in the chain. 3. Merkle Tree Root Hash: The hash of the root of the Merkle tree of this block’s transactions, i.e., the summary of all transactions included in the block. 4. Timestamp: The time of creation of this block. It uses the Unix epoch time (i.e., the time when the miner started hashing the header for the mining process). 5. Bits: Also known as the difficulty target. It is the encoded difficulty target of proof-of-work algorithm of this block. 6. Nonce: Abbreviation for “number only used once.” It is the cryptographic number that authentication protocols attach to communication. Blockchain miners solve the cryptographic problem to obtain this number and win the right to add a new block to the existing blockchain. The reward for mining is in the form of receiving the linked cryptocurrency.

346 SECTION

B Blockchain architecture and security

Merkle Tree Ralph C Merkle [10], the inventor of cryptographic hashing, patented the concept of hash trees in 1979. Hash trees ensure that data transferred between computers in a peer-to-peer network is undamaged and unaltered, verifiable, and also check the authenticity and credibility of the network peers. The above diagram represents the structure of a binary Merkle tree. It can be observed that the tree provides the mapping of data in a huge and complicated network. The map helps in tracing any small change made in the data to the source of the change. The source of the change can easily be identified by comparing the data consistency with the root hash, and thus, one is not required to traverse the entire data structure but only a small part of it. This means a user can easily verify whether a transaction is part of a particular block or not. Therefore, the root hash is often referred to as the fingerprint of the blockchain. Merkle trees are used to remove inconsistencies in data systems where huge amounts of data are widely distributed and exist at multiple locations.

2. Signatures: Digital signatures are fundamental to any blockchain. They are used to verify and authenticate transactions just like the normal bank cheques that are signed by the account holder to transfer the money to another account. Therefore, like the properties of an individual’s signature in real life, the digital signature should also have the following qualities—(a) it should provide verification that it belongs to the said individual, (b) it should be non-forgeable, i.e., it cannot be duplicated, and (c) it should be non-repudiable, i.e., the individual cannot deny the authenticity and validity of the signature on the communication. For any transaction to take place, all the nodes in the system should agree to the authenticity of a transaction and that a particular node is authorized to spend/transfer the funds, by preventing the other nodes in the system from spending the same funds (i.e., prevents double spending). Every node in the network verifies the conditions related to the submission of a transaction and checks all other nodes’ work to unanimously agree on a correct state. To remove the possibility of any kind of fraudulent transaction, the concept of Public Key Cryptography or Asymmetric Cryptography is used to authenticate the transaction process. This cryptography has two parts: (a) a private key and (b) a public key. A public key allows a cryptocurrency user to receive transactions. Every public key is paired with a unique “private key,” and it is infeasible to “unlock” the “private key” even if the public key is known. Think of the public key to be your bank account number, which is visible to everyone, can be shared publicly, and serves as an address for your transactions, whereas the private key is like your authentication password and should never be shared with anyone else. The only catch here is that, in a normal banking transaction, where the transactions are centralized it is possible to retrieve the transaction password from one’s bank in case one forgets or loses it by authenticating the personal details related to the account number, but there is no way to retrieve the private key in a blockchain if one happens to lose it because it is infeasible to guess the private key associated with a public key. All the cryptocurrency related to the private key will be lost once and for all in case one loses the private key. So, in a cryptocurrency transaction the sender encrypts the transaction using the private key (signature key), and at the receiver’s end, the transaction can be verified using the public key. Let us try to understand it with an example. Suppose Aron wants to send some money to Ben (refer to Fig. 4). To do so, Aron will use his private key to digitally sign a message detailing the transaction and send the same to Ben via blockchain. Ben can verify whether the transaction message did come from Aron’s node (or digital wallet) by using Aron’s public key. Therefore, Aron digitally signs a transaction to prove that he is the owner of the funds. Nodes in

Cryptoeconomics Chapter

19

347

FIG. 4 Public key cryptography.

the system conduct checks and authenticate the transactions automatically. Unauthenticated transactions get rejected by the network. Thus, any mined transaction, once authenticated on a blockchain, becomes irreversible.

3. Mining: A process by which new blockchain transactions are validated digitally on a particular blockchain network by the miners (to solve the problem of double spending) and thereafter added to the decentralized ledger is called mining. Miners solve cryptographic puzzles (or hash puzzles) used for creating new blocks (or crypto coins) which further enter circulation of the cryptocurrency blockchain. Mining requires extremely sophisticated hardware that solves a very complex mathematical problem. The reward for solving this complex problem is a crypto coin. Many miners simultaneously attempt to solve the math problem, but only the first one to solve the problem is awarded the next block of crypto coins, and thereafter, the process is repeated to create new blocks of crypto coins. This process is extremely costly as it requires huge amounts of high-speed internet, electricity, and expensive hardware, and there is no guarantee that solving problem will generate the reward since the probability of being the first one to solve the problem is dependent on the number of miners in the network (or the total mining power of the network). Even though the rewards are sporadic, miners are still interested in the mining process because even if the reward is probabilistic, the reward is too gratifying for them. So, mining allows one to earn a cryptocurrency without paying for it which otherwise would be bought by using fiat currency. 4. Proof-of-Work: Proof-of-work mechanism is used to arrive at a consensus by all participants regarding a transaction in a decentralized network. It is the original consensus algorithm in a blockchain network. Proof-of-work is an algorithm that is used to define the difficulty level of the crypto puzzle and the rules for the “work” the miners have done in order to add valid blocks in the blockchain ledger. More work equals a longer chain comprising higher number of blocks. The miners are in a rush to find the nonce for the block as only a valid nonce can be added to the chain. To create a block, the miners compete against each other repeatedly to complete transactions on the network to obtain the reward that can be gotten only by running the complete chain through the hash puzzle and solving it. Thus, the answer to the proof-of-work problem is a new hash. As the network grows, so does the level of difficulty of the proof-of-work problem which further requires more and more hash power to solve making it a complex issue. Further to check any malpractice in the network, “Zero-Knowledge Proofs” are used to verify the transactions in a blockchain. Zero-knowledge techniques use mathematical algorithms to verify transactions without revealing or sharing the underlying data. For example, you want to make a payment using a digital wallet app connected to your bank account on your mobile phone. The app can simply verify the sufficiency of the funds in your bank account for making the transaction without finding out any other detail about the account. Zero-knowledge protocols provide fragmented, unlinked information which when put together show that there is a very high probability of an assertion being valid. Therefore, zero-knowledge proofs can be used to achieve the integrity and privacy of transactions without disclosing the inner workings of a transaction.

348 SECTION

B Blockchain architecture and security

Now that we have explored the cryptography part of the cryptocurrency, let us explore the economics part of it. As discussed in the introduction to this chapter, the concept of cryptocurrency is to provide an economic or financial incentive for some work done. This is same as in the real world where individuals are paid for the product or services they provide in exchange of money and are punished for any kind of malpractice undertaken by them. The concept of crypto economics came into vogue during 2014 to 2015 when the Ethereum Developer Community was formed. Vitalik Buterin and Gavin Wood launched the Ethereum cryptocurrency in 2014. Buterin explains crypto economics “as a methodology for building systems that try to guarantee certain kinds of information security properties” [11]. Vlad Zamfir, however, is of the view that crypto economics deals with the “protocols that govern the production, distribution, and consumption of goods and services in a decentralized digital economy. Crypto economics is a practical science that focuses on the design and characterization of these protocols.” Inspired by the economic incentives provided for contributions to the network as in the case of Bitcoin protocols [2], the Ethereum community was the first to coin the word, crypto economics. This has further led to the use of cryptographic techniques in organizations and financial markets. Davidson et al. [12] claimed that blockchain is an ICT innovation with two economic approaches—innovation centered and governance centered. Halaburda et al. [13] explored the microeconomics behind the demand and supply of cryptocurrencies and what drives the competition and trading among the various cryptocurrencies. In all the above examples, the most important question that surfaces is— how do crypto currencies acquire value? Like fiat currency, cryptocurrency also derives its value from the mutual trust that is put in the value of the two transacting parties in a cryptocurrency network. The value of a cryptocurrency is generated through two factors: incentive’s structure, and its demand and supply. In normal parlance, an incentive can be described as a design element of the system that drives the system participants to behave in a particular way by making choices in the system and allowing them to make a cost–benefit analysis of the selected choices. In simple terms, a correct behavior in a system will generate rewards for the system participant which can be monetary or non-monetary and conversely a wrong act will be punished. Incentives are fundamental to blockchain and can be divided into two sets. The first set of incentives consists of: (a) Tokens—where system participants contributing to the blockchain are given cryptocurrencies for their work; and (b) Privileges—for example, a miner who creates a new block temporarily becomes the decision maker regarding which transactions can go into the system and for this the miner can charge a “transaction fee.” The second set of incentives consist of: (a) Rewards—in this a system participant is given monetary reward or decision-making right for following the rules of the system and doing good work; and (b) Punishments—which take the form of monetary fines or taking away the rights of decision making from the system participants for flouting the rules of the system or non-ethical behavior. So, categorically a blockchain contains both, tokenized financial rewards and non-monetary rewards which help in shaping the behavior of the community to align with the goals and vision of the creator of the blockchain. Unlike the fiat currency, cryptocurrency has a fixed supply. For example, the market cap on Bitcoin is 21 million, i.e., there are only 21 million Bitcoins in existence. Therefore, the maximum quantitative supply of Bitcoins is fixed. To control the indiscriminate mining of Bitcoins, it is important that the mining of the same becomes harder and harder progressively to increase the value of Bitcoin. Basic rule of economics is followed here—if the demand increases and the supply is restricted, then it will result in price rise. Therefore, to ensure controlled outflow of Bitcoins in the market certain rules must be in place. For example, in Bitcoin there is a time limitation on creation of new blocks, i.e., a new block can only be added after 10 min of a block creation and not a second before that, and further, the difficulty level of hash increases significantly as each new block is created. The demand of cryptocurrency is affected by various factors such as, how secure is it, has it been exposed to hacking, how consistent has been its performance, who are its creators, what is its future market potential, what is the “buzz” around the cryptocurrency, etc. Now that we have understood how value is created in a cryptocurrency, the next challenge is to understand how honesty and ethics can be maintained in a decentralized and unregulated system where miners can easily disrupt the system and attempt to make it work for their own gain. The game theory and the Nash equilibrium give us the answer to this challenge. Game theory is the study of strategic decision making in situations where competing participants experience a conflict of interest. Here, the decision maker is fully aware of the objectives, preferences, and limitations of one’s actions. It helps decision makers to arrive at an optimal solution for a given situation. The theory was propounded in 1944 by mathematician John Von Neumann and Morgenstern [14] and was revolutionary in understanding the oligopoly markets. According to game theory model, there are three components to a decision-making system: (a) Players: The decision makers. (b) Possible strategies: The decisions that will help the players advance to a better situation; and (c) Possible payoffs: The outcomes associated with the strategies.

Cryptoeconomics Chapter

19

349

There are two types of games in game theory: (a) zero-sum game and (b) nonzero-sum game. In a zero-sum game, the gain of one player is at the cost of loss of the other player or we can say it is a win–lose situation, whereas in a nonzero-sum game the win of one player is not at the cost of loss of the other player or in other words it can be win-win situation. An extension of the game theory is the Nash equilibrium which works on a similar payoff matrix as that of game theory. As per Nash equilibrium, the optimal outcome for choosing a strategy is the one where there is no incentive to deviate from the original strategy after considering an opponent’s choice. So, in a game there may be multiple Nash equilibria. Let us try to understand it with an example. Consider the following payoff matrix and possible scenarios in a game being played between Aron and Ben. At a crucial point in the game, both the players have to make a move to secure an advantageous position in the game (Table 3). Scenario 1: If Aron takes action “X”: In this case, Ben has a payoff of “10” if Ben takes action and a payoff of “zero” if he does not take the action. Therefore, the optimal strategy is for Ben to take the action. Scenario 2: If Aron does not take action “X”: In this case too it is optimal for Ben to take action as it gives a payoff of 10. Scenario 3: If Ben takes action “X”: In this case, the payoff for Aron to take the action is 10 and for not taking an action is 0. Therefore, the optimal choice for Aron is to take the action. Scenario 4: If Aron does not take action “X”: In this case again the optimal strategy for Aron is to take the action. From the above, we can establish that the best solution for both Aron and Ben is to “take action,” regardless of what the other decides. Therefore, the Nash equilibrium established here in the payoff matrix is (10,10) for both the players. Now, how do we apply Nash equilibrium in blockchain? The blockchain is a self-imposing Nash equilibrium structure. Let us assume that a rogue miner in the blockchain decides to mine a new malicious block. By the rule of the blockchain, any block mined on an invalid block will not be considered a valid transaction (i.e., consensus on the decentralized ledger will not be reached). Therefore, the existing miners will ignore the new malicious block and continue to mine on the previously existing valid block. Since the value of a block in the blockchain is derived from mutual trust, therefore the invalid transaction will not be considered of any value. Further, as discussed earlier, mining is a very expensive process, so it does not make sense to invest so much of resources on a divergent behavior in the system just to waste those resources for an invalid transaction with zero value. A thought of colluding with the other members of the blockchain may also come to the mind of the malicious miner, but this is also not possible because the innumerable miners on the system are anonymous and widely distributed making it infeasible for a rogue miner to coordinate and communicate with the participants for a wellcoordinated and strategized attack on the system. Thus, miners will choose a position of maximum payoff, which in this case is to follow the rules of the chain, and therefore establishing a Nash equilibrium in the blockchain.

1.3 Financial market structures and blockchain We have seen how blockchain is able to amalgamate cryptography and economics to create an alternate form of financial asset for the future. So, can we say that in future crypto economics will pave the way for an alternative to the traditional economy? The following points help us explore how crypto economics aims to break away from traditional economic conventions to create conditions for a potential crypto economic business environment. 1. Initial coin offerings (ICOs) provide an alternative to traditional fundraising methods comprising debt and equity instruments, with fewer regulations, no transaction fees, and wider reach. This is a viable source of entrepreneurial funding. 2. With the derivatives markets thriving globally, convertibility between asset classes makes liquidity an easy affair. Similarly, tokens issued in ICOs can be converted to both monetary and non-monetary rewards. 3. The volatility of currency conversion rates can be reduced since cryptocurrency provides more stability than conventional fiat as it is not affected by foreign relations, bilateral issues, or financial and political instability of a country.

TABLE 3 Payoff matrix. Payoffs for action “X”

Ben takes action

Ben does not take action

Aron takes action

(10,10)

(10,0)

Aron does not take action

(0,10)

(0,0)

350 SECTION

B Blockchain architecture and security

4. Blockchain has redefined the way assets are classified since blockchain is treated as an intangible asset and this makes it difficult for the accountants to value them in the corporate accounts of a company. Since there is no standardization of its valuation, it therefore cannot be added to a country’s GDP make it detached from the existing economy. 5. Conversion of cryptocurrency to fiat currency can be a costly affair but can be avoided by using tradable token on the exchanges which can help in asset conversion. 6. Lack of trust in global financial systems is another reason for rapid development of the crypto economic environment. The frequent financial crises across the globe have pushed businesses to live under constant state of fear. In such unstable times, crypto economic environment can provide a more stable economic environment. 7. Crypto economics enables risk distribution among peers which acts as a deterrent to malicious and unethical behavior by system participants. 8. Redefining the basic principles of competition among industry peers. Every blockchain creator has aims, objectives, and vision for it. This means that they can be different from one creator to the other, and since there are industry standards for blockchain, competition becomes a relative term. The drivers of blockchain are mutual trust and the wellbeing of the blockchain community. 9. A shift toward machine economy has propelled the adoption of the crypto economic environment. IoT, blockchain, and artificial intelligence have revolutionized the art of decision making in the financial sector. With real-time and lighting fast decision-making algorithms being available because of the above trifecta, risk associated with financial decision making can be drastically reduced. Machine economy comes with the advantages of reduced operational cost, high revenue, improved operational efficiency, value creation, risk mitigation, and increased transparency. 10. Penetration of information systems in every aspect of modern-day businesses have the companies scrambling for procuring and implementing blockchain technologies not only in finance but also in day-to-day business decision making as well. Blockchain is rapidly intertwining all aspects of business decision making with better connectivity of business activities within and outside the organizations. The above-discussed points indicate that crypto economics is here to stay for the long haul, but it is too early to predict its absolute success. In the next part of this chapter, we explore the concept of initial coin offerings (ICOs) which is fast disrupting the fintech environment, and without which our exploration into crypto economics will be incomplete.

2.

Initial coin offering (ICO)

ICOs are a method of raising capital for new business ventures through cryptocurrency and is the latest disruption in the fintech industry for raising capital. ICO is a concept similar to “reward crowdfunding” where the contributors to the initial funding of the venture, platform, or project are given some sort of reward, in this case digital tokens in a blockchain network. One should not mistake these tokens for a “share” like in an IPO. These tokens can be certain privileges, access to certain special services or some sharing of monetary benefits from the earnings. There are generally two types of ICOs, private and public. In a private ICO, the investor base is limited, for example, accredited investors, high net worth individuals, investment banks, etc., whereas a public ICO is open for investments from the public. The private ICOs are more popular because it attracts lesser regulatory concerns and is easy to float as compared to the public ICOs. Over the past few years, ICOs have gained a lot of popularity in developed markets as an alternative to traditional finance since there are fewer constraints in raising funds through cryptocurrency ICOs. Some of the successful ICOs are Ethereum (2014), IOTA (2015), NEO (2015–2016), Stratis (2016), and EOS (2017). Let us have a glimpse at some of the benefits of cryptocurrency ICOs: Benefits: 1. Limited Currency Risk: Since cryptocurrency operates via decentralized and distributed ledger system, therefore unlike fiat currency it is not subject to sovereign defaults, i.e., even if the government becomes unstable or central banks collapse, it will have no effect on the valuation of the cryptocurrency and the value of the fund raised. 2. No Regulation Required: Cryptocurrency runs under an unregulated system in most countries and therefore requires no regulatory clearance to raise funds. 3. No Transaction Fees: Since cryptocurrency is not subject to a regulator or bank, therefore there is no transaction fee associated with it. 4. Easy Access: Cryptocurrencies are not subject to geographical restrictions as they are mostly unregulated, and therefore, ICOs can attract a wider investor base for raising funding without differentiating between domestic and international funders.

Cryptoeconomics Chapter

19

351

5. Stability: Cryptocurrencies have the potential to provide a stable currency in an environment of frequent financial uncertainties worldwide. This can also result in a more stable environment for entrepreneurial funding. Though the benefits are promising and attractive, yet there are some limitations to the full acceptability of cryptocurrency as it is an emerging area with lots of technicalities which is difficult to comprehend with the continuous and frequent changes in the blockchain technology. Below are outlined some of the limitations of cryptocurrencies: Limitations: 1. Lack of Regulation and Accountability: It is a decentralized system, so the absence of regulators makes law enforcement a challenge. 2. No Consumer Protection: There is no insurance of customer assets against hacking. Also, if the customer loses his private key (password) there is no way to retrieve it since all participants are anonymous in the system and are only recognized by their public and private keys. Further, if the cryptocurrency of an individual is being managed by an agent on his behalf and unfortunately there is a mishap with the agent (e.g., the agent dies or goes missing), there is no way for the investor to recover his investment. 3. ICO Frauds: With cryptocurrency being the in-thing of the fintech industry, everyone wants a share of this pie, and this is exactly what the hackers are baiting unsuspecting investors into. Most investors lack complete knowledge of the ICO investments, and the risks associated with it. It is very easy to forge credentials in the virtual world and show that an ICO is backed by industry bigwigs such that it lures in unsuspecting investors. Since there is no legal recourse, the investment is a lost cause if the hackers have their way. 4. ICOs and Cryptocurrency Exchanges are not Registered Exchanges; Authenticity of the online cryptocurrency trading platforms can be difficult to establish as they are unregulated. Investors end up losing a lot of money by falling prey to hackers on these platforms who can extract all personal information of the investor and can easily impersonate the investor on the virtual platform. 5. Questionable Value of Tokens: The tokens received by investors in an ICO may be rendered useless if the venture fails. Often, these tokens can only be exchanged for goods and services offered by the token issuer and may not have the ability to be traded on exchanges. Thus, the worth of the token is contingent to the success of the project. 6. FOMO: The fear of missing out factor among investors can result in bad investment decisions by investors. In a hurry to join the bandwagon of cryptocurrency, investors may end up taking ill-informed decisions without comprehensively evaluating the ICO and not paying attention to the market fundamentals. With most of the governments not recognizing cryptocurrency as a legal tender for exchange of goods and services, ICOs face a challenging future. Though it will take time for all market participants to adopt cryptocurrency and blockchain technologies, the pace at which blockchain technology adoption is taking place is quite promising. ICOs do have the capacity to provide a stable entrepreneurial financing environment without all the roadblocks of traditional sources of finance. Therefore, we can look toward more deregulated technologies to shape up a parallel economic environment.

3. Future of blockchain As we have seen in our above discussion, blockchain technology is not limited to creation of cryptocurrency. It has multifarious applications. For example, blockchain can contribute to efficient business decision making and corporate governance by standardizing the sharing of information across all system participants. Blockchain networks also secure and maintain the data across all platforms in an organization enabling interoperability of decision-making algorithms across different platforms. Risk of miscommunication hacked information, data manipulation, etc., can be eliminated due to the presence of validation tools. Reduction of human intervention across all business activities will also reduce the errors in data due to human data entry. Besides business, blockchain is also paving the way for better healthcare systems by providing greater transparency of patient records. For example, smartwatches which enable real-time health monitoring of the wearer can help emergency services to reach the individual in time to save his life in case of any health-related emergencies. The data accumulated from the wearer can be analyzed in real time by customized blockchain applications using AI and IOT. Blockchain can thus provide customized health solutions to patients and improve the efficiency of the healthcare system. Smart agriculture is also a blockchain technology. Right from getting information about the best farming practices to establish a connect between farmers, wholesalers, processed food manufactures, and retailers can all be streamline by using blockchain technologies in supply chain management. This will drastically reduce the problem of worldwide food wastage by providing efficient supply chain networks.

352 SECTION

B Blockchain architecture and security

Blockchain is also making inroads into education by providing greater transparency of student records, verification of student credentials, storing of student certificates and diplomas securely in blockchain. It also provides less expensive means of peer-to-peer information sharing, and publication of ideas along with management of rights and protection of piracy of these ideas. With the above ideas, we have just scratched the surface of the potential that blockchain technologies hold for our future. With the above discussions taken into consideration regarding cryptocurrency and blockchain, it is safe to say that though the test of the true potential of blockchain will be revealed over time, for now we can only explore its application in the various fields of technology, medicine, management, and more with an optimistic view.

References [1] V. Zamfir, What Is Cryptoeconomics? [Online], 2015, Available at: https://youtu.be/9lw3s7iGUXQ?t¼58. (Accessed 2 October 2021). [2] S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System. [Online], 2008, Available at: https://bitcoin.org/bitcoin.pdf. (Accessed 8 August 2021). [3] L. Lamport, R. Shostak, M.C. Pease, The byzantine generals problem, ACM Trans. Program. Lang. Syst. 4 (1982) 382–401. [4] S. Voshmgir, Z. Michael, Foundations of Cryptoeconomic Systems, Institute for Cryptoeconomics/Interdisciplinary Research, 1, Vienna, 2020. WU Vienna University of Economics and Business, Vienna. [5] W.D.A.M. Hellman, New directions in cryptography, IEEE Trans. Inf. Theory 22 (6) (1976) 644–654. [6] D. Chaum, Computer Systems Established, Maintained, and Trusted by Mutually Suspicious Groups. [Online], 1982, Available at: https:// nakamotoinstitute.org/static/docs/computer-systems-by-mutually-suspicious-groups.pdf. (Accessed 26 August 2021). [7] S. Haber, W.S. Stornetta, How to time-stamp a digital document, J. Cryptol. 3 (2) (1991) 99–111. [8] A. Back, http://www.hashcash.org. [Online], 2002, Available at: http://www.hashcash.org/hashcash.pdf. (Accessed 26 August 2021). [9] H. Stevens, Hans Peter Luhn and the birth of the hashing algorithm, IEEE Spectr. 55 (2) (2018) 44–49. [10] R.C. Merkle, Secrecy, Authentication, and Public Key Systems, UMI Research Press, US, 1983. [11] V. Buterin, Introduction to Cryptoeconomics [Interview], 2017 (24 February 2017). [12] S. Davidson, P.D. Filippi, J. Potts, Economics of Blockchain. [Online], 2016, Available at: https://papers.ssrn.com/sol3/papers.cfm?abstract_ id¼2744751. (Accessed 8 October 2021). [13] H. Halaburda, G. Haeringer, J. Gans, N. Gandal, The Microeconomics of Cryptocurrencies. [Online], 2020, Available at: https://ssrn.com/ abstract¼3274331. (Accessed 8 October 2021). [14] J.V. Neumann, O. Morgenstern, Theory of Games and Economic Behaviour, Sixth ed., Princeton University Press, New Jersey, 1955.

Section C

Distributed computing

This page intentionally left blank

Chapter 20

Distributed databases and distributed operating systems for blockchain Deepa Pavithran, Charles Shibu, Munavwar Shaikh, and Enrico Angeles Abu Dhabi Polytechnic, Abu Dhabi, United Arab Emirates

1. Introduction Millions of people rely on World Wide Web (WWW) for reading news, email, health care, listening to music, online shopping, online education, etc. Information stored on different web servers can be accessed globally through web browsers which gives an illusion to the user that they are accessing information that is stored locally in their computer. The WWW represents a distributed system where users view it as a single resource. The internet is largely a worldwide distributed system, and the current computing environment is distributed. Distributing data and computations over multiple devices can achieve high availability and scalability. Distributed computing deals with all forms of computing, information access, and information exchange across multiple processing platforms connected by computer networks. A collection of multiple, logically interrelated databases located at the nodes of a distributed system is termed as distributed database. While it has the advantages of scalability, flexibility, reliability, and openness, it faces several challenges in terms of security and heterogeneity. Blockchain uses linked data structures that are managed in a decentralized way and operates in distributed environment. Blockchain can be a solution to the problem of trust in distributed systems. In blockchain, transactions are recorded in an immutable ledger and are maintained within a distributed network of mutually untrusting peers. A copy of the ledger is maintained in every peer. Transactions are validated by peer nodes through consensus protocols. This creates a trusted decentralized application where security is provided through cryptography. Hence, no parties in the blockchain can control the code or the data. Originally, blockchain was developed as a solution to the double-spending problem in cryptocurrency that can provide strong data integrity and a distributed trusted network. Every block is added to the blockchain upon block creation by the crypto miner and after complete validation. With the use of distributed computation, blockchain has eliminated the use of a centralized authority which usually exists within a generic network. The final block within a blockchain gets added by winning miner and the other blocks involved in the blockchain listen, synchronize, and confirm with the current state of the system. This update is usually done in real time within the distributed system to establish trust mechanism and propagate the consensus protocol between peers and immediate neighbor nodes to arrive at a common decision. Combining the ledger-based design of blockchain and distributed database makes a desirable blockchain-based database system. However, the distributed databases are designed for parallel processing but blockchain is a sequential data structure that is designed in a way to provide data integrity. The applications in distributed systems can be deployed by any node in the network. Hence, it can even be deployed by malicious entity so that application code is potentially untrusted. These differences make blockchain different from traditional distributed systems, and hence, it needs to incorporate security and ways to manage trust within the system.

2. Distributed system Large network infrastructures use distributed systems for parallelly processing the workloads of cloud computing servers and performing databases operations. This ensures that the tasks are fulfilled in a timely manner. The evolution of distributed systems is well known in the technological world since it has evolved over a considerable period. Distributed computing usually begins with a task such as streaming or rendering an object to create a finished compilation of work to be submitted. This task completion could also involve multiple iterations of subtasks eventually leading to a final completed product. These tasks and subtasks are handled by client computers and their peers rather than a Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00022-X Copyright © 2023 Elsevier Inc. All rights reserved.

355

356 SECTION

C Distributed computing

single-server rendered environment. This same principle could be found in blockchain-based distributed computing environment. Such environment does not have to rely only on selective nodes to execute a task but can propagate or exemplify the work to multiple nodes to accomplish the task within a selective period. Several models of distributed systems exist these days, but client-server-based architectural models being the most prominent ones. A client-server model includes a network of computers for interaction such as processing, storage, compilation, and job sharing. An example would be ISP Telecommunication networks where the data gets distributed between handsets, switching, and replicating systems in between, signal extenders, peer-to-peer networks, and numerous computers and routers all running software with a common viewpoint making it a perfect distributed system.

3.

Distributed database system

Distributed database system is a combination of computer network and database system aimed to deliver transparency data and faster computations to fulfill certain tasks in a timely manner. The data can be stored and retrieved from anywhere in the network. Collection of databases that are physically distributed across various sites within a network is termed as distributed database. The data may be in multiple computers located in the same physical location or may be dispersed over a network of devices. The data and files are organized in a structured way, logically interrelated and will be distributed across multiple sites. Data is accessed through a common interface. Even though the database is distributed across multiple sites, the end users feel it as if they are interacting with a single centralized database. A group of machines work in a synchronized way to provide the feel of a single centralized system. Even though this helps in sharing the load of the servers, there are many challenges in a distributed database. This includes handling deadlock, concurrency, data fragmentation, security, etc. Distributed database improves performance as the transactions can be processed on different machines. Distributed transaction is a database transaction and must have all four ACID (atomicity, consistency, isolation, durability) properties.

3.1 Rules of distributed database system Chris dates formulated 12 directives and a fundamental principle to describe distributed database system [1,2] . Rule 0—The fundamental principal: To the user, a distributed database should look exactly like a nondistributed database. Rule 1—Local autonomy: Local sites can be autonomous and independent while providing vital functions like security, concurrency control, backup, and recovery. Rule 2—Central site autonomy: There is no central site and no site in the network relies on a central site. Rule 3—Failure autonomy: Failure of a site does not affect the system. The system should work continuously even in case of node failure. Rule 4—Location autonomy (transparency): Data stored are transparent and end user should not know where the data is located physically or in which node. Rule 5—Fragmentation autonomy: Data fragmentation is crystal clear to the user, who perceives only one logical database. The user does not need to know the name of the database fragments to retrieve them. Rule 6—Replication autonomy: Multiple stored copies of relations and fragments will be stored at different sites and is transparent to user. Rule 7—Distributed query processing: Any node in the network should be able to execute the query and many nodes can respond to user’s query without the user being conscious of such contribution. Rule 8—Distributed transaction management: The transaction is executed transparently and a transaction may update data at numerous sites. Rule 9—Hardware independence: The distributed database system can run on any kind of hardware platform with all machines participating as equal partners where appropriate. Rule 10—Operating system independence: The distributed database system can run on any kind of operating system (e.g., Windows, Linux, MacOS, Android). Rule 11—Network independence: The distributed database should be capable of being implemented on any suitable network platform. Rule 12—Database independence: The system must support any vendor’s database product. That means the distributed database system should be able to work with different databases if they have the same interfaces.

Distributed databases Chapter

20

357

These rules lead to certain mandatory traits that effectively evaluate the nature of distributed systems with respect to their attributes and functionalities such as the following: l

l

l

l

l

l

Scalability: Scalability is nothing but the ability of the network to expand by committing more nodes and other computational units. Parallel processing: The nature of the constituents operating within the distributed system run in a parallel manner. This is usually achieved with effective clock synchronization and relative speeds to unify network synchronization. For example: Network Time Protocol (NTP) in a Microsoft Server environment. High availability: Within the peer-to-peer architecture when a node fails, the operations continue working since the computational task gets taken over by peer nodes for a smoother coherency. Transparency: The transparent essence of the system is expressed by the openness of the architecture, which is well known to the technological community, while the end user within the distributed system gets to see the whole operation as a single entity from work initiation till completion thereby resulting in a fulfilled product of the task. Heterogeneity: Inclusion of hardware, software, operating systems, and different assets of the diversified network infrastructure. Re-duplication: Re-duplication within the distributed system addresses message sharing, consistency, and redundant nature of assets within the organization and infrastructure [3].

4. Distributed ledger technology (DLT) being part of distributed systems 4.1 Understanding distributed ledgers Ledgers are primary form of economic transactions since ancient times using clay or papyrus tablet until the time of paper invention. The main purpose being recording contracts, bill payment proofs, contractual agreements, and amendment of services. With the advancement of computers and digital systems, the speed and convenience of contract execution improvised tremendously wherein technology included a decentralized authentication, cryptographic security, and respective tokens. Every bit of information in the transaction ledger gets encrypted and saved in a secure manner until further usage after decryption or signature-based authentication. When the information is entered to the database, it becomes uneditable and managed by the policies enforced within the infrastructure. While understanding ledgers, it is imperative to understand the concepts underpinning the terminology Digital Ledger Technology (DLT). DLT is a distributed system managed by several participants while the same is referred to as nodes in blockchain. The recorded events in every juncture are secured by cryptographic hashes. The recorded events also referred to as transactions grouped together in a chained manner, and hence, distributed ledgers are often referred to as blockchains.

4.2 Advantages of distributed ledgers Distributed ledgers are transparent in nature and more difficult to attack as compared to cyberattacks on centralized ledgers. For an attack on distributed ledger to be successful, a universal compromise of the registry system within the DLT is necessary which is nearly impossible. Distributed ledgers are equivalent hardened systems where the registries are usually immutable. Distributed ledgers run continuously, and periodic interruption is not necessary. It also overcomes operational difficulties improving speed of transaction execution, thereby reducing cost metrics. The flow of information is usually consistent allowing ease of digital audit on registry records and respective transactions. Hence, a reliable and inherent nonrepudiation factor gets established as default. Other significant advantages are: 1. 2. 3. 4.

Synchronized and accessible databases Synchronization between ledgers and participants Geographical distribution and registry access Default control over fraud and forgery protection

Practical application of distributed ledgers DLT can revolutionize the way of transactions concurrent with blockchain. A few practical applications are not limited to:

358 SECTION

1. 2. 3. 4. 5. 6.

C Distributed computing

Passport issuance and social security alignment with it Tax collections Tokens in entertainment industry Product-based network marketing Jewels and jewelry signatures on precious artifacts Licenses, social security benefits, property management, etc.

Although the underlying benefits of DLT are enormous, the technology is under development and there are concerns in the unification of adoption process across multiple fields due to the skeptical purview been built around the distributed systems.

5.

Blockchain and distributed system

A majority of current applications rely on a centralized cloud-based system. In the case of centralized systems, the infrastructure including storage and computation is managed by a single authority. However, there exist some business applications, where a decentralized and distributed approach offers multiple advantages. An example of such a business case is Walmart, the world’s largest retailer, uses Distributed Ledger Technology (DLT), to test for food safety. An efficient system for such kind of applications can be offered by DLT [4]. In a distributed model, storage and computations are shared between nodes within the distributed network. A blockchain is a distributed database of immutable records that are shared among participating entities. The record is a public ledger maintained within a distributed network of mutually untrusting peers. Every node in the network can access copy of the ledger and can execute the consensus protocol to validate transactions, group them into blocks, and build a hash chain over the blocks [5]. Each transaction in the public ledger is verified by the consensus of a majority of the participants in the system [5]. A blockchain not only allows to add new data to the database but also ensures that all the users on the network have exactly the same data. Thus, a blockchain is a distributed and decentralized linked data structure for data storage and retrieval which also ensures that the data is resistant to any modification. A blockchain is composed of a cryptographically linked chain of blocks of data. The transactions are recorded in units of blocks. Each transaction contains the receiver’s public key, hash of the previous transaction signed with the sender’s private key. Each block contains a record of recent transactions, a reference to the previous transaction and the answer for the mathematical puzzle. Miners validate the transaction and add the block to the blockchain after solving a mathematical puzzle. The mathematical puzzle is difficult to compute but easy to validate [6]. However, the immutability property is an emergent property of a Distributed Ledger System (DLS) and not an intrinsic property of a blockchain data structure. It is because the miners who have the majority of hashing power can accept a fake transaction and add to block or deny a legitimate transaction from adding to the ledger. In this case, a more adequate term would be Mutable-By-Hashing-Power [4].

5.1 Difference between distributed database and blockchain While blockchain is a distributed database that provides efficiency, transparency, and security, there are some differences between them. Trusted vs untrusted: In a blockchain, the nodes are untrusted, whereas in distributed database, nodes are trusted nodes. Blockchain uses consensus mechanism to provide trust among nodes; however, a distributed database is managed by a centralized authority. Figs. 1 and 2 provide the trust boundary in distributed database system and blockchain. Performance: The performance in blockchain is very less compared to distributed databases. Blockchains, such as Bitcoin, can process only 4.6 transactions per second, Fabric achieves a throughput of more than 3500 transactions per second with the scalability of over 100 peers, whereas the distributed NoSQL database can process over 50,000 operations per second [7]. Data fragmentation: Distributed database can store fragments of data in multiple nodes, whereas existing blockchain stores the entire data in multiple nodes. Data structure: The distributed database is a database that is spread across multiple nodes, whereas blockchain uses data structure and comprises blocks of data. Each block is linked to the previous blocks. Sequential order: Blockchain follows a sequential order of data, whereas distributed databases can do parallel processing.

Distributed databases Chapter

FIG. 1 Nodes in distributed database system.

FIG. 2 Nodes in blockchain.

20

359

360 SECTION

C Distributed computing

5.2 Drawbacks of distributed computing in blockchain environment Although we are witnessing the unprecedented growth of blockchain in the current years, there are notable setbacks in terms of distributed and decentralized computing issues, issues related to cryptographic algorithms and some primary concerns around the areas of cybersecurity [8]. The following are a few drawbacks of distributed computing in a blockchain environment. l

l

l

l

l

l

6.

Backup necessity is a major hurdle in a distributed environment. Node and blockchain data backup is required to maintain high availability of the transactions and the relevant synchronized calculations within the blockchain system. To ensure effective backup mechanism, higher computing power and highly dependable nodal connectivity is vital. Distributed Denial of Service (DDOS) attacks are some concerns too. DDOS attacks can deplete computing system’s resources, thereby making the system send erroneous requests and calculations. Application of security for each node individually is vital since the central authority is destabilized within any distributed environment while the peer-to-peer architecture in blockchain allows access to each node. Small blockchains usually contain relatively small number of nodes. These nodes are usually vulnerable and can be taken control off by hackers giving them access to majority of the blocks. Large blockchains maintain proof of work (PoW) within the distributed environment to overcome such issues to improve the trust mechanism within the blockchain. Examples are Ethereum and Bitcoin. The inherent issues associated with private key management persist in blockchain. The current blockchain users are held responsible for their own private key in terms of generation, relevant identification in transactions, and storage without the involvement of any external party for key management. Loss of private key makes the blockchain assets inaccessible entirely, and hence, the accountability remains with the users in maintaining their digital assets [9]. Blockchain adopts cryptographic algorithms such as ECC and RSA predominantly in their system. It is known to the blockchain community that some of these cryptographic implementations give rise to backdoors and other security vulnerabilities posing damage to the entire blockchain. In addition to this, with the advent of quantum computing deciphering asymmetric encryption schemes is expected to get much easier [9].

Distributed operating system and blockchain

A distributed operating system is one that runs on multiple independent CPUs, but for users, it looks like an ordinary centralized operating system. The use of multiple operating systems is invisible to the end user. Instead of a collection of distinct machines, the end user views the system as a “virtual uniprocessor.” In a distributed operating system, network resources are allocated in the most effective way and hide the distribution of resources with the user.

6.1 Distributed operating system for blockchain Distributed operating system for blockchain has its unique feature where the operating system uses blockchain as its predominant support. The operating system not only can run on hardware-based systems but also can make use of cloud-based platforms which eventually directs the accountability factor to the users. The operating system keeps track of all user commands and interactions from the platform of use, while authentication, execution, and authorization happen within the blockchain itself. The decentralized use of the blockchain operating system provides inherent security and privacy due to its distributed nature which makes it a popular choice to laud deregulated operating system. Some examples of blockchain operating systems to be considered are [10]: l l l l

Consensys Codefi (introduced in 2014) EOS (introduced in 2017) Overledger (introduced in 2015) LibertyOS (introduced in 2019)

Notable key advantages of distributed operating systems using blockchain are significant in multiple ways [10]: l

l

Consensys Codefi provides elasticity in creation and management of digital assets over the blockchain network acknowledging the decentralized platform. EOS provides significant advantage with ease of scalability of distributed database environments.

Distributed databases Chapter

l

l

20

361

Overledger is more popular compared to the formers by supporting enterprise OS with several other blockchains such as Hyperledger Fabric, Bitcoin, Ethereum, and Corda. Liberty OS which is the most recent supports Bitcoin, Ethereum, Monero, etc., ensuring privacy to the user while disabling tracking functionality.

6.2 Hyperledger fabric Fabric [11] is the first distributed operating system for the permissioned blockchain. It is an open-source system from the Hyperledger project regulated by the Linux Foundation. It is designed as a modular and extensible general-purpose blockchain that introduces a new architecture aiming at resiliency, flexibility, scalability, and confidentiality. While Bitcoin can process only 4.6 transactions per second, Fabric achieves a throughput of more than 3500 transactions per second with the scalability of over 100 peers. The majority of the public and permissioned blockchains use order-execute architecture which first orders the transaction and propagates to all peers and secondly, each peer executes the transactions sequentially. Fabric allows execution of applications across many nodes consistently, giving the impression of executing on a single node by creating a distributed blockchain. The distributed applications can be written in general-purpose programming languages and do not follow the order-execute design of standard blockchain architectures. It uses execute-order-validate blockchain architecture. The distributed application for Fabric consists of a smart contract, also called chaincode, and an endorsement policy. Chain codes are program code that runs during the execution phase, whereas endorsement policy is evaluated in the validation phase. Chaincode implements an application logic and can be written by an untrusted developer, whereas endorsement policies are written by designated administrators and cannot be created or modified by untrusted developers. System chaincodes are special chain codes for managing blockchain systems and its parameters, whereas endorsement policy acts as a static library for validating transactions. An endorsement policy uses a monotone logical expression on sets, such as “three out of five” or “(A ^ B) _C.” Custom endorsement policies may implement arbitrary logic [11]. Major cloud operating systems such as Oracle, IBM, and Microsoft offer (or announced) Hyperledger Fabric as “blockchain as a service.” Some of the use cases where Fabric can be deployed include food safety network, cloud service blockchain platforms for banking, and digital global shipping trade solutions. The real use cases where Fabric has been deployed include foreign exchange (FX) netting, enterprise asset management (EAM), and global cross-currency payments [11]. The primary purpose of Hyperledger system is the following [12]: 1. Provisioning every user to execute transactions within the blockchain platform due to the enhanced querying mechanism. 2. Allowing modular architecture in utilization of multiple modules simultaneously. 3. General ledger distribution management with optimum protection leading to the protection of digital keys and information from getting tampered. 4. Only authorized personnel are allowed to access and view sensitive information due to permissioned data scheme.

Architecture of fabric There are three types of nodes in fabric. 1. Client: Submits transaction proposal 2. Peers: Execute transaction proposal and validate transactions. 3. Ordering service nodes (OSN): Nodes that collectively form the ordering service. They do not participate in transaction execution or validation. Fabric has two types of peer nodes. A validating peer and nonvalidating peer. A validating peer is a node on the network that is responsible for validating the transaction. This includes running the consensus and maintaining the ledger. They run the consensus, validate the transactions, and maintain the ledger in the blockchain. A nonvalidating peer does not execute transactions, but may verify them, it is a node that functions as a proxy to connect clients to validating peers [13]. The architecture of Fabric includes three types of transactions as operations [13]: 1. Deploy transaction: Chaincode is installed and ready to be invoked 2. Invoke transaction: Execute the transaction, may read or write entries in its state, and indicate success or failure

362 SECTION

C Distributed computing

3. Query transaction: Returns an entry of the state directly from reading the peer’s persistent state; this may not ensure linearizability.

Working principle of fabric The step-by-step working principle of Fabric architecture is depicted in Fig. 3: Step 1: The requester (client) node submits a transaction proposal to the Fabric node. Step 2: The Fabric node validates the proposal to be sent to the ordering node. Step 3: The ordering node endorses the transaction with the authenticator or endorser node with the help of a Certification Authority or a Membership Service Provider (MSP). Step 4: The endorsed transaction block gets compared with all other committers in the network. Step 5: The final transaction entries are made in the ledger (blockchain or worldstate).

Transaction flow in fabric Hyperledger Fabric follows the execute-order-validate architecture. The transaction flow between the client and other nodes is depicted in Fig. 4 [14]. 1. Initiation of transaction: Client node signs and sends the transaction proposal to one or more of the endorser node for execution. A transaction proposal mainly includes the submitting client’s identity, the transaction payload, and identifier of the chaincode. 2. Execution of transaction: Upon receiving the request, the endorsers check for the authenticity of the client and execute the transaction and return back to the client in a proposal response. 3. Collection of endorsements and ordering requests: The client then collects all the proposal response from endorsers until they satisfy the endorsement policy in the chaincode. When the endorsement policy is satisfied, the client creates the transaction and passes it to the ordering service. The transaction contains the transaction payload, transaction metadata, and a set of endorsements. 4. Transaction validation and commit: Ordering service, atomically broadcast endorsements, and output hash chained sequence of blocks containing transactions. Transactions are grouped into blocks which help to improve the throughput. These blocks are then delivered to the peers for validation. In the validation phase, the endorsement policy evaluation and read-write conflict is checked for all transactions in the block. Finally, the block is appended to the ledger and the blockchain state is updated [11,14].

Endorsement policy An endorsement policy is used for transaction validation which uses a monotone logical expression consisting of the endorsers and endorsing organizations. Examples of endorsement policy are (Org1.peer AND Org2.peer), (Org1.peer

FIG. 3 Working principle of fabric architecture.

Distributed databases Chapter

20

363

FIG. 4 Transaction flow in Hyperledger Fabric [14].

OR Org2.peer), t-out-of-n organizations should endorse or an arbitrary combination of these [15]. Transactions are validated by checking the endorsement policy. It is a static library where only designated administrators can modify. It cannot be modified by an untrusted application developer [11]. An example of a combination of endorsement policy is [15]. Outof(2,0 Org1.member0 ,0 Org2.member0 ,0 Org3.member0 )) OR(AND(0 Org1.member0 ,0 Org2.member0 ), AND(0 Org2.member0 ,0 Org3.member0 ), AND(0 Org1.member0 ,0 Org3.member0 ))

Security in fabric Authentication and authorization of peers are done through public key certificates. Every peer needs to obtain an enrollment certificate from an enrollment Certification Authority (CA) to connect to the network. Authorized peers should acquire transaction certificates from transaction CA. Pseudonymous authorization is supported for the peers submitting transactions. Confidentiality is provided through symmetric encryption of transactions and states with a blockchain-specific key that is available to all peers with enrollment certificate [13].

Shortcoming of existing fabric architecture In Hyperledger Fabric, only a subset of nodes can execute the transactions. These nodes are determined by the endorsement policy. Allowing only a subset of nodes to execute the smart contract provides privacy to the smart contract and saves resources. However, since the endorsement policy and the endorsement on transaction response reveal the identity and the organization involved in the endorsement process, this may lead to certain attacks like DDoS (Distributed Denial of Service) and spam attack [15].

Difference between fabric and parallel database system Even though Fabric processes transactions in parallel, it differs from parallel database system in four ways [16]. 1. Fabric commits at the granularity of blocks instead of the granularity of transactions. 2. Fabric is distributed system, where the state is fully replicated among all nodes and the transaction takes place on all nodes. Parallel database systems are installed on a single node and divide the state across the nodes and transaction happens on a subset of nodes in the network

364 SECTION

C Distributed computing

TABLE 1 Difference between Fabric and parallel database system. Blockchain system (Fabric)

Parallel database system

Commits at the granularity of blocks

Commits at the granularity of transactions

State is fully replicated among all nodes

State is divided across the nodes

Single transaction takes place on multiple nodes

Single transaction is executed only once

Performance depends on consensus, cryptographic technique used, and network communication

Performance depends on low level components

3. In Fabric, a transaction is executed on multiple nodes. This helps to provide trust, whereas in parallel database system, a transaction is executed only once. 4. The performance of blockchain systems mostly depends on the underlying cryptographic techniques used, network communication, and consensus used to establish trust, whereas the performance of parallel database system depends on the low-level components such as locking mechanism for concurrency control. Table 1 summarizes the major difference between blockchain system (Fabric) and parallel database system.

7.

Conclusion

Blockchain is a decentralized linked data structure that provides transparency, data availability, and data integrity in an untrusted network. However, it follows a sequential order of data and has a low throughput. Distributed database is also a decentralized data structure that has high throughput in query processing, and provides transparency, efficient, and security. Blockchain can be considered as a subset of distributed database system and expanding this subset to include all the features of distributed systems can help to create secure, reliable, and fast processing applications.

References [1] C. Date, Twelve Rules for a Distributed Database, Computer World, 1987. [2] M.S. Rana, M.K. Sohel, M.S. Arman, Distributed database problems, approaches and solutions—a study, Int. J. Mach. Learn. Comput. 8 (5) (2018) 472–476, https://doi.org/10.18178/ijmlc.2018.8.5.731. [3] A. Belapurkar, A. Chakrabarti, H. Ponnapalli, N. Varadarajan, S. Padmanabhuni, S. Sundarrajan, Distributed Systems Security: Issues, Processes and Solutions, John Wiley & Sons, 2009. [4] D. Conte de Leon, A.Q. Stalick, A.A. Jillepalli, M.A. Haney, F.T. Sheldon, Blockchain: properties and misconceptions, Asia Pacific J. Innov. Entrep. 11 (3) (2017) 286–300, https://doi.org/10.1108/apjie-12-2017-034. [5] A. Stanciu, Blockchain based distributed control system for edge computing, in: Proc. - 2017 21st Int. Conf. Control Syst. Comput. CSCS 2017, 2017, pp. 667–671, https://doi.org/10.1109/CSCS.2017.102. [6] D. Pavithran, R. Thomas, A survey on analyzing bitcoin transactions, in: 2018 Fifth HCT Inf. Technol. Trends, 2018, November, pp. 227–231, https:// doi.org/10.1109/CTIT.2018.8649517. [7] P. Ruan, et al., Blockchains vs. distributed databases: dichotomy and fusion, in: Proc. ACM SIGMOD Int. Conf. Manag. Data, 2021, pp. 1504–1517, https://doi.org/10.1145/3448016.3452789. [8] D. Dasgupta, J.M. Shrein, K.D. Gupta, A survey of blockchain from security perspective, J. Bank. Financ. Technol. 3 (1) (2019) 1–17, https://doi.org/ 10.1007/s42786-018-00002-6. [9] F. Dai, Y. Shi, N. Meng, L. Wei, Z. Ye, From Bitcoin to cybersecurity: a comparative study of blockchain application and security issues, in: 2017 4th Int. Conf. Syst. Informatics, ICSAI 2017, 2017, pp. 975–979, https://doi.org/10.1109/ICSAI.2017.8248427. vol. 2018-January, no. 61471129. [10] T.K. Sharma, Blockchain Operating System: A Complete Overview, Blockchain Certifications, 30 March 2020 [Online]. Available: https://www. blockchain-council.org/blockchain/blockchain-operating-system-a-complete-overview/. (Accessed 25 February 2022). [11] E. Androulaki, et al., Hyperledger fabric, in: EuroSys ‘18: Thirteenth EuroSys Conference 2018, April 23–26, 2018, Porto, Portugal, 2018, pp. 1–15, https://doi.org/10.1145/3190508.3190538. [12] N. Shah, Blockchain for Business with Hyperledger Fabric: A Complete Guide to Enterprise Blockchain Implementation Using Hyperledger Fabric, BPB Publication, 2019. [13] C. Cachin, Architecture of the hyperledger blockchain fabric, in: Workshop on Distributed Cryptocurrencies and Consensus Ledgers, vol. 310 (4), 2016, July, pp. 1–4.

Distributed databases Chapter

20

365

[14] D. Ravi, S. Ramachandran, R. Vignesh, V.R. Falmari, M. Brindh, Privacy preserving transparent supply chain management through Hyperledger Fabric, Blockchain: Res. Appl. (2022) 100072. [15] J. Dharani, K. Sundarakantham, K. Singh, A privacy-preserving framework for endorsement process in Hyperledger fabric, Comput. Secur. (2022), 102637. [16] A. Sharma, F.M. Schuhknecht, D. Agrawal, J. Dittrich, Blurring the lines between blockchains and database systems: the case of hyperledger fabric, in: Proceedings of the 2019 International Conference on Management of Data, 2019, June, pp. 105–122.

This page intentionally left blank

Chapter 21

Demystifying blockchain adoption in financial sector—A critical analysis Shruti Singh and Anindita Chakraborty Institute of Management Studies, Banaras Hindu University, Varanasi, Uttar Pradesh, India

1. Background Blockchain technology seems to have penetrated and intensified its enormity of usage in practically every industry, and has given birth to a buzz-seeking prospect for businesses and service sector, ensuring security and building trust. Yet, some industries, such as the financial sector, are considering it as a disruptive technology that cannot be avoided and need to be reengineered and managed. Blockchain technology is a financial technology (FinTech) that was initially created for Bitcoin’s distributed ledgers [1]. Because of its decentralized structure and open-source standards, the technology has gained traction because it fits well into a wide range of businesses and applications. Emergence of FinTech can be marked as a transition from consumers to users of financial services, and in no time, it has become the most actively growing sector. For a long time, the Bitcoin craze eclipsed blockchain technology. However, in recent years, it has begun to draw its own attention and is quickly becoming a key component of the FinTech family [2]. FinTech is currently attracting academic and corporate attention. The Great Economic Depression (2008) has brought about drastic changes in the ways traditional financial players used to carry out their financial services [3]. In the last decade, especially postdemonetization, a noticeable difference has been witnessed from cash money funds to online wallets. For instance, according to Cryan [4], currency will be obsolete in 10 years. Services are now being more and more controlled by technological supervision as the technological growth has not left any sector around the world distant from its impact. Innovative technology and creativity are the critical factors to be considered for FinTech firms to enhance profitability, growth, and competitiveness. FinTech firms are always trying to develop and create new products and services by using innovative technology, blockchain being one of them. While blockchain is already playing a key part in financial innovations and is the backbone technology fueling the FinTech revolution, its primary use has been in the field of payments [5]. As a consequence of new developments in technology and business operations, as well as the constantly rising expectations of customers, payment instruments and payment systems have evolved and changed. Any payment system’s principal goal is to provide secure and smart transactions [6]. The blockchain is considered to be a disruptive technology with highly distinguished features, especially the eradication of third parties/intermediaries and removal of central authorities in any transactions. But it can never be assumed that this technology will be aloof from challenges and risks. Before moving to a blockchain-based system, there are still technological and regulatory hurdles to surmount. There is little question that blockchain technology will have enormous longterm significance, but it will take time to realize its full potential. “We won’t get there tomorrow, but we will get there,” said Masters [7] of the adoption of blockchain technology in the banking sector.

1.1 Existing perspective on blockchain Bitcoin brought blockchain technology to the world, and it was first confined to use as a cryptographic method for spreading Bitcoin and related crypto-currency transactions [8,9]. Blockchain is a technical innovation that has changed the world as we know it and will continue to do so. It permits transparent interactions between parties on a more trustworthy and secure network that distributes data access. Despite the fact that the technological components have been there for decades, blockchain offers a new, robust, and pervasive approach to data, transaction analytics, and networks. It has the potential to eliminate inefficiencies, decrease costs, free up money, boost confidence in the social fabric, and open up new business models Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00008-5 Copyright © 2023 Elsevier Inc. All rights reserved.

367

368 SECTION

C Distributed computing

[10]. It may also hasten the rise of the informal sector or even criminal elements in countries, undermining governments’ efforts to provide security and safety to their population. Blockchain’s pervasiveness has been acknowledged by the public and private sectors, as well as the academic research community, and it is seen as an essential element of the future. This finding prompted academics to suggest a slew of novel applications to take use of the new technology. These applications may be found in a variety of fields, including education, healthcare, FinTech, and smart grid. Surprisingly, enthusiasm in many of these applications has waned, and we now have just a handful of major blockchain uses [11]. We were able to determine that scholars’ interest in blockchain is steadily rising and accelerating since 2015. The following blockchain subtopics are somewhat successful quantitatively and are moderately anticipated to reach the production and adoption phase: Bitcoin, finance, healthcare, education, government and e-voting, smart grid.

1.2 Blockchain implementation in financial services Financial services have witnessed huge paradigm shift through the evolution of networked innovations. The development of internet, World Wide Web, intuited cross-connection among these services. Then, the paradigm saw a bludgeoning effect due to incorporation of cloud computing and Internet of Things. Many new services were identified and worked upon using these technologies and the sector witnessed an upthrust in its market. Firms and industries started identifying the need of incorporating these technologies into their system to be competitive in the market. Then, the fruition of blockchain in 2008 took place which was a solution for trust, information asymmetry, and the economics of tiny transactions without the onerous risk infrastructure and central middleman. Efanov and Roschin [12] identified three generations of blockchain development since 2008 (Fig. 1): i. Blockchain 1.0—Digital Currency ii. Blockchain 2.0—Digital Economy iii. Blockchain 3.0—Digital Society The blockchain is rewriting traditional corporate transaction notions, allowing for new value reconfiguration potential [13]. It has the potential to disrupt various sectors as its application is growing across industries. The financial services can integrate the blockchain applications to exploit its below mentioned features: l l l l

Increase the speed and lower the cost of syndicated loans by enabling direct syndication [14]; Improve regulatory compliance through automated, immediate record validation [15]; Reduce the cost of money remittance and currency exchange [14]; Develop self-executing contracts that reduce or eliminate the possibility of fraud or corruption [16];

FIG. 1 Networked innovation and evolution of blockchain technology.

Demystifying blockchain adoption in financial sector Chapter

l l l

21

369

Improve the rule of law in the transfer of property title [6]; Eliminate most of the costs and friction in the issuance and trading of securities such as equities and debt [14]; Allowing for the simpler establishment of self-insured risk pools would lower costs and enhance access to insurance markets [17].

2. Methodology A thorough review of the existing literature was conducted, including the use of key academic-based research databases. It involved analyzing numerous peer-reviewed research contributions, academic publications, and technical reports in order to discover connected advantages, opportunities, costs, and risks. It is vital to remember that the blockchain is still in its early stages of development, and the amount of scientific material available is limited, making it impossible to anticipate how the blockchain area will evolve. An attempt is made in this study to gauge how the people are responding toward this emerging trend. Google search volume index is used to identify whether the people are actually interested in this emerging trend of amalgamation of blockchain and financial services or not. Further through thorough review of existing applications and research, researcher tries to put forward key features of adaptability, usage, benefits, risks, and challenges of amalgamating blockchain and financial services. As a result, the study’s goal is to give a critical examination of how blockchain is genuinely impacting the financial sector.

3. Acceptability of blockchain in FinTech—Google search intensity (SVI) In the financial markets, blockchain has sparked a lot of curiosity and excitement. Why? Any financial transaction is built on trust and faith in the commitment to fulfill obligations [18]. The risk management infrastructure is meant to solve for trust and asymmetry in financial transactions across large portions of financial markets. According to the search volumes of Blockchain and Financial Technology shown below, both blockchain and financial technology had most of the search queries in the last 5 years. While blockchain was not very well recognized initially with the wave of Bitcoin, but as the popularity of Bitcoin started to fad off the blockchain gained recognition in many industries especially the financial services-based industry [19].

3.1 SVI of financial technology

Financial technology: (Worldwide) 120 100 80 60 40 20 0 22-05-2016

22-05-2017

22-05-2018

22-05-2019

22-05-2020

Source: Author’s Computation of Search query related to Financial Technology using Census Data

As evident from the data, this novel combination of finance and technology is gaining great public attention. This wave of information transformation is reshaping both the society and the industries by enhancing the trust and minimizing cost.

370 SECTION

C Distributed computing

3.2 SVI of blockchain technology

BLOCKCHAIN TECHNOLOGY: (Worldwide) 120 100 80 60 40 20 0 22-05-2016

22-05-2017

22-05-2018

22-05-2019

22-05-2020

Source: Author’s Computation of Search query related to Blockchain Technology using Census Data

The data clearly highlights that the novel phase of the technology is over and in no time it has gained esteemed recognition among the users. The technology has shown considerable adaptability in recent years as large number of industries is searching ways to incorporate the salient features of the technology into their operations.

3.3 Compared SVI’s of financial and blockchain technology

Compared SVI's 150 100 50 0 22-05-2016

22-05-2017

22-05-2018

BLOCKCHAIN TECHNOLOGY: (Worldwide)

22-05-2019

22-05-2020

Financial technology: (Worldwide)

Source: Author’s Computation of Cumulative Search query related to FinTech and Blockchain Technology using Census Data

The data clearly shows that blockchain technology is playing an important role, majorly a supporting role in the upliftment of the financial sector, and it is clear that in not more than a decade both the technologies in synchronization will take the sector to its boom.

4.

Finance sector with and without blockchain technology

The financial service sector, which is under a transition process to innovate its system due to severe competitions in today’s globalized economy, is said to lead the way with blockchain-related business innovations. Blockchain has been proposed as an innovative solution to areas such as clearing and settlement of financial assets, payment systems, smart contracts, operational risks in financial market, and so on [20]. The table below demonstrates some key characteristics which the blockchain technology has supplemented to the existing financial system (Table 1).

5.

Adaptability and usage of blockchain technology in financial services

By utilizing blockchain across a variety of financial services like UPI, GSTN, PM-JAY, and many more, blockchain has a huge latent to disrupt the financial sector. India has successfully built fundamental digital infrastructure intended to enable

Demystifying blockchain adoption in financial sector Chapter

21

371

TABLE 1 Comparison of traditional and blockchain built-in financial system. Characteristics of platform [5,21]

Traditional financial system

Blockchain built-in financial system [10,19,22]

Data object

Nonsequential data mapping

Sequential and chronological data mapping

Transaction structure

Transaction carried out through trusted central authority

No such central body/organization involved and can easily be carried out through new cryptographically secured ways, smart contracts being one of them

Information accessibility and immutability

Accessibility and extension limited to central authority

Information accessibility is high with proper tamper protection of the information shared

Data security

Comparatively low

Comparatively high

Timestamp

Took more time as the transactions went through cumbersome process

Takes relatively much less time to process the transactions

Efficiency

Low

High

Consensus determination

One central organization/authority

Can be public/private depending upon the chosen type of blockchain dimensions

Consensus process

Permissioned

Permissionless/permissioned

private sector apps to operate on top of it during the last decade, just like the government creates roads and sewage facilities in a city and private industry builds buildings. Blockchains are a new sort of network infrastructure (a mechanism to organize how information and value travels across the internet) that introduces distributed verifiability, auditability, and consensus to generate “trust” in networks [23]. Some of the most momentous attributes of blockchain technology that are urging the financial sector to amalgamate it into its system are:

5.1 Global payments and remittances Blockchain has streamlined payment and remittance processes, reducing settlement times and significantly reducing costs. It is now just a matter of less than a week times to send money across borders. Cross-border payments have been made accessible to general public and the cumbersome process of acceptance and rejection is no more a usual phenomenon. It allows: l l l l l

Fast and secure sales payments Quick and secure border payments Real-time agreement between central banks, commercial banks, and private banks KYC/AML digital data and transaction history, reduce fraud risk and enable real-time authentication Automatic control and auditing

5.2 Mortgage claims and processing Blockchain has streamlined banking and lending services, reducing counterparty risk, and decreasing issuance and settlement times. Traditionally, it took around 60–90 days to get the approval against the claims, but with blockchain technology incorporated in the process it is being achieved within a time span of 3–4 weeks. It allows: l l

l

l

Certified documents and KYC/AML data, reduce operating risk and enable real-time financial document validation Specified credit description and credit markets, which are quickly informed of the integration of user activity with allowed data across the network Automatic syndicate formation, transaction, and disbursement of capital and interest, cost reduction, delays and consolidation disputes Collaborative asset integration because digital production enables real-time asset management, tracking, and enforcement control

372 SECTION

C Distributed computing

5.3 Trade finance Blockchain has streamlined the entire trade finance lifecycle with increased security and efficiency. It can enable more transparent governance, decreased processing times, which initially was 90–120 days, lower wealth requirements and abridged risks of fraud, human error, and overall counterparty risk. It allows: l l l l

Verified credentials (for ex. bills and bill of lading) and KYC/AML data with real-time financial document verification Digital installation of assets enables faster deployment times Creating more efficient financial institutions with secure shared networks and computerized system The creation of a long-term financing vehicle for the full company life cycle, so eliminating the time-consuming practice of negotiating private financial vehicles at each step of the trade

5.4 Insurance claims Blockchain has securely streamlined data verification, claims processing, and disbursement, reducing processing time significantly. It can also help in reduction of fraud claims and wrong assessments. It allows: l l l l l

Authorized documents and KYC/AML data, reducing the risk of fraud and simplifying claims testing Automated claims processing using smart contracts Automatic payment contracts in the event of a risk Automatic payment of insurance premiums Token renewal markets to facilitate open-market policy enforcement, from traditional retailers and relationship-based programs

5.5 Regulatory compliance Blockchain has streamlined the complete process of maintaining the regulatory compliance as this compliance has become increasingly important in the commerce and finance space. It allows: l l

l

6.

Distinguished governance and compliance regulated by digital assets Extended processes that simplify data reporting, control regulatory oversight, reduce operational conflicts, and eliminate audit errors and other tasks—all in real time Establishment and enforcement of incentives to improve network governance

Benefits of integrating blockchain technology and financial services

With real-time tracking of transactions possible due to DLT, blockchain ensures no transaction repudiation or doublespending transaction. In the long term, it can reduce operating and maintenance expenses and reach clients at the edge of wireless rather than simply bank accounts. Some of the noteworthy aspects of integrating blockchain and financial services are grouped below: l

l

l

l

l

Instant settlement—With removal of intermediaries and third parties, blockchain makes the settlement process less cumbersome and it can manage huge settlements in much lesser response time than before. Programmable capabilities—With digitization of the financial services process and new innovations in the field such as smart bonds and smart contracts, automatically gets executed and maintained, as and when certain programmed terms are met. Digital payments—With financial inclusion booming, the economy is transitioning from cash money funds to ewallets. Economic benefits—Although a significant amount of money is necessary to integrate the technology into the system at first, in the long term, blockchain can reduce operating and maintenance expenses, which banks are aiming for, and reach clients at the edge of wireless rather than simply bank accounts. Eliminates error handling—With real-time tracking of transactions possible due to DLT, blockchain ensures no transaction repudiation or double-spending transaction.

Demystifying blockchain adoption in financial sector Chapter

21

373

7. Risks and challenges of incorporating blockchain technology in financial services Financial institutions must develop a transformation strategy to incorporate the technology into their existing systems or replace them with a digital ledger called a blockchain. Integrating traditional financial system to the mounting blockchain technology, embracing and upholding the technological advancement remains the main apprehension for the authorities. Some of the identified challenges involved in this amalgamation are listed below: l

l

l

l

l

Initial cost—The technological setup demands a large amount of initial cost because the technology is new and requires a lot of interventions and training. Adoption rate—Due to lesser familiarity and high initial cost, the adoption rate of the technology is still suffering. Not many industries or sectors are open to use it yet. Uncertain regulatory status—Blockchain can face hurdles in adoption by the financial institutions until the government regulations get settled. Integration concerns—Blockchain applications provide solutions that need significant adjustments or the entire replacement of existing systems. For effective change, financial institutions must develop a transformation strategy. Control and privacy—Although robust encryption exists for private blockchain, there are still cyber security problems that must be solved before the general public trusts a blockchain solution with their private data.

8. Critically demystifying blockchain adoption in financial sector The blockchain technology is promising and developing, but current understanding of the phenomena is inadequate, necessitating further study and investigation. Businesses and stakeholders are unsure how blockchain technology works and what it can do for long-term market growth [24]. As consumers and adopters become more interested in blockchain applications, it is critical to look into a number of challenges, including impact analysis of the blockchain on human life, corporate operations, and social activities, factors influencing blockchain adoption, a cost–benefit study of the technology’s adoption timetable, creating value, concerns about security and privacy, organizational preparedness and ease of use, transaction scale and economics, resource (re)alignment and organizational structure, development of strong standards, legal, compliance, regulatory structure and infrastructure management. It is vital to remember that the blockchain is still in its early stages of development, and the amount of scientific material available is limited, making it impossible to anticipate how the blockchain area will evolve [24]. Blockchain poses a variety of difficulties and possibilities for enterprises and end users, as well as new income streams and business models. There are worries regarding the technology’s infancy, as well as the hazards of early adoption and disruption of current industrial processes [25]. There is a dearth of proof on the advantages of blockchain technology, as well as clarity on how it is/will be controlled. Uncertainty about legislation, different noninteroperable implementations, and fragmentation are just a few of the issues that the sector is dealing with. For organizations that use technology, maintaining data security and privacy is also a big challenge [14]. However, for each key obstacle the significant efficiency gains and cost–benefits of incorporating blockchain in a sector could not be overlooked. The expansion of the blockchain ecosystem may lead to the development of novel business and economic models, such as new forms of company cooperation and crypto-currencies. It has the potential to empower users by giving them authority over their own data, and it has the potential to increase consumers’ trust in transactions [21]. The underlying financial system, blockchain technology, is transforming the accounting information system’s registration, verification, transparency, and trustworthiness. Previous studies have emphasized the advantages of blockchain technology for business and financial services, because all blockchain records are distributed over the network and cryptographically sealed, making them hard to falsify, edit, or remove.

9. Future agenda Due to the numerous applications in other fields, the scope of blockchain technology, which was first connected with the cryptocurrency Bitcoin, has grown. Its importance in the financial industry stems primarily from the fact that it lowers risks and the possibility of fraud, eliminates human error, boosts efficiency, and improves transparency and dependability. As a result, it is used in a variety of economic areas as a recording and management tool. Further study into existing and new research lines on blockchain technology for safe financial management might be done on a worldwide scale. Similarly, as this field of study evolves, new thoughts and methodologies emerge can be pondered upon like Credit Valuation Evaluation Mechanism, and Consolidate Financial Risk analysis. Moreover, the process of integration could be made reliable by auditing the authorization/authentication process and researchers can contribute to this area of research which would assist

374 SECTION

C Distributed computing

the policy-makers, financial institutions, and the incorporators in managing highly perilous process as it involves a major wealth of the nation.

10.

Conclusion

Blockchain is transforming the financial services industries by integrating it with technology and innovations. It is helping in reducing time and complexities, increasing automation, enhancing programmable capabilities, and strengthening security. FinTech has strengthened firms and industries toward adoption of a new disruptive technology like blockchain. The industry is witnessing clear transition from cash money to e-wallets, from manual handling to self-managed applications, from dependence on central authority to elimination of any third-party intermediaries and from a cumbersome transaction process to a streamlined sequential process with minimal hurdles. However, because to its novelty, the technology has significant ambiguities, posing hurdles in terms of integration and acceptance. The financial sector will have to look out for ways to reshape/manage their existing system with the upgraded technology and innovate the financial services so that the domain becomes more user-friendly and gains trust of users. Ensuring security and minimizing cost are identified as the two most critical factors that could instantiate the adoption rate of the technology in the sector. With proper integration of a nontechnological business (traditional finance) with a technological innovation (Blockchain), FinTech is assumed to reach great heights and it can be said that in decade time the sector will be at its boom.

References [1] O. Ali, M. Ally, Clutterbuck, Y. Dwivedi, The state of play of blockchain technology in the financial services sector: a systematic literature review, Int. J. Inf. Manag. 54 (July) (2020), 102199, https://doi.org/10.1016/j.ijinfomgt.2020.102199. [2] W.D. Du, S.L. Pan, D.E. Leidner, W. Ying, Affordances, experimentation and actualization of FinTech: a blockchain implementation study, J. Strateg. Inf. Syst. 28 (1) (2019) 50–65, https://doi.org/10.1016/j.jsis.2018.10.002. [3] F.E. Foldvary, The Depression of 2008, Gutenberg Press, 2007. https://doi.org/10.2139/ssrn.1103584. [4] J. Cryan, The Transformation of Finance. Fintech Davos World Economic Forum: Remarks at the World Economic Forum, Davos, Switzerland, 2016, Retrieved from: https://www.youtube.com/watch?v¼AsetntXCPRQ. [5] A. Tandon, P. Kaur, M. M€antym€aki, A. Dhir, Blockchain applications in management: a bibliometric analysis and literature review, Technol. Forecast. Soc. Chang. 166 (October 2020) (2021), https://doi.org/10.1016/j.techfore.2021.120649. [6] N. Kshetri, 1 Blockchain’s roles in meeting key supply chain management objectives, Int. J. Inf. Manag. 39 (December 2017) (2018) 80–89, https:// doi.org/10.1016/j.ijinfomgt.2017.12.005. [7] Masters, B. (2015). See http://tabbforum.com/videos/blythe-masters-on-the-significance-of-blockchain-the-financial-challenge-of-our-time. [8] A.K.M.N. Islam, M. M€antym€aki, M. Turunen, Why do blockchains split? An actor-network perspective on Bitcoin splits, Technol. Forecast. Soc. Chang. 148 (December 2018) (2019), 119743, https://doi.org/10.1016/j.techfore.2019.119743. [9] M. Monti, S. Rasmussen, RAIN: a bio-inspired communication and data storage infrastructure, Artif. Life 23 (4) (2017) 552–557, https://doi.org/ 10.1162/ARTL_a_00247. [10] D. Shrier, D. Sharma, A. Pentland, Blockchain & Financial Services: The Fifth Horizon of Networked Innovation, Massachusetts Institute of Technology, 2016, April, pp. 1–10. https://www.getsmarter.com/career-advice/wp-content/uploads/2017/07/mit_blockchain_and_fin_services_report. pdf. [11] S. Zeadally, J.B. Abdo, Blockchain: trends and future opportunities, Internet Technol. Lett. 2 (6) (2019) e130, https://doi.org/10.1002/itl2.130. [12] D. Efanov, P. Roschin, The all-pervasiveness of the blockchain technology, Proced. Comput. Sci. 123 (2018) 116–121, https://doi.org/10.1016/j. procs.2018.01.019. [13] Q.Q. Gan, R.Y.K. Lau, J. Hong, A critical review of blockchain applications to banking and finance: a qualitative thematic analysis approach, in: Technology Analysis and Strategic Management, 2021, https://doi.org/10.1080/09537325.2021.1979509. [14] M. Osmani, R. El-Haddadeh, N. Hindi, M. Janssen, V. Weerakkody, Blockchain for next generation services in banking and finance: cost, benefit, risk and opportunity analysis, J. Enterp. Inf. Manag. 34 (3) (2021) 884–899, https://doi.org/10.1108/JEIM-02-2020-0044. [15] Y. Chen, C. Bellavitis, Blockchain disruption and decentralized finance: the rise of decentralized business models, J. Bus. Ventur. Insights 13 (November 2019) (2020), e00151, https://doi.org/10.1016/j.jbvi.2019.e00151. [16] L.W. Cong, Z. He, Blockchain disruption and smart contracts, Rev. Financ. Stud. 32 (5) (2019) 1754–1797. [17] B. Notheisen, J.B. Cholewa, A.P. Shanmugam, Trading real-world assets on blockchain: an application of trust-free transaction systems in the market for lemons, Bus. Inf. Syst. Eng. 59 (6) (2017) 425–440, https://doi.org/10.1007/s12599-017-0499-8. [18] B. Notheisen, J.B. Cholewa, A.P. Shanmugam, M. Risius, K. Spohrer, A blockchain research framework: what we (don’t) know, where we go from here, and how we will get there, Bus. Inf. Syst. Eng. 59 (6) (2017) 425–440, https://doi.org/10.1007/s12599-017-0506-0. [19] L.A. Petrova, O.A. Kalachev, T.E. Kuznetzova, B.S. Saparova, Prospects for blockchain implementation in the financial sector, in: Advances in Economics, Business and Management Research (ICEMT), vol. 139, 2020, pp. 184–188, https://doi.org/10.2991/aebmr.k.200509.034. [20] M. Risius, K. Spohrer, A blockchain research framework: what we (don’t) know, where we go from here, and how we will get there, Bus. Inf. Syst. Eng. 59 (6) (2017) 385–409, https://doi.org/10.1007/s12599-017-0506-0.

Demystifying blockchain adoption in financial sector Chapter

21

375

[21] V. Chang, P. Baudier, H. Zhang, Q. Xu, J. Zhang, M. Arami, How Blockchain can impact financial services—the overview, challenges and recommendations from expert interviewees, Technol. Forecast. Soc. Chang. 158 (May) (2020), 120166, https://doi.org/10.1016/j.techfore.2020.120166. [22] A. Pal, C.K. Tiwari, A. Behl, Blockchain technology in financial services: a comprehensive review of the literature, J. Glob. Oper. Strateg. Sourc. 14 (1) (2021) 61–80, https://doi.org/10.1108/JGOSS-07-2020-0039. [23] N. Aayog, Blockchain—The India Strategy, 6, Blockchain—The India Strategy, 2020. [24] N. Upadhyay, Demystifying blockchain: a critical analysis of challenges, applications and opportunities, Int. J. Inf. Manag. 54 (March) (2020) 102120, https://doi.org/10.1016/j.ijinfomgt.2020.102120. [25] A. Deshpande, K. Stewart, L. Lepetit, S. Gunashekar, Understanding the landscape of distributed ledger technologies/blockchain: challenges, opportunities, and the prospects for standards, in: Understanding the Landscape of Distributed Ledger Technologies/Blockchain: Challenges, Opportunities, and the Prospects for Standards, May, 2020, https://doi.org/10.7249/rr2223.

Further reading H. Albayati, S.K. Kim, J.J. Rho, Accepting financial transactions using blockchain technology and cryptocurrency: a customer perspective approach, Technol. Soc. 62 (June) (2020), 101320, https://doi.org/10.1016/j.techsoc.2020.101320. C. Alexander, M. Dakos, A critical investigation of cryptocurrency data and analysis, Quant. Finance 20 (2) (2020) 173–188, https://doi.org/10.1080/ 14697688.2019.1641347. A.A. Amponsah, A.F. Adekoya, B.A. Weyori, Blockchain in insurance: exploratory analysis of prospects and threats, Int. J. Adv. Comput. Sci. Appl. 12 (1) (2021) 445–466, https://doi.org/10.14569/IJACSA.2021.0120153. B.W. Barnes III, B. Xiao, Organizational adoption of blockchain technology: an ecosystem perspective, in: Proceedings of the 2019 DIGIT Workshop, 2019. https://aisel.aisnet.org/digit2019. _ S. Bulbul, G. Ince, Blockchain-based framework for customer loyalty program, in: UBMK 2018—3rd International Conference on Computer Science and Engineering, 2018, pp. 342–346, https://doi.org/10.1109/UBMK.2018.8566642. M. Friedlmaier, A. Tumasjan, I.M. Welpe, Disrupting industries with blockchain: the industry, venture capital funding, and regional distribution of blockchain ventures, in: Proceedings of the Annual Hawaii International Conference on System Sciences, 2018–January, 2018, pp. 3517–3526, https://doi. org/10.24251/hicss.2018.445. P. Garg, B. Gupta, A.K. Chauhan, U. Sivarajah, S. Gupta, S. Modgil, Measuring the perceived benefits of implementing blockchain technology in the banking sector, Technol. Forecast. Soc. Chang. 163 (October 2020) (2021), 120407, https://doi.org/10.1016/j.techfore.2020.120407. Y. Guo, C. Liang, Blockchain application and outlook in the banking industry, Financ. Innov. 2 (1) (2016), https://doi.org/10.1186/s40854-016-0034-9. H. Hyv€arinen, M. Risius, G. Friis, A blockchain-based approach towards overcoming financial fraud in public sector services, in: Business and Information Systems Engineering, vol. 59 (6), 2017, pp. 441–456, https://doi.org/10.1007/s12599-017-0502-4. H. Kim, M. Laskowski, A perspective on blockchain smart contracts: reducing uncertainty and complexity in value exchange, in: 2017 26th International Conference on Computer Communications and Networks, ICCCN 2017, 2017, https://doi.org/10.1109/ICCCN.2017.8038512. M. Kulkarni, K. Patil, Block chain technology adoption for banking services-model based on technology-organization-environment theory, SSRN Electron. J. (2020) 1–11, https://doi.org/10.2139/ssrn.3563101. T. Laura Jutila, A. Laura Jutila, The Blockchain Technology and its Applications in the Financial Sector (Thesis), Aalto University School of Business, 2017, p. 26. B. Pani, Blockchain powered financial inclusion, Cognizant (2016) 1–11. http://pubdocs.worldbank.org/en/710961476811913780/Session-5C-PaniBaruri-Blockchain-Financial-Inclusion-Pani.pdf. M.M. Queiroz, S. Fosso Wamba, Blockchain adoption challenges in supply chain: an empirical investigation of the main drivers in India and the USA, Int. J. Inf. Manag. 46 (December 2018) (2019) 70–82, https://doi.org/10.1016/j.ijinfomgt.2018.11.021. M. Schlegel, L. Zavolokina, G. Schwabe, Blockchain technologies from the consumers’ perspective: what is there and why should who care? in: Proceedings of the Annual Hawaii International Conference on System Sciences, 2018-January, 2018, pp. 3477–3486, https://doi.org/10.24251/ hicss.2018.441. D. W€ orner, T. Von Bomhard, Y.P. Schreier, D. Bilgeri, The bitcoin ecosystem: disruption beyond financial services? in: 24th European conference on information systems, ECIS 2016, 2016. L. Zhao, The analysis of application, key issues and the future development trend of blockchain technology in the Insurance Industry, Am. J. Ind. Bus. Manag. 10 (02) (2020) 305–314, https://doi.org/10.4236/ajibm.2020.102019.

This page intentionally left blank

Chapter 22

e-Governance and blockchain-based data supply chain for used cars Gwang Seok Kima and Sam Goundarb a

Department of Information and Industrial Engineering, Yonsei University, Seoul, South Korea, b School of Science, Engineering and Technology, RMIT

University, Hanoi, Vietnam

1. Introduction Consumers of used cars often suffer from the purchasing disfavor of a defective vehicle, because used car dealers wish to hide information that can lower car price. Due to information asymmetry and moral hazard, lemon marketization has been underway in the used car market [1]. The characteristics of the used car market in Korea include online transactions, general trading complex, and certified used car sales method. With the developed Korean IT environment, more than 1 million used cars are registered on the Internet annually. Most of the big companies (dealers) are concentrating on B2B with the online trading platform due to government regulations and have yet to enter the B2C. The trading complex is a representative market for used car transactions where customers visit and buy, including trading companies, maintenance companies, and financial companies. Small- and mid-sized dealers are selling used cars directly to visiting customers in trading complex or offline shops. Certified used car sales method is to assure the quality for a certain period by imported car brands likes BMW, Mercedes, and Korean financial companies since 2005. Such systems and efforts could not completely resolve the asymmetry of information in the used car market. In Korea, consumer damage in the used car market was mainly caused by poor performance (45.7%), lack of accident information (17.7%), and fraud of mileage (5.5%) [2]. In Europe, mileage fraud is currently affecting up to 30% of the used cars, costing the consumers approximately 5.6–9.6 billion Euro per year [3]. Even though the types of damages are different in each country, a lack of consumer confidence has rippled out across the used car market regardless of country. According to Casinoa et al. [4], “blockchains introduced serious disruptions to the traditional business processes since the applications and transactions, which needed centralized architectures or trusted third parties to verify them, can now operate in a decentralized way with the same level of certainty.” A blockchain can be considered a distributed database that is organized as a list of ordered blocks, where the committed blocks are immutable. The introduction of blockchain technology is expected to recover customers’ confidence in the used car market. Blockchain studies on used cars can be roughly classified into new platform development and field validation by proof of concept (PoC). The new platform development drives to change the whole business process by developing new platform, process, and architecture. It is mainly performed by research groups and emphasizes necessary parts of process change and technology development in the future. For example, previous study presented a system to share information by digitizing an existing paper-based car log book and applying a blockchain [5]. They proposed blockchain-backed vehicle data and processed ledger framework to digitize the vehicles’ life cycle over a consortium. On the other hand, the field validation drives to apply blockchain as a new service method linking with existing business processes. It is mainly performed by the existing companies which try to use blockchain to solve the problems faced in the market. For example, Group Renault, Microsoft, and VeChain attempted to apply blockchain technology to secure the transparency of vehicle mileage data in 2017. DOVU and BMW created a pilot program to track mileage data and preserve the resale value of leased and fleet vehicles using cryptocurrency as an incentive for consumers in 2018. Therefore, the field validation focuses on the limitations of practical application and confirmation of possible improvement. In particular, it is affected by the existing market, operator, and IT readiness. Due to these characteristics, the results and obstacles can be different depending on European, American, and Korean regulations and market

Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00015-2 Copyright © 2023 Elsevier Inc. All rights reserved.

377

378 SECTION

C Distributed computing

environments. The PoC refers to a demonstration to verify that certain concepts or theories have the potential for real-world application. Although previous study addressed new development, it digitized paper-based used car log and proposed a new blockchain framework for European B2C used car market [5,6]. This study is a field validation for Korean OEM who is in the used car business to B2B wholesale and wants to expand the business to B2C retail. The used car logs are digitized through the IT system, and the process is standardized already. Customers can pay to access the information of car accidents from insurance companies, but the data of the repair and maintenance centers are not accessible to them. Benefits of applying blockchain in the used car market and the barriers against the existing business environment were analyzed. The contributions of this chapter are twofold: (1) proposition of the specific blockchain platform, customized smart contacts, and blockchain architecture for the used car transaction, and (2) analysis of benefits and barriers to applying the blockchain in the existing used car market. Application is carried out on a formalized Korean company which is to expand B2B business to B2C. The remainder of this chapter is organized with the necessary steps to design and perform field validation for the used car business as follows. Section 2 reviews the overall studies of blockchain and specific studies on application cases. Section 3 describes the research methods of the blockchain in the used car business. Section 4 discusses the lessons learned and challenges to apply blockchain in the automobile supply chain. Finally, Section 5 concludes with the limitations and future research.

2.

Literature review

Applying a blockchain to used car transactions is to take advantage of the core concepts of traceability and information sharing. In this study, we analyzed the application case, processes, and technologies of blockchain that assures traceability in the supply chain. According to Kshetri [7], “blockchain is a disruptive technology that can change existing market orders and is likely to affect key management objectives such as cost, quality, speed, dependability, risk reduction, sustainability and flexibility.” Blockchain was first introduced to the financial transaction market where decoding is essential for the safety of transactions and has been gradually spreading to other areas [8,9]. Although “blockchain technology is commonly considered disruptive in many regards, there is a lack of understanding where and how it is effectively applicable and where it induces mentionable practical effects.” Surveys on the applications of blockchain technology in different fields were conducted [10]. Previous studies predominantly focused on the technological perspective of blockchain designs and features, but they neglected application, value creation, and governance [11]. It is necessary to specify the improving points in the target business area in advance in order to maximize the effect of the application of the blockchain. Harvard business review proposed a stepwise approach to the application areas of the entire supply chain, including single-use application level, localized application level, substitute application level, and transformative applications stage [12]. A recent study on blockchain expanded the application area to operation and supply chain management (SCM) [7,13,14]. Moreover, a recent review of blockchain identified empirical studies using the survey method approach. It adds to the scarcity of studies on blockchain applications that use practical approaches, including survey [15]. “Different from the researches focusing on specific applications of blockchain technology in a certain field, studies devote to capturing the attitudes of investors regarding different risk criteria in blockchain technology investment decision making” [16]. Deloitte supply chain professionals identified four key supply chain pain points—traceability, compliance, flexibility, and stakeholder management—that clients are experiencing across the globe. Blockchain can be the enabler to allow organizations to more effectively tackle these problems, with its capabilities of audibility, immutability, smart contracts, and disintermediation [17]. For example, Walmart used blockchain to keep track of its pork, which sourced from China. The blockchain recorded the country of origin, processing procedures, storage, and the date of sale of each piece of meat [18,19]. Similarly, Unilever, Nestle, Tyson, and Dole also used blockchain for similar purposes [20]. The previous study proposed new architecture and process to apply blockchains to the used car market [5]. To secure traceability for fraud mileage and rolling wreck, they formed a stakeholder consortium over the car life cycle and proposed a leger framework for data on the blockchain and used car transaction process, respectively. The study discussed practical lessons learned from the filed validation to implement the proposed new blockchain architecture. Blockchain improves inter-organizational business processes because it can execute without the intervention of any central party that serves as the single point of trust (and failure). In 1994, Szabo introduced a new concept that the inclusion of smart contracts in the implementation of blockchain will enable faster and more effective transactions between users. He defined smart contract as a computerized transaction protocol that executes the terms of a contract [21]. Szabo also

e-Governance and blockchain-based data supply chain Chapter

22

379

suggested that the clauses of contracts could be transferred to code to reduce the need for intermediaries in transactions between parties. Thus, transactions can be executed independently and automatically in a prescribed manner on every node in the network. Smart contact is an actual trigger that changes business processes and is structured differently depending on the characteristics of the business [22]. A design methodology for a smart contract, which enables the development of different use cases using blockchain technology, was proposed [23]. Detailed state finite functions and processes were addressed for a specific use case, providing contributions to the real-estate field, including smart contract structure and design procedure. Compared to existing business process management (BPM), Mendling et al. [8] outlined the challenges and opportunities of blockchain-based BPM in terms of strategy, governance, IT, people, and culture. Platform is one of the core technologies for the applications of blockchains. There are different types of blockchain platforms, depending on the managed data, data availability, and actions performed by the user. The types of blockchain platform include public permissionless, consortium (public permissioned), and private. The difference is explained based on the technologies and applications in business [24]. All data in the public permissionless (often called public) blockchain are accessible and visible to the public. Well-known examples include Bitcoin, Ethereum, and Litecoin [9,25,26]. The consortium-type blockchain enables only a selected group of nodes to participate in the distributed consensus process. A private blockchain only allows chosen nodes to join the network within the company. It is, therefore, a distributed yet centralized network [27]. HyperLedger Fabric is an example that only supports private and consortium blockchain networks and aims to apply in finance, IoT, logistics, manufacturing, and technology industries [28,29]. Linux camp’s HyperLedger is competing with IBM’s Ethereum in the market for business expansion [25]. Architecture can be considered as another core technology for the applications of blockchains. Blockchain architectures have not yet been standardized [30]. The six-layered blockchain architecture that is classified by the ecosystem was proposed [23]. Three-layered architecture including such functions as management, data processing, and blockchain operation was proposed [31]. The architecture and the different mechanisms involved in blockchain technology were reviewed [27]. Taxonomy “to classify and compare blockchains and blockchain-based systems to assist with the architectural considerations about the performance and quality attributes” was stated [32]. Meanwhile, the emerging blockchain technology to propose a new model architecture called OriginChain of three technical layers was leveraged [33]. Microsoft Azure introduced a blockchain PoC in 2017. Microsoft reported that customers and partners commonly estimate that developing a blockchain PoC will take 8–12 weeks and cost as much as about $300,000. However, “if a framework is given, customers and partners can concentrate on creating truly innovative applications that demonstrate the potential of the blockchain and spend less time and resources on integrating tasks that are required to get a primary PoC up and running.” There have been several PoC projects on a trial basis. HyperDirectory project is one of the blockchain-based and highly auditable access management solutions (directory service) for global telecom operator T-mobile and Intel. “Colt Technology Services and PCCW Global, the international operating division of HKT, have collaborated with Clear, a blockchain start-up company, to demonstrate that inter-carrier settlement times can be reduced from hours to minutes by blockchain technology. IBM partnered with Deutsche Bank and HSBC to implement the Know-Your-Customer (KYC) project.” Financial messaging service SWIFT has announced a new PoC to reduce the operational costs of cross-border payments. Insurwave, a joint venture between Earnest Young and Guardtime, leveraged blockchain and smart contracts to automate insurance in the marine industry, and so on.

3. Research process In this chapter, we followed the studies proposed and discussed in the previous research and expanded the research to reflect the domain characteristics of the used car business. First of all, we chose the target sector of study among the automotive supply chain. The business case is of expanding the used car business from existing B2B to B2C. Considering the Korean business environment, we drove essential questions and analyzed appropriate technologies in the field validation, including the consortium-type blockchain, two-level smart contract, and layered architecture.

3.1 Targeting application area The areas are usually recommended in which the business process can be improved through the transparency and traceability and in which the return on investment (ROI) can be improved through blockchain application.

380 SECTION

C Distributed computing

FIG. 1 Automobile supply chain and lifecycle.

A good example of transparency and traceability is Amazon’s food traceability. According to O’Neal [34], “it is expected that the Walmart China’s traceability system will see traceable fresh meat account for 50% of the total sales of packaged fresh meat, traceable vegetables will account for 40% of the total sales of packaged vegetables, traceable seafood will account for 12.5% of the total sales of seafood by the end of 2020.” IBM and Musk’s digitizing-global-trade project is a good example of ROI. Here is another example, by [35], “the cost of global trade is estimated at $1.8 trillion annually with potential savings from more efficient process of 10%. The cost and size of the world’s trading ecosystems continues to grow in complexity.” For the application of blockchain in automobile supply chain, this chapter considered the need for horizontal information sharing among various stakeholders and the acceptability of the organization. The SCM process in the automotive business is a complicated and vast one which flows 20,000–30,000 components of a car. The automobile supply chain is composed of the supplier, manufacturing factories, sales dealers, and backend car life areas as shown in Fig. 1. The overall process of car life is composed of part punching, R&D, manufacturing, testing, shipment and logistics, sales and financing, car driving, after service (A/S), used car transaction, and disposal and recycling. In the automobile supply chain, except for shipment, purchasing, production, and sales are primarily driven by Original Equipment Manufacturer (OEM), while the involvement of external stakeholders is minimized. In general, the information is carried out under the OEM-led SCM. However, in the supply chain, the A/S, used car, disposal, and recycling areas after the sale are where several external stakeholders are involved. Therefore, these are areas where blockchain application effects can be expected through horizontal information sharing for safe transactions. The acceptability of an organization should take into account the emotional aspects of its members. In terms of the organization, it is easy to accept emotionally because they are perceived as a new business area rather than requiring cost reduction and driving productivity, which the organization is tired. In this study, the company targets the used car business areas and intends to push for new business expansion internally, and the used car market also needs a new approach to secure traceability of the product.

3.2 Essential questions Most of the successful Korean companies in SCM are equipped with IT systems. Used car logs are digitized, and the transaction process is almost standardized in the market. The application of blockchain will cause changes in the existing IT systems and business processes across the company. Duplicable investments and additional jobs will be inevitable for blockchain application in the short term. The blockchain application team will face resistance from IT operators and users through redundant tasks. Blockchain allows suppliers to share information peer to peer without the need for a trusted authority of OEM, which has strong control power in collecting and sharing information with suppliers. Therefore, the weakened supply chain control due to blockchain application became an issue of concern. Moreover, the stakeholders participating in the consortium are worried that they will be disadvantaged by the disclosure of potentially sensitive information. When applying the blockchain, the following questions will likely be asked by internal and external stakeholders.

e-Governance and blockchain-based data supply chain Chapter

22

381

CEO: How much will the company get direct profits from investing blockchain? IT operator and user: What are extra or new works when blockchain is adopted? IT system: How do existing IT systems secure connectivity with blockchain? Consortium: What does blockchain cause changes in governance? We will give the best answers to these questions by learning from the filed validation. Through further discussions on facing issues, the final decision on the blockchain application will be made.

3.3 Research method Korean Vehicle Logistics and Shipment Company wants to expand its B2B used car business to the B2C market. This study analyzed the processes of the used car business, designs architecture, and selects appropriate blockchain platform necessary to identify the technical feasibility and process adaptability. Why did the company plan the PoC for the blockchain application? Usually companies have an internal rule that PoC should be applied when new technology introduction and new system have to be linked to other systems. They should evaluate the feasibility of new technology, adaptability of an existing process, and interoperability with other systems. The data for the evaluation were modeled and vehicles were classified into four cases to consider the real situation as follows: vehicles that have historical repair records due to car accidents, vehicles that received A/S without any accident, vehicles that postponed fines due to traffic violations and paid penalties, and vehicles that had changed owners more than once. Personal data or any other sensitive information are excluded to avoid privacy and legal problems. In the used car business sector, it is desirable to apply a consortium blockchain platform with stakeholders like the National Police Agency, the insurance companies, A/S car centers, and dealers. These stakeholders have established their own systems to manage car and customer information for the transparency in the used car market and are the groups that should become members of a consortium when introducing blockchain. There are several consortium blockchain platforms, including R3, Ripple, Ethereum, HyperLedger, and so on. This study adopted the HyperLedger platform because it is a universally applicable and configurable technology for consortium blockchain. How this study differentiates from previous studies [5] in regards to the blockchain application in used car transactions are summarized, as shown in Table 1. First, the research objectives and the management methods of used car data are different. This study is an extension of the existing process, rather than a new process development with digitizing. The dealer becomes the subject of governance that manages the system, data, and access control in this study. If other organizations become the governor, consensus between stakeholders is unlikely to be achieved in terms of business security management. The target of traceability is not limited to the only car but expands up to the components and driving histories in this study. This causes a difference in the composition of the smart contract. Both studies apply the consortium platform and the PoC approach. The internal blockchain execution team formed and draws vital points to improve the process of used car transaction for 2 months for this field validation.

TABLE 1 Analysis of difference in studies. Classification

Previous study

This study

Object

New development

Field validation

Data management

Paper-based car log book

IT-based car log

Business method

B2C

B2B ! B2C

Data governor

Not identified

Dealer

Object of traceability

Vehicle history

Vehicle and parts history

Approach and platform

Consortium platform for PoC

Research team

Multidisciplinary team

Internal working-level staff

382 SECTION

4.

C Distributed computing

Implementation of field validation

4.1 Business case This chapter aims to analyze the feasibility of applying blockchain to the case of expanding the existing B2B-based used car transactions of OEMs to B2C. Used car transactions in Korea are divided into B2B transactions between OEMs and large used car dealers, and B2C transactions between dealers and customers. Recently, OEMs are focusing on B2B transactions to expand their business to B2C transactions and are interested in applying blockchain as a way to secure trust in used car transactions. Most Korean OEMs operate A/S centers and directly manage vehicle customers, parts replacement, and repair information. Through the blockchain platform, it is possible to share repair and maintenance information from A/S centers which are operated by OEM. Customers can access the information of car accident from insurance companies at a cost, but the data through the repair and maintenance centers are not allowed to the customers. OEM expects that sharing information of A/S centers will be the core competence for the B2C expansion. The warranty for OEM cars is maintained usually for about 3 years to guarantee quality and A/S cost. OEM will collect the A/S and disabled parts information from A/S centers for cost settlement between dealer and OEM. However, most of the information that arises during these periods is attributable to OEMs. Fig. 2 illustrates the physical task flow and the information flow for used car transactions. As shown in Fig. 2, it is not possible to find the path to transfer A/S information in used car transactions. During the used car trading process, the core trust-building task happens in “Customization and Renewal,” and most of the information is manipulated in this station. In the B2B market, transactions take place between selected companies with long-term relationships, and it is controllable even if problems are discovered. However, B2C’s “Customization and Renewal” task is where it is hard to deal with problems once happened. In case of actual used car transactions, insurance information related to car accidents or traffic violations can be found by customers on the “Vehicle Identification” task, but only information about car accidents or traffic violations is limited. The specific processes are needed to provide traceability and transparent information to customers to expand to B2C.

4.2 Two-level smart contract Previous studies focused on information traceability of vehicle units. In this study, we secured traceability of vehicle and parts to ensure transparency in used car transactions. The smart contract specifies the process changes in the used car transaction. Using smart contracts is an important method to remove intermediaries and simplify/reform the process to enhance the traceability of the product. In order to assure the completeness of contract for used car transaction, there should be a ledge that shows the changes of ownership of the vehicle and a ledge that records the status of the vehicle components and the driving history of the vehicle. Therefore, the contract should consist of a master contract and subcontract. The master contract identifies the general terms and conditions of a used car trade, while the subcontract details the changes and activities in the used car including VIN (vehicle identification number), car type, car option, repairing parts, accidents, violation fines, and details of the car’s activities (Fig. 3).

FIG. 2 Used car transaction process (B2B and B2C).

e-Governance and blockchain-based data supply chain Chapter

22

383

FIG. 3 Illustration of master and subcontract in a used car transaction.

FIG. 4 Process improvement with blockchain.

4.3 Process design In Korea, used car transaction systems follow a standard used car transaction procedure. The used car transaction process is divided into B2B and B2C, with specific changes in procedure as follows. In the beginning, consumers who wish to participate in used car transactions register as a user through the “Auction Request” task, which is recognized as an authorized subscriber within the blockchain through the “User Permission” process. Blockchain allows subscribers to explore the terms of transactions and used car status. Specific information is contained in a block composed of master contract and subcontracts. The consortium of OEM, Insurance, and the National Police Agency provides information on the car life cycle. The changes in these procedures allow used car buyers to look information at a glance such as mileage, parts repair and accident history, unpaid taxes, and stolen vehicles throughout the life cycle. Blockchain will be used as a venue for sharing information among authorized subscribers in the used car market. The changes in information-sharing procedures through the application of blockchain are described in Fig. 4.

4.4 Consortium blockchain platform As stated by Dib et al. [30], “general characteristics of a consortium blockchain are applicable to highly regulated business (known identities, legal standards, etc.), efficient transactions throughput transactions without fees, infrastructure rules are easier to manage, and better protection against external disturbances.”

384 SECTION

C Distributed computing

The reason for applying the consortium platform is to limit the sharing of information owned by existing operators. Major companies with the vested interests of the business want to maintain the governance of information and business operations even if blockchain is applied. Consortium blockchain is preferred as a way to guarantee the vested interests of operators. In the field validation, stakeholders engaged in used car transactions are composed of the OEM, the insurance company, the National Police Agency, and A/S centers. Also, users for used car purchases and information inquiries must go through formal access procedures to access the consortium blockchain.

4.5 Layered architecture Blockchain architectures have not yet been standardized, and different layers of architecture are mentioned in the previous study. Technical layers of blockchain architecture are reviewed and summarized best practice as three layers: blockchain layer which is hardcoded into the blockchain protocol itself, smart contract layer which is coded into the smart contract itself, and application layer which is coded into the website and backend management processes [27]. In this chapter, we constructed the three-layered architecture that is composed of an administration layer, DB layer, and blockchain layer considering the technical feature and efficiency of system management and operation. The structure of the applying blockchain is described in Fig. 5. The application layer is the portal system of an internal and external chain, which serves as a user interface for signing up, updating, and verifying the information. The DB layer connects the four DBs to integrate information of used car inventory, A/S history, insurance, and traffic violation information that can be shared. The blockchain layer consists of the network and the administration system, and it operates the back office for subscriber permission control and smart contract registry management. The nodes that make up the blockchain were configured as the three servers to satisfy the basic network structure of the blockchain.

FIG. 5 Layered blockchain architecture for used car transaction.

e-Governance and blockchain-based data supply chain Chapter

22

385

5. Lessons learned and challenges Now the development of blockchain technologies is in its early stage, and new trials and versions will be arising continuously. The current technical limitations must be observed until the emergence of new technologies to resolve the issues. At this point, it is important to expand the application case at the same time as developing the technology. The blockchain is no more a technical matter rather than an application matter. It is time to discover different application cases and share the learning effects that are learned through these processes to expand the blockchain. This study focused on the field validation study, unlike the previous new platform development study. Therefore, the key point is how to apply the blockchain to the existing process rather than presenting the new blockchain platform. There is a difference in that the application environment is not a paper-based used car log but is already digitized, and the process is standardized. By applying the blockchain to the used car market, we have found the following three benefits. First, the historical records of a used car can be surely managed throughout the car life cycle. From the moment that a consumer buys a car, records such as vehicle inspection, accident and damage, fine not paid, part changes, ownership change, and driving mileage are managed with certainty. Second, it is possible to prevent fraudulent sales. A customer can identify the difference between the actual price and the advertisement price from used car sales system. It can block false-price information on the Internet or false-product information that tempts customers. Third, the customer can evaluate a dealer’s credibility. The system can evaluate the credibility of dealers by checking the history of the cars that have been sold in the meantime. If the coin is issued as an incentive for valuation, it can be very voluntary to evaluate the dealer’s credibility from the customer and help to construct a healthy used car market. In the course of this research, we found that business environmental barriers are more important than technical ones. The challenges will be answered with strategies to overcome them. Based on the finding, the four barriers to be noticed are as follows. First, it is difficult to generate economic profit in the short term as a blockchain investor. The question of “how much the company will get direct profits from investing blockchain” is concerned. Most of the blockchain-applying effects are from the digitization of the paper-based data and changing the multistep of manual process to automatic IT processing. In the case of Maersk and IBM’s blockchain application in global shipment, the expected effects were caused by digitizing the process. In this study, expected cost reduction, which was preestimated, is not acquired, because the data are already digitized and the process is standardized with the IT system. However, most expecting effects of blockchain occur in terms of quality of work: information sharing, tight security, traceability, transparency of the market, and so on. It is a difficult situation to explain to a nonprofessional CEO the economic effects or to suggest visible changes in appearance. Therefore, CEOs need to start from the perception that long-term return will be achieved through changes in business structure rather than short-term outcomes in the application of blockchains. Second, existing IT system operators or job workers shall be inconvenienced by additional or redundant work due to the blockchain application. The question of “what extra or new works are required when blockchain is adopted” is concerned. A site system operator might have the following negative opinion: “the operator must take two tasks to enter information into the existing IT system and blockchain system. Although the blockchain secure excellent security, the existing IT system is enough with a reasonable security level in the business. The blockchain does not make us feel particularly good about security.” For IT operators and workers who are familiar with the existing SCM system, the acceptance level of blockchain may be weak in a position of concerning redundant tasks, data entering, multiple system monitoring, and new technology education. Therefore, it is essential to increase existing IT user acceptance through initial change management and improved the user interface. Third, existing IT systems are still usable, and the effects of blockchain are not skin-deep. The question of “how existing IT systems secure connectivity with blockchain” is concerned. Existing SCM system is a result of improvement of processes through long-term investments, management of changes, and optimization of the application system. Thus, it is a practical approach to apply blockchain in a small way from a long-term perspective or to complement existing systems rather than replace the whole existing system in the short term. In particular, it would be wise to introduce new businesses into areas of sales expansion, rather than face internal indifference through hasty application in anticipation of radical productivity improvements. However, since most IT systems have already been invested in the area of purchase and production of the supply chain, blockchain would be used for the information-sharing tools through the supply chain. It needs to be emphasized that blockchain is a future information-sharing system on behalf of existing system.

386 SECTION

C Distributed computing

Fourth, blockchain causes new governance issues. The question of “what blockchain causes changes in governance” is concerned. The application of blockchain is based on changes in existing control structures or processes. Therefore, changes in the existing governance system are inevitable. The first issue is raised in securing controllability of business information. The company may take a defensive posture in the introduction of blockchain concerning to disclose such sensitive information: cause of the quality problem, inadequate service processing, and so on. The confidential information could harm the company’s interests and increase abuse or disclosure to competitors. Therefore, even if blockchain is applied to the used car business and a consortium is formed, the dealer performing the used car business wants to lead governance. If a public organization or a third party organizes governance, used car dealers may be negative about participating in consortiums for the reasons of business information protection. Such cases also represent a recent issue in the Korean government-led blockchain project. The second issue emerges in data privacy. The emergence of new regulations, such as the General Data Protection Regulation, will affect personal information disclosure related to used car transaction among consortiums. The third issue is raised in data standardizations in different organizations. For example, an automotive A/S center manages vehicle information on a VIN basis, an insurance company manages the information on an owner-centered basis, and a National Police Agency manages the information on a vehicle number basis. Therefore, data standardization is mandatory to share information and data integration within the consortium.

6.

Conclusion

In this chapter, we proposed a blockchain application case for used car business expansion from B2B to B2C. Through the field validation, we found that the blockchain enables the traceability of car and parts among consortium and secure the transparency of the used car market. We also discussed the benefits of the field validation and highlighted the barriers from the business environment. The blockchain is no more a technical matter rather than an application matter. The interlink blockchains of the supply chain are required to expand the blockchain application. Above all, the development of application cases in various fields and the sophistication of smart contact to improve sales and productivity are required in future research. It started from the assumption that most of the information is well managed when applying the blockchain. However, managing big data collected from various sources of information remains a big task. To secure improved traceability and transparency through standardization of big data and information integration is left as a future study. It started from the assumption that most of the information is well managed when applying the blockchain. However, managing big data collected from various sources of information remains a big task. To secure improved traceability and transparency through standardization of big data and information integration is left as a future study. As mentioned by Charles and Gherman [36], researches are needed to expand the transparency of used car transactions by cross-checking and combining fragmented data from multiple data sources for insufficient data information of consortium.

References [1] A.G. Akerlof, The market for "lemons": quality uncertainty and the market mechanism, Q. J. Econ. 84 (3) (1970) 488–500. https://www.jstor.org/ stable/1879431. [2] L. Kang, Used Car Market Revolution, Blockchain News, 2018, July. http://www.blockchainnews.co.kr/news/view.php?idx¼1643. [3] T. Willemarck, H. Graafland, C. Gonderinger, J. Cobbaut, B. Lycke, J. Hakkenberg, M. Peelman, Protect European Consumers Against Odometer Manipulation (Online), 2014, October Available: goo.gl/CnQuYg (Accessed 13 November 2017). [4] F. Casinoa, T.K. Dasaklisb, C. Patsakisa, A systematic literature review of blockchain-based applications: current status, classification and open issues, in: Telematics and Informatics, vol. 36, 2018, pp. 55–81. March 2019. [5] K.L. Brousmiche, T. Heno, C. Poulain, A. Dalmieres, E.B. Hamida, Digitizing, securing and sharing vehicles life-cycle over a consortium blockchain: lessons learned, in: IFIPNTMS International Workshop on Blockchains and Smart Contracts (BSC), Feb 2018, Paris, France. hal-01760781, 2018. [6] M. Staples, S. Chen, S. Falamaki, et al., Risks and Opportunities for Systems Using Blockchain and Smart Contracts, Commonwealth Scientific and Industrial Research Org, 2017. https://www.researchgate.net/publication/320619389_Risks_and_opportunities_for_systems_using_blockchain_ and_smart_contracts. [7] N. Kshetri, 1 Blockchain’s roles in meeting key supply chain management objectives, Int. J. Inf. Manag. 39 (2017) 80–89. https://www.sciencedirect. com/science/article/pii/S0268401217305248. [8] J. Mendling, et al., Blockchains for business process management – challenges and opportunities, ACM Trans. Manag. Inform. Syst. (2018). https:// dl.acm.org/citation.cfm?id¼3183367. [9] S. Nakamoto, Bitcoin: A Peer-To-Peer Electronic Cash System, Portal Unicamp, Campinas, 2008. https://bitcoin.org/bitcoin.pdf.

e-Governance and blockchain-based data supply chain Chapter

22

387

[10] K. Christidis, M. Devetsikiotis, Blockchains and smart contracts for the internet of things, IEEE Access 2016 (4) (2016) 2292–2303, https:// ieeexplore.ieee.org/document/7467408. [11] M. Risius, K. Spohrer, A blockchain research framework: what we (don’t) know, where we go from here, and how we will get there, Bus. Inf. Syst. Eng. 59 (6) (2017) 385–409. https://aisel.aisnet.org/bise/vol59/iss6/2/. [12] M. Iansiti, K. Lakhani, The truth about blockchain, vol. 119, Harvard Business Review, 2017. January–February https://hbr.org/2017/01/the-truthabout-blockchain. [13] B. Marr, How Blockchain Will Transform the Supply Chain and Logistics Industry, Fobes, 2018, March. https://www.forbes.com/sites/bernardmarr/ 2018/03/23/how-blockchain-will-transform-the-supply-chain-and-logistics-industry/#64e20cc05fec. [14] F. Wamba, K. Kamdjoug, J. Robert, R. Bawack, J. Keogh, A systematic review and case studies in the supply chain, in: Production Planning and Control, 2018, June. https://www.tandfonline.com/toc/tppc20/current. [15] W. Ying, S. Jia, W. Du, Digital enablement of blockchain: evidence from HNA group, Int. J. Inform. Manag. 39 (December 2017) (2018) 1–4, https:// doi.org/10.1016/j.ijinfomgt. [16] W. Zhi, H. Liao, A. Emrouznejad, Information representation of blockchain technology: risk evaluation of investment by personalized quantifier with cubic spline interpolation, Inf. Process. Manag. 58 (4) (2021) 102571, https://doi.org/10.1016/j.ipm.2021.102571. [17] L. Kehoe, N. O’Connell, D. Andrzejewski, K. Gindner, D. Dalal, When Two Chains Combine, Supply Chain Meets Blockchain, Deloitte Consulting LLP, 2017. https://www2.deloitte.com/content/dam/Deloitte/pt/Documents/blockchainsupplychain/IE_C_TL_Supplychain_meets_blockchain_.pdf. [18] D. Galvin, IBM and Walmart: Blockchain for Food Safety, IBM, 2017. https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?htmlfid¼39022839USEN. [19] R. Kamath, Food traceability on blockchain: Walmart’s pork and mango pilots with IBM, J. Br. Blockchain Assoc. 1 (1) (2018) 1–12. https://www. researchgate.net/publication/326188675_Food_Traceability_on_Blockchain_Walmart%27s_Pork_and_Mango_Pilots_with_IBM. [20] M. Del Castillo, Microsoft Unveils Project Manifest, a Plan for Blockchain Product Tracking, CoinDesk, 2017. www.coindesk.com/microsoftunveils-project-manifest-a-plan-for-product-tracking-via-blockchain. 25 January 2017. [21] N. Szabo, The Idea of Smart Contracts, 1994. http://szabo.best.vwh.net/smart_contracts_idea.html. [22] V. Buterin, Ethereum Whitepaper a Next Generation Smart Contract & Decentralized Application Platform, Github, 2017. https://github.com/ ethereum/wiki/wiki/White-Paper. Retrieved 1 June 2017. [23] I. Karamitsos, M. Papadaki, N.B.A. Barghuthi, Design of the blockchain smart contract: a use case for real estate, J. Inf. Secur. 9 (2018) 177–190. https://www.scirp.org/journal/PaperInformation.aspx?paperID¼85741. [24] A. Deshpande, K. Stewart, L. Lepetit, S. Gunashekar, Understanding the Landscape of Distributed Ledger Technologies/Blockchain, BSI/RAND Corporation, 2017. [25] Ethereum, Ethereum Project, Ethereum Switzerland GmbH (EthSuisse), Zug, Switzerland, 2015. https://www.ethereum.org/. [26] M. Swan, Blockchain: Blueprint for a New Economy, O’Reilly Media, Newton, MA, USA, 2015. [27] Z. Zheng, S. Xie, H. Dai, X. Chen, H. Wang, An overview of blockchain technology: architecture, consensus, and future trends, in: Proceedings of the 2017 IEEE International Congress on Big Data (BigData Congress), Boston, MA, USA, 11–14 December 2017, 2017, pp. 557–564. https:// ieeexplore.ieee.org/abstract/document/8029379. [28] E. Androulaki, Y. Manevich, S. Muralidharan, C. Murthy, B. Nguyen, M. Sethi, G. Singh, K. Smith, A. Sorniotti, C. Stathakopoulou, et al., HyperLedger fabric: a distributed operating system for permissioned blockchains, in: Proceedings of the Thirteenth EuroSys Conference, Porto, Portugal, 23–26 April 2018, 2018. https://arxiv.org/abs/1801.10228. [29] C. Cachin, Architecture of the HyperLedger Blockchain fabric, ibm.com, 2016. https://pdfs.semanticscholar.org/f852/c5f3fe649f8a17ded391 df0796677a59927f.pdf. [30] O. Dib, K. Brousmiche, A. Durand, W. Thea, W. Hamida, B., Consortium blockchains: overview, applications and challenges, Int. J. Adv. Telecommun. 11 (1 and 2) (2018). http://www.iariajournals.org/telecommunications//. [31] X. Xua, Q.B. Lua, Y. Liuc, L.B. Zhua, H. Yaoc, A.V. Vasilakosd, Designing blockchain-based applications a case study for imported product traceability, Future Gen. Comput. Syst. 92 (2019) 399–406. [32] X. Xu, I. Weber, M. Staples, L. Zhu, J. Bosch, L. Bass, C. Pautasso, P. Rimba, A taxonomy of blockchain-based systems for architecture design, in: Proc. 2017 IEEE Int’l Conf. Software Architecture (ICSA 17), 2017, 2017, pp. 243–252. https://www.researchgate.net/publication/321057052_ Adaptable_Blockchain-Based_Systems_A_Case_Study_for_Product_Traceability. [33] Q. Lu, X. Xu, Adaptable blockchain-based systems: a case study for product traceability, IEEE Softw. 34 (6) (2017) 21–27, https://doi.org/10.1109/ MS.2017.4121227. [34] S. O’Neal, Blockchain for Food, How the Industry Makes Use of the Technology, Cointelegraph, 2019, July 17. https://cointelegraph.com/news/ blockchain-for-the-food-how-industry-makes-use-of-the-technology. [35] M. White, Digitizing Global Trade with Maersk and IBM, 2019. https://www.ibm.com/blogs/blockchain/2018/01/digitizing-global-trade-maerskibm/. (16 January 2018). [36] V. Charles, T. Gherman, Big data analytics and ethnography: together for the greater good, in: A. Emrouznejad, V. Charles (Eds.), Big Data for the Greater Good. Studies in Big Data, vol. 42, Springer, Cham, 2019, https://doi.org/10.1007/978-3-319-93061-9_2.

This page intentionally left blank

Chapter 23

Emerging trends of blockchain in bioinformatics: A revolution in health care Arpita Balakrishnana, Poonam Jaglana, Saksham Sellyb, Veronica Kumarb, and Neetu Jabaliab a

Amity Institute of Virology and Immunology, Amity University Uttar Pradesh, Noida, Uttar Pradesh, India, b Amity Institute of Biotechnology,

Amity University Uttar Pradesh, Noida, Uttar Pradesh, India

1. Introduction The blockchain concept emerges as a result of the cryptocurrency Bitcoin. It is most contentious because it helps to facilitate a multibillion-dollar global industry of anonymous transactions with no officials in sight. Over time, blockchain technology has shown to be extremely effective in different applications, including bioinformatics, health records security, genomic data, artificial intelligence training, supporting clinical trials, and many others. For instance, blockchain has shown to provide new endeavors and potentials for dealing with cybersecurity, data access, and safety concerns. Bioinformatics difficulties related to genomics or any other aspects of omics include massive privacy information management and compute-intensive data analysis. Since Satoshi Nakamoto proposed blockchain in 2008, it has revolutionized financial organization [1]. Over time, blockchain technology has shown to be extremely effective in several sectors, including healthcare, education, and governance sectors [2]. It is decentralized and without a hierarchical structure, hence, it is difficult to hold anybody responsible for the acts of others. It is composed of connected series of blocks and cannot be replaced by other blocks. It mimics its framework which is hosted on a server for database access. This technology enables it to be varied and systematized and be used for project execution in such an organization and to team up several structures. Because of distributed consensus, system transparency, high storage, decentralized structure, and obscurity, evolving blockchain technology offers an alternative to private genomic information. In recent decades, blockchain technology has been frequently used for sharing health records, due to which prototype devices and corporations have been developed. For example, clinical research data analysis for a breast chemotherapeutic drug was completed by utilizing a blockchain database to validate protocol conformity from cloud-based computing resources. Fig. 1 illustrates the major scientific subjects for which blockchain technology have thus far been created [3]. Blockchain technology can reduce various health-care industry frictions. Everything from safely encrypting health records to managing disease breakouts is now possible with this platform. Estonia, a member of the European Union, began encrypting health-care data and conducting transactions via blockchain in 2012 [4]. Traditional research methodologies are, without a doubt, evolving. The ability to get information rapidly, the interaction of participants in data search, and the elimination of time and location barriers should all be considered in research. Everything said above necessitates the use of innovative research technologies, like blockchain. To address such challenges, health-care providers are exploring the use of blockchain, a tamperproof, and distributed digital record system. This chapter presents a substantial overview of blockchain approaches and their impact on life sciences. The next section discusses genomics as big data, its challenges, and the potential of blockchain in storing and interpreting genomics records. Later dimensions will present the potential role of blockchain in health-care systems and bioinformatics. The last and final section emphasizes the necessity of understanding blockchain in comparison to traditional research methods, as well as the problems and future of blockchain.

Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00018-8 Copyright © 2023 Elsevier Inc. All rights reserved.

389

390 SECTION

C Distributed computing

Infrastructure, based blockchain ecosystem

Decentralization patient records management

Healthcare industry

Decentralization app

Research Genomic research, research collaboration

Wagers, family trusts, performance, proofs

Smart contract

Currency Transfers, Payments, Tips FIG. 1 Evolutionary trend of block in science.

2.

Blockchain

With its very first modern Bitcoin application, revolutionary technology has miraculously impacted different industries on the market. Blockchain technology, which has stormed the world over the past years, revolutionizes the way we handle assets, manage data, and implement agreements. Originally developed for the Bitcoin cryptocurrency by Satoshi Nakamoto [1], blockchain has been tailored to a variety of application data administration, for example, to rationalize remittance, improve food trackability, secure electronic health records, ensure genomic information privacy, train artificial intelligence, strengthen cyber safety, address climate change, and support clinical studies [5–10]. Blockchain is a distributed database solution that maintains an extended list of confirmed node data records. The information on all transactions is recorded in a public record. Blockchain is a decentralized solution that no third-party organization is needed in the middle. All transactions in blockchain will be communicated and available to all nodes. This attribute makes the system more open than centralized third-party transactions [11]. Blockchain has a peer-to-peer network consisting of individual devices that store and share data in their communications. This data-sharing network and its structure make it more popular than a traditional centralized database. Data can be accessed from different users saved in blocks and saved on various servers. It reduces the coordination cost of different users wishing to receive information [12]. Blockchain technology offers the scientific community a wide range of advantages. Every scientist is aware that highquality research is dependent on effective communication, transparency, and data security. As blockchain technology continues to evolve, it can offer numerous benefits to the scientific community [13].

2.1 Role of blockchain in life sciences Blockchain is protected by cryptographic means that a network of nodes allows shared information to be collectively maintained without having to have complete trust between the nodes. Blockchain is a timed chain of events based on an agreed mechanism for consensus. The mechanism ensures that information stored on the blockchain is reliable if most networks validate the records that are posted to the blockchain as per governance rules. Although important investments were made in the last decade in serialization, companies in life sciences are restricted to traditional technology constraints where information is collected in a database and transmitted to a different database and reconciled [14]. With the continuing challenges

Emerging trends of blockchain in bioinformatics Chapter

23

391

of trust and speed in the life sciences supply chain, blockchain becomes more relevant. The ability of blockchain to generate confidence and create the right permission for sharing data allows businesses in the life sciences sector to refer to some of these business challenges, allowing greater traceability. Without revealing commercially sensitive data, companies may access the information they want [15]. Blockchain’s potential uses in the field of life sciences are as follows: Medical records: Electronic health records can be operated securely on a personal network blockchain, protecting patient data and privacy, while enabling doctors to access the medical history of their patients and enabling scientists to use shared data for further research. Blockchain solutions allow the installation of permission layers. Thus, while patients are unable to change or delete medical information supplied by their physicians, they can control their profiles by giving different stakeholders full or partial visibility [16]. Akiri is one such example, where medical records are stored. It operates in a network optimized for the health-care industry. It helps protect patient data by setting policies to configure data and verify its sources and destinations. Only authorized parties have access to this data [17]. Collection of clinical trial information: Pharmaceutical firms already collect clinical trial blockchain applications to manage data. Perhaps the main advantage of it is when data are added into the blockchain, the researchers cannot change the results without making the change appear to everyone; this can help in maintaining data integrity. Consequently, after analyzing their research data, it is extremely difficult for researchers to change their initial clinical trial hypotheses but can make changes that can be viewed by everyone [16,18]. Hirano and colleagues validated a system to ensure secure medical data storage for breast cancer clinical trials using blockchain technology. The system utilizes a platform called the hyperledger fabric platform which has a higher transaction throughput than other public blockchain platforms like ethereum, due to it being a closed network and only specified registered users can use these channels. Here private information can be shared without notifying the entire network [19]. Their system maintained stable operation with no incurring loss of patient data [20]. Clinical trials access: Clinical and logistical barriers often prevent patients from participating in clinical trials, even if they are eligible. Blockchain—in conjunction with other technologies such as telemedicine—provides a potential platform for remote clinical trials, while securely collecting testing data [18]. BlockTrial is a system that runs trials on an Ethereum Network, using a web interface. Researchers can access and submit queries about patient data after getting permission from the concerning party. The data access and query system are logged in a transparent ledger system which ensures privacy and integrity of the information [21]. Modeling cancer evolution: The blockchain model of cancer evolution can be a powerful retrospective tracking model. Reconstructing cell lineage information retrospectively is valuable for human disease understanding because experimentally it is impossible to manipulate the data [22]. Mutations such as copy number variations, single nucleotide variants, LINE-1 transpositions, microsatellite mutations, and DNA mutations may naturally occur as barcode lines; this serves as the point of initiation for reconstitution of blockchain cancer history [23,24]. Included in the current genetic methods, the blockchain model could improve the integrity and utilities of retrospective lineage tracking by testing biological memory, like MemorySeq. Blockchain is used to collect and analyze data to provide a wide variety of diagnostic, therapeutic, and research options. Not only that, information may be linked to the data of previously affected patients together and draw a simpler and direct strategy for dealing better with different phases, as well as with the causative agent of cancer by using blockchain technology [25].

2.2 Blockchain in COVID-19 With blockchains’ unique features, its utilization in the COVID-19 pandemic scenario was very well received and helped accentuate the need for secure and decentralized platforms for large amounts of data and its large-scale usage. These data need to be available transparently without any adulteration by third parties. The data need to be traced to its owner while ensuring the maintenance of privacy of this sensitive information [26]. This contact tracing needs to be collected, verified, and distributed to concerned authorities; so here data leakage of patient information should be majorly avoided, thus usage of traceable and transparent platforms which use blockchain is required. For this purpose, Hao Xu and colleagues are planning to implement BeepTrace software for contact tracing purposes integrating blockchain systems in the same [27]. In India, Arogya Setu App serves the purpose of initial contact tracing, to inform citizens of people around them who have tested positive, but data verification is an issue. Also, test reports or other related documents are in physical form and verification of all individuals for these data is time-consuming and laborious. To ease the situation, a blockchain platform BelYo, which is India’s first blockchain platform, is being developed. This software is being made in a collaboration between IIT Bangalore, Global Blockchain Start-up BelfricsBT, and YoSync (a start-up at IIB-IMACX studios) [28].

392 SECTION

C Distributed computing

By using blockchain public network platforms, original creators can be tracked easily by their digital signatures. This can help prevent people from falling prey to fraudulent information [29].

3.

Bioinformatics

As a rapidly developing subject, bioinformatics brings together mathematics, information science, and biology to assist and address biological issues. The term “bioinformatics” was coined in 1968, and the first definition was published in 1978 [30]. “Computational biology” is another term for bioinformatics. Computer biology, on the other hand, is largely concerned with the modeling of biological systems. The creation of software instruments and algorithms, as well as the analysis and interpretation of biological data, employs the two basic components of bioinformatics, software tools, and algorithms [31]. Bioinformatics approaches combine molecular and chemical tools in the search for natural substances. Phylogenetic resolution and the ability to screen huge groups of people are essential features of molecular approaches. Comparative genome sequence analysis is necessary to have a better understanding of the genetic and epigenetic components of distinct bacterial taxa. This is owing to the finding of so-called silent or cryptic secondary metabolite gene clusters that code for the synthesis of unknown chemicals [32]. Along with the applications mentioned above, many more applications of bioinformatics are also known, some of which are highlighted in Fig. 2.

3.1 Bioinformatics and biological databases Biological databases are divided into two categories: sequence databases and structure databases. Structure databases hold protein structures, while sequence databases store nucleic acid and protein sequences. Biological databases arose in reaction to the massive amounts of data produced by low-cost DNA sequencing technology. GenBank, a compilation of all accessible protein and DNA sequences, was one of the first databases to appear [33]. Other databases, like RELIBASE, REBASE, etc., are also present which do not fall into structure and sequence database categories; a comprehensive flowchart highlighting all the databases is given in Fig. 3. Primary, secondary, and composite databases are the three types of biological databases: 1. Primary databases: Primary databases (sometimes called data repositories) are well-organized, user-friendly portals to the vast amounts of biological data generated by researchers all over the world. In the 1980s and 1990s, main databases were created to store experimentally determined DNA and protein sequences. Only sequence or structural information is stored in primary databases. l Swiss-Prot and PIR for protein sequences are examples of primary biological databases. l Genome sequences may be found in GenBank and DNA Data Bank of Japan (DDBJ). l Protein databank (structures of proteins).

Gene therapy

Antibiotic resistance

Veterinary Sciences

Wheather analysis Applications of Bioinformatics Drug designing Medicine Biotechnology

FIG. 2 Various applications of bioinformatics.

Crop development

Forensic analysis Evolutionary Studies

Emerging trends of blockchain in bioinformatics Chapter

23

393

Biological Databases

Structure

PDB

Sequence

Protein

Nucleic Acid

Swiss Prot PIR TrEMBL PROSITE PFAM

Genbank DDBJ EMBL

SCOP CATH

Other

RELIBASE REBASE GPCRDB

FIG. 3 Biological databases.

2. Secondary database: Information from primary databases is stored in secondary databases. Conserved sequences, active site residues, and signature sequences are all stored in secondary databases. Data from the Protein Databank are kept in secondary databases. Examples are: l SCOP at Cambridge University. l The University College London’s CATH. l Swiss Institute of Bioinformatics PROSITE. l Stanford’s eMOTIF. 3. Composite databases: Composite databases combine many primary databases, obviating the requirement to search each one individually. Different search methods and data formats are used in each composite database. The National Centre for Biotechnology Information (NCBI) maintains several databases, which include linkages to the Online Mendelian Inheritance in Man database [34].

3.2 Potential role of blockchain technology in bioinformatics In this postgenomics era, with the growing availability of omics data and mounting evidence of the utility of computational approaches to solve multilevel data problems in bioinformatics and biomedical research, blockchain has become increasingly important in making the path for patient-centric health care. Two examples are as follows: (i) applying AI algorithms based on biological data would provide substantial benefits/improvements toward precision medicine aims, and (ii) medical practitioners can safely and confidentially create personal health records and find the best therapies and disease predictions with the help of blockchain techniques [35]. Bioinformatics and blockchain are both young technologies that are still in their infancy. While the conceptual and intellectual foundations of these activities have been developed, their full applicability has yet to be commercialized. Blockchain technology has taken the globe by storm in recent years, revolutionizing the way we transfer assets, store data, and enforce agreements. Blockchain technology has played a significant part in the health business and has a great deal of promise in the area of bioinformatics, such as data storage and clinical data management and sequencing [36]. Bioinformatics was utilized to get insight into patient health, and genealogy data were given to both insurance companies and the FBI without the knowledge of the customer. Blockchain has the potential to significantly improve the security of patient data. There has never been a better moment to implement this type of solution because the amount of the data is only going to grow. This type of approach is already gaining traction and might become a common platform in the coming years [36]. Genobank.io is a company that specializes in this. They perform genetic testing on customers and save their genetic data on the blockchain, giving them the key to ensuring that they are the only ones who have access (https://genobank.io/). This kind of data management significantly reduces the risk of data theft and ensures that a record is maintained if and when a copy is produced [37]. Decentralized autonomous organizations are virtual establishments that use blockchain technology, to keep data distributed, with a transparent digital ledger in place [38]. One example of such an organization is The Cancer Genome Atlas,

394 SECTION

C Distributed computing

which can be used for operating and governing mediums to predefine laws and regulations, with great utilization of ethereum smart contracts [19]. As both technologies progress and become increasingly important in the enterprise, they can combine to create platforms to keep the increasing amount of information generated by genetic testing safe.

4.

Genomic big data

The genomic sequencing field has developed tremendously over the last decade. It had started from Sanger sequencing, developed by Dr. Frederick Sanger, which is a low throughput technique [39] that can sequence only one genomic data at a time. It has now evolved to next-generation sequencing (NGS), also referred to as high-throughput sequencing that can sequence multiple genomic data parallelly [39]. For data analysis, particularly biological data, the favored and influential method is NGS. For the Human Genome Project, Sanger Sequencing was implemented which is the most traditional method for genomic sequencing; this took over a decade and billions of dollars to complete [39], whereas, with NGS, it can read the entire genome in a few days, with a comparatively low cost [38]. NGS shows an approximately 100,000-fold increased efficiency [40] than the previous technologies used. Further, new technologies which aid in sequencing are in developmental phases, which is referred to as third-generation sequencing. The Oxford Nanopore’s nanopore sequencing [41] is a new promising candidate, which will lead to an improved understanding of genomic sequencing and even help in the overall advancement of genomics. The scale of data produced is enormous approximating to almost 2 petabytes of data per year [38] due to which genomics is now considered as a valid big data field. Also, the fact data will increase immensely in the coming decades is imaginable, owing to the widespread usage of this technology. An increased number of individuals are adopting personalized medicine which is generated via ancestry analysis and disease risk prediction which is formulated by genome sequencing [42]. Thus, as the health-care systems are now focusing on a more genomic data-driven approach, that necessitates the need of the sequencing of data speedily.

4.1 Challenges in genomics NGS being a boon in biological analysis generates a spectacular amount of data. While this great data availability is impressive, the challenges faced to support the same are also quite prominent, as shown in Fig. 4. Massive computing power is required to support these mammoth records. The information generated might represent a major bottleneck in computational analytics if reforms aren’t made to incorporate the same. So, to sustain the ginormous data, a pronounced distributed network system to store, retrieve, and help analyze the data efficiently is the need of the hour. Another thing to keep in mind about data storage is to compress the available material without compromising any important data [43]. These massive genomic data also raise concerns about cohorts’ privacy who are involved in the genomic projects. The implication of data leaks or sharing of data on public forums can be disadvantageous, since in various cases, it can be harmfully used against the owner, for example, in the instance of employment and health insurance, where the information can be

FIG. 4 Challenges in genomics big data.

Emerging trends of blockchain in bioinformatics Chapter

23

395

subjected to discrimination against a particular individual [41]. The genomic information can be sold to other parties without the knowledge of the owner which can be used with malicious intent for identity theft as well [41]. Moreover, there is a growing concern associated with the ownership of the data, as it should be the cohorts’ property, but the repositories who store the data take ownership and may sell or transfer that information to third parties without any consent [44]. Big data are no longer only available in traditional structured data, like in rows and columns, but are deviated from them into semistructured data like XML or unstructured data which include flat files. These are not in compliance with the traditional database methods [45]; hence, their storage requires more sophisticated methods. Data from extensive research can be used for several secondary analyses. After its original purpose, the data can be repurposed for many applications, namely, independent replicative research, avoiding duplicate studies, generation and/ or testing of novel hypotheses, and the general advancement of clinical and biologic understanding [46]. This further analysis, by default, demands an easily accessible computational approach to be deployed, which can handle the humongous data properly. Furthermore, the challenges faced in genomics owe largely to the fact that currently a state-of-art centralized system is adopted for the storage, access, sharing, and analysis of data [47]. Having one main authority makes data manipulation fairly easy. The main issue with centralized platforms is that they are not able to facilitate the active indulgence and participation of multiple stakeholders [47]. A third party is usually involved which also poses a threat to security [47]. This centralized approach raises concerns like single point of failure on the server [48], which means that the entire system can fail if even one part becomes dysfunctional.

4.2 Potential of blockchain technologies in genomics The following features are expected to be there in a genomic data storage system: (1) protection from damage and manipulation, (2) facilitating access to researchers, and (3) provision of individual control over their data [42]. Distributed networks are the solution for this as it allows the contributors to manage the data and access the information; it even has encryption features to ward off cyber data theft, one such example of this type of network is blockchain. For added security, asymmetric cryptography is used; it is also referred to as Public Key Cryptography [49]. Blockchain is a decentralized peerto-peer encrypted architecture with nodes consisting of network participants [47]. It is automatically shared among all participants [50]. Blockchain has recently gained impetus because it is competent and relevant to the sector. The delegation of authority from a central entity such as a bank to a bigger group is termed decentralization [51]. In this, the data contributors are the custodians of the data instead of a third party like in the case of many genomic data storage repositories. Storage of bulk data can be done in the distributed system. Owing to both these features, the data are being stored securely and are easily accessible and manageable [52]. Some key features of blockchain technology are that certain access permissions can be assigned and the data producer is the only one who can edit it [53]. So, a transparent environment is created by deploying blockchain, which aids in overcoming the challenges to some extent. Additionally, blockchain-based platforms support auditing by the presence of an immutable ledger to record who accesses the information across the whole network and the nodes [47].

4.3 Storing and analyzing a genome on a blockchain Peer-to-peer network nodes store the genomic information of the individuals, in encrypted files that allow access to only the data custodians. The addition of data is done through a consensus mechanism. This is the main and the most advantageous feature of the network [42]. Proof of work (PoW) is one such example of a consensus mechanism that is used widely in large networks for individuals having unknown identity [42]. PoW is like a ledger system that has entries, which requires proof from a node that their work is completed. It is an important characteristic as it keeps the transaction of information in check. Several platforms employ blockchain to some extent, for instance, a Biotech Company; DNAtix utilizes blockchain for genomic data exchange and sequencing. In a public proof of concept, DNAtix shifted the complete DNA of scientist, Craig Venter, using blockchain [49]. Although data length limitations are there in this platform [54], it utilizes Ethereum smart contracts, in the form of DNAtix tokens [54]. Another example is Zenome, which uses Ethereum Smart Contracts for genomic data files’ access and exchange of a cryptocurrency “ZNA tokens,” which acts as a means for compensation to individuals for their genomic data [38,55]. But due to difficulty in the storage of data, the companies store the data elsewhere, thus missing out on the main feature of blockchain and also making the data prone to theft. Further, Nebula is a peer-to-peer distributed platform for genomic data generation, sharing, and analysis. The main goal of Nebula is to guarantee the global accessibility of genomic data while combining a decentralized system having privacy preservation features [56,57]. “Nebula Tokens” are the Ethereum smart

396 SECTION

C Distributed computing

contracts used for this system [58,59]. But here also the storage of data occurs in off-chain cloud storage, thus not fully utilizing the blockchain’s features as well. Additionally, Shivom, a genomics medicine company, is using blockchain by developing a Unique Global Genome ID. This ID helps in linking the genomic data to its particular owner within the database, accurately. It also utilizes an Omix Token, called OmiX which is the currency for data exchange [49]. Furthermore, Genesy is also an innovative blockchain platform, which transcribes genomic data and safeguards the data with access rights subjected to owners only. It even facilitates the possibility of transactions between concerning parties [56,60]. Encrypgen is another genomic ecosystem that deploys blockchain. It creates a monetized platform wherein the data are stored securely and users can manage and share their profiles with other parties in return for a payment in the form of tokens. But this also stores the data in other off-chain cloud storage, thus not utilizing blockchain technology to its fullest [56].

4.4 Next-generation bioinformatics using blockchain technology NGS is a method that carries out parallel sequencing of substantial quantities of DNA; this was not possible by earlier methods like Sanger sequencing method, which used the fragment cloning method [61]. Thus, here a reliable blockchain network can aid in the competent transfer and storage of immense amounts of DNA sequencing data. Blockchain Applied FASTQ and FASTA Lossless Compression (BAQALC) is an algorithm deployed in the blockchain network [62,63]. BAQALC has an overall blockchain architecture where the distributed ledgers help the researchers transmit the DNA information [64]. Additionally, this algorithm is immune to hacking owing to the blockchain network and this can contribute to a resourceful platform for NGS data [63]. The limitation of this algorithm is that the stability was low compared to widely used algorithms. The other technologies currently being deployed do not fully utilize the blockchain’s node storage features and use external services to store a large amount of data which makes it prone to cyber leaks and raising a big privacy question.

5.

Blockchain applications in bioinformatics

Blockchain is a technology that is new and gaining momentum among professionals and researchers. It is a secure and unchanging publicly distributed block with a timestamp and encrypted hash. It makes transaction operations easy without requiring a trusted third party because of its traceability, smart contracts, tamper resistance, decentralization, and encryption algorithms. In the beginning, blockchain uses timelines for the traceability and verification of data, which ensures a secure and transparent way to monitor property ownership before, during, or after any transaction. Second, the built-in open-source sharing protocol enables all participants to simultaneously log and store data, ensuring retrospectively, without the full consent of the network, that the specifics of recorded transactions cannot be modified. Finally, the decentralized design and governance of a blockchain make it fault-tolerant and immune to assaults and collusion. Furthermore, using cryptographic hash functions and asymmetric encryption, a blockchain may safeguard users’ privacy by allowing them to perform encryption with the data of their private key [65]. As a result, a blockchain provides a unique solution to addressing and resolving challenges that occur during the construction of huge data platforms for genomics. It can benefit a genomics big data platform in at least three ways [65]. As indicated in Table 1, it can help a genomics big data platform in at least three ways. TABLE 1 Platforms of blockchain in big data. Sl. no.

Parameter

Property

Description

1.

Data ownership empowerment

Traceability

  

Its ability to use documented recorded identification to authenticate an item’s history, location, or use Blockchain uses timer technology that records the entire process from data production to ultimate storage to make the data traceable and verifiable At the time of production, each part of the data on the blockchain can be determined to belong to each data producer, and blockchain records can verify this data ownership [65]

Emerging trends of blockchain in bioinformatics Chapter

23

397

TABLE 1 Platforms of blockchain in big data—cont’d Sl. no.

Parameter

Property

Description

2.

Data-sharing facilitation

Antitampering and smart contracts

    

3.

Data security and privacy protection enhancement

Decentralization and encryption algorithms

   

A smart contract is made up of a set of instructions that allow the smart contract’s parties to communicate automatically Any single node on the blockchain cannot tamper with any record The antitampering feature enables access and data integrity to be carried out Ensure the operation of intelligent agreements and enable, check, and enforce the negotiation, performance or execution of an agreement or transaction with the smart contract code As a result, combining these two properties of blockchain can strengthen the data-sharing mechanism, encouraging platform users to submit data for nonmonetary reasons Decentralized storage aids in the reduction of security concerns, the increase of trust, and the management of data A component of electronic data transit security is an encryption technique The data is encrypted using blockchain encryption technology, which ensures data confidentiality and privacy Sun et al., for example, advocated using blockchain technology in online education to safeguard intellectual property, data security, and privacy [66]

6. Blockchain in the health-care industry Blockchain offers numerous possibilities for use in the health-care industry, such as management in public health, useroriented medical research based on personal data from patients, and counterfeit medicines. It is possible to improve the health areas with blockchain technology. These include device tracking, pharmaceutical, and health insurance [14]. The role of blockchain in the health-care industry as a whole is presented in Fig. 5. Blockchain applications in the health-care industry: Research: Currently electronic health records only allow medical information to be updated automatically and shared by a given patient within an organization. This could be expanded if the information was arranged so that only information which could not be identified can be obtained personally at the top of the blockchain. It would allow scientists and other organizations, with hundreds of thousands of patients, access to this wide spectrum of data [16]. Quicker, cheaper, better care for patients: For the safe and quick recuperation of authorized users, the blockchain system can create a unique system for storing and constantly updating health records. By preventing miscommunication among the various health workers involved in treating the same patient, it is possible to avoid countless mistakes, diagnose them more quickly, and give personalized care to each person [16]. Mobile health and remote monitoring applications: Mobile health applications with advanced technology are becoming increasingly important. Electronic medical records in a blockchain network were found to be secure and could quickly forward the data to the medical personnel; this was also available for home monitoring and care. This area is especially sensitive with malware, however, especially root exploit, which allows the hacker to have access to the patient’s private key. Tracking outbreaks and diseases: Blockchain’s unique capabilities can help to report diseases and explore patterns of diseases in real time to help determine their origin and transmission parameters. Protection of genomics: Genetic data theft has become an important problem with many companies that bring DNA sequencing to the individual. Blockchain can prevent this, and it can even provide an online marketplace where researchers can purchase genomic data. This could encourage safe sales and remove expensive intermediaries. Pharmaceutical companies: With the blockchain platform in place, pharmaceutical companies can gather data in real time so that they can offer a wide range of specially tailored treatments and medical products to their patients.

398 SECTION

C Distributed computing

Issues that blockchain can solve in healthcare:

Blockchain use case categories in healthcare

Benefits of blockchain in healthcare:

Digital identity management Health supply chain management Clinical research & data access/ Monetization Financials, Insurance & Records

Interoperability Security Maintenance cost Data integrity Universal Access

Wellness Apps

Rehabilitation incentive programs

APPS

Medical inventory management

Electronic medical records

Global patient ID software

Effective & costefficient

Powerful monitoring

Better collaboration

Cleared & organized process

Easy access & budget control Extracting the best benefits

Protection of crucial data

FIG. 5 Blockchain in health care.

Medical record integrity: To ensure the integrity of all medical records, blockchain can be used. When a medical record is generated, it can be kept inside the blockchain, which gives absolute proof because the record cannot be changed in the blockchain. This is a big plus, as both medical and legal considerations depend on the integrity of a medical record.

7. Blockchain technology changing traditional methods of applied research in bioinformatics Digital technology is concerned with the reception, storage, processing, utilization, and transfer of information via computers. The performance and versatility of this design have made it popular. It is critical to developing digitalization-based research approaches in the field of problem-solving associated with raising human living standards. Bioinformatics is one of the most promising areas of digital technology in this regard [12]. Since it evolved at the boundaries of functional

Emerging trends of blockchain in bioinformatics Chapter

23

399

genomics, software applications, and arithmetic, bioinformatics provides a new perspective on various biological processes. It enables the nucleic acid sequences or amino acids analysis, and their evolution, structural, physical, and functional properties [67,68]. Blockchain technology is the expansion of standard bioinformatics approaches, where the storage of ever-increasing information is the topmost priority in bioinformatics. The usage of blockchain expands the potential for stored massive information while adhering to a unified widespread data concept that unites scientists all over the world. The NCBI website has the most scientific and thorough information on the human genome and usage of blockchains resulted in an entire human genome repository creation [12]. Furthermore, blockchain technology provides the solution associated with the collection, processing, usage, and exchange of genetic information. After Bitcoin drew attention to blockchain technology, the Ethereum Project presented in late 2013 unlocked the technology’s full potential [69]. Ethereum transformed the blockchain through “smart contracts,” which allowed the development of unique blockchain applications. It is accomplished by framework for software to generate different commands specified in a “smart contract.” Briefly, smart contracts include agreement terms (e.g., work performance and resource distribution), along with rewards and penalty systems when terms are fulfilled or not [70]. The blockchain storage of genetic information resulted in the emergence of a central database of human genes and led to the identification of a person’s genetic passport. Such registered information is used to generate medicine, determine relationships, and also in forensics, among other applications [71]. This encoding approach leads to the genome research revolution which provides privacy and transparency to patient’s data [12]. The Shivom Project sets the human DNA or genome on the blockchain in a decentralized cloud storage with subsequent data analysis. This program supports worldwide ecosystem, including research institutes, genetic experts, medical facilities, and a nonprofit research group to assist nonservice fields and also offers genomes decoding tools. All forms of swaps, incentives, and many auctions for the most favored DNA genomes would be possible thanks to blockchain technologies for the public welfare of drug development (https://shivom.io/) [72]. The possibility of biological remodeling or transformation in one’s genetic bases exists. This is a shift in one’s basis, covering a wide variety of societal and cultural beliefs. As a result, the growth of modern biotechnology in this field is not assessed [73,74]. Pharmacogenomics enables the dosage selection based on a person’s unique genetics. Several articles demonstrate that genome and medicine are interrelated to each other. However, an incredibly high level of proof, replication, validation, and mechanistic investigation is necessary for genetic information to be used for a pharmaceutical prescription [75].

8. Blockchain: A critical analysis of challenges and opportunities Just as any system, performance flaws have been noted in interfaces using blockchain, namely, Bitcoin, Ethereum, Litecoin, and others [76,77]. This performance flaw is concerning its low transaction rates and high latency, which is serving as a major drawback for blockchain applications. Caixiang and colleagues, through their efficiency analysis, found that Hyperledger Fabric (HLF) and Ripple systems that deploy blockchain were seen to reach up to 1000 transactions per second as compared to ethereum, outperforming it significantly [76]. Additionally, an IoT-proposed system, Tendermint, outperforms HLF and Ripple in terms of throughput and latency [78]. High latency is influenced by consensus finality, a property of blockchain, where a particular block receives affirmation when it is appended to a ledger [79]. PoW-based blockchain systems usually lack this finality and cause a high latency period for those systems. BFT-based blockchains utilize consensus finality, making it able to finalize a transaction in seconds showcasing its obvious advantage [76]. For improvement, Sharding has been considered; it is a database partitioning technique used with the purpose of scalability, to improve latency [80]. This has been implemented in many blockchains; a need to comparatively evaluate its advantages is eminent [76]. For the holistic improvement of blockchain systems to overcome their limitations, several measures have been adopted as shown in Table 2.

9. Future of blockchain Blockchain technology offers many health-care applications, still certain challenges to overcome for health-care industry beginners before implementing it. Interoperability, privacy, security, scalability, efficiency, and patient involvement comprise some highlighted barriers in the development of blockchain-based systems. Since there is no established standard for building blockchain-based health-care applications, an application built by different vendors or on different platforms may be unable to connect. Consider different patient monitoring systems, one on the ethereum based [6], another on the hyperledger based [88]. In that case, information between the two platforms would be impossible to communicate [89]. It is alarming in terms of safety and privacy since the patient’s identity can be exposed through the combination of sufficient data related to the patient, despite the encryption techniques applied [90]. It is also possible that security violations will

400 SECTION

C Distributed computing

TABLE 2 Critical analysis of blockchain systems. Areas of improvement

Improvement strategies

1. System interoperability

 

Using a unique identification number (UID) framework to provide easy access to secure, immutable and comprehensive medical records of patients [81] Using a fog computing paradigm as an alternative to cloud storage to store patient health records which brings computation and storage in affinity to data sources [82]

2. Interinstitutional access privileges



Utilizing blockchain technology with the integration of electronic health records (EHR) in a system called UniRec (Unified Medical Records). This allows patients and physicians to access the patient data more easily. This system has been tested to report a fast response time [83]

3. Data control



Data control through the use of an IOTA model—masked authenticated messaging, to store and retrieve data in a secured encrypted fashion. This utilizes a tamper-free distributed ledger [84]

4. System scalability



System scalability through MeDShare system. This system provides data provenance and control of data in cloud-sharing services. Tamper-proof ledger system ensures the prevention of malicious use [85]

5. Performance



Using a keyless infrastructure for health-care data storage to ensure authentication and secrecy of digital signatures. This infrastructure showed results in a shorter response time than other blockchain systems [86]

6. Flexibility



GloreChain system, a decentralized way to preserve health-care and genomic data in an encrypted fashion, is a great tool as it utilizes blockchain’s decentralized method but provides a consensus model thus having a clear advantage over blockchain [87]

result from deliberate malicious attacks to prevent health services that could expose patients’ privacy. Several examples of cyberattacks on the public blockchain which support various cryptocurrencies have been recorded [11]. The Radanovich cryptographic keys for encrypting and decrypting, employed in blockchain, are similarly subject to manipulation, which can potentially result in security breaches. There is also a major concern that the uniqueness of blockchain can contradict the data protection regulation rights and stipulate individual rights which are entitled to claim the effective dissolution of personal information. Since blockchain immutability does not delete or alter data that are stored within a blockchain, it can be detrimental if the patient’s medical history is completely erased [89]. The scalability of blockchain-based health-care solutions is a major challenge, particularly in terms of data volume. Keeping huge biomedical records at blockchain is not optimal, or in certain situations possible because that causes a substantial deterioration in performance. There is also the concern of speed since blockchain-based therapy might create a significant delay. For example, in the present Ethereum blockchain platform set-up, the validation mechanism requires an entire network in the validation process [11]. It leads to a large delay, particularly if there is an important load of data. Another concern is how patients may use blockchain to control their records. Also, there is no involvement in the management of health information for patients, especially elderly and young patients [90]. Numerous cryptocurrencies have been emerging which utilize this technology. But some developers, however, may fake their blockchain results to attract enormous profit-driven investors. As a result, a blockchain testing process is required, and this testing is classified into two distinct stages: testing and standardization [91]. During the standardization process, all criteria must be created and accepted. After the development of blockchain, it could be validated against agreed criteria for checking its performance including designers claim. Blockchain testing must be performed using several conditions. Most blockchains in the financial sphere are now employed, and more applications for various fields are being developed. Traditional industries could investigate blockchain and use blockchain to better their systems. For instance, on blockchain user reputations might be saved. At the same time, blockchain might be used in the emerging industry to boost efficiency. For example, Arcade City [92], a ridesharing start-up, offers a market where riders engage directly with drivers utilizing blockchain technology. As mentioned before, an intelligent contract is an automated transaction method, which complies with the contractual conditions [91]. Several blockchain health applications, including smart contracts, permissions to the blockchain, off-chain storage, etc., have been developed based on emerging blockchain concepts. However, to identify, characterize, and analyze the usefulness of blockchain health-care technology, more validation is required.

Emerging trends of blockchain in bioinformatics Chapter

23

401

References [1] S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, 2008, Retrieved from: www.bitcoin.org. [2] I.I. Benna, Optimizing health, Educ. Governance Deliv. Through Blockchain 24–47 (2018), https://doi.org/10.4018/978-1-5225-5448-6.CH002. [3] F. Mohammadipanah, H. Sajedi, Potential of blockchain approach on development and security of microbial databases, Biol. Procedures Online 23 (1) (2021) 1–8, https://doi.org/10.1186/S12575-020-00139-Z. [4] S. Malhotra, S. Chandak, Sunita, What is Estonia Doing with Block Chain in Providing Healthcare to Its Citizens, 2021, March, Available from: https://innohealthmagazine.com/2021/in-focus/what-is-estonia-doing-with-block-chain-in-providing-healthcare-to-its-citizens/. (Retrieved 17 September 2021). [5] G. Chapron, The environment needs cryptogovernance, Nature 545 (7655) (2017) 403–405, https://doi.org/10.1038/545403a. [6] K.N. Griggs, O. Ossipova, C.P. Kohlios, A.N. Baccarini, E.A. Howson, T. Hayajneh, Healthcare blockchain system using smart contracts for secure automated remote patient monitoring, J. Med. Syst. 42 (7) (2018) 130, https://doi.org/10.1007/s10916-018-0982-x. [7] D. Grishin, K. Obbad, G.M. Church, Data privacy in the age of personal genomics, Nat. Biotechnol. 37 (10) (2019) 1115–1117, https://doi.org/ 10.1038/s41587-019-0271-3. [8] C. Krittanawong, A.J. Rogers, M. Aydar, E. Choi, K.W. Johnson, Z. Wang, S.M. Narayan, Integrating blockchain technology with artificial intelligence for cardiovascular medicine, Nat. Rev. Cardiol. 17 (1) (2020) 1–3, https://doi.org/10.1038/s41569-019-0294-y. [9] A. Reina, Robot teams stay safe with blockchains, Nat. Mach. Intell. 2 (5) (2020) 240–241, https://doi.org/10.1038/s42256-020-0178-1. [10] D.R. Wong, S. Bhattacharya, A.J. Butte, Prototype of running clinical trials in an untrustworthy environment using blockchain, Nat. Commun. 10 (1) (2019) 917, https://doi.org/10.1038/s41467-019-08874-y. [11] J. Yli-Huumo, D. Ko, S. Choi, S. Park, K. Smolander, Where is current research on blockchain technology?—a systematic review, PLoS ONE 11 (10) (2016), e0163477, https://doi.org/10.1371/journal.pone.0163477. [12] N. Rasskazova, L. Ratushnaia, Blockchain technology changing traditional methods of applied research in bioinformatics, Int. J. Appl. Res. Bioinform. 9 (1) (2019) 66–74, https://doi.org/10.4018/IJARB.2019010105. [13] A. Baker, Blockchain for Science: Revolutionary Opportunities and Potential Problems—RTInsights, 2019, November, Available from: https:// www.rtinsights.com/blockchain-helps-science-research/. (Retrieved 16 September 2021). [14] L. Bell, W.J. Buchanan, J. Cameron, O. Lo, Applications of blockchain within healthcare, Blockchain Healthc. Today 1 (2018), https://doi.org/ 10.30953/bhty.v1.8. [15] C. Guenther, M. Pierson, N. Modi, Blockchain We Trust: Transforming the Life Sciences Supply Chain, 2018, Retrieved from: https://www. accenture.com/_acnmedia/PDF-71/Accenture_Blockchain_Innovations_Life_Sciences.pdf. [16] L. Thomas, Blockchain Applications in Healthcare, 2021, January 19, Available from: https://www.news-medical.net/health/Blockchain-Applica tions-in-Healthcare.aspx. (Retrieved 16 September 2021). [17] S. Daley, How Using Blockchain in Healthcare is Reviving the Industry’s Capabilities, 2021, Retrieved from: https://builtin.com/blockchain/ blockchain-healthcare-applications-companies. [18] M. Benchoufi, P. Ravaud, Blockchain technology for improving clinical research quality, Trials 18 (1) (2017) 335, https://doi.org/10.1186/s13063017-2035-z. [19] B. Adanaur, Blockchain Based Data Sharing Platform for Bioinformatics Field, Abdullah Gul University, 2020. [20] T. Hirano, T. Motohashi, K. Okumura, K. Takajo, T. Kuroki, D. Ichikawa, et al., Data validation and verification using blockchain in a clinical trial for breast cancer: regulatory sandbox, J. Med. Internet Res. 22 (6) (2020), e18938, https://doi.org/10.2196/18938. [21] D.M. Maslove, J. Klein, K. Brohman, P. Martin, Using blockchain technology to manage clinical trials data: a proof-of-concept study, JMIR Med. Inform. 6 (4) (2018), e11949, https://doi.org/10.2196/11949. [22] C.S. Baron, A. van Oudenaarden, Unravelling cellular relationships during development and regeneration using genetic lineage tracing, Nat. Rev. Mol. Cell Biol. 20 (12) (2019) 753–765, https://doi.org/10.1038/s41580-019-0186-3. [23] A.C. Chin, Blockchain biology, Front. Blockchain 3 (2020), https://doi.org/10.3389/fbloc.2020.606413. [24] M.B. Woodworth, K.M. Girskis, C.A. Walsh, Building a lineage from single cells: genetic techniques for cell lineage tracking, Nat. Rev. Genet. 18 (4) (2017) 230–244, https://doi.org/10.1038/nrg.2016.159. [25] S.M. Shaffer, B.L. Emert, R.A. Reyes Hueros, C. Cote, G. Harmange, D.L. Schaff, et al., Memory sequencing reveals heritable single-cell gene expression programs associated with distinct cellular behaviors, Cell 182 (4) (2020) 947–959.e17, https://doi.org/10.1016/j.cell.2020.07.003. [26] W.Y. Ng, T.-E. Tan, P.V.H. Movva, A.H.S. Fang, K.-K. Yeo, D. Ho, et al., Blockchain applications in health care for COVID-19 and beyond: a systematic review, Lancet Digital Health 3 (12) (2021) e819–e829, https://doi.org/10.1016/S2589-7500(21)00210-7. [27] H. Xu, L. Zhang, O. Onireti, Y. Fang, W.J. Buchanan, M.A. Imran, BeepTrace: blockchain-enabled privacy-preserving contact tracing for COVID-19 pandemic and beyond, IEEE Internet Things J. 8 (5) (2021) 3915–3929, https://doi.org/10.1109/JIOT.2020.3025953. [28] International Institute of Information Technology Bangalore, India’s First-Ever COVID-19 Blockchain Platform—BelYo Launched, 2020, Retrieved from: http://cognitive.iiitb.ac.in/belyo/. [29] V. Chamola, V. Hassija, V. Gupta, M. Guizani, A comprehensive review of the COVID-19 pandemic and the role of IoT, drones, AI, blockchain, and 5G in managing its impact, IEEE Access 8 (2020) 90225–90265, https://doi.org/10.1109/ACCESS.2020.2992341. [30] M. Bilotta, G. Tradigo, P. Veltri, Bioinformatics data models, representation and storage, in: Encyclopedia of Bioinformatics and Computational Biology, vols. 1–3, Elsevier, 2019, pp. 110–116, https://doi.org/10.1016/B978-0-12-809633-8.20410-X. [31] S. Maloy, K. Hughes, Brenner’s encyclopedia of genetics, in: M. Stanley, K. Hughes (Eds.), Brenner’s Encyclopedia of Genetics, second ed., Elsevier, 2013, https://doi.org/10.1016/c2009-1-03766-6.

402 SECTION

C Distributed computing

[32] L. Mander, Comprehensive Natural Products. ii: Chemistry and Biology, Elsevier, Amsterdam, Netherland, 2010. [33] D. Zou, L. Ma, J. Yu, Z. Zhang, Biological databases for human research, Genom. Proteom. Bioinform. 13 (1) (2015) 55–63, https://doi.org/10.1016/ j.gpb.2015.01.006. [34] Enago Academy, Biological Databases: An Overview and Future Perspective—Enago Academy, 2019, July, Available from: https://www.enago. com/academy/biological-databases-an-overview-and-future-perspectives/. (Retrieved 16 September 2021). [35] J.J.-P. Tsai, K.-L. Ng, Application of Omics, AI and Blockchain in Bioinformatics Research, World Scientific (2019), https://doi.org/10.1142/11364. [36] E. Longoria, Blockchain and Bioinformatics—Converging Technologies that Strive to Improve Genetic Data Security—GeneOnline News, 2021, Available from: https://www.geneonline.com/blockchain-and-bioinformatics-converging-technologies-that-strive-to-improve-genetic-datasecurity/. (Retrieved 16 September 2021). [37] Genobank.io, genobank.io, 2018, Available from: https://genobank.io/. (Retrieved 30 August 2021). [38] H.I. Ozercan, A.M. Ileri, E. Ayday, C. Alkan, Realizing the potential of blockchain technologies in genomics, Genome Res. 28 (9) (2018) 1255–1263, https://doi.org/10.1101/gr.207464.116. [39] J.M. Churko, G.L. Mantalas, M.P. Snyder, J.C. Wu, Overview of high throughput sequencing technologies to elucidate molecular pathways in cardiovascular diseases, Circ. Res. 112 (12) (2013) 1613–1623, https://doi.org/10.1161/CIRCRESAHA.113.300939. [40] T.J. Treangen, S.L. Salzberg, Repetitive DNA and next-generation sequencing: computational challenges and solutions, Nat. Rev. Genet. 13 (1) (2012) 36–46, https://doi.org/10.1038/nrg3117. [41] H. Shen, J. Ma, Privacy challenges of genomic big data, in: B. Shen (Ed.), Advances in Experimental Medicine and Biology, vol. 1028, 2017, pp. 139–148, https://doi.org/10.1007/978-981-10-6041-0_8. [42] G. G€ ursoy, C. Brannon, S. Wagner, M. Gerstein, Storing and analyzing a genome on a blockchain, Genome Biol. 3 (2020) 1–7, https://doi.org/ 10.1101/2020.03.03.975334. [43] L. Papageorgiou, P. Eleni, S. Raftopoulou, M. Mantaiou, V. Megalooikonomou, D. Vlachakis, Genomic big data hitting the storage bottleneck, EMBnet J. (2018) 24. Retrieved from: http://www.ncbi.nlm.nih.gov/pubmed/29782620. [44] D. Gurwitz, Y. Bregman-Eschet, Personal genomics services: whose genomes? Eur. J. Hum. Genet. 17 (7) (2009) 883–889, https://doi.org/10.1038/ ejhg.2008.254. [45] A. O’Driscoll, J. Daugelaite, R.D. Sleator, ‘Big data’, Hadoop and cloud computing in genomics, J. Biomed. Inform. 46 (5) (2013) 774–781, https:// doi.org/10.1016/j.jbi.2013.07.001. [46] B.E. Bierer, M. Crosas, H.H. Pierce, Data authorship as an incentive to data sharing, N. Engl. J. Med. 376 (17) (2017) 1684–1687, https://doi.org/ 10.1056/NEJMSB1616595. [47] M. Shabani, Blockchain-based platforms for genomic data sharing: a de-centralized approach in response to the governance problems? J. Am. Med. Inform. Assoc. 26 (1) (2019) 76–80, https://doi.org/10.1093/jamia/ocy149. [48] T.K. Mackey, T.-T. Kuo, B. Gummadi, K.A. Clauson, G. Church, D. Grishin, et al., ‘Fit-for-purpose?’—challenges and opportunities for applications of blockchain technology in the future of healthcare, BMC Med. 17 (1) (2019) 68, https://doi.org/10.1186/s12916-019-1296-7. [49] R.-M. Stephano, J. Edelheit, Blockchain in Genomics, 2021, Retrieved from: https://www.corporatewellnessmagazine.com/article/blockchain-ingenomics#::text¼Companies%20Pioneering%20the%20Blockchain-Genomics%20Infusion&text¼DNAtix%20built%20its%20own% 20blockchain,Craig%20Venter%2C%20using%20Blockchain%20technology. [50] D. Tapscott, A. Tapscott, Blockchain Revolution: How the Technology Behind Bitcoin is Changing Money, Business, and the World, Penguin, New York, 2016. [51] G. G€ ursoy, R. Bjornson, M.E. Green, M. Gerstein, Using blockchain to log genome dataset access: efficient storage and query, BMC Med. Genet. 13 (S7) (2020) 78, https://doi.org/10.1186/s12920-020-0716-z. [52] S. Angraal, H.M. Krumholz, W.L. Schulz, Blockchain technology, Circul.: Cardiovasc. Qual. Outcomes 10 (9) (2017), https://doi.org/10.1161/ CIRCOUTCOMES.117.003800. [53] L.A. Linn, M.B. Koo, Blockchain For Health Data and Its Potential Use in Health IT and Health Care Related Research, 2016, Available from: https:// www.healthit.gov/sites/default/files/11-74-ablockchainforhealthcare.pdf. (Retrieved 31 August 2021). [54] B.A. Dedeturk, A. Soran, B. Bakir-Gungor, Blockchain for genomics and healthcare: a literature review, current status, classification and open issues, PeerJ 9 (2021), https://doi.org/10.7717/PEERJ.12130/SUPP-2. [55] N. Kulemin, S. Popov, A. Gorbachev, The Zenome Project: Whitepaper Blockchain-Based Genomic Ecosystem, 2017, Retrieved from: https:// zenome.io/download/whitepaper.pdf. [56] F. Carlini, R. Carlini, S. Dalla Palma, R. Pareschi, F. Zappone, The Genesy model for a blockchain-based fair ecosystem of genomic data, Front. Blockchain 3 (2020), https://doi.org/10.3389/fbloc.2020.483227. [57] D. Grishin, K. Obbad, P. Estep, K. Quinn, S.W. Zaranek, A.W. Zaranek, G. Church, Accelerating genomic data generation and facilitating genomic data access using decentralization, privacy-preserving technologies and equitable compensation, Blockchain Healthc. Today 1 (2018) 1–23, https:// doi.org/10.30953/bhty.v1.34. [58] K. Bryant, Cryptocurrency to Cryptogenomics: How Blockchain Technology is Changing Genomics, 2018, Retrieved from: https://www.synthego. com/blog/blockchain-genomics. [59] U.W. Chohan, The decentralized autonomous organization and governance issues, SSRN Electron. J. (2017), https://doi.org/10.2139/ SSRN.3082055. [60] R. Carlini, F. Carlini, S. Dalla Palma, R. Pareschi, Genesy: A Blockchain-Based Platform for DNA Sequencing, 2019, Retrieved from: https://www. stellar.org/.

Emerging trends of blockchain in bioinformatics Chapter

23

403

[61] L. Chen, X.-P. Mei, C.-J. Gao, G.-H. Zhang, X.-D. Sun, Histologic distribution, fragment cloning, and sequence analysis of G protein couple receptor 30 in rat submaxillary gland, Anat. Rec. Adv. Integr. Anat. Evol. Biol. 294 (4) (2011) 706–711, https://doi.org/10.1002/ar.21349. [62] M.A. Khan, K. Salah, IoT security: review, blockchain solutions, and open challenges, Futur. Gener. Comput. Syst. 82 (2018) 395–411, https://doi. org/10.1016/j.future.2017.11.022. [63] S.-J. Lee, G.-Y. Cho, F. Ikeno, T.-R. Lee, BAQALC: blockchain applied lossless efficient transmission of DNA sequencing data for next generation medical informatics, Appl. Sci. 8 (9) (2018) 1471, https://doi.org/10.3390/app8091471. [64] A. Gon˜i, A. Burgos, L. Dranca, J. Rodrı´guez, A. Illarramendi, J. Bermu´dez, Architecture, cost-model and customization of real-time monitoring systems based on mobile biological sensor data-streams, Comput. Methods Prog. Biomed. 96 (2) (2009) 141–157, https://doi.org/10.1016/j. cmpb.2009.04.010. [65] X.L. Jin, M. Zhang, Z. Zhou, X. Yu, Application of blockchain platform to manage and secure personal genomic data: a case study of lifecode. AI in China, J. Med. Internet Res. 21 (9) (2019), https://doi.org/10.2196/13587. [66] H. Sun, X. Wang, X. Wang, Application of blockchain technology in online education, Int. J. Emerg. Technol. Learn. (IJET) 13 (10) (2018) 252–259. Retrieved from: https://online-journals.org/index.php/i-jet/article/view/9455. [67] T. Attwood, D.J. Parry Smith, in: Wood (Ed.), Introduction to Bioinformatics, Pearson Education, Asia, 2005. [68] A. Lesk, Introduction to Bioinformatics, Oxford Univeristy Press, 2019. Retrieved from: https://books.google.com/books?hl¼en&lr¼& id¼sCCWDwAAQBAJ&oi¼fnd&pg¼PP1&dq¼Leak,A.,+2008.+Introduction+to+Bioinformatics.Oxford,UK:Oxford+University+Press.& ots¼TATc3Ropqm&sig¼SxxNFizFlJnnrU4gyvZAAp8vL0A. [69] V. Buterin, A next-generation smart contract and decentralized application platform, Etherum January (2014) 1–36. Retrieved from: https://tran slatewhitepaper.com/wp-content/uploads/2021/04/EthereumOrijinal-ETH-English.pdf. [70] S. Raval, Decentralized Applications: Harnessing Bitcoin’s Blockchain Technology, first ed., O’Reilly Media Inc., Newton, MA, USA, 2016. Retrieved from: https://books.google.com/books?hl¼en&lr¼&id¼fvywDAAAQBAJ&oi¼fnd&pg¼PR2&dq¼Raval+S.+2016.+Decentralized +applications:+harnessing+Bitcoin%27s+blockchain+technology.+O%27Reilly+Media.+&ots¼-134t-mMPj& sig¼8P19PRCiwO1uQi15717OUmjz9q4. [71] D. Davydov, I. Pitaikina, Blockchain Technology is Changing the Innovation Aspect in the Digital Economy, 2020, pp. 103–112, https://doi.org/ 10.4018/978-1-7998-1104-6.ch006. [72] Shivom, Shivom, 2018, Retrieved from: https://shivom.io/. [73] K. Servick, CRISPR—A Weapon of Mass Destruction? 2016, Available from: https://www.science.org/news/2016/02/crispr-weapon-massdestruction. (Retrieved 16 September 2021). [74] F. Valdamir, Philosophical and methodological substantiation of projects of human genetic construction, Philos. Thought 8 (2016) 1–10, https://doi. org/10.7256/2409-8728.2016.8.20221. [75] J.P. Roberts, Technology feature j pharmacogenomics: better drugs through better screening, Science 361 (6409) (2018), https://doi.org/10.1126/ science.361.6409.1396-b. 1396.2–1396. [76] C. Fan, S. Ghaemi, H. Khazaei, P. Musilek, Performance evaluation of blockchain systems: a systematic survey, IEEE Access 8 (2020) 126927–126950, https://doi.org/10.1109/ACCESS.2020.3006078. [77] G. Wood, Ethereum: a secure decentralised generalised transaction ledger, Ethereum Project Yellow Paper 151 (2014) 1–32. [78] R. Han, G. Shapiro, V. Gramoli, X. Xu, On the performance of distributed ledgers for internet of things, Internet Things 10 (2020), 100087, https:// doi.org/10.1016/j.iot.2019.100087. [79] A. Gauba, Finality in Blockchain Consensus, 2016, Retrieved from: https://medium.com/mechanism-labs/finality-in-blockchain-consensusd1f83c120a9a. [80] J. Frakenfield, E. Rasure, Y. Perez, Sharding, 2021, Retrieved from: https://www.investopedia.com/terms/s/sharding.asp. [81] D. Dhagarra, M. Goswami, P.R.S. Sarma, A. Choudhury, Big data and blockchain supported conceptual model for enhanced healthcare coverage: the Indian context, Bus. Process. Manag. J. 25 (7) (2019) 1612–1632, https://doi.org/10.1108/BPMJ-06-2018-0164/FULL/XML. [82] C.A. Silva, G.S. Aquino, S.R.M. Melo, D.J.B. Egı´dio, A fog computing-based architecture for medical records management, Wirel. Commun. Mob. Comput. 2019 (2019) 1–16, https://doi.org/10.1155/2019/1968960. [83] T. Quaini, A. Roehrs, C. Andre Da Costa, R. Da, R. Righi, A model for blockchain-based distributed electronic health records, IADIS Int. J. WWW/ Internet 16 (2) (2017) 66–79. [84] J. Brogan, I. Baskaran, N. Ramachandran, Authenticating health activity data using distributed ledger technologies, Comput. Struct. Biotechnol. J. 16 (2018) 257–266, https://doi.org/10.1016/j.csbj.2018.06.004. [85] Q. Xia, E.B. Sifah, K.O. Asamoah, J. Gao, X. Du, M. Guizani, MeDShare: trust-less medical data sharing among cloud service providers via blockchain, IEEE Access 5 (2017) 14757–14767, https://doi.org/10.1109/ACCESS.2017.2730843. [86] G. Nagasubramanian, R.K. Sakthivel, R. Patan, A.H. Gandomi, M. Sankayya, B. Balusamy, Securing e-health records using keyless signature infrastructure blockchain technology in the cloud, Neural Comput. Appl. 32 (3) (2018) 639–647, https://doi.org/10.1007/S00521-0183915-1. [87] T.-T. Kuo, R.A. Gabriel, L. Ohno-Machado, Fair compute loads enabled by blockchain: sharing models by alternating client and server roles, J. Am. Med. Inform. Assoc. 26 (5) (2019) 392–403, https://doi.org/10.1093/jamia/ocy180. [88] X. Liang, J. Zhao, S. Shetty, J. Liu, D. Li, Integrating blockchain for data sharing and collaboration in mobile healthcare applications, in: IEEE International Symposium on Personal, Indoor and Mobile Radio Communications, PIMRC, 2017, pp. 1–5, https://doi.org/10.1109/ PIMRC.2017.8292361.

404 SECTION

C Distributed computing

[89] C. Agbo, Q. Mahmoud, J. Eklund, Blockchain Technology in Healthcare: a systematic review, Healthcare 7 (2) (2019) 56, https://doi.org/10.3390/ healthcare7020056. [90] I. Radanovic, R. Likic, Opportunities for use of blockchain technology in medicine, Health Econ. Health Policy 16 (5) (2018) 583–590, https://doi. org/10.1007/s40258-018-0412-8. [91] Z. Zheng, S. Xie, H.N. Dai, X. Chen, H. Wang, Blockchain challenges and opportunities: a survey, Int. J. Web Grid Serv. 14 (4) (2018) 352–375,https://doi.org/10.1504/IJWGS.2018.095647. [92] S. Solat, M. Potop-Butucaru, Brief announcement: ZeroBlock: timestamp-free prevention of block-withholding attack in bitcoin, in: Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), vol. 10616, LNCS, 2017, pp. 356–360, https://doi.org/10.1007/978-3-319-69084-1_25.

Chapter 24

Blockchain’s potential to rescue sports: A social media perspective Jitendra Yadava, Madhvendra Misrab, Nripendra P. Ranac, Kuldeep Singhd, and Sam Goundare a

Department of Marketing & Strategy, IBS Hyderabad, A Constituent of IFHE (Deemed to be) University, Hyderabad, India, b Indian Institute of

Information Technology, Allahabad, Uttar Pradesh, India, c College of Business and Economics, Qatar University, Doha, Qatar, d Faculty of Management Studies, JAIN (Deemed to be University), Bangalore, Karnataka, India, e School of Science, Engineering and Technology, RMIT University, Hanoi, Vietnam

1. Introduction Since Bitcoin’s inception, several industries such as agri-food [1–3], health care [4–6], or supply chains [2,3,7–9] have been interested in blockchain and this interest extends to the sporting realm. With this technology, data storage and transmission are dispersed and decentralized. This may assist with providing technological answers to issues the industry has been facing for a long time: diversifying financing and revenue sources, combating ticket price speculation and fraud, and implementing antidoping initiatives. As an industry, sport has seen the potential of cryptocurrencies and blockchain technology to foster monetized fan engagement, attract sponsors, and engage world markets in ways that were unprecedented a few decades ago. Passionate fans, each one a digital citizen, devour sports and its associated information above and beyond the actual match period [10,11]. Teams, clubs, and sports organizations innovate to survive and satisfy fans’ expectations in the new digital era [12–15]. The industry has reacted and developed new methods to guarantee that the clubs and fans stay linked in a socially distanced world with the restrictions imposed on the sector by the COVID-19 pandemic. The industry recognizes that blockchain may revolutionize income streams and fan experience via higher crypto-sponsorships, fan tokens, or even by entering the market for blockchain suppliers. Fan tokens are one of the most significant developments to emerge from the sport-blockchain nexus. These digital assets are issued by a sporting organization or club as part of a fan token offering (FTO), which, like an initial coin offering (ICO), does not allow purchasers to acquire stocks and shares but rather allows them to participate in the team’s existence and obtain benefits [16,17]. These utility tokens may then appreciate in value and be traded on the secondary market. The confluence between sport and technology with the development of fans’ engagement tokens is an intriguing breakthrough. A fan token is a fully fungible digital token that provides supporters with access to and influence on specific sports club choices [16–18]. The tokens give the owner the ability to vote on club issues such as uniform design, training names, or charitable activities. They are like membership cards that offer unique benefits for fans, including special VIP access and treatment for some events. Fans may, therefore, purchase fan tokens on socios.com based on the cryptocurrency platform known as Chiliz ($CHZ) [17,18]. They can take part in many decisions taken by their favorite clubs such as choosing a band of colors, picking the name of the training fields, or where they can take the next friendly step. Users may also get unique benefits such as VIP seats, guided tours, meet and greets, and signed merchandise. Though an FTO is generated and given to fans (similar to the concept of an ICO), unlike an IPO, the fan tokens do not reflect stock ownership of any sports team. For example, in less than 2 h after being on sale on the Chilean exchange, FC Barcelona ($BAR) earned US$ 1.3 million. Fan tokens of $BAR have been sold in 106 countries [19]. Collecting cards for a specific sport or group is another method of satisfying fans’ interests. Particularly popular in the 1980s and 1990s, sports cards have evolved considerably due to blockchain and nonfungible tokens (NFTs) [20]. NFTs are a broad variety of distinct physical and intangible things, from collectible sports cards to virtual property and even digital shoes kept in digital wallets. An NFT cannot be replaced. Each NFT is a unique piece of digital technology. The card and collectible business is a multimillion dollar sector that allows fans to immortalize sports events in photos and other media [20]. NFTs also include unique and readily verifiable distinctive information on the blockchain network—each accruing value cannot be duplicated as each NFT is individual. Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00025-5 Copyright © 2023 Elsevier Inc. All rights reserved.

405

406 SECTION

C Distributed computing

Management scholars that focus on technology adoption have paid a lot of attention to blockchain technology. These scholars have underlined the significant impacts of blockchain and the increased possibilities for business development focusing mostly on data protection and supply chain management [2,3,8,9,21]. Although blockchain technology has garnered management scholars’ attention, sport studies have not contributed much to the literature, especially in the field of technology adoption. Motivated by the limited literature on blockchain adoption in the field of sports, this research provides an overview of communications taking place on social media concerning blockchain adoption in sports domain. This study’s findings will provide sports managers with insights that can be utilized when drafting social media marketing campaigns. The remainder of the article can be summarized as follows: the theoretical background supporting this research has been provided in Section 2. Section 3 explains the methodology of data collection and analysis followed by the presentation of results in Section 4. The results have been discussed along with a statement of the theoretical and practical implications of this chapter in Section 5. This chapter ends with some concluding remarks in Section 6.

2.

Theoretical background

Excitement about the Super Bowl is seen every year across the USA. The Super Bowl is an important sporting event which deals with celebrities, half-time events, and action-packed football games. This kind of event shows that the sports sector is a profitable one that produces significant revenues from ticket sales, marketing, concession sales, and goods. Reports indicate that the world sporting sector has an approximate worth of US$ 1.3 trillion [22]. Sports incomes, however, have been adversely affected by the decline of spectators at big sports events [23]. Many fans can now watch live sports on their mobile phones. In addition, eSports are becoming more popular among sports enthusiasts and may be a potential sports business competitor [24,25]. The increase in the number of esports and other online games has caused a decrease in the world’s main sports. The number of participants in major league baseball has, for example, reduced to approximately 9% in 2017, to its lowest in the previous 15 years [26]. In a study on trends, Deloitte [27] said that marketers are spending more money on digital and social networks to reach millennials. Fantasy sports leagues are a fun way to connect with sports enthusiasts worldwide. The hype generated by fantasy sports contributes to the generation of millions of dollars in income. According to estimates, the fantasy sports business grew from US$ 20.36 billion in 2020 to US$ 22.3 billion in 2021 with a growth rate of 9.5% [28]. Sports teams and companies are continuously launching initiatives aimed at increasing fan engagement. Fans share images of sports on social media to show their support for their favorite teams [14,29,30]. Sports teams may reward fans for their support to increase fan engagement and recruit new supporters [15]. Sports teams may reward supporters with blockchain-based tokens for sharing and liking material on social media and for attending a certain number of consecutive games. These tokens may be used for special club items and complimentary admission. Fan tokens’ appeal is rooted in their potential to provide more income sources for clubs and boost their participation significantly. Fiat currency such as dollars, pounds, and euros may be used to buy tokens, which are traded by the fans who swap them for goods, collectibles, or special interactions, such as a VIP experience. Fantasy sports leagues may potentially make use of decentralized currencies to represent their teams and players. By trading tokens, fans may buy more teams and players. Blockchains may be utilized as trustworthy data banks, logging anything from athlete statistics to world records and biometric measures. The data may be automatically saved in the ledger utilizing distributed oracles, removing the possibility of receiving erroneous data. TV networks pay the Europa League and the Champions League billions of euros for exclusive broadcasting rights. Blockchain technology may be used to establish popular pay-per-view broadcasts in sports such as the Ultimate Fighting Championship. The cryptography inherent in blockchain technology enables consumers to be authenticated online without going through cable providers as intermediaries. Though the scope of adopting blockchain adoption in the sports domain is huge, it has been a topic largely overlooked by management researchers. A huge corpus of recent literature [1–3,5,7–9,21,31–33] on blockchain adoption in various business sectors such as supply chain, food security, tourism, and hospitality have been found but the studies in the sports domain are very limited. However, a few recent studies [6,34,35] have been conducted concerning the secured data transfer of athlete records from one entity to another without the intervention of third parties. All these prior studies have been conducted from an organizational point of view using traditional research methodologies. This study followed a nontraditional research approach and explored the readiness and inclination of consumers (sports fans) toward the adoption of blockchain technology in the various facets of sports business operations. This chapter, through social media analytics, explored the sentimental inclination of consumers toward blockchain integration in sports and the network structure of the discussions taking place over Twitter.

Blockchain’s potential to rescue sports Chapter

24

407

3. Methodology 3.1 Data collection Twitter may be defined as a website for microblogging where users communicate via short comments called “tweets.” These tweets offer views and information about current events related to personal or social topics. With Twitter, researchers may utilize a variety of computer interfaces to extract tweets including user views, hashtags, and screen names. This research was performed using RStudio, which extracted and analyzed tweets with the keyword “sports blockchain” using the twitteR package [15,36]. Using the Twitter API, a total of 913 tweets were collected within a 1-week timeframe.

3.2 Algorithmic evaluation The tweets collected were preprocessed following the methodology proposed by Piryani et al. [37] and Yadav et al. [15,38,39] to remove any non-ASCII characters, emoticons, URLs, unnecessary spaces, breaks, and stopwords. Further sentiment analysis was conducted on the processed tweets using the NRC Word-Emotion Association Lexicon repository [40] to explore the sentiment inclination of the words contained in the tweets and emotions displayed by the users. From the processed tweets, the most frequently used hashtags and words were segregated to discover which segments were a major focus of the discussions concerning blockchain adoption in the sports domain. A bigram analysis produced the association between the cooccurrence of the most frequent terms in the discussions. With Twitter being an open social media platform that facilitates information from a variety of sources, the identification of key information sources promoting blockchain adoption in sports was important. By using a network approach, this chapter identified the most important active and influential in the Twitter network.

4. Results 4.1 Sentiment analysis Sentiment analysis was conducted on the processed dataset using the Syuzhet package in RStudio [41]. It categorized tweets into positive and negative sentimental polarities and into eight emotions—anger, anticipation, disgust, fear, joy, sadness, surprise, and trust (see Fig. 1). This sentimental categorization of the tweets was based on the NRC Word-Emotion Association Lexicon repository [40].

FIG. 1 Sentiment frequency of tweets. (Source: Author.)

408 SECTION

C Distributed computing

The above plot shows the overall frequency of sentiments displayed by the users in their tweets. From the visualization, it can be seen that there is a very high positive attitude toward the adoption and use of blockchain technology in the sports domain. To better understand the above visualization, individual tweets have been classified into positive, neutral, and negative polarities. Table 1 contains a sample of tweets with positive and negative tweets concerning blockchain application to various sports facets. TABLE 1 Semantic classification of tweets. Sentiment category

Polarity value

@sportsmktgguy @PaniniAmerica These are my FAVORITE NFTs in the market. Artistic! Sexy! Can I please request Kaboo… https://t.co/YtiPgeGcg1

Positive

3.1

15+ HIVE won on the last round of actifit gadget prize! Congrats to the winner Will you be our next winner?… https://t.co/HNOjReKMuc

Positive

3.05

@TradeStarsOK Very good project. Looking so sustainable. Hope it will go a long way in future. Really happy to be pa… https://t.co/tsmynEgJIh

Positive

3

Professional sports and similar platforms for celebrating human accomplishment also create downstream fan markets:… https://t.co/BhEJRXrBpu

Positive

2.75

@TradeStarsOK What a great project, good vision and relevant team solidly behind it. @GameoneC1 @Goodboy101b… https://t.co/ImGGP8JJ1h

Positive

2.55

When: 14 August, 02:00 PM UTC Where: @DoraemonIdChat Rewards: $50 worth $ARC tokens Prize Pool for the BEST Qu… https://t.co/ETfJgl1L9f

Positive

2.55

@TradeStarsOK This is a wonderful innovation which the team just started, it’s certain it’s going to take over the… https://t.co/GmTrhP8Djq

Positive

2.3

CHILIZ j CHICAGO BULLS JOIN SOCIOS. COM’S GLOBAL FAN ENGAGEMENT NETWORK Chicago Bulls are proud to announce a new… https://t.co/07j8piGP4d

Positive

2.2

1/2 “In 2021, sports organizations should consider three key strategic opportunities to boldly position themselves… https://t.co/QntLRmJd6w

Positive

1.85

Fans of @ufc finally get their NFTs, made possible through a partnership with @paniniamerica #niftysports #nft… https://t.co/iSZx2mePwS

Positive

1.8

Non-fungible tokens (NFT) are not merely game rewards alone. These tokens can be garnered in various “play-to-earn”… https://t.co/W8BA02Wr33

Negative

0.01

RT @ludus_eth: As clear as water, just as @joerogan described it. In sports, centralization (sports federations) directly interferes with t…

Negative

0.1

WIN Bluebombers vs TOR Argonauts Can the Argos really be this bad? https://t.co/5wa2nNMqJH #Wagerr #NoLimit… https://t.co/wsy3XNbWMi

Negative

0.25

Africa sugar daddy poo bowel movement i love italian seo gaming irritable bowel syndrome rare! Goose sandwiches blo… https://t.co/vbsAv3ZIAB

Negative

0.25

The crypto bug is seemingly proving to be having a big bite on the sports industry as Tom Brady joins other sports… https://t.co/B4oK4AYxyv

Negative

0.35

Anyways. If everyone has ten monitors in front of their face tracking weather or betting illegally on the meteorolo… https://t.co/2pXi6po7Dm

Negative

0.5

Could this turn in government adoption be triggered by more sports teams adding #cryptocurrency as payment, #NFT fo… https://t.co/A6xpd7ni8g

Negative

0.5

@SCryptoschool @olesportslab Soccer is one of the most played sports in the whole world and there’s no mistaking th… https://t.co/rZkqymSq3b

Negative

0.8

Messi joins crypto craze as gets part of PSG fee in fan tokens: https://t.co/L8iJyxLbJI

Negative

0.85

@EvaluateMarket As a sports fan, I was disappointed when you guys shifted over to avatar NFTs rather than sports NF… https://t.co/FlnxONtnDk

Negative

1

Tweet

Blockchain’s potential to rescue sports Chapter

24

409

FIG. 2 Most prominent keywords. (Source: Author.)

From the above tabulation, it can be seen that users commented most on the adoption of blockchain for transactions in the form of cryptocurrencies such as NFTs that can be possessed by both the players and fans for various sports-related transactions. A curated list of terms (keywords) with the maximum frequency of occurrence in the complete dataset has been shown in Fig. 2. Both Table 1 and Fig. 2 show that users on Twitter have tweeted mostly on the adoption and use of NFTs and probable advancements that can be achieved through the use of blockchain technology in sports. However, Fig. 2 only displays the frequency of terms used in the total corpus of tweets and retweets. To understand the pattern of term occurrence and also the conjoint appearances of the terms, we used bigrams (see Fig. 3).

FIG. 3 Bigram network of terms. (Source: Author.)

410 SECTION

C Distributed computing

FIG. 4 Organic tweets versus retweets versus replies. (Source: Author.)

Though the network diagram shows that the blockchain-related keywords (such as blockchain, technology, cryptocurrency, and mining) have been jointly used with sports keywords (such as fans, football, betting, and fantasy sports), it is important to investigate the sources generating tweets concerning blockchain use in sports. The total organic tweets generated and the number of replies and retweets obtained by all the organic tweets in the corpus are shown in Fig. 4. The high percentage of retweets led us to investigate the users whose tweets were retweeted most and it was found that the majority of the information consumed by the users is generated by organizations (see Table 2). The retweet network analysis of all retweeted users was done to visualize the direction of the flow of information (see Fig. 5).

5.

Discussion

This chapter uses a dataset of 913 tweets that were preprocessed to eliminate unnecessary characters. The sentiment analysis on the processed tweets showed that the users hold a positive inclination toward blockchain adoption in the sports TABLE 2 Top 10 retweeted users. Screen name

Retweet frequency

Type

TRADESTARSOK

55

Organization

STARSXPLATFORM

14

Organization

ULTIMATECRYPTO4

11

Organization

REDPILLBLUE1

7

Organization

SCALPING_KINGS

5

Organization

888TRON

4

Organization

FANANCECLUB

4

Organization

OG45THPREZ

4

Organization

ACTIFIT_FITNESS

3

Organization

SCRIPT_NETWORK

3

Organization

Blockchain’s potential to rescue sports Chapter

24

411

FIG. 5 Retweet network. (Source: Author.)

domain. The analysis also shows that there is a very high frequency of occurrence of NFTs in the discussions that depicts high concern for the use of blockchain technology stating the ownership of a product. However, the majority of original tweets were generated from the users representing certain organizations offering blockchain-based gaming platforms. The network analysis revealed that the information generated by these organizational users was consumed by the users (gamers and sports consumers) and also that the nature of communications was unidirectional. It was also found that these sports consumers tend to share the information through retweets but the reciprocation of information was limited to their firstdegree contacts. The retweet network diagram also revealed that the communication networks were fragmented, that is, user groups derived information from a single source disseminating a particular piece of information. The two major organizations, TradeStars and StarsX, both tweeted on the use of NFT tokens for trade in sports but there were no connections found across the retweet network structure as shown in Fig. 5. One of the probable reasons that can be inferred is the limited replies made by the sports consumers as it can be seen from Fig. 4 that only 10% of replies were generated, and on the other side, the retweet count was significantly high (68%).

5.1 Theoretical implications Multiple studies [34,35] have recently been conducted concerning blockchain adoption in the sports domain for secured health and athlete information transfer from one organization to the other. However, none of the previous literatures explores the communication pattern of blockchain adoption in sports on widely used information-sharing platforms such as social media. This study explored for the first time the information transmission pattern on a social media platform. This chapter used a widely used social media platform—Twitter—and to our surprise, only limited tweets were obtained. This indicates that the users are only infrequently talking about blockchain adoption in sports. Also, these limited

412 SECTION

C Distributed computing

communications are having a shorter reach as the user networks are fragmented and hence the information generated is limited to close network members and also may suffer from frequent decay. Future research can expand on this study to find the probable reasons for the low levels of discussion on blockchain adoption in the sports domain.

5.2 Practical implications This chapter provides critical insights for managers, sports practitioners, and people engaged in publicity and media management. It will enable blockchain-based sports start-ups with an opportunity to ponder over the effectiveness of using social media channels when drafting a promotion strategy for their organizations. This chapter’s initial findings were that out of the 913 tweets scraped, only 196 original tweets were generated that contained first-hand information and received 625 retweets. This shows that users are open to the consumption of this information and that organizations must engage in more information generation, utilizing the network power offered by Twitter. This research’s findings also suggest that users are refraining from replying to or commenting on the messages delivered on social media. One of the probable reasons for this could be the low knowledge levels of the users about blockchain technology and its integration with sports. This low reply rate could lead to a loss of information dissemination to second- or third-degree connections on social media. Apart from engaging in the direct advocation of the services offered and advantages of using the platform, organizations should also engage in the dissemination of basic knowledge about the technology and how it is integrating with sports. Organizations should encourage users to post their views and questions in the form of replies and engage in rereplies that may contribute to the upgrading of users’ knowledge and positive commenting behaviors. Apart from appointing official members, organizations could ally with influencers as they have extensive networks with high engagement rates. They also possess high levels of trust among consumers as knowledge disseminators [15,38,39,42,43].

5.3 Limitations and future scope of research Like any research, this study suffers from certain limitations. This chapter’s dataset was modest due to the application programming interface limitation when scraping data from Twitter. Future researchers can gather a larger dataset by using other social media platforms offering a longer timeline for data scraping. Also, through qualitative analysis, this chapter provides an overview of the communication network structure and finds that users reply less on organic tweets. Future studies can be conducted adopting a quantitative approach to unearth the probable reasons for low response rates from the users in the form of comments or replies. Prospective research can replicate this chapter on various other social media platforms to investigate the communication network structures on other platforms and varying research domains.

6.

Concluding remarks

The initial investigation of the Twitter data found that the users have a positive inclination toward the adoption of blockchain technology in the sports domain but the majority of the information on the platform was generated by organizational entities. This chapter also found that users’ reply rate is significantly low compared to the high retweet behavior. Since this study provided a qualitative overview of the blockchain sports integration scenario on social media, future researchers through quantitate analysis can explore the possible causes of this behavior over social media. This chapter suggests that organizations must engage in disseminating knowledge of blockchain technology, its advantages, and how it is being integrated with sports infrastructure. This chapter also proposes the election of influential social media users for effective customer engagement.

References [1] X. Lin, et al., ‘Consumers’ intention to adopt blockchain food traceability technology towards organic food products, Int. J. Environ. Res. Public Health 18 (3) (2021) 912, https://doi.org/10.3390/ijerph18030912. [2] J. Yadav, M. Misra, S. Goundar, An overview of food supply chain virtualisation and granular traceability using blockchain technology, Int. J. Blockchains Cryptocurrencies 1 (2) (2020) 154, https://doi.org/10.1504/IJBC.2020.108997. [3] J. Yadav, M. Misra, S. Goundar, Autonomous agriculture marketing information system through blockchain: a case study of e-NAM adoption in India, in: Blockchain Technologies, Applications and Cryptocurrencies, World Scientific, 2020, pp. 115–138, https://doi.org/10.1142/ 9789811205279_0005. [4] S. Balasubramanian, et al., A readiness assessment framework for Blockchain adoption: a healthcare case study, Technol. Forecast. Soc. Chang. 165 (2021) 120536, https://doi.org/10.1016/j.techfore.2020.120536.

Blockchain’s potential to rescue sports Chapter

24

413

[5] A. Kumar, R. Liu, Z. Shan, Is Blockchain a silver bullet for supply chain management? Technical challenges and research opportunities, Decis. Sci. 51 (1) (2020) 8–37, https://doi.org/10.1111/deci.12396. [6] S. Yu, Application of blockchain-based sports health data collection system in the development of sports industry, in: S.-B. Tsai (Ed.), Mobile Information Systems, 2021, pp. 1–6, https://doi.org/10.1155/2021/4663147. [7] R. Dubey, et al., Blockchain technology for enhancing swift-trust, collaboration and resilience within a humanitarian supply chain setting, Int. J. Prod. Res. 58 (11) (2020) 3381–3398, https://doi.org/10.1080/00207543.2020.1722860. [8] L. Hughes, et al., Blockchain research, practice and policy: applications, benefits, limitations, emerging research themes and research agenda, Int. J. Inf. Manag. 49 (February) (2019) 114–129, https://doi.org/10.1016/j.ijinfomgt.2019.02.005. [9] D. Mathivathanan, et al., Barriers to the adoption of blockchain technology in business supply chains: a total interpretive structural modelling (TISM) approach, Int. J. Prod. Res. 59 (11) (2021) 3338–3359, https://doi.org/10.1080/00207543.2020.1868597. [10] F. Lera-Lo´pez, A. Ollo-Lo´pez, J.M. Sa´nchez-Santos, Is passive sport engagement positively associated with happiness? Appl. Psychol. Health Well Being 13 (1) (2021) 195–218, https://doi.org/10.1111/aphw.12227. [11] T. Tang, J. Kucek, S. Toepfer, Active within structures: predictors of Esports gameplay and spectatorship, Commun. Sport (2020), 216747952094274, https://doi.org/10.1177/2167479520942740. [12] D. Antunovic, M. Hardin, Women bloggers: identity and the conceptualization of sports, New Media Soc. 15 (8) (2013) 1374–1392, https://doi.org/ 10.1177/1461444812472323. [13] Y. Li, Y. Guo, Virtual gifting and danmaku: what motivates people to interact in game live streaming? Telematics Inform. 62 (April) (2021) 101624, https://doi.org/10.1016/j.tele.2021.101624. [14] V. Prado-Gasco´, et al., To post or not to post: social media sharing and sporting event performance, Psychol. Mark. 34 (11) (2017) 995–1003, https:// doi.org/10.1002/mar.21038. [15] J. Yadav, M. Misra, K. Singh, Sensitizing Netizen’s behavior through influencer intervention enabled by crowdsourcing – a case of reddit, Behav. Inform. Technol. (2021) 1–12, https://doi.org/10.1080/0144929X.2021.1872705. [16] K. Dwyer, What Are Fan Tokens?, CoinMarketCap, 2021. Available at: https://coinmarketcap.com/alexandria/article/what-are-fan-tokens. (Accessed 25 August 2021). [17] Socios, Fan Tokens, 2021, Available at: https://www.socios.com/fan-tokens/. (Accessed 25 August 2021). [18] Chiliz, What is a Fan Token and How do They Work?, Chiliz $CHZ, 2021. Available at: https://www.chiliz.com/en/what-is-a-fan-token-and-howdo-they-work/?__cf_chl_jschl_tk__¼pmd_IIkPygFx.0rTiE0kgxZoWcFGiqo2ClGZOKEuvO45Qfs-1629869697-0-gqNtZGzNAhCjcnBszQeR. (Accessed 25 August 2021). [19] A. Clarke, FC BARCELONA ($BAR) Fan Token Sells Out In Less THAN Two Hours Generating $1.3M, Socios, 2020. Available at: https://www. socios.com/fc-barcelona-bar-fan-token-sells-out-in-less-than-two-hours-generating-1-3m/. (Accessed 25 August 2021). [20] L. Cohen, Crypto Meets Baseball Cards … the Birth of NFTs, Citrin Cooperman, 2021. Available at: https://www.citrincooperman.com/infocus/ crypto-meets-baseball-cards-the-birth-of-nfts. (Accessed 25 August 2021). [21] Y.K. Dwivedi, et al., Impact of COVID-19 pandemic on information management research and practice: transforming education, work and life, Int. J. Inf. Manag. 55 (July) (2020) 102211, https://doi.org/10.1016/j.ijinfomgt.2020.102211. [22] Plunkett Research, Sports Industry Statistic and Market Size Overview - Industry Statistics, Plunkett Research Ltd, 2021. Available at: https://www. plunkettresearch.com/statistics/Industry-Statistics-Sports-Industry-Statistic-and-Market-Size-Overview/. (Accessed 25 August 2021). [23] W. Leitch, Nobody’s Going to Sports in Person, and No One Seems to Care, 2018, Available at: https://nymag.com/intelligencer/2018/07/nobodysgoing-to-sports-in-person-and-no-one-seems-to-care.html. (Accessed 25 August 2021). [24] K. Hallmann, T. Giel, eSports – competitive sports or recreational activity? Sport Manag. Rev. 21 (1) (2018) 14–20, https://doi.org/10.1016/j. smr.2017.07.011. [25] J. Macey, et al., Does esports spectating influence game consumption? Behav. Inform. Technol. (2020) 1–17, https://doi.org/10.1080/ 0144929X.2020.1797876. [26] D. Singer, We are wrong about millennial sports fans, Sports Bus. J. (2017) 1–12. September(October). [27] Deloitte, Deloitte’s Sports Industry Starting Lineup, 2018, Available at: https://www2.deloitte.com/bg/en/pages/life-sciences-and-healthcare/ articles/deloitte-sports-business-trends-disruption.html. (Accessed 25 August 2021). [28] BRC, Global Fantasy Sports Market Data and Industry Growth Analysis, 2021, Available at: https://www.thebusinessresearchcompany.com/pressrelease/global-fantasy-sports-market-2021. (Accessed 25 August 2021). [29] M. Romney, R.G. Johnson, Show me a story: narrative, image, and audience engagement on sports network Instagram accounts, Inf. Commun. Soc. 23 (1) (2020) 94–109, https://doi.org/10.1080/1369118X.2018.1486868. [30] J.L. Shermak, Scoring live tweets on the beat: examining twitter engagement in sports newspaper beat reporters’ live coverage, Digit. Journal. 6 (1) (2018) 118–136, https://doi.org/10.1080/21670811.2017.1338144. [31] V. Filimonau, E. Naumova, The blockchain technology and the scope of its application in hospitality operations, Int. J. Hosp. Manag. 87 (2020) 102383, https://doi.org/10.1016/j.ijhm.2019.102383. [32] W. Rashideh, Blockchain technology framework: current and future perspectives for the tourism industry, Tour. Manag. 80 (2020) 104125, https:// doi.org/10.1016/j.tourman.2020.104125. [33] J. Weking, et al., The impact of blockchain technology on business models – a taxonomy and archetypal patterns, Electron. Mark. 30 (2) (2020) 285–305, https://doi.org/10.1007/s12525-019-00386-3. [34] C. Liu, et al., Trusted player transfer evaluation for sport markets based on blockchain and locality-sensitive hashing, IEEE Access 9 (2021) 87332–87339, https://doi.org/10.1109/ACCESS.2021.3089546.

414 SECTION

C Distributed computing

[35] Y. Shan, Y. Mai, Research on sports fitness management based on blockchain and internet of things, EURASIP J. Wirel. Commun. Netw. 2020 (1) (2020) 201, https://doi.org/10.1186/s13638-020-01821-2. [36] J. Gentry, Package ‘twitteR’ Title R Based Twitter Client Description Provides an interface to the Twitter web API, CRAN, 2016. Available at: https://cran.r-project.org/web/packages/twitteR/twitteR.pdf. (Accessed 5 October 2020). [37] R. Piryani, D. Madhavi, V.K. Singh, Analytical mapping of opinion mining and sentiment analysis research during 2000–2015, Inf. Process. Manag. 53 (1) (2017) 122–150, https://doi.org/10.1016/j.ipm.2016.07.001. [38] J. Yadav, M. Misra, N.P. Rana, K. Singh, Exploring the synergy between nano-influencers and sports community: behavior mapping through machine learning, Inf. Technol. People (2021), https://doi.org/10.1108/ITP-03-2021-0219 (ahead-of-print). [39] J. Yadav, M. Misra, N.P. Rana, K. Singh, et al., Netizens’ behavior towards a blockchain-based esports framework: a TPB and machine learning integrated approach, Int. J. Sports Mark. Spons. (2021), https://doi.org/10.1108/IJSMS-06-2021-0130 (ahead-of-print). [40] S. Mohammad, NRC Emotion Lexicon, Saif Mohammad, 2015. Available at: http://saifmohammad.com/WebPages/NRC-Emotion-Lexicon.htm. (Accessed 12 August 2020). [41] M.L. Jockers, Syuzhet- Extracts Sentiment and Sentiment-Derived Plot Arcs from Text, CRAN, 2017. Available at: https://cran.r-project.org/web/ packages/syuzhet/syuzhet.pdf. (Accessed 28 October 2020). [42] E. Ismagilova, et al., The effect of characteristics of source credibility on consumer behaviour: a meta-analysis, J. Retail. Consum. Serv. 53 (February 2019) (2020) 101736, https://doi.org/10.1016/j.jretconser.2019.01.005. [43] E. Ismagilova, Y.K. Dwivedi, E. Slade, Perceived helpfulness of eWOM: emotions, fairness and rationality, J. Retail. Consum. Serv. 53 (November 2018) (2020) 101748, https://doi.org/10.1016/j.jretconser.2019.02.002.

Chapter 25

Design and development of a mobile application for level monitoring of oxygen cylinders using block chain technology K. Sujathaa, T. Kavithab, N.P.G. Bhavanic, C. Tamilselvid, K. Senthil Kumard,e, U. Jayalatsumie, V. Srividhyaf, and B. Rengammal Sankaria a

EEE Department, Dr. MGR Educational and Research Institute, Chennai, Tamil Nadu, India, b Department of Civil Engineering, Dr. MGR Educational

and Research Institute, Chennai, Tamil Nadu, India, c Department of ECE, Saveetha School of Engineering, SIMATS, Chennai, Tamil Nadu, India, d

Department of IT, Dr. MGR Educational and Research Institute, Chennai, Tamil Nadu, India, e Department of ECE, Dr. MGR Educational and Research

Institute, Chennai, Tamil Nadu, India, f EEE Department, Meenakshi College of Engineering, Chennai, Tamil Nadu, India

1. Introduction Industry produces large number of smart gadgets that can connect to various networks. Smart gadgets can sense their surroundings and interact with other smart devices in network. Kevin Ashton initially proposed Internet of Things in lecture about supply chains [1]. IoT is one of building blocks for creating a smart environment. Low-power embedded systems, fog computing, cloud computing, big data, machine learning, and networking are all being combined. Internet has grown so popular in twenty-first century that number of devices linked to network has reached billions, making world’s population minority. As billions of devices become linked, massive amount of data and information is created and exchanged between them. To alleviate the difficulty, IoT offers a lot of scope for development of various medical applications that will facilitate smart hospitalization. Internet of Things makes traditional networks and applications more real time, allowing for deployment of various sensors and smart devices to be monitored in real time. Data analysis may be done with the help of some associated technology, which speeds up system’s operation. Usage of cloud computing speeds up processing and computation by performing functions at network’s edge [2–4]. Presently, the medical care for the diagnosed corona virus-2019 (COVID-19)-affected patients is a challenging task worldwide as the disease is spreading at a very faster rate when one person with the disease comes into contact with the other. Current information denotes that several people are detected with COVID-19 and the data analyst says that the rate of spread of the disease is increasing exponentially, across many countries in the world [1]. This investigation has facilitated the need for designing an oxygen level monitoring technique in an oxygen cylinder used as the support system for COVID-19-affected patients. Monitoring the level of oxygen in the cylinders is very important because they are used for saving the lives of the patients suffering from COVID-19. Not only the COVID-19 patients are dependent on this system, but this system will also be helpful for other patients who require oxygen support. The present scenario is that, many patients affected by COVID-19 are admitted in hospitals, that manual monitoring of all these oxygen cylinders become a difficult task. If this level monitoring of oxygen cylinders are automated and developed as a mobile App, it would be of great use to the medical field, saving the lives of the patients who are left unmonitored during this pandemic. This proposal is entitled to develop a system to measure oxygen level using a smartphone App which will send instantaneous values about the level of the oxygen inside the cylinder. Pressure sensors and load cell are fitted to the oxygen cylinders, which will measure the oxygen content inside the cylinder in terms of the pressure and weight. The pressure sensors and load cells are connected to the Arduino board and are programmed to display the actual level of oxygen inside the cylinder in terms of numerical values. A beep sound is generated as an indicator to caution the nurses and attendants of the patients regarding the level of the oxygen inside the cylinder when it is only 15% of the total oxygen level in the cylinder in correlation to the pressure and weight [5]. The signal with respect to the level corresponding to the measured pressure and weight of the cylinder is further transmitted to the monitoring station through Global System for Mobile communication (GSM). Graphical display is used at monitoring end to indicate the level of oxygen inside all oxygen cylinders to facilitate Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00017-6 Copyright © 2023 Elsevier Inc. All rights reserved.

415

416 SECTION

C Distributed computing

actions like 100% full, 80% full, 60% full, 40% full, 20% full which states that the oxygen cylinder is in good condition, or requires a replacement of empty cylinders with filled ones in correlation to the pressure and weight being sensed by the sensors. The levels of the oxygen monitored inside the cylinder can also be stored on a cloud storage which will facilitate the retrieval of the status at any point of time, as when required by the physicians and nurses. These results reported, are valued in monitoring the level of the oxygen cylinder connected to the patients, affected by COVID-19, using a smartphone App. This mobile phone App is an effective tool for investigating the oxygen cylinder level used as a life-support system for COVID-19-affected patients. A virtual model of the partial system is developed using TINKER CAD simulation package [6]. In real time, the sensor data analysis will be performed to detect and track the level of the oxygen cylinders.

2.

Literature review

2.1 International status Yang et al. [1] investigated that by using a smartphone, the health conditions of the patients can be monitored online. He also decided that a low-cost device would be helpful in health monitoring. This PHM gate is a separate hardware placed in between the mobile phone and the sensors that are attached to the human body. The operating system (OS) requires an Android and an environment to develop software as proposed by John Whipple et al. [5]. The information about the speed and location was collected using a receiver with Global Positioning System (GPS). Google Maps with application programming interface (API) was used to find the location whichever is nearer to the schools. The system will produce an alarm if the speed exists beyond certain limits. An Android mobile phone was used for developing smart health monitoring system by Heming Pang et al. [6]. The data is collected and processed at the server and the data is sent to the terminals of the mobile phone through the socket enabling a wireless monitoring system to monitor the target site from anywhere at any time [6]. This system has greater flexibility and used to collect the various sensor data and display it. Wanhong Wu et al. [7] suggested a scheme, where there is no need for an exclusive caretaker. Sensors are used to gather the signals in the real domain with the help of the Bluetooth in the smartphone. Initial processing is done on smartphone itself and connected with GSM to transfer the data and messages periodically. Alert messages are sent during medical emergencies. Shye et al. [8] studied the various qualities of the smartphone and inferred that the users recharge their mobiles every day even with only 20% of the power in the battery. Finally, he inferred that energy optimization techniques are not incorporated which leads to failure in the medical field. Pathak et al. [9] proposed a novel system by using the modeling approach for not saving the power after usage. A new modeling scheme with optimal usage of power for smartphones equipped with Android and Windows Mobile is discussed here. Falaki et al. [10] proposed a paper where the two factors that are responsible for energy drain are discussed here. They also demonstrate the user behaviors to predict future energy drain on the smartphone. They are not proposing any energy optimizing functionality in smartphone so that the phone will run long time before the next battery recharge. In Sweden, a system for monitoring the oxygen level in the oxygen cylinder is proposed by using a pressure sensor which is constructed using MEMS technology. These MEMS sensor will measure the level of the oxygen inside the cylinder and convert it to equivalent electrical signal based on which a display is generated along with a buzzer sound to indicate the critical situation enabling the replacement of the cylinders. Health care, smart parking, smart grid, smart lighting, smart product management, air pollution, forest fire detection, and earthquake early detection are some of uses of Internet of Things. Our main goal is to create smart IoT-based home system. Block chain is made up of eight distinct components, each with its own set of specifications. Ledger is immutable and distributed historical record, and block chain’s objective is to build one. Peer network is used to store, update, and maintain ledger [2–4]. This ledger is replicated by each node in network. Goal of this network is to reach consensus on content of each update. This eliminates requirement for centrally copied ledger and assures that all ledger copies are identical. Membership Services Department is in charge of user permission, authentication, and identity management. Smart house is private residence that transmits and receives data in real time. Through different household gadgets such as TVs, lighting, and refrigerators, it delivers automated and intelligent services. These devices are part of home-based communication system that allows gadgets to interact with one another and with outside world without requiring human intervention. Users control range of home gadgets to monitor and manage themselves according on their preferences and home network configuration [4].

Design and development of a mobile App using block chain technology Chapter

25

417

2.2 National status In Indian hospitals, the system used for oxygen management is called as common oxygen supply system (OSS). This scheme is need of a foolproof system to supply the oxygen gas to the patients admitted in hospitals for critical care. The standard procedure for oxygen gas supply includes the following ways: (a) Cylinders filled with oxygen gas with a movable tank for storage: This is known as compressed gas system which requires refilling of the cylinders frequently. On the other hand, they need a central refilling system with proper transport which is economical and consistent. (b) Oxygen concentrators (fixed and portable): This device carries oxygen for healing the patients and eliminates the other unwanted gases present. This type is not portable and fixed to the bed side. The advantages include cost-effectiveness and are not in need of filling the tanks. The main disadvantage is that, a continuous power supply is needed along with maintenance. (c) Central source with liquid tank and a unit for oxygen generator: An interconnected system of pipes to supply oxygen to the required patients under critical care is necessary. For very big systems, large oxygen cylinders with greater capacity are required which supplied to the patients through centralized pipeline infrastructure. Oxygen generators will be used in hospitals which require high oxygen content. These systems need a continuous power supply with trained personnel to monitor the system [11]. Health monitoring devices used for monitoring the patients in the intermediate (IMCU) and intensive care units are constructed using wearable technology (ICU). They have wired connections with sensors being integrated to enable continuous monitoring of the patients. As advancement, a wireless personal area network is being used to have consistent transmission of physiological parameters that are being measured from the patients. The hardware module uses 8051 microcontroller which is the gateway to ZigBee and GSM module. This wireless technology consumes low power and is portable which enables measurement at any point ensuring safety and security [12].

3. Importance of the proposed work 3.1 Gaps identified Presently, the smartphone-based App is not used to track level of the oxygen cylinders used to treat the COVID-19-affected patients. The researchers have not developed the technology to infer the level of the oxygen cylinders for those patients affected by COVID-19 using a non-contact method. Hence from our side, it is focused to develop a robust smartphone App which will use an intelligent technique to detect the level of the oxygen inside the oxygen cylinder using pressure sensor and load cell, ensuring replacement of the oxygen cylinders at an appropriate time without human intervention for monitoring the supply of oxygen to COVID-positive patients. This scheme can support level monitoring of any number of oxygen cylinders at the same time without human interference by using pressure sensor and load cell. The proposed smartphone App which will infer the level of the oxygen gas present inside the cylinder connected to COVID-positive patients in a critical condition using a pressure sensor and load cell. All these sensor modules will be integrated to the Arduino board and are programmed to display the pressure and weight values in proportion to the actual level of oxygen inside the cylinder in terms of numerical values. This technique will also avoid the time delay in checking the level of the oxygen cylinder manually, which also a cumbersome process. When the level of the oxygen inside the cylinder reaches a minimum value (for example, 15% of the total oxygen level in the cylinder), an alarm signal along with an alert message can be generated and the information can be instantaneously displaced on the mobile phone. The signal with respect to the level of the cylinder is further transmitted to the monitoring station through Global System for Mobile communication (GSM) connected with the Arduino board, so that it becomes easy to track and monitor the patients and send the information to the smartphone. The related App installed in smartphone will enable the online remote oxygen level monitoring inside the oxygen cylinders.

3.2 Novelty The proposed online, remote level monitoring in oxygen cylinders for COVID-19-affected patients uses a smartphone App which is built, to remotely measure and monitor the level of oxygen inside the cylinders used for patients affected by COVID-19 by integrating the pressure sensor and load cell. This method enables user-friendly measurements of oxygen levels in the cylinder by embedding intelligent algorithms which will process the signals, captured from the pressure sensor

418 SECTION

C Distributed computing

and load cell fitted to the oxygen cylinders using a smartphone. This smartphone App extracts the features from the oxygen sensor values and will classify the levels of oxygen as 100% full, 80% full, 60% full, 40% full, 20% full with specific and accurate measurements of the level inside the oxygen cylinder. This system thereby offers a contactless measurement system so that the COVID-19-affected patients can be tracked and monitored in a better way during this pandemic, COVID-19 situation.

4. l

l

l

l

l

5.

Objectives The development of an online remote smartphone App for oxygen-dependent COVID-19 patients which can remotely measure and monitor the level of oxygen inside the cylinders used for these patients by integrating the pressure sensor and load cell. This smartphone App extracts the features from the oxygen sensor values and will classify the levels of oxygen as 100% full, 80% full, 60% full, 40% full, 20% full with specific and accurate measurements of the oxygen. The multiple sensor units which are attached to the oxygen cylinders are connected to the Arduino board fitted with Global System for Mobile communications (GSM), where many number of such oxygen cylinders can be monitored at a time. The Global Positioning System (GPS) will share the information with respect to the location, hospital name, ward number, and patient’s name so as to track the status of the oxygen in the cylinders. Smartphone Apps helps to monitor the status of the oxygen without coming into direct contact using a web server and Android application, where doctor or patient relatives can continuously monitor the level of the oxygen in the cylinders on his smartphone.

Methodology

The use of smartphones can be used to monitor the status of the oxygen level inside the oxygen cylinder along with the location of the patients who are suffering from serious respiratory problems which serves as a life-support system during this pandemic situation. The COVID-19-affected patients cannot be monitored under direct mode continuously, because of high risk to the attenders, nurses, and physicians to acquire the same disease. Hence to safeguard and save the human lives which are very valuable, a remote, online monitoring scheme to measure the level of the oxygen inside the oxygen cylinder is proposed here. The sensors are attached to the oxygen cylinder to measure the pressure and weight of the oxygen present inside the cylinder and this information will be communicated with the smartphones for remote monitoring and collecting the related data about the pressure, weight of the oxygen cylinders, along with the location of the patient, hospital name, ward number, patient number, and patient ID. A scientific intensive care system was established to monitor the whole unit with multiple beds or even single separate beds using the mobile phone with Android. It will produce a red alert with an alarm when the pressure and weight values of the oxygen cylinder are very less denoting that the level of the oxygen inside the cylinder is approaching the empty condition. For this purpose, multiple sensor units were attached to the oxygen cylinders which are connected to the Arduino board fitted with Global System for Mobile communications (GSM), where many number of such oxygen cylinders can be monitored at a time. This is enabled by transferring all the data from the pressure and weight sensors to the cloud storage from where the relevant data can be retrieved and processed any time based on the necessity. The Global Positioning System (GPS) will share the information with respect to the location, hospital name, ward number, and patient’s name so as to track the status of the oxygen cylinders that are used as a life-support system for COVID-19affected patients enabling social distancing and remote monitoring. Smartphone Apps help to monitor the status of the oxygen cylinders without coming into direct contact using a web server and Android application, where doctor can continuously monitor the level of the oxygen cylinders on his smartphone using an Android application. The block diagram is indicated in Fig. 1. However, a large number of dispersed information from the load cell connected to the oxygen cylinders are linked in a network with user registration required to validate the IoT device to the network. All the sensor information from the load cells are linked to Arduino board, with access to the cloud for data storage through WiFi for performing the required operation of monitoring the level of the oxygen inside the cylinders. Once transaction has been validated by nodes, it is stored in all the nodes of the network. Then make a smart care monitoring unit in the hospital by utilizing the block chain idea. IoTenabled smart hospitals have following security problems, which block chain can address:

Design and development of a mobile App using block chain technology Chapter

Power Supply

25

419

LCD

CLOUD Pressure Sensor

Arduino UNO

Oxygen cylinder with Regulator Weight Sensor

GSM

FIG. 1 Block diagram for online remote monitoring of oxygen cylinders.

l l l l

The devices are identified by unique hash number. Users are authenticated via decentralized authentication method. Business logic is enabled via access control mechanism enabled by smart contract. Every transaction available to each and every node after verification and validation is referred to as trust management.

6. Development and discussions The system consists of an Arduino board with inbuilt microcontroller to which the pressure and weight sensors, GSM modem, power supply and liquid crystal display (LCD) are connected. An alert signal will be generated during crisis which will send intimation immediately to the nurses, attenders, and physicians. The communication is facilitated by using a smartphone App which sends SMS regarding the status of the oxygen cylinders associated with each and every patient. In the hospital, each and every oxygen cylinder connected to the patient is having this setup with Arduino module which facilitates online and remote monitoring of the oxygen cylinders enabling the replacement of the cylinders on time, thereby saving the lives of the patients. If the level of the oxygen inside the cylinder falls below the reference value approaching empty state, the sensors will send an equivalent voltage value corresponding to the measured physical parameters like pressure and weight, whose values are stored in the cloud storage and being accessed by the mobile phone as soon as the App is enabled. This module immediately sends the detect values denoting the level of the oxygen in the oxygen cylinder to the local central monitoring system as well as to the patients and their attenders and generated as a SMS which sent via the GSM module. The proposed measurement technique is carried out with the help of an experimental setup as shown in Fig. 2. Here, a pressure nozzle is used to sense the pressure head of the oxygen cylinder. MEMS pressure sensor is used at the end of the nozzle to sense the oxygen pressure. Once the pressure is sensed by the pressure sensor, it is passed to the data conversion unit and microcontroller to process the data. The output is displayed using a LCD display and activates the buzzer when required. The RF transmitter module is designed to transmit the oxygen level data to the monitoring station. An additional circuit is added to indicate battery level. A red LED will glow if the battery level is low else a green LED will glow. Figs. 3 and 4 show the circuit board for realizing the connections of the pressure sensor and load cell. The circuit board as shown in Fig. 5 can be placed on the oxygen cylinder, and the GSM module is placed at the monitoring station to acquire signals and to initiate necessary actions. The output value of the voltages corresponds to the value of the pressure inside the oxygen cylinder. The proposed technique is such that signals are processed and amplified before it is displayed on the LCD. The alarm signal will be generated when the pressure and weight value drops below the predefined set point value inside the oxygen cylinder. The next step involves in communicating through GSM so that the values are stored in cloud storage and as well sent to the mobile phone. The connections of the pressure sensor, load cell, and GSM are done using TINKERCAD software, which is an open-source simulation package for testing the correctness of the proposed circuits before building the real-time hardware (Fig. 6). Once the simulation is over, the next part of the project is about constructing a mobile App which comprises of a highlevel architecture. Mobile client—This will act as a user interface and can be installed on their mobile phones.

420 SECTION

C Distributed computing

Data Acquisition from Pressure and weight sensors

Determine the oxygen content inside the cylinder in proportion to the pressure & weight values connected to Arduino board

Yes reference value

No Display the values in the Serial Monitor of the PC through ZigBee Wireless communication

Sending SMS to preset mobile phone number (care taker or family member) through GSM facility FIG. 2 Flowchart for sensing the level of oxygen in oxygen cylinders.

FIG. 3 Connection of pressure sensor with Arduino.

FIG. 4 Connection with load cell with Arduino.

Display the values in the PC at equal intervals through ZigBee Technology

Design and development of a mobile App using block chain technology Chapter

25

421

FIG. 5 Connection of GSM module with Arduino.

FIG. 6 Arduino with GSM module connection for SMS and HTTP requests.

Server—This will be deployed on AWS as an API, and this will be responsible for the data processing and notifications. The following are the various components present on the mobile application: Mobile application is the container which enables the user to authenticate and capture his/her nails. This application will consume the various APIs developed, to process the captured images and detail out the deficiencies based on the algorithm. Server APIs are the connectors which bridge the mobile application and the data processing engine hosted on the application server. These APIs utilize its own authentication mechanisms for a secured data transport. Data processing engine is developed with a pre-approved algorithm to process the captured values of voltages corresponding to the pressure and weight values of the oxygen cylinder, match it with the pre-built models, and provide a response back with the details. This module also has its data ingestion module for the administrator to upload more samples, or tweak sample results. Error handling module provides the base framework to capture erroneous data, or any server-related downtime. This module will be responsible for providing the user-readable messages. The validation of the smartphone App developed can be done by connecting 100 oxygen cylinders placed at various locations in a hospital on to the cloud server established as in Fig. 7, whose values of voltages correspond to the pressure and weight values of the oxygen cylinders, as sensed by the pressure sensor and load cell which connected to the regulators of the gas cylinders. These stored values from the cloud

C Distributed computing

Processing Engine

Mobile Client

Al based Computing Layer

OS – Android

API

SDK – Android SDK

Processing Engine/ Rules Manager

Business Layer

422 SECTION

Sample Results, Captured Images, Rules Manager, Profile, Historical Values

DAL

Language – Kotlin, Java

Tool to import samples, create/update rules, modify algorithms FIG. 7 Development of cloud setup.

service can be accessed by the mobile App installed on the smartphone device where all these voltage values are processed using a simple thresholding technique to detect the status of the oxygen cylinder and thereby report its location along with the level of the oxygen with the patient name and identity number. Once the smartphone App is developed, the calibration will be done by asking the patient to install the App onto their smartphone. After that, the patient/physician/nurse needs to open the App and input the location along with hospital name, patient’s name, and ID to retrieve the corresponding information about the oxygen cylinder as in Table 1. In case of emergency, an alert message will be generated on the smartphone.

TABLE 1 Outputs obtained during online monitoring of oxygen cylinders.

S. No.

Status of the oxygen cylinders connected to COVID-19-affected patients 100% full

80% full

60% full

40% full

20% full

Message delivered on the smartphone

1

Ward No: 10 Oxygen cylinder ¼ 100% full. No replacement needed for next 8 h

2

Ward No: 11 Oxygen cylinder ¼ 40% full. No replacement needed for next 3.2 h

3

Ward No: 12 Oxygen cylinder ¼ 60% full. No replacement needed for next 4.8 h

4

Ward No: 13 Oxygen cylinder ¼ 80% full. No replacement needed for next 6.4 h

5

Ward No: 14 Oxygen cylinder ¼ 20% full. Replacement needed for next 1.6 h. Nurse needs to rush to the ward within half an hour to 45 min

6

Ward No: 15 Oxygen cylinder ¼ 60% full. No replacement needed for next 4.8 h

Design and development of a mobile App using block chain technology Chapter

25

423

TABLE 1 Outputs obtained during online monitoring of oxygen cylinders—cont’d

S. No.

Status of the oxygen cylinders connected to COVID-19-affected patients 100% full

80% full

60% full

40% full

20% full

Message delivered on the smartphone

7

Ward No: 16 Oxygen cylinder ¼ 80% full. No replacement needed for next 6.4 h

8

Ward No: 17 Oxygen cylinder ¼ 40% full. No replacement needed for next 3.2 h

9

Ward No: 18 Oxygen cylinder ¼ 100% full. No replacement needed for next 8 h

10

Ward No: 19 Oxygen cylinder ¼ 60% full. No replacement needed for next 4.8 h

11

Ward No: 20 Oxygen cylinder ¼ 80% full. No replacement needed for next 6.4 h

12

Ward No: 21 Oxygen cylinder ¼ 40% full. No replacement needed for next 3.2 h

13

Ward No: 22 Oxygen cylinder ¼ 20% full. Replacement needed for next 1.6 h. Nurse needs to rush to the ward within half an hour to 45 min

14

Ward No: 23 Oxygen cylinder ¼ 100% full. No replacement needed for next 8 h

15

Ward No: 24 Oxygen cylinder ¼ 60% full. No replacement needed for next 4.8 h

16

Ward No: 25 Oxygen cylinder ¼ 40% full. No replacement needed for next 3.2 h

17

Ward No: 26 Oxygen cylinder ¼ 80% full. No replacement needed for next 6.4 h

18

Ward No: 27 Oxygen cylinder ¼ 100% full. No replacement needed for next 8 h

19

Ward No: 28 Oxygen cylinder ¼ 40% full. No replacement needed for next 3.2 h

20

Ward No: 29 Oxygen cylinder ¼ 80% full. No replacement needed for next 6.4 h

21

Ward No: 24 Oxygen cylinder ¼ 60% full. No replacement needed for next 4.8 h

22

Ward No: 14 Oxygen cylinder ¼ 20% full. Replacement needed for next 1.6 h. Nurse needs to rush to the ward within half an hour to 45 min

424 SECTION

7.

C Distributed computing

Conclusion

The proposed technology which is to be developed is an App for smartphone. This work offers a detailed study of IoT-based smart hospital monitoring architecture using Arduino and cloud computing for data processing-related applications. Despite the fact that numerous security and privacy protocols exist, they are not relevant to IoT-based architecture due to resource constraints and use of lightweight devices to connect to smart home system. The connected data retrieval can be made possible by using the block chain technology with cloud computing. So, as many numbers of users as possible will be able to download the App from the internet sources at free of cost. They only have to install the App in their smartphone, open the App to input the hospital name, patient’s name, Patient ID, name of the hospital, and simply use it. Since the proposed technology for measurement of the oxygen level inside the cylinder, this scheme will facilitate a remote monitoring without coming into direct contact with the COVID-19-affected patients. This is made possible by using a smartphone App once developed, does not require a separate device but instead the App which is available in the internet sources at free of cost can be downloaded on a smartphone with Android technology. This smartphone App will be used by all the hospitals where the usage of oxygen cylinder serves as a life-support system.

References [1] C.-T. Yang, S.-T. Chen, W. Den, Y.-T. Wang, E. Kristiani, Implementation of an intelligent indoor environmental monitoring and management system in cloud, Futur. Gener. Comput. Syst. 96 (2019) 731–749, https://doi.org/10.1016/j.future.2018.02.041. [2] D. Geneiatakis, I. Kounelis, R. Neisse, I. Nai-Fovino, G. Steri, G. Baldini, Security & privacy issues for IoT based smart home, in: 2017 40th International Convention on Information & Communication Technology, Electronics & Microelectronics (MIPRO), IEEE, 2017, pp. 1292–1297. [3] Jose, R. Malekian, Improving smart home security: integrating logical sensing into smart home, IEEE Sens. J. 17 (13) (2017) 4269–4286. [4] C. Lin, D. He, N. Kumar, X. Huang, P. Vijayakumar, K.-K.R. Choo, Homechain: block chain-based secure mutual authentication system for smart homes, IEEE Internet Things J. 7 (2) (2019) 818–829. [5] J. Whipple, W. Arensman, M.S. Boler, A public safety application of GPS-enabled smartphones and the android operating system, in: International Conference on Systems, Man and Cybernetics, 2009. [6] H. Pang, L. Jiang, L. Yang, K. Yue, Research of android smart phone surveillance system, in: Proceedings of the 2010 International Conference on Computer Design and Applications, vol. 2, 2010, pp. 373–376. [7] W. Wu, J. Cao, Y. Zheng, Y.-P. Zheng, Waiter: a wearable personal healthcare and emergency aid system, in: Proceedings of Sixth Annual IEEE International Conference on Pervasive Computing and Communications, 2008, pp. 680–684. [8] A. Shye, B. Scholbrock, G. Memik, P.A. Dinda, Characterizing and modeling user activity on smartphones: summary, in: Proceedings of the 2010 ACM, June, 2010. [9] A. Pathak, Y.C. Hu, M. Zhang, P. Bahl, Y.-M. Wang, Fine-grained power modeling for smartphones using system call tracing, in: Proceedings of the 2011 ACM, April, 2011. [10] H. Falaki, R. Mahajan, S. Kandula, D. Lymberopoulos, R. Govindan, D. Estrin, Diversity in smartphone usage, in: Proceedings of 2010 ACM, June, 2010, pp. 179–194. [11] A. Tasniem, N. Jamil, T. Khan, Amitabha Chakrabarty Development of Application based Health Monitoring System using GSM module, IEEE, 2017. [12] N.V. Panicker, A. Sukeshkumar, S.M. Stephen, Patient monitoring system using GSM and ZigBee technology, AMSE J. 2014 Ser. Modell. C 75 (1) (2014) 13–21.

Chapter 26

A futuristic approach to decentralize and authenticate workplace safety records leveraging on blockchain distributed ledger network Chiang Liang Koka and Kavitha Palaniappanb a

Newcastle Australia Institute of Higher Education (A Wholly-Owned Entity of the University of Newcastle, Australia), Singapore, Singapore, b Duke-NUS

Medical School, Singapore, Singapore

1. Introduction The invention of blockchain technology and distributed ledger network (DLN) are fundamentally used to speed up and facilitate large volume of retail/institutional financial transactions. They are well-distributed data structures or ledgers which can remotely safeguard digital financial transactions by completely eliminating central authority management. Furthermore, it is able to automate the execution of smart contracts in a peer to peer (P2P) environment [1]. At the same time, it also allows multiple authorized personnel to edit, make appropriate changes and save it in the ledger simultaneously. This helps to speed up the processing of work as each authorized personnel will keep a copy of the record and reach a consensus with the other authorized personnel on its validity and authenticity. The inclusion and recording of new financial transactions in the blockchain network are closely associated with older financial transactions by embedding it with a unique cryptographic signature known as hash and could only be retrieved by the relevant authorized personnel, thereby ensuring complete privacy, transparency, and accountability. It is clearly evident that there is a huge untapped potential in the usage of blockchain or distributed ledger network (DLN) as it is highly trustable and can keep/store important and tamperproof records in a safe and organized manner. Thereby, it could highly likely disrupt many traditional ways of governance and corporate management [2] by replacing the ineffective top-down corporate governance approach with a more inclusive decision making which involves the larger community. However, there is still a milestone to overcome before blockchain technology and distributed ledger network (DLN) could achieve a more significant adoption by the community. Some of the key obstacles and challenges in achieving a higher rate of adoption are the issue of anonymity, proper blockchain governance, data privacy, high cost and scalability, without compromising privacy, transparency, and accountability. Therefore, blockchain technology could easily be employed in other important sectors, whereby the organization and management of large amount of correlated and uncorrelated data always prove to be a bottleneck. Hence, in the following sub-chapters, we shall be discussing on the proposed approach to leverage on secure blockchain distributed ledger network to decentralize workplace safety records and to allow the data to be accessed more securely and effectively. At the same time, we shall present the benefits of this novel decentralized blockchain distributed ledger network when it is used for keeping records pertaining to major accidents, minor accidents, near misses, and occupational health-related issues.

2. Fundamental principles of blockchain technology Blockchain network comprises of a fully digital and encrypted data hyper-structure which is a shared and distributed database that consists of an increasing pool of financial transactions sorted in accordance with their date of order. In simpler terms, it is a distributed ledger network that may contain any form of financial transactions, large volume of important correlated or uncorrelated data records. These financial transactions and data records are segregated into larger digital groups, called digital blocks, which are time-stamped and correlated to previous and older digital blocks. This ultimately forms a chain of digital blocks known as the blockchain [3]. Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00002-4 Copyright © 2023 Elsevier Inc. All rights reserved.

425

426 SECTION

C Distributed computing

FIG. 1 Comparison of centralized management system with distributed transaction system. (Source: Author.)

In the traditional way of managing and verifying financial transactions, it utilizes a central point of governance, such as a central authorized bank, who acts as the trusted intermediary between all transacting parties. Their primary job is to verify and to safeguard financial transactions and to avoid any fraud or theft. On the other hand, central management may not be the best and ideal way going forward as it introduces high intermediary costs and requires users to employ a trustable partner/company to operate the system [3]. Furthermore, centralized management system (see Fig. 1) is definitely more susceptible to both cyberattacks and common technical glitches [4]. Therefore, the ultimate benefit for the implementation of blockchain technology is to eliminate intermediaries and central management systems, thereby replacing them with a decentralize and yet distributed leger network (see Fig. 1) of authorized personnel who will collaborate and work collectively to check all financial transactions. This will no doubt enhance the integrity, transparency, and accountability of the entire ledger network. As compared to having a central management system, each authorized personnel in the blockchain ledger network holds his own authenticated copy of the ledger (receipt of transaction). Hence, they all could access the historical record of all the transactions in the system and verify their authenticity which will give rise to a much higher level of privacy, transparency, and accountability. One of the most prominent benefits for the use of blockchain technology is the inclusion of the unique cryptographic signature known as hash and could only be retrieved by the relevant authorities, thereby ensuring better security, improved privacy, and accountability. Basically, the unique cryptographic signature (hash) consists of complex mathematical equations or functions that yield an output of certain bits (64 bits) which is known to be the hash output. Their uniqueness and enhanced security are derived from the fact that it is impossible to hack the system just by relying on the hash output at least not by a human being. Lastly, the most appealing part of blockchain ledger network is the ability to work with smart contracts [5] which are user-friendly algorithms/scripts that control by and large how the way ledger network operates. Smart contracts are editable programs that could alter the operations in the distributed ledger network and can be triggered at any time after a mutual agreement between different parties. Furthermore, there are legal bidding terms which will be encoded in computer language. There are several key benefits for employing smart contracts in the blockchain ledger network which involved the removal of central management system (the intermediaries), being tamperproof in all records/transactions and lowering operational and compliance costs [5]. In the next sub-chapter, we will introduce the different aspects of workplace safety and health issues.

3.

Workplace safety and health issues

The impact of workplace on workers’ safety and health has been recognized and is also of concern since many centuries together now. However, the systematic gathering of information pertaining to the types of accidents, occupational diseases, work-related mortalities, etc., did not become widespread until the late nineteenth century. This gave rise to a new field of study called “Occupational Health” and its definition as proposed by the International Labour Organization and the World Health Organization is “The promotion and maintenance of the highest degree of physical, mental, and social well-being of workers in all occupations; the prevention among workers of departures from health caused by their working conditions; the protection of workers in their employment from risks resulting from factors adverse to health; the placing and maintenance of the worker in an occupational environment adapted to his physiological and psychological ability” [6]. In order to effectively implement the above parameters of Occupational Health and Safety at the workplace, it is necessary for many

A futuristic approach to decentralize and authenticate workplace safety records Chapter

26

427

experts and stakeholders such as physicians, occupational hygienists, safety officers, occupational health nurses, epidemiologists, and policy-makers to get an idea on the different issues that are capable of leading to accidents and mortalities at the workplace. They would then have to analyze the risk levels of each of these issues and rate them and arrive at suitable control measures to curb their occurrences. Soon after, it also needs to be closely monitored to figure out whether the control measures that have been put in place are effective in curbing the issues to a significant level and if not, alternative measures have to be arrived at. According to the International Occupational Hygiene Association (IOHA), “Occupational Hygiene is the discipline of anticipating, recognizing, evaluating, and controlling health hazards in the working environment with the objective of protecting worker health and well-being and safeguarding the community at large” [7]. In order to address their tasks, occupational hygienists gather data and information pertaining to the harmful or potentially harmful agents that are used or produced in the workplace, risks that these agents pose to the workers’ health and safety, any existing legislation pertaining to the safe levels of these agents in their respective countries, various methods and analytical techniques used to sample and analyze these agents, and also the different ways to eliminate or at least, minimize the risks to workers’ health and safety. There are two important terminologies that one need to be familiar with when it comes to Occupational Health and Safety: hazard and risk. A hazard is an actual or potential source of harm to the health, safety, or well-being of exposed individuals, whereas risk is the likelihood or probability that harm will occur as a result of exposure to a hazard. Hazards can be classified into structural safety hazards (any machinery or parts of machinery or moving objects such as vehicles at the workplace), electrical safety hazards (defective or worn-out wiring or electrical equipment), environmental health hazards (these can be further classified into physical hazards such as noise, temperature, heat, light, radiations, etc., chemical hazards such as gases, vapors, acids, alkalis, mists, dusts, fumes, etc., and biological hazards such as microbes, pollen, etc.), ergonomic hazards (design of workplaces and workstations, manual handling of heavy objects at the workplace, etc.), and psychosocial hazards (lack of job scope and clarity, heavy workload, shift-work, workplace violence and abuse, relationship with supervisors, subordinates, colleagues, etc.). Hazards are primarily identified by direct observations at the workplace and also by consulting various records such as chemical registers, Safety Data Sheets (SDS), accident and incident reports, results of environmental impact assessment (EIA) studies, company records, and complaints/submissions from the resident activity groups. Further to that, quantitative hazard monitoring is performed using suitable sampling and analytical techniques as prescribed by the legislation and at frequencies required by the law of the country. Three types of monitoring techniques are usually employed, namely environmental monitoring, biological monitoring, and health monitoring. Environmental monitoring is done at the workplace and can be either done at a specific location in a workplace wherein it is referred to as static sampling or a sampling device can be placed on a worker, wherein it is referred to as personal sampling. Biological monitoring refers to the testing of various samples collected from potentially exposed workers such as blood, urine, hair, saliva, etc., for the presence of the chemical substances under scrutiny. Health monitoring includes the assessment of the physiological and biochemical processes within the potentially exposed workers which could show signs and symptoms of the chemical substance’s effects. Moving forward, the next sub-chapter would discuss the various workplace safety records that need to be maintained in order to ensure the health and safety of workers at the workplace.

4. Workplace safety records Recordkeeping of occupational injuries and illnesses is a very important aspect of every workplace in order to develop effective control and preventive measures for the same. Even though the importance of recordkeeping has been stressed by various stakeholders at different points of time, there is still a huge lacuna in terms of reported accidents and disease statistics in several countries. The main reasons for this are several categories of workers, especially the informal sectors are not covered under the legal requirements of the country and under-reporting is also common by many workplaces that fear the penalties issued by the government. Generally, employers with more than 10 employees are required to keep a record of work-related injuries and illnesses for a period of five years as per OSHA (Occupational Safety and Health Administration). OSHA defines a recordable injury or illness as any work-related fatality or injury or illness that results in loss of consciousness or days away from work or that requires medical treatment beyond first aid or that results in diagnosis of an irreversible disease [8]. Workplace incident is an unexpected and unplanned occurrence that happens at the workplace and is connected to the work and affects one or more worker(s) adversely. The degree of the workplace incident is defined as “fatal” if it results in death of one more worker(s), “major” if it results in severe injuries, but not fatal; “minor” if it results in non-severe injuries that require at least about 24 h of hospitalization or more than three days of medical leave. There is also another category

428 SECTION

C Distributed computing

FIG. 2 Different viewpoints for recording an incident. (Source: Author.)

called “near miss,” wherein the unplanned occurrence did not result in any injury or illness, however had the potential to do so. These are accidents that almost happened or even did happen but did not cause any injury to workers this time around. It is necessary to have a close surveillance of near-miss incidents in order to avoid similar occurrences in the future and also put suitable control measures in place to overcome them. Recordkeeping of every workplace incident, be it fatal or major or minor or near miss, usually has the following details attached to every incident: basic information of the injured worker which includes his/her name, age, gender, address, national identification number, employment status, designation, duration of employment, and service in the current job; basic information of the incident that occurred which includes date, time, and place of the incident and brief description of the incident; basic information of the employer that includes name, address, contact details, number of workers in the company, major economic activity of the company, type of work activities, and number of workers involved in each of those activities, controls (if any) put in place to protect the workers from workplace accidents. Generally, four viewpoints are recorded for every workplace injury or illness to describe it and they are the nature of disabling condition, the event or exposure that led to it, the primary and secondary sources that led to it and part of the body affected. An example of “a construction worker fractured his arm from over-exertion in lifting heavy machinery” is illustrated below (see Fig. 2) to explain the four viewpoints for recording the incident. As mentioned earlier, all these data need to be scrutinized and analyzed collectively with all the experts and stakeholders in order to achieve efficient control measures at the workplace to reduce workplace mortalities. Technical limitations of sampling and analytical methods need to be considered, but measurements also need to be interpreted in relation to individual work practices. At the same time, it is also essential to note that these data could be confidential to the workplaces, and hence, their data safety is also important. There is an urgent need to maintain the confidentiality of such data as it is being analyzed by the experts and stakeholders and this gap can be effectively filled by the blockchain technology.

5.

Leveraging on blockchain network for managing workplace safety records

Our proposed approach is to leverage on secure blockchain distributed ledger network to safeguard and effectively manage workplace safety records without the need of a central management system. This will certainly allow past workplace safety records to be accessed more securely and effectively by the relevant authorities/personnel. Some important safety records include detailed information pertaining to major accidents, minor accidents, near misses, and occupational health-related issues. Furthermore, other safety records like occupational injuries and illnesses which are a very important aspect of every workplace in order to develop effective control and preventive measures could also be safeguarded well in the blockchain distributed network. Even though the importance of recordkeeping has been stressed by various stakeholders at different

A futuristic approach to decentralize and authenticate workplace safety records Chapter

26

429

points of time, there is still a huge lacuna in terms of reported accidents and disease statistics in several countries. Therefore, leveraging on distributed blockchain network to remotely access, manage, and safeguard important and critical workplace safety records is definitely beneficial to all parties and stakeholders involved. When a workplace safety record (major/minor accident, near misses, and occupational health-related issue) has to be stored in the system for future reference, the details of it could be securely translated into the blockchain ledger network and stored permanently in a digital block. It would be time-stamped and correlated to previous and older digital blocks which stores other historical workplace safety records. This ultimately forms a series chain of digital blocks known as the blockchain. In this particular field, we could refer to it as the workplace safety record blockchain network. This particular data storage is embedded with a unique cryptographic signature (hash) which consists of complex mathematical equations or functions that yield an output of certain bits (128 bits) which is known to be the hash output. The complexity of it helps to ensure complete privacy and accountability. In addition, we could configure how the way ledger network operates by editing the program in the smart contracts, whereby it also contains legal bidding consensus between all parties and stakeholders involved. This ensures that all workplace safety records are transparent and tamperproof, hence reducing operational and compliance costs. However, the general data to be stored in the network, that is, how the accident/near miss had happened, the factors that led to such incidents, and the control measures that were put in place to curb their further occurrences could be available to all related parties, will not be revealing any confidential matter relating to the particular company. This would enable active participation and also facilitate sharing strategies across board with all industries that are functioning in that sector. Furthermore, this would considerably reduce the number of workplace accidents to a significant level and would also enable the government authorities to frame policies and regulations for advanced technologies. At the same time, only the relevant personnel who are authorized to access/edit past workplace safety records and add new records will be given both a public and private cryptographic key so as to ensure enhanced security and transparency. The key benefit is that it encourages all the industries in the different sectors to be able to view/access historical workplace safety records simultaneously at the same time and at their own convenience. Our proposed architecture representation (see Fig. 3) is shown below. This workplace safety record blockchain network can be configured to follow a certain set of ground rules which heavily depends on its specific operation and application. It will comprise of user/personnel and validator (referee). User/personnel will receive the new details of the workplace safety records and keep a copy of it (ledger), while a validator (referee) will be responsible for validating and approving the addition of the new safety records to the blockchain network. For added security, user/personnel are unknown to validator and vice versa. This enhances the collaborative effort and trust required for a transparent ledger network management. Furthermore, if tampering of past workplace safety records does occur, all other blockchain nodes would cross-reference with one another and could easily locate the tampered node (a particular workplace safety record). In this way, the distributed ledger network is able to establish an exact and transparent way

FIG. 3 Our proposed architecture representation. (Source: Author.)

430 SECTION

C Distributed computing

of tracking the workplace safety records and to prevent further cyber-hacking. Lastly, any viewing/additional of workplace safety records (ledger) to the blockchain network would be time-stamped for complete transparency and accountability. In conclusion, our proposed approach is definitely a more cost-effective, transparent, efficient, and organized way than the traditional way of manually managing large data sets of workplace safety records and would also reduce the number of workplace accidents which is on a constant rise in the past few decades.

6.

Limitations

The workplace safety record blockchain proposed in this work proved that blockchains are indeed a very promising technology to be used to store all incident reports (major/minor accident, near misses, and occupational health-related issue) in that particular workplace. However, it needs to gradually build up its resilient capabilities against security invasion from malicious cyberattacks. Blockchain ledger network, in particular, face higher number of risks which includes technical glitches/malfunctions at early stages of software/hardware development due to the lack of practical experience with large-scale recordkeeping for workplace safety accidents. Furthermore, the operating ideology behind blockchain is based on the coding of new algorithms/programs, an engineering aspect which can be highly susceptible to human errors. Therefore, breaches in security are possible as this technology is still premature which will then erode confidence from the respective authorities trying to implement a blockchain ledger network to manage the recordkeeping of workplace safety accidents. There is another obstacle toward the full implementation of blockchain ledger network which is the high development costs that come with it [9]. It may require new custom-designed software/hardware infrastructure which is no doubt expensive and there is a need to weigh the benefits of having a workplace safety record blockchain network against the traditional way of manually managing large data sets of safety records. We could easily argue that the benefits will far outweigh the trade-offs as it would potentially reduce the number of workplace accidents and at the same time being able to achieve data integrity, enhanced security, and elimination of a central management system. Lastly, though the implementation of a workplace safety records blockchain system do has its limitations, we firmly believe that our proposed approach is definitely a more cost-effective, transparent, efficient, and organized way than the traditional way of manually managing large data sets of workplace safety records and would also reduce the number of workplace accidents which is on a constant rise in the past few decades.

7.

Conclusion

Recordkeeping of occupational injuries and illnesses is a very important aspect of every workplace in order to develop effective control and preventive measures for the same incident. Even though the importance of recordkeeping has been stressed by various stakeholders at different points of time, there is still a huge lacuna in terms of reported accidents and disease statistics in several countries. Therefore, we proposed to leverage on secure blockchain distributed ledger network to safeguard and effectively manage workplace safety records without the need of a central authority system. This will certainly allow past workplace safety records to be accessed more securely and effectively by the relevant authorities/personnel. Some important safety records include detailed information pertaining to major accidents, minor accidents, near misses, and occupational health-related issues. Furthermore, other safety records like occupational injuries and illnesses which are a very important aspect of every workplace in order to develop effective control and preventive measures could also be safeguarded well in the blockchain distributed network. In conclusion, it is definitely a more cost-effective, transparent, efficient, and organized way than the traditional way of manually managing large data sets of important and critical workplace safety records. Thereafter, it will bring along a slew of benefits which include reducing the number of workplace accidents which is on a constant rise in the past few decades.

References [1] M. Swan, Blockchain: Blueprint for a New Economy, O’Reilly Media Inc., 2015. [2] O. Konashevych, Advantages and Current Issues of Blockchain use in Microgrids, 2016. https://ssrn.com/abstract¼2662660. (Accessed 10 November 2021). [3] J. Mattila, T. Seppala, C. Naucler, R. Stahl, M. Tikkanen, A. Badenlid, et al., Industrial Blockchain Platforms: An Exercise in Use Case Development in the Energy Industry, 2016. https://www.etla.fi/julkaisut/industrial-blockchain-platforms-an-exercise-inuse-case-development-in-the-energyindustry/. (Accessed 27 October 2021). [4] M. Armbrust, A. Fox, R. Griffith, A.D. Joseph, R. Katz, A. Konwinski, et al., A view of cloud computing, Commun. ACM 53 (4) (2010) 50–58.

A futuristic approach to decentralize and authenticate workplace safety records Chapter

26

431

[5] M. Walport, Distributed Ledger Technology: Beyond Blockchain, 2016. https://assets.publishing.service.gov.uk/government/uploads/system/ uploads/attachment_data/file/492972/gs-16-1-distributed-ledger-technology.pdf. (Accessed 1 November 2021). [6] WHO (World Health Organization), Protecting Workers’ Health, 2017. https://www.who.int/news-room/fact-sheets/detail/protecting-workers%27health. (Accessed 18 November 2021). [7] IOHA (International Occupational Hygiene Association), Occupational Hygiene, 2021. https://www.ioha.net/about/occupational-hygiene/. (Accessed 19 November 2021). [8] OSHA (Occupational Safety and Health Administration), OSHA Injury and Illness Recordkeeping and Reporting Requirements, 2020. https://www. osha.gov/recordkeeping/. (Accessed 19 November 2021). [9] Eurelectric, Eurelectric Launches Expert Discussion Platform on Blockchain, 2017. http://www.eurelectric.org/news/2017/eurelectric-launchesexpert-discussionplatform-on-blockchain. (Accessed 22 November 2021).

This page intentionally left blank

Chapter 27

Designing business models through blockchain: A process of value creation Arvind Deshmukha and Neelam Saxenab a

Amity Business School, Amity University Uttar Pradesh, Noida, Uttar Pradesh, India, b Amity Center of Entrepreneurship Development, Noida, Uttar

Pradesh, India

1. Introduction Blockchain has gained immense popularity over the past decade since the Internet exploded with cryptocurrency trade [1]. However, the applicability of blockchain goes beyond the financial trading sector and has found use in other traditional sectors such as health care, supply chain management, energy, and education [2–5]. Besides the traditional areas, intersections between blockchain and new emerging IT technologies such as the IoT (Internet of Things) and AI (artificial intelligence) have also been discovered. Blockchain provides security, transparency, and immutability and eliminates the need for centralized governance and third-party interventions [6]. These qualities make blockchain technology suitable for transforming organizations’ business models to generate more excellent value for the stakeholders. Blockchain enables organizations to do their business in unique ways and at the same time reduce costs, improve efficiencies, and remove dependencies from nonessential entities [7]. The researchers noticed the idea of business models in recent years [8]. A “Business Model” of a focal firm is a system of interdependent activities that goes beyond the focal firm and determines its limits [9]. The system enables the organization to nurture value for itself, its partners, and customers. Blockchain technology with unique characteristics such as decentralized structure, distributed storage mechanisms, immutable traceability, and high network security makes it a very apt enabler for organizations to design their business models. The business model defines how an organization would generate value for all its stakeholders. Nowi nski and Kozma propose that blockchain will impact the business models in three different ways. Blockchain technology would authenticate the trade of goods, reduce intermediaries, and lower the costs of business transactions [10]. Weking et al. defined five archetypical patterns of the business model taxonomy—blockchain can integrate businesses through a shared database that can advance the interoperability of the users. Blockchain can behave as a multisided platform and provide a marketplace without intermediaries. It creates a secure and trustworthy business environment for the business transactions to take place. The organizations can apply blockchain technology to generate APIs and also facilitate the transfer of monetary value between the users [7]. Blockchain-driven business models ensure a paper trail of every transaction, making the data secure and unalterable. They offer businesses opportunities to function even in underexplored and complex work environments. These business models ensure profitability while maintaining transparency in operations. The customers and the end users can appreciate both fairness in price and the quality of the goods. The effect of the technology can be felt across industries and geographies. This chapter will elucidate how blockchain technology is paving the way to develop intelligent, user-friendly, and secure business models that create value for businesses and their customers. We examine a range of industry use cases to ascertain the value generated for the business models through blockchain technology.

2. What is blockchain technology? Blockchain is a decentralized, distributed, and secure system that records transactions irreversibly. It is a newer technology that allows the users to transact and store static information and offer a standard view of the state of a record across the distributed network [11,12]. Blockchain uses a peer-to-peer network to collect information in packages, also called a block. Every block has a limited capacity to hold some amount of information. When the block is full, it attaches itself to a previously filled block to form a chain of blocks called the “blockchain.” Distributed Computing to Blockchain. https://doi.org/10.1016/B978-0-323-96146-2.00026-7 Copyright © 2023 Elsevier Inc. All rights reserved.

433

434 SECTION

C Distributed computing

Blockchain technology has three critical aspects—shared governance and operation, verifiable state, and resilience to data loss [13]. To enable a group of entities to work together, the blockchain systems deploy many smart devices across a distributed network to operate the system. These smart devices are also called “miners.” The miners follow a set of rules called the “consensus protocols” that are put in place to facilitate the transactions between the entities. A transaction is an interaction or exchange made between two entities. Most of the time, the transactions are seen as financial transactions, where a unit value is transferred from one entity to another. Whenever a transaction takes place, every miner in the distributed network knows about it through the transparency mechanism built in the blockchain network [14]. Every miner maintains the record of information stored in the blockchain. If any miner witnesses an error in its records, it can correct itself by referencing thousands of other miners that also hold the same data. Similarly, if a few miners get compromised, the other miners can turn down the actions of the compromised minors and maintain the blockchain’s data integrity. In a shared governance model, every miner validates the transaction following the consensus protocols. If a few miners create a discrepancy, it is rejected by thousand other miners. Therefore, only correct and authenticated output gets to be included on the blockchain. The second aspect of blockchain technology is the verifiable state. All transactions are written cryptographically on a secure ledger to enable this state of veracity. Every block in the chain has its hash and the block’s hash that was added earlier. A “hash” is a function that translates the data into a string of letters and numbers [15]. Every hash has a fixed length depending upon the information in the block header. A set of data will always have the same hash. If the data is altered, the hash changes as well. Further, the hash within the block is timestamped when it is published on the server, making the transaction more authentic and secure. The present state and the genesis state (state of the first block entry) remain alike for all miners. Whenever a new block is added to the chain, it is first validated by all the miners before it joins the blockchain. The appended blockchain gets updated for all miners, enabling them to see the new state in complete transparency. The third aspect of blockchain technology is “data restoration.” Since the data replicates across all the miners, any data loss occurring at specific points can be detected and repaired. To sum up, blockchain offers several benefits to the participants in the distributed network. The first is the transparency to all the nodes to view and validate data without accessing a third-party intermediary. With the intermediary gone, the transactions are processed faster, and the blockchain allows the users to remain unidentified by using privacy keys in the system [2]. The decentralized and distributed architecture in the blockchain enables organizations to adopt business models, where firms can transact unequivocally and establish their boundaries across regions, systems, and regulations. The robustness, flexibility, security, and lucidity make blockchain a superior technology that can revolutionary impact the organization’s business models.

3.

Business models

As a subject of research, business models have gained significant prominence in the past decade. The concept of a “Scholarly Business Model” started becoming significant with the advent of the Internet in the mid-nineties and has been rising since then. According to Google Scholar, 562 scholarly articles were published in 2017 with “Business Model” in their title compared to 197 a decade ago [16]. The definitions of business models have been spun in a variety of ways. Some popular definitions are: 1. 2. 3. 4. 5.

“The logic of the firm, the way it operates and how it creates value for its stakeholder” [17] “A simplified description and representation of a complex entity or process” [18] “A structural template that offers the business model construct as a unit of analysis for future research” [19] “A description of the relationships between the firm’s stakeholders to realize the benefits” [20] “Creating sustainable advantage through the interplay between strategic and economic variables” [21]

Several themes have driven the research on business models. The prominent themes are [22] 1. 2. 3. 4.

Business model as an analysis unit Providing a holistic perspective of doing business Business activity Importance of value creation

Scholars have defined business models in numerous ways. A business model has been described as a statement, description, representation, architecture, method, framework, pattern, set, or a conceptual tool or model [22].

Designing business models through blockchain Chapter

27

435

FIG. 1 Business model canvas. (Adapted from V.J. Morkunas, J. Paschen, E. Boon, How blockchain technologies impact your business model, Bus. Horiz. 62 (3) (2019) https://doi.org/10.1016/j.bushor.2019.01.009.)

Some authors like Osterwalder and Pigneur have suggested nine different blocks that make up a business model, including segmentation of customers, value proposition, design of sales channels, creating customer relations, and generation of revenues [23]. This description of business models provided by Osterwalder and Pigneur is famously known as the business model canvas, that has gained a considerable amount of traction between the academic and practitioner communities. Fig. 1 represents these nine blocks of the business model canvas. Business model canvas has nine components: customer segment, customer relationships, channels, key partners, key resources, key activities, revenue streams, cost structure, and value proposition. Businesses need to target customers based on specific demographics, attitudes, and behaviors. The business model approach suggested by Osterwalder and Pigneur defines customer segments as the groups of people the organization wants to reach out and serve. Businesses must identify the relationships they want to build with their customers and include them in their strategic relationships. Maintaining healthy customer relationships is the key to a company’s survival. The business should know how to reach out to its targeted customers to offer its products and services. The organizations can deliver their services through various channels such as outlets, distribution networks, and partner networks. The business model should clearly define the key activities that it would be undertaking to generate value for the organization and its customer. Key activities should be accompanied by key resources necessary to implement those activities. Businesses also have the option to develop partner networks to increase their efficiency. The partners or the stakeholders in business could be suppliers, vendors, advisors, and alliance partners. To maintain clarity on finances and profitability, the organizations should also include the revenue streams from where they intend to make money. Revenue streams could be diverse such as sales of products and services, licensing agreements, and subscription fees. Similarly, the cost structure of operating the businesses should also be included in the business model. All the business model components are directed to generate a unique value proposition for the organizations. Value proposition makes an organization different from other organizations operating in the same space. The value proposition is a strategic input and is vital for any organization to survive and grow. Business process modeling has two perspectives. The first perspective is the internal organizational perspective that is the intrinsic organizational attributes such as organizational processes, human competency, motivation, facilities, and process rules [24].

436 SECTION

C Distributed computing

The second perspective is the external perspective that includes external stakeholders such as the customers, partners, suppliers, government, and other stakeholders in the external environment. In the following sections, we shall review the transformation of business models through blockchain from external and internal perspectives.

3.1 Blockchain-based business models Technology plays a significant role in the evolution of organizational business models [25]. Since its inception, blockchain technology has been a significant game changer in reshaping organizational business models. Studies in the past have analyzed the readiness of business models to adopt blockchain technology [25]. Business models have thus far relied on a traditional approach where a centralized entity has controlled the governance of the businesses. Therefore, the business transactions have relied on third-party intermediaries for movement and verification. However, with the entry of blockchain systems bringing trust and immutability in the peer-to-peer network, the role of the central authority in governing business transactions stands diminished. Blockchain provides a robust framework to businesses that enables more transparent, secure, and traceable transactions. Several major multinational firms such as IBM and Walmart have run pilots on blockchain technology in their business lines [26]. The alignment to blockchain also brings new dimensions to the value that the organization’s business models generate. The business model represents an organization’s business strategies, operational procedures, and technological systems. The business models need to be holistically aligned with all the stakeholders involved in the business’s operations. It needs to consider the vulnerabilities of the external and internal environment. The core purpose of a business model is to generate consistent and continuous value for the organization. Therefore, it becomes imperative for businesses to adapt their business models to technological disruptions to remain relevant. New business paradigms lean toward cooperation and coordination between all the stakeholders both inside and outside the organizations. Blockchain technology can be a great enabler to diffuse trust between the stakeholders in an organization’s value chain. Value creation is no longer a linear process but an integrated effort to realize synergies in a connected world. In the following sections, we shall review the values that can be realized in the business models through blockchain implementation.

3.2 Smart contracts Introduced in 1994 by Nick Szabo, smart contracts are programs in a blockchain called into action when specific predefined settings are met [27]. The purpose of smart contracts is to execute agreements between the participating entities and allow the organizations to interact in an agile business network [28]. Smart contracts automate the workflow and ensure all participating entities report the action without delay or third-party interventions [2,29]. Smart contracts can be used for multiple contractual purposes. It can be used between two parties as an enforcing agent to govern a bilateral contract or can be used by a consortium of multiple parties. In some cases, a third party can put smart contracts in force that offers greater transparency in the system. Smart chains reduce the intricacies by removing third-party intermediaries [30]. Smart contracts can be situated in a blockchain through a simple transaction that holds the code for the conditions following the agreed terms between the entities. When these conditions are called upon by a miner or a group of miners, the contract is executed and verified through the consensus protocol. The blockchain gets updated when the action is completed. Actions such as issuing a ticket, releasing funds, and registering a vehicle can be governed by smart contracts. Smart contracts are autonomous actions whose behavior is entirely predictable [31]. They significantly improve the speed, transparency, and security of the transactions. The Ethereum platform uses smart contracts to establish exchange rates between the issuers of new cryptocurrencies and Ethereum. Besides, currencies smart contracts also find applications such as supply chain, IoT, and content distribution [2].

3.3 Business value Theoretical studies indicate that blockchain holds the potential to generate organizational value for the organization. Saheb et al. classified organizational value in four dimensions—operations, strategy, collaboration, and knowledge management [32]. The highest values come from business operations because blockchain enhances trust, transparency, and traceability in business transactions. Besides these factors, automation using smart contracts, the enhanced scalability scope, and the irrevocability of the transactions also raise the organizational value through improved business operations.

Designing business models through blockchain Chapter

27

437

Business value through blockchain is also generated through active collaborations between the participating business entities. Blockchain provides accessibility across divisions/departments to streamline the flow of communication. Besides removing the unnecessary intermediaries that elongate the transactional cycle, blockchain also improves stakeholder management through transparency in data governance. Carson et al. indicated that the value created by blockchain in the short term would primarily reduce operational costs. Blockchain suits some specific industries such as financial services, government, and health care better because it addresses the pain points of these sectors with apt efficiency. The core functions of these industries closely align with the impact of the modus operandi of blockchain. The long-term transformative impact of blockchain on business models might take a few years to mature because it may take some for the technology to become feasible at scale [11].

3.4 Partner value and permissioned blockchain “Partners” forms an essential component of a firm’s business model. Partner relations are usually disrupted by a lack of integrity and data availability. Blockchain provides transparent data sharing and validation, improves transactions’ seamlessness and efficiency, and helps the firm progress from a transactional to a relationship-based partnership. The large gamut of features offered by blockchain makes the technology an ideal candidate for enabling organizations to do business with partners safely in a protected environment. The business activity occurs between organizations that are validated members of the distributed network. This section will explore another unique feature of blockchain technology known as the permissioned blockchain. Permissioned blockchain provides an additional security layer to the users who require an access control layer. In a permissioned blockchain, specific actions can only be performed by identified and validated participants making it an appropriate option for running business activities through a hierarchical system. Permissioned blockchains facilitate trust between the organizations and help them strengthen their partnerships and alliances, and identify new opportunities and new possibilities of doing business. Permissioned blockchains are relatively more minor than public blockchains, where everyone can access user access. However, not everyone can join a permissioned blockchain. A user must be inducted explicitly into the network by an accredited authority. All the nodes in a permissioned blockchain are identifiable and trustworthy, and the consensus is reached early in the network at a lower cost. Theoretical studies indicate that blockchain has efficiently facilitated collaborations between health care, finance, and public administration organizations. Blockchain’s data integrity, adherence to privacy, and rapid accessibility of information have fostered trust between organizations to share sensitive data. Bedin et al. defined three collaborative business models where blockchain can create a transformational impact. A vertical relationship that is predominantly supplier-customer relationships. Horizontal relationships where competing firms operate in a shared space and diagonal relationships where companies unrelated share synergies. Blockchain complements all three models to run business activities through data sharing and trust-based collaborative action [1]. The blockchain’s use in consolidating alliances allows businesses to share synergies and reach new and unexplored audiences. The agility of blockchain systems enables secure transactions across non-related organizations to create value without making expensive investments. However, it is also noteworthy that technology alone cannot reap the fruits of collaborative action. The participating firms must have the temperament and mindset to view cooperation and data sharing as a medium of creating a positive-sum value for all the business entities.

4. User value through blockchain The last mile of a firm’s business model is the user of its products or services. Firms strive hard to achieve service excellence and high customer satisfaction. Several blockchain applications, such as Food Traceability, are driving consumer intention to adopt the technology [33]. Significant research and feasibility studies have been conducted to determine blockchain technology as a driver to study consumer behavior. Researchers have also tried to explore the possibilities of integrating user perceptions and needs in product design using blockchain technology [34]. We have already reviewed an example of customer value being generated through blockchain in the food delivery sector where contaminated food can be traced in the supply chain in a minimal amount of time at reduced costs. The cost benefits can be transferred to customers in the form of improved products and services. Besides the cost, blockchain can create better experiences for the customers by harnessing the power of the ecosystem. Blockchain is redefining how companies interact with their customers through seamless, trusted, and secure digital experiences.

438 SECTION

C Distributed computing

In his book, The Second Curve, Ian Morrison presents two curves for an organization for doing business [35]. During the first curve, a firm should focus on creating efficiency in the existing business climate, such as improving customer experience, reducing costs, optimizing the processes, and making the organization more competitive. However, the second curve is the future where the organization should transform itself to create new markets, new customer experiences, and a new way of doing things. Blockchain, as envisaged by experts, can do both things.

5.

Blockchain-based business models—Industry use cases

Blockchain finds applicability in several industries, including health care, real estate, finance, IoT, supply chain, and digital currency [36]. Some industry use cases of blockchain-based business models are mentioned below: 1. Health care: A critical challenge in healthcare systems is recordkeeping. Since the patients take treatment from several doctors and every doctor makes a different prescription, it becomes challenging to keep track of all the prescriptions [36]. Blockchain can help solve this challenge. Blockchain can securely store the data and share it securely with the correct entities, such as the patients and the consulting doctors. Several start-ups are working on using blockchain in healthcare recordkeeping systems. Blockchain systems can also provide the flexibility to build smart contract applications in the blockchain. Personal health records are encrypted with security keys so that only specific individuals can access them. The data is stored in decentralized systems and can be accessed with all medical stakeholders when requested [3,37]. Blockchain can also help share consolidated medical data for medical research purposes keeping any identifiable information confidential [38]. The technology uses medical imaging considerably by tracking radiological and clinical data [39]. 2. Logistics and Supply Chain: Blockchain can upgrade supply chain systems. The technology can be used to record the origins of the procured materials and verify and label the authenticity of the products. Blockchain does not just increase the efficiency of the process but also builds trust between the entities. The food sector is witnessing rapid transformation in its global supply chains. Global retail giants are leaning toward blockchain to improve their tracing and tracking abilities in food delivery mechanisms from the farmer to the end user. Blockchain can provide value to multiple sectors, including the supply chain management system, through improved transparency, trust, and cooperation between organizations [40]. 3. Currency: The most popular use case of blockchain technology has been cryptocurrencies. The vulnerability of the regular currency of any country controlled by the country’s centralized federal reserves led to the idea of building cryptocurrencies such as bitcoin and ether. The cryptocurrencies operate on blockchain technology across a distributed network of miners. The principal feature of cryptocurrencies is the non-reliance on a centralized authority. The technology is secure and foolproof and can provide economic stability to even countries with unstable governments. 4. E-Voting: There are conceptual studies about blockchain-based e-voting systems where voters can vote electronically through mobile phones or computers. Blockchain-based voting systems can eliminate voting fraud and the entry of bad actors. Votes are recorded cryptographically, making them secure, accurate, and permanent. Kshetri et al. proposed a blockchain E-voting system where every voter is provided with a wallet with a secure personal id and a voting coin [41]. The coin will be spent when the vote is cast, and the user will not vote twice. The e-voting system provides remote voting options to the voters and costs less than the traditional voting systems. 5. Education: Blockchain technology can enable accurate, secure, and tamperproof student records in universities and institutes of higher education [42]. The EduTech services have made a significant space in the education market and currently stand at 165 billion USD. Blockchain technology can help store and issue student records such as certificates and mark sheets [4]. They can also share the student information across university groups, eliminating the students’ pain to share the same information repeatedly with different units. The student data also remains protected through security keys and biometric information [43]. 6. Government Administration: Blockchain finds its applicability in the public sector as well. Administrative services deal with a significant amount of paperwork to alleviate the pains of the citizens. Blockchain holds the potential to reduce the paperwork and expedite the delivery of services. The State of Illinois and the Government of Dubai have taken up blockchain technology to streamline their operations early on [36]. Among the several benefits of poised to gain by the administration, some notable mentions are securing of records, speed, and cost savings. The decentralized and scalable blockchain systems enable jobs through little effort [44,45]. Smart contracts also play a vital role in systemizing complex government operations, reducing processing time and unnecessary delays. They provide better transparency to access public records while keeping citizen information confidential [46].

Designing business models through blockchain Chapter

27

439

7. Finance and Banking: Banking and financial markets allow asset trading through third-party intermediaries such as exchanges and brokering agencies. On the other hand, blockchain can facilitate a direct transaction between the trading entities administered by smart contracts. The current centralized systems in banks and financial institutions limit the speedy processing of business transactions because of red-tapism and multiple compliance norms [2]. However, blockchain technology can improve the performance of business transactions in several ways. Blockchain can establish a single-window framework and automate the processes to reduce costs and improve liquidity [47]. Blockchain can integrate external and internal components for increased efficiency [48]. Blockchain can also ramp up cyber security and streamline financial contracts resulting in cost savings, data integrity, and quick turnaround of business transactions [49,50]. Some challenges in implementing this model could be handling off-chain components and regulatory compliances. 8. Internet of Things (IoT): Blockchain also finds applicability in IoT. The current model of IoT, where thousands of devices are connected, may experience limitations in synchronicity and communication between devices [51]. Conceptual studies have been made to explore the possibilities of using blockchain to control and configure IoT devices through security keys and smart contracts [52]. A significant challenge in implementing the IoT systems is the security concern emanating from the various interfaces that enable communication between the interconnected devices. Blockchain can solve these problems sensitively through addressing space, identity management, and governance mechanisms [2,53]. Blockchain helps the users maintain their anonymity while being able to do transactional business through a decentralized authorization management framework [31,54,55]. IoT-based business models can be driven through smart contracts, the core functionality of blockchain [2]. Blockchain’s automation abilities can allow direct communication between the devices and thus eliminate the possibility of human error, and manage the devices through their device and key settings [52,54,56,57]. 9. Real Estate: Recordkeeping in real estate is a highly convoluted process in many parts of the world. The process of recording, maintaining, updating, and property deeds go through several hands, leading to inaccuracies, high costs, and long delays. Blockchain records can eliminate these challenges arising from third-party interventions. The property documents stored on blockchain systems enable veracity and permanency of ownership/lease records. All stakeholders involved in the deal can trust the data stored and accessed through blockchain [58]. 10. Energy: Business models in the energy sector can be transformed using blockchain because the technology finds extensive use in the energy sector in applications such as controlling the electricity markets, enabling trade in the energy sector, making energy grids secure, and promoting green energy [2]. Studies reveal that blockchain can help create an energy marketplace where customers can choose their energy suppliers [59]. Blockchain can also facilitate electricity trade between various stakeholders of the community. They can mitigate privacy concerns by enabling the exchange of information without revealing user identity and simplifying energy exchange and regulation mechanisms [60]. Payment processing mechanisms can also be set up in blockchain to make transactions between distributed energy systems [61,62]. Blockchain can also help green energy management by authenticating the clean energy providers [63]. The business, partner, and user value for the above industry use cases are summarized in Table 1.

5.1 Challenges and limitations in blockchain-based business models Even though the blockchain holds the potential to revolutionize the digital space, however, the technology itself does not come without its limitations. One of the most significant disadvantages of blockchain is its high energy usage. Every time a new user is added to the distributed network, it communicates with the existing nodes. Similarly, every time a new transaction takes place, all the miners in the network validate the transaction cryptographically before the dataset is appended to the chain. This process consumes enormous energy because all the miners are computers that consume electricity for their operations. Another challenge is time inefficiency. “Proof of work” can take up to 10 min per transaction because millions of nodes validate the transaction. However, the business models based on permissioned blockchain do not face this challenge. Since blockchain is still an emerging technology, there are regulatory concerns by the governments of many countries about the effectiveness of blockchain systems. Some cryptocurrencies were shadowbanned in a few countries due to concerns over illegal activity that was taking place on the distributed network.

440 SECTION

C Distributed computing

TABLE 1 Business, partner, and user value generated through adoption of blockchain in various industries. Industry

Business value

Partner value

User value

Health care

Smart contracts, connectivity, trust reduced the cost of storage

Shared data for medical research

Instant accessibility to medical records, user control

Supply Chain Management

Improved processes, higher efficiency of material movement, reduced cost

Better traceability, transparency, and trust between organizations

Safe access to goods and services

Cryptocurrencies

Elimination of third-party governance, improved trust

Exchange value, smart business transactions

Improved access to currency, protection from fraud, and economic collapse

E-Voting

Security, irreversibility, trust, quicker outcomes, low costs

Trust, transparency, authentication of vote

Ease of voting, trust in the outcome

Education

Improved storage of student records, restricted access through security keys, reduced costs of recordkeeping

Easy access to records and standardized authentication processes

Quick accessibility to self-records, user control over documents

Government Administration

Lesser paperwork, cost savings

Quick approvals and service payments. Removal of red-tapism

Speedy delivery of services, confidentiality

Finance and Banking

Direct business with users and partners, increased efficiency. Single window framework to reduce cost and increase liquidity

Improved trust and efficiency of business transactions. Ease of doing business

Secure access to user financial records. Data integrity

Internet of Things (IoT)

Better communication between devices, elimination of human error

Reduced security concerns

Anonymity, trustworthiness in the automation systems

Real Estate

Removal of tedious manual recordkeeping processes, avoidance of records traveling in multiple hands

Transparency of property ownerships

Better access to property records. Quicker execution of formal processes (registration/sale/lease) of property

Energy

Creation of online energy marketplace, security of microgrids, reduce regulations

Better energy trading opportunities

Freedom to choose energy suppliers

Irrespective of the effectiveness of the technology, for a blockchain-based business model to thrive, it is essential that the participating business entities put their trust in the technology and share their data with business entities. Without active participation from the businesses, the probability of building a solid blockchain-based ecosystem is minimalistic.

6.

Discussion and critical analysis

Blockchain is a relatively new technology. However, it provides several avenues to build, develop, and reinvent business models across the industries. Some essential benefits offered by the blockchain are reduction in operational costs, swiftness in the transactional procedures, improved traceability and verification of data, and the ease of maintaining customer records. Better security, improved reliability, and increased autonomy incentivize organizations to adopt and implement blockchain technology in their business models [7]. The improved transparency through the blockchain systems enables the firms to access the real-time data without the control of a central regulatory authority. This data can further enable the organizations to innovate and rework their business models to include a more nuanced approach toward generating value for the users. The value in a business model gets transformed through blockchain at several levels—the network value changes when partners in the value chain are eliminated. The resource value gets consolidated through enhanced trust built in the process. The improved efficiency advances the customer value for the businesses [10]. Despite the myriad of benefits, the technology still faces significant challenges because of technical limitations, global regulatory frameworks, and a lack of open-mindedness in businesses to adopt new technologies. However, the potential of the technology to rapidly transform business systems cannot be denied.

Designing business models through blockchain Chapter

27

441

7. Conclusion This chapter attempts to provide an overview of the rewards and implications arising from the induction of blockchain technology in organizational business models. Blockchain technology is one of the top ten emerging technologies today that have the potential to revolutionize the way we do business [11]. The traditional business processes executed through centralized mechanisms stand disrupted today. The overall digital economy calls for new and holistic approaches for the firms to do secure and user-friendly business and keep the spirit of innovation alive. However, blockchain technology still needs to evolve and consolidate to stand the test of time and change business dimensions. The technology alone cannot transform the business styles and methods; there is a need for a conscious effort from the organizations to open up to new cutting-edge technologies that will have a transformative effect on their business models.

References [1] A.R.C. Bedin, M. Capretz, S. Mir, Blockchain for collaborative businesses, Mob. Netw. Appl. 26 (1) (2021), https://doi.org/10.1007/s11036-02001649-6. [2] J. Abou Jaoude, R. George Saade, Blockchain applications – usage in different domains, IEEE Access 7 (2019), https://doi.org/10.1109/ ACCESS.2019.2902501. [3] A. Azaria, A. Ekblaw, T. Vieira, A. Lippman, MedRec: using blockchain for medical data access and permission management, in: Proceedings - 2016 2nd International Conference on Open and Big Data, OBD 2016, 2016, https://doi.org/10.1109/OBD.2016.11. [4] I. Bandara, F. Ioras, M.P. Arraiza, The emerging trend of blockchain for validating degree apprenticeship certification in cybersecurity education, in: INTED2018 Proceedings, 2018, p. 1, https://doi.org/10.21125/inted.2018.1828. [5] S. Saberi, M. Kouhizadeh, J. Sarkis, L. Shen, Blockchain technology and its relationships to sustainable supply chain management, Int. J. Prod. Res. 57 (7) (2019), https://doi.org/10.1080/00207543.2018.1533261. [6] J.Y. Park, C.S. Sung, A business model analysis of blockchain technology-based startup, Entrepreneurship Sustain. Issues 7 (4) (2020), https://doi. org/10.9770/jesi.2020.7.4(32). [7] J. Weking, M. Mandalenakis, A. Hein, S. Hermes, M. B€ohm, H. Krcmar, The impact of blockchain technology on business models – a taxonomy and archetypal patterns, Electron. Mark. 30 (2) (2020), https://doi.org/10.1007/s12525-019-00386-3. [8] P. Spieth, D. Schneckenberg, J.E. Ricart, Business model innovation – state of the art and future challenges for the field, R D Manag. 44 (3) (2014), https://doi.org/10.1111/radm.12071. [9] C.Z. Amit, Business model design: an activity system perspective, Long Range Plann 43 (2010) 216–226. [10] W. Nowi nski, M. Kozma, How can blockchain technology disrupt the existing business models? Entrepreneurial Bus. Econ. Rev. 5 (3) (2017), https:// doi.org/10.15678/EBER.2017.050309. [11] B. Carson, G. Romanelli, P. Walsh, A. Zhumaev, Blockchain beyond the Hype: What Is the Strategic Business Value?, McKinsey& Company, 2018. Digital McKinsey, June https://www.mckinsey.com/business-functions/mckinsey-digital/our-insights/blockchain-beyond-the-hype-what-is-the-stra tegic-business-value. [12] S. Meunier, Chapter 3: Blockchain 101: what is blockchain and how does this revolutionary technology work? in: Transforming Climate Finance and Green Investment with Blockchains, Elsevier, 2018, https://doi.org/10.1016/B978-0-12-814447-3.00003-3. [13] S. Ruoti, B. Kaiser, A. Yerukhimovich, J. Clark, R. Cunningham, Blockchain technology: what is it good for? Commun. ACM 63 (1) (2020), https:// doi.org/10.1145/3369752. [14] T. Aste, P. Tasca, T. Di Matteo, Blockchain technologies: the foreseeable impact on society and industry, Computer 50 (9) (2017), https://doi.org/ 10.1109/MC.2017.3571064. [15] J.H. Witte, The Blockchain: a gentle introduction, SSRN Electron. J. (2016), https://doi.org/10.2139/ssrn.2887567. [16] K.S. Scott Bryant, Business model innovation by design: a review of design’s role in business model innovation, Int. J. Des. Creat. Innov. (2020). [17] J.E. Ramon Casadesus-Masanell, From Strategy to Business Models and Onto Tactics, Elsevier, 2010. [18] A. Osterwalder, Y. Pigneur, C.L. Tucci, et al., Clarifying business models: origins, present, and future of the concept, Commun. Assoc. Inf. Syst. (2005), https://doi.org/10.17705/1CAIS.01601. [19] R. Amit, Value Creation in E-Business, Strateg. Manag. J. (2001). [20] P. Weill, M.R. Vitale, Place to Space: Migrating to E-Business Models, Harvard Business School Press, 2001. [21] M. Morris, M. Schindehutte, J. Allen, The entrepreneur’s business model: toward a unified perspective, J. Bus. Res. 58 (6) (2005), https://doi.org/ 10.1016/j.jbusres.2003.11.001. [22] R.A. Christoph Zott, The business model: recent developments and future research, J. Manag 37 (4) (2011) 1019–1042. [23] A. Osterwalder, Y. Pigneur, Business Model Generation, Wiley, NJ, 2010. [24] J€ urgen Moormann, E. Z. (2013). Customer-Centric Business Modeling: Setting a Research Agenda. Proceedings of 2013 IEEE International Conference on Business Informatics, 15.-18.7.2013, Wien, S. 173-179. [25] K. Dehbasteh, A. Pourebrahimi, C. Valmohammadi, M.A. Afshar Kazemi, Identification of the determinants of blockchain-based business model using hybrid method: content analysis & system dynamics, Revista Rom^ana˘ de Informatica˘ Şi Automatica˘ 29 (4) (2019), https://doi.org/10.33436/ v29i4y201902.

442 SECTION

C Distributed computing

[26] R. Kamath, Food traceability on Blockchain: Walmart’s pork and mango pilots with IBM, J. Br. Blockchain Assoc. 1 (1) (2018), https://doi.org/ 10.31585/jbba-1-1-(10)2018. [27] N. Szabo, Smart Contracts, 1994. Https://Www.Fon.Hum.Uva.Nl/Rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/ Szabo.Best.Vwh.Net/Smart.Contracts.Html. [28] A. Norta, Creation of smart-contracting collaborations for decentralized autonomous organizations, in: Lecture Notes in Business Information Processing, 229, 2015, https://doi.org/10.1007/978-3-319-21915-8_1. [29] F. Zhang, E. Cecchetti, K. Croman, A. Juels, E. Shi, Town crier: an authenticated data feed for smart contracts, in: Proceedings of the ACM Conference on Computer and Communications Security, 24-28-October-2016, 2016, https://doi.org/10.1145/2976749.2978326. [30] H.M. Kim, M. Laskowski, A perspective on blockchain smart contracts: reducing uncertainty and complexity in value exchange, SSRN Electron. J. (2017), https://doi.org/10.2139/ssrn.2975770. [31] K. Christidis, M. Devetsikiotis, Blockchains and smart contracts for the Internet of Things, IEEE Access 4 (2016), https://doi.org/10.1109/ ACCESS.2016.2566339. [32] T. Saheb, F.H. Mamaghani, Exploring the barriers and organizational values of blockchain adoption in the banking industry, J. High Technol. Managem. Res. (2021), https://doi.org/10.1016/j.hitech.2021.100417. [33] X. Lin, Consumers’ intention to adopt blockchain food traceability technology towards organic food products, Int. J. Environ. Res. Public. Health. (2021). [34] Alexander Schoenhals, T. H. (2018). Design Thinking using the Blockchain: Enable Traceability of Intellectual Property in Problem-Solving Processes for Open Innovation. (pp. 105–110). CryBlock’18. [35] I. Morrison, The Second Curve, 1996. [36] P. Prajapati, K. Dave, P. Shah, A review of recent blockchain applications, Int. J. Sci. Technol. Res. 9 (1) (2020). [37] P.T.S. Liu, Medical record system using blockchain, big data and tokenization, in: Lecture Notes in Computer Science, Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics, 9977, 2016, https://doi.org/10.1007/978-3-319-50011-9_20. [38] M. Mettler, Blockchain technology in healthcare: the revolution starts here, in: 2016 IEEE 18th International Conference on E-Health Networking, Applications and Services, Healthcom 2016, 2016, https://doi.org/10.1109/HealthCom.2016.7749510. [39] E. Kotter, L. Marti-Bonmati, A.P. Brady, N.M. Desouza, ESR white paper: blockchain and medical imaging, Insights Imaging 12 (1) (2021), https:// doi.org/10.1186/s13244-021-01029-y. [40] A. Kumar, R. Liu, Z. Shan, Is blockchain a silver bullet for supply chain management? Technical challenges and research opportunities, Decis. Sci. 51 (1) (2020), https://doi.org/10.1111/deci.12396. [41] N. Kshetri, J. Voas, Blockchain-enabled E-voting, IEEE Softw. 35 (4) (2018), https://doi.org/10.1109/MS.2018.2801546. [42] M. Turkanovic, M. H€olbl, K. Kosˇic, M. Hericko, A. Kamisˇalic, EduCTX: a blockchain-based higher education credit platform, IEEE Access 6 (2018), https://doi.org/10.1109/ACCESS.2018.2789929. [43] E.P. Fedorova, E.I. Skobleva, Application of blockchain technology in higher education, Euro. J. Contemp. Educ. 9 (3) (2020), https://doi.org/ 10.13187/ejced.2020.3.552. [44] H. Hou, The application of blockchain technology in E-government in China, in: 2017 26th International Conference on Computer Communications and Networks, ICCCN 2017, 2017, https://doi.org/10.1109/ICCCN.2017.8038519. [45] A. Stanciu, Blockchain based distributed control system for edge computing, in: Proceedings - 2017 21st International Conference on Control Systems and Computer, CSCS 2017, 2017, https://doi.org/10.1109/CSCS.2017.102. [46] S. Ølnes, A. Jansen, Blockchain technology as s support infrastructure in e-Government, in: Lecture Notes in Computer Science, Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics, 10428, 2017, https://doi.org/10.1007/978-3-319-64677-0_18. [47] G.W. Peters, E. Panayi, Understanding modern banking ledgers through blockchain technologies: future of transaction processing and smart contracts on the internet of money, in: New Economic Windows, 2016, https://doi.org/10.1007/978-3-319-42448-4_13. [48] T.J. MacDonald, D.W.E. Allen, J. Potts, Blockchains and the boundaries of self-organized economies: predictions for the future of banking, in: New Economic Windows, 2016, https://doi.org/10.1007/978-3-319-42448-4_14. [49] B. Egelund-M€uller, M. Elsman, F. Henglein, O. Ross, Automated execution of financial contracts on blockchains, Bus. Inf. Syst. Eng. 59 (6) (2017), https://doi.org/10.1007/s12599-017-0507-z. [50] S. Singh, N. Singh, Blockchain: future of financial and cyber security, in: Proceedings of the 2016 2nd International Conference on Contemporary Computing and Informatics, IC3I 2016, 2016, https://doi.org/10.1109/IC3I.2016.7918009. [51] O. Novo, Blockchain meets IoT: an architecture for scalable access management in IoT, IEEE Internet Things J. 5 (2) (2018), https://doi.org/10.1109/ JIOT.2018.2812239. [52] S. Huh, S. Cho, S. Kim, Managing IoT devices using blockchain platform, in: 2017 19th International Conference on Advanced Communication Technology (ICACT), 2017, https://doi.org/10.23919/ICACT.2017.7890132. [53] M.A. Khan, K. Salah, IoT security: review, blockchain solutions, and open challenges, Futur. Gener. Comput. Syst. 82 (2018), https://doi.org/ 10.1016/j.future.2017.11.022. [54] T. Hardjono, N. Smith, Cloud-based commissioning of constrained devices using permissioned blockchains, in: IoTPTS 2016 - Proceedings of the 2nd ACM International Workshop on IoT Privacy, Trust, and Security, Co-Located with Asia CCS 2016, 2016, https://doi.org/10.1145/ 2899007.2899012. [55] A. Ouaddah, A.A. Elkalam, A.A. Ouahman, Towards a novel privacy-preserving access control model based on blockchain technology in IoT, Adv. Intell. Syst. Comput. 520 (2017), https://doi.org/10.1007/978-3-319-46568-5_53.

Designing business models through blockchain Chapter

27

443

[56] M. Samaniego, R. Deters, Using blockchain to push software-defined IoT components onto edge hosts, in: ACM International Conference Proceeding Series, 2016, https://doi.org/10.1145/3010089.3016027. [57] M. Samaniego, R. Deters, Blockchain as a service for IoT, in: Proceedings - 2016 IEEE International Conference on Internet of Things; IEEE Green Computing and Communications; IEEE Cyber, Physical, and Social Computing; IEEE Smart Data, IThings-GreenCom-CPSCom-Smart Data 2016, 2017, https://doi.org/10.1109/iThings-GreenCom-CPSCom-SmartData.2016.102. [58] S.S. Thota, Blockchain for real estate industry, J. Soc. Sci. Res. 52 (2019), https://doi.org/10.32861/sr.52.53.56. [59] J.J. Sikorski, J. Haughton, M. Kraft, Blockchain technology in the chemical industry: machine-to-machine electricity market, Appl. Energy 195 (2017), https://doi.org/10.1016/j.apenergy.2017.03.039. [60] J. Kang, R. Yu, X. Huang, S. Maharjan, Y. Zhang, E. Hossain, Enabling localized peer-to-peer electricity trading among plug-in hybrid electric vehicles using consortium blockchains, IEEE Trans. Ind. Inf. 13 (6) (2017), https://doi.org/10.1109/TII.2017.2709784. [61] T. Lundqvist, A. De Blanche, H.R.H. Andersson, Thing-to-thing electricity micro payments using blockchain technology, in: GIoTS 2017 - Global Internet of Things Summit, Proceedings, 2017, https://doi.org/10.1109/GIOTS.2017.8016254. [62] E. Munsing, J. Mather, S. Moura, Blockchains for decentralized optimization of energy resources in microgrid networks, in: 1st Annual IEEE Conference on Control Technology and Applications, CCTA 2017, 2017-January, 2017, https://doi.org/10.1109/CCTA.2017.8062773. [63] F. Imbault, M. Swiatek, R. De Beaufort, R. Plana, The green blockchain: managing decentralized energy production and consumption, in: Conference Proceedings – 2017 17th IEEE International Conference on Environment and Electrical Engineering and 2017 1st IEEE Industrial and Commercial Power Systems Europe, EEEIC / I and CPS Europe 2017, 2017, https://doi.org/10.1109/EEEIC.2017.7977613.

This page intentionally left blank

Index Note: Page numbers followed by f indicate figures, t indicate tables, and b indicate boxes.

A Absolute consensus techniques, 228 Abstract domains reduced product, 120–121 relational and nonrelational intervals, 118, 119f octagons, 118–119, 119f polyhedra, 118, 119f, 120 sign, 118, 119f strength and weakness, 120, 120t Abstract interpretation-based information flow analysis, 107 Abstract semantics, of solidity smart contracts, 115 assignment statement, 115 code snippet, 115b conditional, 116 constructor, 116 function, 116 iteration, 116 sequence, 116 smart contract, 116 Abstract syntax, 111, 112t Abstract syntax tree (AST), 133 Account creation, 308–310, 309f Additive white Gaussian noise, 41–42 Advanced encryption standard (AES), 253–254 Advanced Research Projects Agency Network (ARPANET), 3 AES. See Advanced encryption standard (AES) Agriculture and farming artificial intelligence (AI), 197 blockchain technology (BT), 198 cloud computing, 198 Internet of Things (IoT), 198 Algorand consensus concept, 150 Alice, 269 Android mobile phone, 416 Application binary interface (ABI), 179 Application development, 87 Application programming interface (API), 416 Application-specific integrated circuits (ASICs), 217, 314 Arogya Setu App, 391–392 Artificial intelligence (AI), 4–5, 23, 39 applications, 190 agriculture and farming, 197, 201–202 cybersecurity, 199, 201–202 5G and 6G networks, 196, 201–202 smart grid (SG), 195, 201–202 smart healthcare system, 200–201

traffic management, 192 transportation, 192, 196, 201–202 weather forecasting, 198, 201–202 deep learning (DL), 190, 201–202 definition, 190 features of, 190 future research, 204 Internet of Things (IoT) applications, 189 cooperative robotics, 193, 201 Industry 4.0, role in, 193, 201 smart city applications, 194, 201 machine learning (ML), 190, 192, 195, 201–202 research and innovation gaps, 203 ASICs. See Application-specific integrated circuits (ASICs) Asymmetric cryptography, 251–252 accountability and non-repudiation, 254 message, digital signing, 254, 255f private key, 346 public key, 346, 347f public key encryption, 254, 255f Atomic broadcast, 210–211 Attack vectors, of consensus, 213, 214f Audio coin, 318 Augur, 241, 269 Autonomous decentralized peer-to-peer telemetry system (ADEPT), 33

B BeepTrace software, 391 BelYo platform, 391–392 BFT. See Byzantine fault tolerance (BFT) BFT-SMaRT method, 161–162, 161f BGP. See Byzantine generals problem (BGP) BigchainDB, 29 Bigram analysis, 409–410, 409f Bioinformatics, 389 applications, 392, 392f and biological databases, 392–393, 393f blockchain technology (BT) applications, 396 applied research, change in traditional methods, 398–399 role of, 393–394 definition, 392 genomics (see Genomic big data) Biological databases, 392–393, 393f Biological monitoring, 427

Bitcoin, 6, 9–11, 14, 20–22, 29–32, 55, 57, 60, 69, 177, 210, 216, 267–268, 298–299, 331, 333, 341, 344, 348, 367 address, 263–264 cyber criminals, attraction for, 237 vs. hedera, 315, 316t miners, 312 proof of work paradigm, 315 SHA-256 hash algorithm, 261 structure, 145, 146f Bitnation, 269 Blackcoin, 79, 148 Blindcoin, 30 Blockchain as a Service (BaaS), 25–26, 92 Blockchain technology (BT), 9f, 80, 105, 207, 230, 251, 338, 341, 390 advantages, 72, 190 agriculture and farming, 198, 202–203 aim, 23 applications, 28, 35–36t, 39, 41, 41f, 55, 107, 190, 267, 367–368, 389, 433 analysis, 40 in banking and finance, 28 in business sectors, 367 future applications, 33 in healthcare (see Health care, blockchain in) in information, 28 in manufacturing industry, 26 stages, 40 supply chain management, 26, 27f in transportation/vehicular ad-hoc network, 27 in voting, 28 architecture centralized architectures, 298–299 centralized vs. decentralized vs. distributed system, 298–299, 299t components, 332, 332f distributed architecture, 298–299 simple blockchain, 299–300, 301f asymmetric cryptography, 71 basic need/use of, 55 benefits of, 301, 302–303t and bioinformatics (see Bioinformatics) bitcoin blockchain structure, 145, 146f block creation, 9, 10f, 308 Ethereum, prerequisites for, 308–310 mining, 316, 317f structure, 70, 70f, 303–308, 308f

445

446

Index

Blockchain technology (BT) (Continued) Byzantine general problem consensus, 311–316 proof of work (PoW), 314–316 censorship resistance, 209 centers, 56 characteristics, 23–24, 25f, 39, 69, 71–72, 230, 267, 433 consensus algorithm (see Consensus algorithm) consortium/federated blockchain (see Consortium blockchain) in COVID-19, 391–392 creation timestamp, 70 critical analysis, 399, 400t cryptography, role in (see Cryptography) cybersecurity, 200, 202–203 data-encrypted blocks, collection of, 297–298 data restoration, 434 as decentralized networks, 192 decentralized peer to peer vs. centralized peer, 20, 20f decentralizing applications, problems in, 33–34 definition, 9, 19, 145, 267, 299–300 disadvantages, 72 distributed computing (see Distributed computing and blockchain) distributed document, 55 distributed ledger network (DLN), 425 distributed ledger technology (DLT) (see Distributed ledger technology (DLT)) edge registration stage, 55–56 Ethereum (see Ethereum blockchain) evolution, 14, 14f, 69, 341–343, 389, 390f Blockchain 1.0, 14, 20 Blockchain 2.0, 15, 20–21 Blockchain 3.0, 15–16, 21 Blockchain 4.0, 21 features, 57–58, 57f, 207 5G and 6G networks, 196, 202–203 financial innovations, 367 financial service sector, adaptability and usage in (see Financial services) forensics (see Forensics, in blockchain) fundamental principles of, 425–426 future research, 34, 204, 351–352, 399–400 vs. Google Docs, 299–300 vs. Hashgrpah, 8, 8f hashing algorithm, 70–71, 72f hash values, 70 history, 8, 21–22, 22f, 60, 60f hybrid (see Hybrid blockchain) Hyperledger Fabric (see Hyperledger Fabric (HLF)) immutability, 9, 19, 208–209, 230 implication, 324 Industry 4.0, role in, 193 initial phase, 69 innovations, 20 and Internet of Things (IoT) (see Internet of Things (IoT))

IP blockchain system, hierarchical structure of, 208, 208f life sciences, role in, 390–391 limitations and challenges, 58f anonymity and data privacy, 30–31 complexity and versions, 16 confidentiality, lack of, 59 consensus, 33 criminal connection, 59 energy consumption, 59 inherent inefficiencies, 16 interoperability, 59 latency/delay, 59 legal issues, 32–33 normalization, lack of, 59 quantum computing, 16 scalability, 16, 29, 59 security, 16, 29–30, 59 smart contracts, 31–32 speed and information transmission, 58 storage capacity, 29 talent, lack of, 59 transaction speed, 59 literature review, 301–303, 304–307t machine learning (ML), 195 Merkle tree function, 145 miners, 434 motivation, 23 nodes, 299–300 in organizational business models (see Business models) for oxygen cylinder level monitoring (see Oxygen cylinder level monitoring) peer-to-peer (P2P) network, 70–71, 71f, 209–210, 298 permissioned (see Permissioned blockchains) permissionless (see Permissionless blockchains) perspective on, 126 private blockchains (see Private blockchains) properties, 70–71, 331–332 public blockchains (see Public blockchains) public ledger, 300–301 research gap analysis in, 33, 36t security, 333 data structure level, 323 decentralized identifier, 323 issues, 190 transaction level, 323–324 services, 24–25, 36t shared governance and operation, 434 smart grid (SG), 195 smart healthcare system, 201 sports, social media perspective on (see Sports, blockchain adoption in) storage, 39 structure, 9, 56, 57f, 70, 70f traditional vs. blockchain built-in financial system, 127t, 370 transaction ledger, 192 transactions, 9, 10f transactions between two parties, 301 in transportation, 197, 197f, 202–203

used car transactions, application in (see Used car market) verifiable state, 434 weather forecasting, 198, 202–203 web 3.0, component of, 299–300 working principle, 300–301, 302f Block ciphers, 253 advanced encryption standard (AES), 253–254 data encryption standard (DES), 253 operation mode, 253 Block header, 344–348, 345t BT. See Blockchain technology (BT) Burnt money, 150–151 Burstcoin, 151 Business models, 433 blockchain technology, 436 benefits, 440 challenges and limitations, 439–440 industry use cases, 438–440 partner value and permissioned blockchain, 437 smart contracts, 436 user value, 437–438, 440t blocks, 435 business value, 436–437 canvas, 435, 435f channels, 435 cost structure, 435 customer relationships, 435 customer segments, 435 definitions, 434 external perspective, 436 of focal firm, 433 internal organizational perspective, 435 key activities, 435 key resources, 435 partner networks, 435 revenue streams, 435 scholarly business model, 434 themes, 434 value proposition, 435 Business process management (BPM), 379 Byzantine agreement technique, 150 Byzantine failure model, 211 Byzantine fault tolerance (BFT), 80, 211, 312 BFT-SMaRT protocol, 161–162 delegated Byzantine fault tolerance (DBFT), 158–159 Istanbul Byzantine fault tolerance (IBFT), 159–161 practical Byzantine fault tolerance (PBFT), 155–158, 229–230 proof of stake (PoS), 220 verifiable Byzantine fault tolerance (VBFT), 162, 162f Byzantine generals problem (BGP), 145, 311, 342 consensus, 311–316 chain replacement, 312, 313f chain validation, 312, 313f definition, 311 distributed computing, challenge in, 311

Index

distributed/decentralized multi-agent platform, 311 features, 312 mining, 312–314 proof of work (PoW), 314–316

C Cancer Genome Atlas, 393–394 Cartel formation (CAF) attack, 222 Censorship resistant systems, 209 Centralized management system, 426, 426f Central processing units (CPU), 44–45, 48, 51, 314 Certified used car sales method, 377 Chained PoS, 220 Chained PoW, 217 Checksum, 209 Chemical hazards, 427 CLI. See Command-line interface (CLI) Cloud computing, 39, 190, 415 agility and usability, 193 agriculture and farming, 198, 203 cybersecurity, 200, 203 definition, 189 5G and 6G networks, 196, 203 future of, 193, 205 and Internet of Things (IoT) cooperative robotics, 194, 203 Industry 4.0 revolution, role in, 193, 203 smart city applications, 194, 203 machine learning (ML), 196 research gaps, 204 services, 189 smart grid (SG), 195, 203 smart healthcare system, 201, 201f transportation, 197, 203 weather forecasting, 199, 203 Cloud manufacturing blockchain characteristics, 225–226 data tampering, prevention of, 225–226 non-tamperable distributed ledger, 225 proof of service power consensus mechanism (see Proof of service power (PoSP), in cloud manufacturing) concerns/issues, 225 restrictions, 225 CoAP. See Constrained application protocol (CoAP) Coinage accumulation (CAC) attack, 221 CoinJoin, 30–31 CoinShuffle, 30 CoinSwap, 30 Cold wallets, 239 Colored coins, 318 Command-line interface (CLI), 179 Committees, consensus process closed committee, 212 dynamic configuration, 212 multiple committees, 212 open committee, 212 single committee, 212 static configuration, 212

Community blockchain. See Consortium blockchain Compressed gas system, 417 Computational biology. See Bioinformatics Compute-bound PoW, 216–217 Concrete semantics, of Solidity language environments and states, 111–112 semantics, 111 assignment statement, 113 conditional, 113 constructor, 114 expressions, 113 function, 114 iteration, 114 local variable declaration, 113 sequence, 113 smart contract, 114 state variable declaration, 114 Confirmable message, CoAP, 329 Consensus algorithm, 145, 332 atomic broadcast, 210–211 Byzantine consensus, 211 Byzantine fault tolerance (BFT), 80 consensus, definition of, 210, 230 consensus taxonomy block and reward properties, 212–213, 213f performance properties, 214–215, 214f security properties, 213–214, 213f structural properties, 211–212, 212f crash-tolerant consensus, 211 direct acyclic graphs (DAGs), 80 Hashgraph, 167 Tangle, 166–167, 166f Ethereum, 269 fault-tolerance models, 211 future trends, 168–170 lightweight consensus, 228, 230 proof-based consensus algorithms, 208 proof of activity (PoA), 79, 152–153, 153f proof of authority (PoA), 79 proof of burn (PoB), 79, 150–151, 151f proof of capacity (PoC), 79–80, 151–152, 152f proof of contribution (PoC), 222–224, 230 proof of elapsed time (PoET), 79, 149–150 proof of importance (PoI), 80, 152, 153f proof of stake (PoS), 79, 148–149, 219–222, 219f proof of weight (PoWeight), 150 proof of work (PoW), 9–10, 79, 146–148, 215–218, 230 proof of service power consensus mechanism (see Proof of service power (PoSP), in cloud manufacturing) taxonomy and comparison evaluation, 167, 168–169t voting-based consensus, 208 BFT-SMaRT protocol, 161–162 delegated Byzantine fault tolerance (DBFT), 158–159 delegated proof of stake (DPoS), 80, 154, 154f Istanbul Byzantine fault tolerance (IBFT), 159–161

447

Paxos, 154–155, 155f practical Byzantine fault tolerance (PBFT), 155–158, 229–231 Raft algorithm, 164–165, 164f ripple protocol consensus algorithm (RPCA), 165 Tendermint consensus, 163, 163f verifiable Byzantine fault tolerance (VBFT), 162, 162f Consortium blockchain, 12f, 14f, 61, 61f, 63, 66, 66t advantages, 63, 74–75 applications, 77 consensus mechanism, 12 disadvantages, 63 examples, 12, 63, 74 vs. hybrid blockchain, 75, 75t members, 12 vs. private blockchain, 75, 75t systems/nodes, 74, 74f use cases, 63 validators, 12 Constrained application protocol (CoAP), 327–329 functions, 329 low-power embedded environments, use in, 328 machine-to-machine (M2M) applications, 328 messages model, 329 structural vulnerabilities, 329–330 Contract accounts, 92–93, 93t Control-flow graph (CFG), 109, 110f Correct by construction approach, 130–131 Cost–benefit analysis, 348 COVID-19, blockchain in, 391–392 CPU-bound PoW. See Compute-bound PoW Crash failure model, 211 Crash-tolerant consensus, 211 Cross-border payments, 371 Cryptocurrency, 14, 57, 317–319, 331, 341 Chiliz, 405 definition, 317 forensics opensource tools in, 247–248 wallets (see Wallets) proof of stake (PoS), 79 proof of work (PoW), 79 vs. tokens, 317 transaction schematics in, 342–343, 342f value of, 348 Crypto economics, 341 bitcoins, 348 deciphering key, 343–344 definition, 348 digital time stamping, 344 distributed ledger system, 106 eCash, 344 enciphering key, 343–344 Ethereum cryptocurrency, 348 financial market structures and blockchain, 349–350 game theory decision-making system, components, 348–349

448

Index

Crypto economics (Continued) Nash equilibrium, 349 nonzero-sum game, 349 payoff matrix, 349, 349t zero-sum game, 349 hashcash, 344 hash functions block header, 344–348, 345t data structures, 344–348, 344–345f Merkle tree, 345–348, 346b security, properties for, 344 incentives, 348 initial coin offerings (ICOs) benefits, 350–351 limitations, 351 private and public, 350 mining, 347 Nash equilibrium, 349 proof-of-work, 347 public key distribution system, 343–344 signatures, 346 timestamping, 344 Cryptography, 6–7, 208, 251, 264, 318, 341 asymmetric cryptography, 251–252 accountability and non-repudiation, 254 message, digital signing, 254, 255f public key encryption, 254, 255f bitcoin blockchain address, 263–264 digital signatures, 259–260, 260b elliptic curve cryptography (ECC), 333 advantages, 255 bitcoin equation curve, 256, 256f characteristics, 256 curves and mechanics, 255 elliptic curve domain parameters (ECDP), 255 encryption-decryption, OpenSSL for, 256–258, 259t public-private key generation, 256–258 vs. RSA, 255, 256t secp256k ECDP standard, 255–256 Standards for Efficient Cryptography Group (SECG), 255 elliptic curve digital signature algorithm (ECDSA), 333 field, 251 finite field, 251 group, 251 group signature, 333 hashing functions application, 261 chains, 262 characteristics, 260–261 digital signatures, 262 hash value/message digest, 260 history of, 261 KECCAK-256, 263 MD5 and SHA256 hash algorithm, 260, 260b Merkle trees, 261–262, 261b, 262f proof-of-work consensus, 262 RIPEMD-160, 263, 263b secure hash algorithm 256 (SHA-256), 260–261, 260b, 263, 263b

homomorphic encryption, 264 order, 251 primitives, 251–252, 252f random oracle (RO) model, 333 ring, 251 ring signatures, 333 role and function, 252 set, 251 signcryption, 264 symmetric cryptography, 251–252 advanced encryption standard (AES), 253–254 alphabets and numbers, combination of, 252–253 block ciphers, 253 data encryption standard (DES), 253 encryption-decryption in, 252, 253f message authentication code (MAC), 253 OpenSSL AES, 254, 254t stream ciphers, 253 zero knowledge proofs (ZKP), 264, 333 Crypto kitties, 318 Crypto tokens. See Tokens Cybersecurity artificial intelligence (AI), 199 blockchain technology (BT), 200 cloud computing, 200 Internet of Things (IoT), 199, 200f

D DApps. See Decentralized applications (DApps) Dark wallet, 30–31 Data directory instantiation, 308–309, 309f Data encryption standard (DES), 253 Data-flow analysis, 109–111 Data structure level security, 323 DBFT. See Delegated Byzantine fault tolerance (DBFT) Decentralization, 4, 395 Decentralized applications (DApps), 21–22 advantages, 90, 173, 176–177, 177f vs. application (App), 173–174, 174–175f, 174t centralized app, design, 89–90, 89f working principle of, 178 Blockchain 3.0, 15–16 block level flow diagram, 95, 96f “Brave”, 5 challenges, 180–181 development Hardhat framework, 104 steps, 179–180 tools, 180 Truffle framework, 101–104 Ethereum, 90, 244, 270, 275, 277, 277–279f account setup, 180 balance, 90–91 as Blockchain as a Service (BaaS), 92 block level representation, 92, 92f building blocks, 93–94 client, 180 code hash, 90–91 contract accounts, 92–93, 93t

Ethereum virtual machine (EVM), 91, 93 externally owned accounts (EOA), 92–93, 93t nonce, 90–91 proof of work (PoW), 92 storage hash, 90–91 TestRPC, 179 transaction-based state machine, 90, 91f world state block level architecture, 90–91, 91f examples, 177–178 facts, 173 features/characteristics, 175, 176f functional flow, 95–98 graph, 98–99 implication, 185–186 issues, 181 open-source applications, 173 platform tokens, 318 problem statement, 179 proposed methodology App folder, 182 contract folder, 182 DApp deployment, 182 MetaMask, 182 private network creation, 181, 181f smart contract creation, 182 smart contract deployment, 182 results MetaMask, 185, 187f migration, 183, 184f mining process, 183, 183f private network creation, 182, 183f smart contract creation, 184, 185f smart contract testing, 185, 186f wallet interface, 184, 184f scalability, 99–100 vs. smart contracts, 270 types, 178, 178t Decentralized autonomous organizations (DAOs), 268 Decentralized banking system, 300–301 Decentralized distributed ledger system, 342–343, 343t Decentralized exchanges (DEXs), 98–99 Decentralized systems, 89f characteristics, 87–88 vs. distributed systems, 88t limitation, 88 nodes, 87–88 Decentralized web (DWeb), 19, 33–34 Deep learning (DL), 39–40, 190 Deep Q Network (DQN), 45 Delegated Byzantine fault tolerance (DBFT), 158–159 Delegated proof of contribution (DPoC), 223 Delegated proof of stake (DPoS), 80, 154, 154f, 220–221 Denial of service (DoS), 29–30, 218 Digital assets cryptocurrency (see Cryptocurrency) definition, 317 tokens vs. cryptocurrency, 317–318

Index

definition, 317 digital tokens, 318 Ethereum blockchain, 318 initial coin offering/initial token offering (ICO/ITO), 319 types, 318–319 Digital blocks, 425 Digital communication, 297–298 Digital currency, 14 Digital gold, 299–300 Digital money, 342–343 Digital payments, 372 Digital signatures, 259–260, 260b, 262, 346 Digital time stamping, 344 Digital tokens, 318 Direct acyclic graphs (DAGs), 16, 80, 168–169t Hashgraph, 167 Tangle, 166–167, 166f Distributed autonomous organizations (DAOs), 15 Distributed computing and blockchain, 39–40, 355–356 application and development trend, 40–41 challenge in, 311 data transmission, security performance of data message lifetime, 51, 52f recognition accuracy, 51, 52f demand analysis, 41 drawbacks, 360 privacy security analysis, 47–48 shortcomings, 53 simulation evaluation, 48–49, 49t system performance, comparative analysis of calculation cost, 49f, 51 comprehensive income, 50f, 51 system operation efficiency, 50f, 51 task allocation, analysis of, 41–46 Distributed database system vs. blockchain, 356–357 challenges, 356 definition, 355–356 rules of, 356–357 Distributed deep learning network model, 39–41 Distributed denial of service (DDOS) attacks, 360 Distributed ledger network (DLN), 425, 428–430 Distributed ledger system (DLS), 358 Distributed ledger technology (DLT), 5, 14, 55, 107, 283, 357 advantages, 357–358 agriculture and farming, 198 vs. blockchain, 20 cryptography, 6–7 decentralized ledger, 107 implementations Hashgraphs, 7–8 Tangle, 7 peer-to-peer network, 6–7 practical applications, 357–358 transactions, visibility of, 6–7 use cases of, 6–7 Distributed operating system for blockchain, 360–361

Hyperledger Fabric (see Hyperledger Fabric (HLF)) virtual uniprocessor, 360 Distributed system advantages, 87, 312 blockchain, 355 business applications, 358 centralized cloud-based system, 358 distributed computing (see Distributed computing and blockchain) vs. distributed database, 358–359 block diagram, 87, 88f Byzantine generals problem (BGP), 145 characteristics, 157 client-server-based architectural models, 356 vs. decentralized systems, 88t distributed ledger technology (DLT), 357 advantages, 357–358 practical applications, 357–358 drawbacks, 312 evolution, 355 nodes, 87 World Wide Web (WWW), 355 DLN. See Distributed ledger network (DLN) DLT. See Distributed ledger technology (DLT) DNAtix, 395 Dogecoin, 79 Double spending, 324

E EB2Sol tool, 125–126, 131, 139 code generation, 132, 137–138, 140f development architecture of, 132, 132f Event-B to solidity, translation of, 134t context models, 133–135, 135t machine model, 135–136 transformation functions, 133, 133t preprocessing and generated POs, 132, 133t Solidity implementation, 131 E-cash, 8, 344 ECC. See Elliptic curve cryptography (ECC) ECDSA. See Elliptic curve digital signature algorithm (ECDSA) Edge computing technology, 40 Education, Hyperledger Fabric, 284 E-gold, 8 Electrical safety hazards, 427 Electronic currencies, 8 Electronic transactions, 8 Elliptic curve cryptography (ECC), 333 advantages, 255 bitcoin equation curve, 256, 256f characteristics, 256 curves and mechanics, 255 elliptic curve domain parameters (ECDP), 255 encryption-decryption, OpenSSL for, 256–258, 259t public-private key generation, 256–258 secp256k ECDP standard, 255–256 Standards for Efficient Cryptography Group (SECG), 255 Elliptic curve Diffie Hellman equation (ECDH), 258, 258t

449

Elliptic curve digital signature algorithm (ECDSA), 43–44, 44–45f, 333 Elliptic curve discrete logarithm problem (ECDLP), 333 Elliptic curve domain parameters (ECDP), 255 Encrypgen, 396 Encryption algorithms, 16 Encryption technology, 39 Energy optimization techniques, 416 Enigma project, 31 Environmental health hazards, 427 Environmental monitoring, 427 EOA. See Externally owned accounts (EOA) Ergonomic hazards, 427 eSports, 406 Ethcash algorithm, 269 Ether, 268–269, 271 Ethereum, 126 Ethereum blockchain, 15, 20–22, 90, 177–178, 281 account setup, 180 addresses, 246 advantages, 267–268 applications, 268 attack, 267 balance, 90–91 as Blockchain as a Service (BaaS), 92 block level representation, 92, 92f building blocks, 93–94 client, 180 code hash, 90–91 consensus algorithm, 269 contract accounts, 92–93, 93t decentralized autonomous organizations (DAOs), 268 definition, 238, 267 disadvantages, 268 ether, 268–269, 299–300 Ethereum 2.0 fragmentation, 280 impact, 281 implementation phases, 280–281 improvements, 280 problems, 280 proof of stake (PoS) algorithm, 280 Ethereum virtual machine (EVM), 91, 93, 268 examples, of real applications, 241 externally owned accounts (EOA), 92–93, 93t features, 268 nodes, 267 nonce, 90–91 prerequisites for, 308–310 private network, 309, 310f proof of work (PoW), 92 simulation, of real environment, 271–279 smart contracts (see Smart contracts) Solidity language, 270 storage hash, 90–91 TestRPC, 179 token, 318 tools, 270–271 transaction-based state machine, 90, 91f world state block level architecture, 90–91, 91f

450

Index

Ethereum Developer Community, 348 Ethereum virtual machine (EVM), 22, 43, 47, 91, 93, 107–108, 125–126, 268 Etheria, 269 Etherscan, 270, 279, 279f, 320, 322, 322f EtherTweet, 177, 269 Ethlance, 269 Event-B modeling language, 125–126 applications, 128 context and machine, 126, 127t EB2Sol (see EB2Sol tool) proof obligations (POs), 127–128, 127t refinement technique, 128 Rodin, 128 smart purchase (see smart purchase model) state variables, 126–127 Everipedia, 177 EVM. See Ethereum virtual machine (EVM) Externally owned accounts (EOA), 92–93, 93t

F Facebook, 3–4 Factom, 177 Fantasy sports leagues, 406 Fan tokens, 405 Fault-tolerance models, 211 F* functional programming language, 126 Fiat money, 341 5G and 6G networks, 196 artificial intelligence (AI), 196 blockchain technology (BT), 196 cloud computing, 196 Internet of Things (IoT), 196 Filecoin, 19 Financial services blockchain technology (BT), 370–371, 374 benefits, 372 cost–benefit study, 373 difficulties and possibilities, 373 evolution, 368, 368f features, 368–369 global payments and remittances, 367, 371 insurance claims, 372 mortgage claims and processing, 371 regulatory compliance, 372 risks and challenges, 373 trade finance, 372 vs. traditional financial system, 370, 371t networked innovation, evolution of, 368, 368f Financial technology (FinTech) bitcoin, 367 blockchain, Google search volume index (SVI), 369–370 emergence, 367 firms, innovative technology and creativity, 367 Finite field, 251 Forensics, in blockchain, 237, 250 addresses information about, 248, 249f information from, 246–247 bitcoins, 237

address, 244–245, 245f cyber criminals, attraction for, 237 block header format, 241, 242t cryptocurrency, opensource tools in, 247–248 genesis block bitcoin/blocks directory, listing files in, 241, 242f genesis.dat file, 241–244, 242–243f investigators, recommendations for, 248–249, 249t mempool, 244–245 traditional digital forensic professionals, 237 wallets (see Wallets) Formal dependency analysis, of solidity smart contracts abstract domain Pos, 115 abstract semantics, 115 assignment statement, 115 code snippet, 115b conditional, 116 constructor, 116 function, 116 iteration, 116 sequence, 116 smart contract, 116 FORTRAN, 87 Full node wallet, 238

G Galois field. See Finite field Game theory decision-making system, components, 348–349 Nash equilibrium, 349 nonzero-sum game, 349 payoff matrix, 349, 349t zero-sum game, 349 Ganache, 101–104, 180, 271 Genesis block, 303–308, 310, 311f, 312 bitcoin/blocks directory, listing files in, 241, 242f genesis.dat file listing files, 241–242, 242f reading, 242–244, 243f Genesis file creation, 308, 309f Genesy, 396 Genobank.io, 393 Genomic big data blockchain technology next-generation bioinformatics, 396 platform, 396, 396–397t potential of, 395 storing and analysis, 395–396 challenges in, 394–395, 394f nanopore sequencing, 394 next-generation sequencing (NGS), 394 Sanger sequencing, 394 third-generation sequencing, 394 Genomic data storage system, 395 Global system for mobile communication (GSM), 415–416, 418–419, 421f Globlal positioning system (GPS), 416, 418 Gnosis, 269

Golem, 177, 318 Google, 3–4 Google Maps, 416 Gossip, 7–8 Governance token, 319 Graph, 98–99 Graphics processing unit (GPU), 314 GSM. See Global system for mobile communication (GSM)

H Hardhat DApp framework, 104 Hardware random-number generators (HRNGS), 252–253 Hardware wallets, 238, 238f, 240 Hashcash, 344 Hashgraphs, 7–8 Hashing algorithms, 70 application, 261 chains, 262 characteristics, 260–261 digital signatures, 262 hash value/message digest, 260 history, 261 KECCAK-256, 263 MD5 and SHA256 hash algorithm, 260, 260b Merkle trees, 261–262, 261b, 262f proof-of-work consensus, 262 RIPEMD-160, 263, 263b secure hash algorithm 256 (SHA-256), 260–261, 260b, 263, 263b Hash pointer blockchain data structure with, 344–345, 345f link list data structure with, 344–345, 344f Hazards, 427 Health care, blockchain in, 26 applications medical record integrity, 398 mobile health and remote monitoring, 397 pharmaceutical companies, 397 protection of genomics, 397 quicker, cheaper, better care for patients, 397 research, 397 tracking outbreaks and diseases, 397 clinical trial information, collection of, 391 clinical trials access, 391 COVID-19, 391–392 medical records, 391 modeling cancer evolution, 391 role of, 397, 398f Health monitoring devices, 417 Hedera, 8 vs. bitcoin, 315, 316t vs. proof of work (PoW) and proof of stake (PoS), 315, 315t HLF. See Hyperledger Fabric (HLF) Hoare-like logic-based interprocedural information flow analysis, 107 Holochain, 78 Homomorphic encryption, 264 Human genome project, 394

Index

Hybrid blockchain, 13f, 61, 61f, 63, 66, 66t, 69, 75 advantages, 63, 75 applications, 77 challenges, 63 vs. consortium blockchain, 75, 75t implementations, 13 use cases, 63–64, 76 HyperDirectory project, 379 Hyperledger Fabric (HLF), 379, 399 architecture, 361–362 certificate authority (CA), 283 chaincode, 284, 361 channels, 283 client node, 361 cloud operating systems, 361 distributed ledger technology (DLT), 283 education, 284 endorsement policy, 362–363 open-source permissioned platform, 283 ordering service nodes (OSN), 361 vs. parallel database system, 363–364, 364t peers/peers nodes, 283–284, 361 permissioned network, 283 policy, 284 private data, 283 purpose of, 361 security, 363 shortcoming, 363 supply chain, 284 trade financing and business, 284 transaction flow in, 362, 363f tutorials Fabric CA operations guide, 284, 288–294 Linux installation, 284 software, 284 test network, 284–288 use cases, 361 working principle of, 362, 362f Hyperledger project, 11

I ICOs. See Initial coin offerings (ICOs) Incentives, 348 Information flow security analysis, 106 abstract interpretation-based information flow analysis, 107 axiomatic approach, 107 Hoare-like logic-based interprocedural information flow analysis, 107 language-based information flow security analysis, 106, 108–109 lattice model, 106 program dependence graph (PDG), 107 security-type systems, 107 semantics characterization, 107 Infrastructure-as-a-Service (IaaS), 189, 200 Initial coin offerings (ICOs), 319, 349, 405 benefits, 350–351 limitations, 351 private and public, 350 Initial token offering (ITO), 319 Insurance claims, blockchain, 372

Intellectual property chain (IPC), 223 Intellectual property (IP) protection, 222–225 International Occupational Hygiene Association (IOHA), 427 Internet, 39 Internet Archive, 33–34 Internet of Health (IoH), 190 Internet of Medical Things (IoMT), 202 Internet of Robotic Things (IoRT), 193, 202 Internet of Things (IoT), 40, 71, 189, 228, 439 agriculture and farming, 198, 202 analytical components, 190 applications, 189–190, 192 artificial intelligence (AI) (see Artificial intelligence (AI)) blockchain technology (BT), 23, 24f, 28, 33–34, 35–36t, 55–56, 202, 333, 334f advantages, 327 alliances, 335 application layer, 337 authentication, authorization, and privacy, 338 challenges, 327, 334–335, 336t cloud computing, 334 cloud data storage, 337 communication protocols, 337 cooperative robotics, 194, 202 data authentication and integrity, 338 data standardization, 189 decentralized and distributed platform, 189 end nodes, 334–335 fog computing, 334 Industry 4.0, role in, 193, 202 and Internet of Vehicles (IoV), integration of, 190, 191–192t, 191f IoT server, 337 mining, 335 need for, 331 platform conceptual architecture, 336–337 secure communications, 338 security and privacy, 327, 337–338, 337f smart city applications, 194, 202 smart healthcare system, 201–202 user client, 337 weather forecasting, 198 constrained application protocol (CoAP), 327–329 functions, 329 low-power embedded environments, use in, 328 machine-to-machine (M2M) applications, 328 messages model, 329 structural vulnerabilities, 329–330 cyberattacks, targets of, 327 cyber physical systems, research and application, 192–193 cybersecurity, 199, 200f, 202 data transfer, 190 definition, 190, 228 devices, 228, 327–328 interconnectivity and interactions of, 190 disadvantage, 327 5G and 6G networks, 196

451

future research, 204 machine learning (ML), 195 medical applications, 415 MQTT model, 327–328, 330–331 representational state transfer (REST), 327–328 research gaps, 203 and robotics, 190, 202 security frameworks, 327 security risks, 327 smart city applications, 194 smart grid (SG), 195, 202 smart healthcare system, 200–201 solutions, 327 transportation, 196, 202 weather forecasting, 198, 202 Internet of Vehicles (IoV), 190, 191–192t, 191f, 202 Interplanetary file system (IPFS), 29, 209–210 IoT. See Internet of Things (IoT) IoV. See Internet of Vehicles (IoV) IPC. See Intellectual property chain (IPC) Istanbul Byzantine fault tolerance (IBFT), 168–169t operations, 159, 160f state machine, 160–161, 160f transitions, 161 validators, 159–160 ITO. See Initial token offering (ITO)

K KECCAK-256, 263

L Language-based information flow security analysis, 106, 108–109 Legacy addresses. See Pay-to-public-key-hash (P2PKH) Lem language, 126 Liberty Reserve, 8 Lightweight blockchain consensus mechanism, 228, 230 Link list data structure, 344–345, 344f Litecoin, 10–11, 14, 29, 79, 335 Long-range (LR) attack, 221

M Machine learning (ML) artificial intelligence (AI), 190, 192, 195 blockchain technology (BT), 195 cloud computing, 196 cybersecurity, 199 Internet of Things (IoT), 195, 202 Machine-to-machine (M2M) applications, 328, 330 Macro base station (MBS), 41–42, 44–46 Man in the middle (MitM), 29–30 Master Cards, 3–4, 8, 13 MATBEA, 247 MATLAB simulation software, 48–49 MBS. See Macro base station (MBS) Melonport, 177 Members, consortium blockchain, 12

452

Index

Memory-bound PoWs, 217 MemorySeq, 391 Mempool, 245–246 Merkle tree, 261–262, 261b, 262f, 303–308, 323, 345–348, 346b Message authentication code (MAC), 253 Metadata, 318 MetaMask, 182, 185, 187, 187f, 270–272, 271f, 273f, 320, 321f MetaMask wallet, 240, 240f Microsoft Azure IoT services, 202 Mining, 312–314 block mining, 316, 317f definition, 314 hardware, 314 MixCoin, 30 ML. See Machine learning (ML) Mobile-distributed computing architectural model, 41, 42f Mobile wallets, 238 Monero coin, 79 Monitoring techniques, 427 Mortgage claims and processing, blockchain in, 371 MQTT model, 327–328, 330–331

N Nakamoto consensus method, 216–217 Namecoin, 14 Nanopore sequencing, 394 Napster, 209 Nash equilibrium, 349 National Centre for Biotechnology Information (NCBI), 393 Near-miss incidents, 427–428 Nebula, 395–396 Network time protocol (NTP), 357 Network transmission protocol, of blockchain, 47 Next-generation sequencing (NGS), 394, 396 NFTs. See Nonfungible tokens (NFTs) NGS. See Next-generation sequencing (NGS) Node Package Manger (NPM), 101, 104 Nonce value, 297–298 Nonconfirmable (NON) messages, CoAP, 329 Nonfungible tokens (NFTs), 405, 409–411 Non-monetary rewards, 348 Nonrelational abstract domains intervals, 118, 119f sign, 118, 119f strength and weakness, 120, 120t Nonvalidating peer, 361 Nonzero-sum game, 108 Nothing-at-stake (NAS) attack, 221

O Occupational health definition, 426–427 and safety, hazard and risk, 427 Occupational hygiene, 427 Off-chain solution, 31 OmiX, 396

Omni protocol, 178 Online games, 406 Online wallet, 238 OpenSSL AES, 254, 254t Ordering service nodes (OSN), 361 Oxygen concentrators, 417 Oxygen cylinder level monitoring COVID-19-affected patients, online remote monitoring in cloud setup, 421–422, 422f development, 419–423 global system for mobile communication (GSM), 415–417 methodology, 418–419, 419f objectives, 418 outputs, 421–422, 422–423t pressure sensors and load cells, 415–418 smartphone App, 284, 415–417 TINKER CAD simulation package, 415–416 in Indian hospitals, 417 international status, 416 Oxygen gas supply, 417 Oxygen generators, 417 Oxygen supply system (OSS), 417

P Paper wallets, 239, 239f Pay-to-public-key-hash (P2PKH), 246 Pay to witness public key hash (P2WPKH), 246 Peercoin, 79 Peer nodes, 283–284 Peer-to-peer (P2P) communication, 3 Peer-to-peer (P2P) network, 70–71, 71f, 209–210, 298, 395 Peer-to-peer (P2P) network transmission protocol, 47 Permissioned blockchains, 10–11, 12f, 65–66, 69, 437 advantages, 65 attributes, 65 disadvantages, 65 properties, 66–67, 67t use instances, 65 Permissionless blockchains, 10–11, 11f, 64, 66, 69, 312 attributes, 64 benefits, 64 disadvantages, 64 feature of, 64 properties, 66–67, 67t use cases, 65 Pharmacogenomics, 399 Platform-as-a-Service (PaaS), 189, 200 Platform tokens, 318 PoC. See Proof of capacity (PoC) Poisson distribution, 43 POs. See Proof obligations (POs) PoS. See Proof of stake (PoS) PoW. See Proof of work (PoW) Practical Byzantine fault tolerance (PBFT), 168–169t, 211, 229, 229f

Byzantine failure liveness, 157 safety, 157–158 committing, 156 communication complexity of, 229, 231 distributed systems, 157 execution of, 155, 156f flowchart, 156, 156f malicious software assaults, 155 non-Byzantine failures liveness, 157 safety, 157 preparing, 156 prepreparing, 155 view changing, 156 voting-based primary node election strategy, 229–230 Pre-computing (PreCom) attack, 221 Pressure sensors, 415–419, 420f Private blockchains, 12f, 61–62, 61f, 66, 66t advantages, 62, 69, 74 applications, 77 bank, 55, 69 definition, 11 disadvantages, 62, 74 drawback of fraud, 11 examples, 62, 69, 73 Hyperledger project, 11 permissioned, 77–78, 77t permissionless, 77–78, 77t vs. public and consortium blockchain, 13, 14f, 76, 76t systems/nodes, 73–74, 73f use cases, 11, 62–63 Private initial coin offering, 350 Probabilistic consensus methods, 228 ProB tool, 139 Program dependence graph (PDG), 107 Proof obligations (POs) generated POs, 132, 133t, 138–139 invariant preservation, 127–128, 127t nondeterministic action feasibility, 127–128, 127t preprocessing POs, 132, 133t refinement, 128, 128t variant and well definedness, 127–128, 127t Proof of activity (PoA), 79 Proof of authority (PoA), 79 Proof of burn (PoB), 79 Proof of capacity (PoC), 79–80 Proof of concept (PoC), 377–378 Proof of contribution (PoC) consensus mechanism, 222f, 230 consensus process block generation threshold, 224 bookkeeping node, determination of, 224 genesis block, 224 new block generation, 224 new block verification, 224 receiving transactions, 224 distributed economy application, 222 intellectual property chain (IPC), 223 intellectual property (IP) protection, 222–223 mining, 223

Index

proof of X (PoX), 223 for public blockchains, 222 Proof of elapsed time (PoET), 79, 168–169t block verification, 150 flowchart, 149, 149f probability distribution, 149–150 registration, 150 secure guard extension (SGX) technology, 149–150 trusted execution environment (TEE), 149 waiting time, computation of, 150 Proof of importance (PoI), 80 Proof of service power (PoSP), in cloud manufacturing, 230 consensus mechanism, 226–227, 226f service power, calculation method of, 227–228 Proof of stake (PoS), 168–169t, 230, 280, 332 advantages, 79 Byzantine fault tolerant (BFT) PoS, 220 chained PoS, 220 coinage, 149 cryptocurrencies, 79, 148, 219 delegated proof of stake (DPoS), 220–221 flowchart, 148, 148f forgers, 148–149 leased proof of stake (LPoS), 149 limitations/drawbacks, 221–222 “nothing at stake”, 148 principle, 219 vs. proof of work (PoW) and hedera, 315, 315t properties of, 219–220 Proof of work (PoW), 7, 9–10, 21, 147–148, 168–169t, 230, 262, 327, 332, 347, 395 advantages/benefits, 147, 217–218 application-specific integrated circuits (ASICs) resistance, 314 chained PoW, 217 characteristic features, 79 computational power, 217–218 computational work, 215–216, 215f compute-bound PoW, 216–217 cryptocurrency, economic value of, 344 double SHA-256, architecture of, 146, 146f email spam, prevention of, 215–216 Ethereum, 92, 269, 280 flowchart, 146–147, 147f Hashcash, 215–216 hash function, 147, 314–315 hash value, 146–147 limitations/drawbacks, 147, 217–218 mechanism, 79 memory-bound PoW, 217 operations, 315 vs. proof of stake (pos) and hedera, 315, 315t Sybil attack, 216 Proof of X (PoX) consensus technique, 223 Protein databank, 392–393 Pseudorandom number generators (PRNGS), 252–253 Psychosocial hazards, 427

Public blockchains, 66, 66t, 72 advantages, 62, 73 applications, 77 benefits, 11 disadvantages, 62 examples, 10–11, 61, 69, 73 permissioned, 73, 77–78, 77t permissionless, 73, 77, 77t vs. private and consortium blockchain, 13, 14f, 76, 76t scalability issues, 11 systems/nodes, 73, 73f use cases, 10–11, 62 Public initial coin offering, 350 Public key cryptography, 395. See also Asymmetric cryptography Public ledger, 300–301

Q Quality of service (QoS), 331 Quantitative hazard monitoring, 427 Quantum computing, 16 Quorum, 31

R Random number generation process (RNG), 252–253 Random oracle (RO) model, 333 Raspberry Pi, 335 Reaching definition (RD) analysis, 109–111, 109–110t, 110–111b Refinement technique, 128 Relational abstract domains octagons, 118–119, 119f polyhedra, 118, 119f, 120 strength and weakness, 120, 120t Remix, 270, 320, 320f one-click DApp extension, installation of, 272, 274f smart contract, 274f compilation window for, 272, 274f compiled correctly, 272, 275f “SimpleAuction.sol”, 272 “ReplaceChain” method, 312 Replicated journal technology. See Distributed ledger technology (DLT) Representational state transfer (REST), 327–328 Resilience censorship, 230 REST. See Representational state transfer (REST) Return on investment (ROI), 379–380 Retweet network analysis, 410–411, 411f Reusable proof of work (RPoW), 21 Rewards, 348 Rijndael algorithm, 253–254 RIPEMD-160, 263, 263b Rockchain, 31 Rodin development framework, 127–128, 131, 138–139 ROI. See Return on investment (ROI) Ropsten test network, 271, 272f RStudio software, 407

453

S Sanger sequencing, 394 SBSs. See Small base station (SBSs) SCM. See Supply chain management (SCM) Search volume index (SVI) of blockchain technology (BT), 370 of financial technology (FinTech), 369 financial vs. blockchain technology, 370 Secure Access for Everyone (SAFE) network, 178 Secure Hash Algorithm 256 (SHA-256), 9, 70–71, 72f, 260–261, 260b, 263, 263b Secure sockets layer (SSL), 254 Security token, 318 Selfish mining attack, 218 Semantics characterization-based information flow analysis, 107 Semantics, of Solidity language assignment statement, 113 conditional, 113 constructor, 114 expressions, 113 function, 114 iteration, 114 local variable declaration, 113 sequence, 113 smart contract, 114 state variable declaration, 114 Semantic web, 4–5 Sensors, 416–417 Sentiment analysis, on tweets, 407, 410–411 classification, 408, 408t organic tweets vs. replies and retweets, 410, 410f retweeted users, 410, 410t retweet network analysis, 410–411, 411f sentiment frequency, 407–408, 407f terms (keywords) occurrence bigram network of, 409–410, 409f frequency of, 409, 409f Sequence databases, 392 Service chain (SP), cloud manufacturing, 227 SHA-256. See Secure Hash Algorithm 256 (SHA-256) ShadowCoin, 79 Sharding, 399 Shared governance model, 434 Shared key cryptography. See Symmetric cryptography Shivom Project, 399 Short-range (SR) attack, 221 Signcryption, 264 Small base station (SBSs), 41–42, 44 Smart agriculture. See Agriculture and farming Smart contracts, 15, 15f, 22, 31–32, 90, 105, 267–268, 270 in blockchain ledger network, 426 business model, 436 ConCert framework, 126 creation, 179, 182, 184, 185f vs. decentralized applications (DApps), 270 definition, 93, 319, 378–379 deployment, 179, 182

454

Index

Smart contracts (Continued) editable programs, 426 features, 268 flow diagram, 93–94, 94f gas fee, 94 invocation, 179 Nebula, 395–396 problems, 268 programming language, 320–322 safe and secure systems, 125 solidity for (see Solidity smart contracts) termination conditions, 126 vs. traditional contracts, 319, 319t transaction with, 180 used car transactions, 379, 382, 383f VERISOL, 126 Smart gadgets, 415 Smart grid (SG) artificial intelligence (AI), 195 blockchain, 195 cloud computing, 195 Internet of Things (IoT), 195 Smart healthcare system artificial intelligence (AI), 200 blockchain technology (BT), 201 cloud computing, 201, 201f Internet of Things (IoT), 200–201, 201f Smart purchase model example, 136, 136f formal development context model, 137 machine model, 137–138, 137–138b functions, 138 validation and analysis, 138–139 Social media perspective, blockchain-based sports. See Sports, blockchain adoption in Software-as-a-Service (SaaS), 25–26, 189, 200 Software wallets, 238, 240 Solidity definition, 129 modifiers, 130, 130b special variables and functions, 129, 130t value types, 129, 129t Solidity compiler (SOLC), 107–108 Solidity contract, 94, 95f Solidity smart contracts, 94, 106, 121, 126, 320–322 benefits, 141 challenges, 105 code generation process, 139–140 Code Snippet 1, 105–106, 105–106b Code Snippet 2, 106, 106b Code Snippet 3, 108, 108b components, 108 confidentiality and integrity properties verification, 116–117 data-flow analysis, 109–111 definition of contract, 108 direct/explicit flow, 105 Ethereum virtual machine (EVM), 107–108 Event-B modeling language, 125–126 applications, 128 context and machine, 126, 127t

EB2Sol (see EB2Sol tool) proof obligations (POs), 127–128, 127t refinement technique, 128 Rodin, 128 smart purchase (see smart purchase model) state variables, 126–127 formal dependency analysis abstract domain Pos, 115 abstract semantics, 115–116 formal framework for, 131f Event-B model block, 130–131 formal verification, 131 Solidity implementation, 131 indirect/implicit flow, 105 information flow security analysis abstract interpretation-based information flow analysis, 107 axiomatic approach, 107 Hoare-like logic-based interprocedural information flow analysis, 107 language-based information flow security analysis, 106, 108–109 lattice model, 106 program dependence graph (PDG), 107 security-type systems, 107 semantics characterization, 107 limitations, 141–142 numerical abstract domains, 118 reduced product, 120–121 relational and nonrelational abstract domains, 118–120 private and public variables, 105 rudimentary solidity contract, 94, 95f security attacks, 105 Solidity compiler (SOLC), 107–108 Solidity language concrete semantics (see Concrete semantics, of solidity language) Solidity syntax, 111 Sony Global Education, 284 Sports, blockchain adoption in collectible sports cards, 405 fantasy sports leagues, 406 fan tokens, 405 management scholars attention on, 406 nonfungible tokens (NFTs), 405 Twitter (tweets) algorithmic evaluation, 407 data collection, 407 definition, 407 limitations and future research, 412 practical implications, 412 sentiment analysis (see Sentiment analysis, on tweets) theoretical implications, 411–412 Standards for Efficient Cryptography Group (SECG), 255 Static sampling, 427 Steemit, 318 Stream ciphers, 253 Structural safety hazards, 427 Structure databases, 392

Supply chain management (SCM), 26, 27f, 33, 69, 378 SVI. See Search volume index (SVI) Swiftcoin, 14 Symmetric cryptography, 251–252 advanced encryption standard (AES), 253–254 alphabets and numbers, combination of, 252–253 block ciphers, 253 data encryption standard (DES), 253 encryption-decryption in, 252, 253f message authentication code (MAC), 253 OpenSSL AES, 254, 254t stream ciphers, 253

T Tangle, 7 Tensorflow 1.13.0 software, 48–49 Thin node client, 238 Third-generation sequencing, 394 3D graphics, 5 TINKER CAD simulation package, 415–416 Tokenized financial rewards, 348 Tokens vs. cryptocurrency, 317–318 definition, 317 digital tokens, 318 Ethereum blockchain, 318 initial coin offering/initial token offering (ICO/ITO), 319 types, 318–319 TPS. See Transactions per second (TPS) Trade finance, blockchain in, 372 Transactional token, 318 Transaction level security, 323–324 Transactions per second (TPS), 99–100 Transportation artificial intelligence (AI), 192, 196 blockchain technology (BT), 197, 197f cloud computing, 197 Internet of Things (IoT), 196 Transport layer security (TLS) protocols, 254 Trezor hardware wallet, 240 Truffle DApp framework, 101–104, 180 Twitter (tweets), blockchain-based sports algorithmic evaluation, 407 data collection, 407 definition, 407 limitations and future research, 412 practical implications, 412 sentiment analysis (see Sentiment analysis, on tweets) theoretical implications, 411–412

U Uport, 269 Used car market blockchain technology in, 377–378 application areas, 378 architecture, 379

Index

automobile supply chain and lifecycle, 380, 380f business case, 382, 382f challenges, 385–386 consortium blockchain platform, 383–384 disruptive, 378 essential questions, 380–381 field validation, 377–378, 382–384 layered blockchain architecture, 384, 384f new platform development, 377–378 platforms, types of, 379 process design, 383 proof of concept (PoC), 379 research method, 381 smart contracts, 378–379 stakeholder consortium, 378 supply chain management (SCM), 378 survey method approach, 378 traceability and information sharing, 378 two-level smart contract, 382, 383f certified used car sales method, 377 characteristics, 377 consumer damage in, 377 lemon marketization, 377 trading complex, 377 User opportunity cost, 48 Utility token, 318

V Validators, consortium blockchain, 12 Vechain, 318 VERISOL, 126 Virtual voting, 7–8 Visa, 3–4, 8, 13

Visual Studio code, 103 Voting-based consensus algorithms, 168–169t, 208 BFT-SMaRT protocol, 161–162 delegated Byzantine fault tolerance (DBFT), 158–159 delegated proof of stake (DPoS), 80, 154, 154f Istanbul Byzantine fault tolerance (IBFT), 159–161 Paxos, 154–155, 155f practical Byzantine fault tolerance (PBFT), 155–158, 229–231 Raft algorithm, 164–165, 164f ripple protocol consensus algorithm (RPCA), 165 Tendermint consensus, 163, 163f verifiable Byzantine fault tolerance (VBFT), 162, 162f

W Wallet import format (WIF), 240–241 Wallets for forensics, 239–240 functions, 237–238 onset, 237–238 private-public keys, transactions and storage of, 237–238 types, 238–239, 238–239f wallet import format (WIF), 240–241 Wearable technology, 417 Weather forecasting artificial intelligence (AI), 198 blockchain technology (BT), 198

455

cloud computing, 199 Internet of Things (IoT), 198 Web 1.0 (static web) content creation, 3 definition, 3 Web 2.0 (interactive web), 3–4, 4f Web 3.0, 4–5, 5f, 299–300 characteristics, 5–6 decentralization, 4 vs. Web 2.0, and Web 3.0, 6, 6f WebMoney, 8 Weifund, 269 WIF. See Wallet import format (WIF) Wireless personal area network, 417 Workplace safety and health issues, 426–427 records blockchain distributed ledger network, leverage on, 428–430 limitations, 430 near-miss incidents, 427–428 occupational injuries and illnesses, recordkeeping of, 427, 430 recordable injury/illness, definition of, 427 workplace incident, 427–428, 428f World Wide Web (WWW), 3, 23, 355

Z Zenome, 395–396 Zerocash, 30 Zerocoin, 30 Zero-knowledge proofs (ZKP), 264, 333, 347 Zero-sum game, 349 ZKP. See Zero-knowledge proofs (ZKP)

This page intentionally left blank