Research and Applied Perspective to Blockchain Technology: A Comprehensive Survey

: Blockchain being a leading technology in the 21st century is revolutionizing each sector of life. Services are being provided and upgraded using its salient features and fruitful characteristics. Businesses are being enhanced by using this technology. Countries are shifting towards digital currencies i.e., an initial application of blockchain application. It omits the need of central authority by its distributed ledger functionality. This distributed ledger is achieved by using a consensus mechanism in blockchain. A consensus algorithm plays a core role in the implementation of blockchain. Any application implementing blockchain uses consensus algorithms to achieve its desired task. In this paper, we focus on provisioning of a comparative analysis of blockchain’s consensus algorithms with respect to the type of application. Furthermore, we discuss the development platforms as well as technologies of blockchain. The aim of the paper is to provide knowledge from basic to extensive from blockchain architecture to consensus methods, from applications to development platform, from challenges and issues to blockchain research gaps in various areas.


Introduction
The 21st century is all about revolutionizing technology. One of the leading technologies that has changed many aspects is blockchain. It impacted different businesses from the very first step. Blockchain provides decentralized, transparent and secure systems. It is a distributed ledger technology which maintains a transaction ledger and secures it by using cryptography. The transactions are recorded in blocks and these blocks are connected to each other through hashes. Initially it was used by Satoshi Nakamoto in 2008 for public transactions of bitcoins. Bitcoin [1] digital currency was the first application of blockchain [2,3].
Blockchain came as a solution to the longstanding user's trust problem. With its emergence with the renowned cryptocurrency Bitcoin, it provided an architecture to allow the user to trust a decentralized system instead of trusting a third party. Operating a peer-to-peer network, it keeps records of the ledger of transactions. This helps to avoid any center party. The whole process is done through a consensus. A ledger is shared between multiple entities, allowing everyone to inspect it. No single user can control it. It is a distributed cryptographically secured database that keeps the record of every transaction from the very initial one.

Main Features of Blockchain
The following are the main features of blockchain.

1.
Decentralized Computation: Blockchain consists of distributed ledgers maintained by peer to peer networks [4]. Blockchain eliminates the role of the central entity by using consensus protocol to validate transactions [5].
• Consensus: All participants must agree on validity of a transaction for it to be valid. Blockchain offer a variety of consensus algorithms which are chosen by the users according to the requirement of blockchain application. • Provenance: Participants know where the asset came from and how its ownership has changed over time. • Immutability: No participant can tamper with a transaction after it has been recorded to the ledger [16,17]. If there is an error in a transaction, a new transaction must be used to reverse the error. Both these transactions are then visible [18]. The error in transaction means that the transactions are either failed or rejected by miners. Usually the transactions with very low fee are rejected. • Finality: A single, shared ledger provides one place to go to determine the ownership of an asset or the completion of a transaction. • Smart Contract: The smart contracts [19] are programs of computer that support in the transmission of money or anything of value. When a particular policy is met, these programs run automatically. Each smart contract contains a contract address, predefined functions and private storage. Ethereum [20], is an open-source and decentralized platform that executes smart contracts. To construct smart contract Ethereum platform uses solidity as programming language.

Research Questions
The following are the research questions are answered in this survey article.
• How can blockchain can be deployed in different applications? • What are the potential consensus methods for public and private blockchains? • Which platforms offer development of blockchain? • What are potential attacks for blockchain and what are the research issues in different applications of blockchain?

Research Contributions
Some of the major contributions of the paper are as follows.
• The core blockchain is discussed i.e., its architecture, its working flow and characteristics.

•
The paper also discusses different applications of blockchain. • This paper focuses on the survey of the consensus algorithms of the public and private blockchains.

•
The algorithms are categorized according to their use in different scenarios and fields.

•
The survey papers are compared in Tables 1 and 2 also as a major contribution of our paper.

Organization
Further the paper is divided as follows. Section 2 discusses blockchain types. Section 3 explains different applications of blockchain other than cryptocurrencies. Section 4 discusses blockchain's architecture. In Section 5 we describe various consensus algorithms. Section 6 contains detailed discussion on blockchain development platforms. Section 7 contains blockchain challenges where possible attacks are discussed. Section 8 highlights some of the blockchain research issues in different areas. In Section 9, we present the conclusion and future work.
Hybrid Blockchains for example Dragonchain etc.

Public/Permissionless Blockchains
Blockchain that has no restriction on accommodating anonymous participants is known as permissionless blockchain [26]. The term public blockchain is used interchangeably. Lottery based consensus algorithms are used to publish a block. A single node is responsible for publishing a block. Lottery-based mechanisms elect the validator to decide the next block to be added into the blockchain ledger. Election is based on a lottery draw and the one who wins is the validator. Each new block is appended using a new draw. The lottery-based mechanism avoids the malicious node having forged block to append it into the ledger. Such mechanisms do not follow a rule of thumb for electing the validator hence each lottery has its own trust model for electing the validator. If voting based consensus is allowed to be used in permissionless blockchain, multiple accounts can be made by the participants to do a Sybil attack to make the decisions in their favour. A sybil attack is one of the issue in peer to peer network where a malicious node creates many identities and tries to manipulate the network by controlling it. Public blockchains need security and for this purpose the block creation mechanism needs to be difficult and expensive so that the resources of one node are not enough to bias the decisions in its favor. The disadvantage of public blockchain is in terms of PoW where heavy computation power is needed. All the nodes need to solve a cryptographic puzzle by brute force. The node which wins the puzzle is rewarded and all the other nodes computations are wasted. The consensus is achieved as 51% of power. Proof of stake uses the wealth of miners to win a ticket rather than computational power [27]. There are other various consensus algorithms for private and public blockchains which are discussed in Section 5.

Private/Permissioned Blockchains
Private and consortium blockchains are permissioned blockchains. In such types of blockchain the number of participants are limited and they keep a copy of the blockchain [28]. Consensus mechanism is not much expensive for publishing a new block. All the participants in the permissioned blockchain are known so the risk of Sybil attack is eliminated. Private blockchains voting mechanisms for consensus are used. Hence, permissioned blockchains have higher performance than permissionless blockchains. Non-public blockchains are divided into fully private or consortium blockchains. An organization can choose one of them based on the cost and needs. A consortium can be the best option if organizations want to share cost and data.

Hybrid Blockchains
A hybrid blockchain combines the privacy of a private blockchain with the security and transparency of a public blockchain [29,30]. This gives the businesses a significant amount of options to choose from for what they want to keep private and what to be made public. For example, Dragonchain blockchain is a hybrid blockchain [31]. It allows its users to connect with other blockchain protocols. Thus, allowing blockchains multichain network. This functionality makes it simple for businesses to operate with the transparency they are looking for, without having to sacrifice security and privacy. Being able to post to multiple public blockchains at once increases the security of transactions, as they benefit from the combined hash power being applied to the public chains [32]. A careful study of the system is needed before implementing blockchain in any industry or business. The following are to be considered for the deployment of blockchains.

•
Does business deals through trusted third parties? • Do people frequently generate transactions? • Are validation and data integrity important? • Is the data integrity and process performance more important than confidentiality? However for time sensitive nature of the application it is not recommended as the transactions take time to be validated and verified. • Blockchain can influence several emerging areas like smart cities, Internet of Vehicles, banking, Internet of Things, edge computing and cloud [33]. • Is blockchain required to be deployed as public or private?

Applications of Blockchain
Blockchain has now being deployed in not only cryptocurrency but its underlying technology is used in various applications [34]. We tried to discuss a few applications of blockchain which includes cryptocurrencies as well as other potential areas where blockchain has emerged. Figure 1 shows different applications of blockchain. However the applications are not limited to the ones discussed in this paper.

Cryptocurrency
Over the past decade cryptocurrency is being an evolving topic, merging incredible technical power and enticing investments worth of value trillions dollars on a world wide scale. The underlying technology of cryptocurrency is attractive for many other applications due to its unique features and architecture. This is why it is becoming popular due to its applicability, efficiency and data-centric characteristics [35]. Cryptocurrencies such as bitcoin use blockchain technology to secure transactions using hashes. Bitcoin was the first cryptocurrency using blockchain with Proof of Work algorithm.

Private Data Storage
The transactions are used to carry instructions for queuing, storing and sharing data. As the increased number of mobile applications needs access to complete access of user data that is: contacts, photos, messages and other important user data. Zyskind et al. proposed the blockchain implementation with other offline storage methods to provide permissions on each set of data. LevelDB [36] or cloud storage can be used to bound the data on blockchain. This could lead to dependency on third parties but provides more scalable solutions. Companies can go for upgrading technology finding more reliable solution for the data that need privacy solutions.

Reputation Management
Private blockchain can be implemented for direct and real time feedback from par-

Cryptocurrency
Over the past decade cryptocurrency is being an evolving topic, merging incredible technical power and enticing investments worth of value trillions dollars on a world wide scale. The underlying technology of cryptocurrency is attractive for many other applications due to its unique features and architecture. This is why it is becoming popular due to its applicability, efficiency and data-centric characteristics [35]. Cryptocurrencies such as bitcoin use blockchain technology to secure transactions using hashes. Bitcoin was the first cryptocurrency using blockchain with Proof of Work algorithm.

Private Data Storage
The transactions are used to carry instructions for queuing, storing and sharing data. As the increased number of mobile applications needs access to complete access of user data that is: contacts, photos, messages and other important user data. Zyskind et al. proposed the blockchain implementation with other offline storage methods to provide permissions on each set of data. LevelDB [36] or cloud storage can be used to bound the data on blockchain. This could lead to dependency on third parties but provides more scalable solutions. Companies can go for upgrading technology finding more reliable solution for the data that need privacy solutions.

Reputation Management
Private blockchain can be implemented for direct and real time feedback from participants without intermediaries to help in auditing and invoicing or any other value of reputation. By the use of this technology, manual collection and transmission of feedback has been reduced. This type of blockchain can be retrieved by the participants in case they want to know the reputation of other participants [37,38].

Education
Sharples and Dommingue [39] suggested the use of blockchain to keep educational records and rewards. They also suggested the use of an educational reputation currency to be given as reward. Ref. [40] described how the founder of education use blockchain for online courses can. This technology can record the student signed up for the course and verify that the student has completed and learned the course. A payment feature can be added for the use of smart contracts by students to ensure lifelong learning plans [41]. Mega University is an example of technology being used by the students to establish their own ways of learning and access the faculty for collaborative experiences. A higher education credit and grading systems is suggested in [42] which is a consolidated outlook for higher education institutions and students.

Banking
Blockchain can be useful in computerization of various niche aspects of banking like, data loss reporting, client account reconciliations, clearing settlement and over the contracts (OTC) contracts/products etc. Classic banking methods like endorsement of a loan or derivative is a time taking process due to several back end stages which involves contract consultations with multiple parties. Blockchain provides the essential transparency and speed through smart contracts. Various banks are already testing blockchain and they are obtaining services from technology companies such as IBM, R3 and Microsoft.

Finance-Payroll and Settlement
Public service transactions involve a sequence of activities to legalize the validity of the transacting party, authentication of the data delivered by the transacting party or parties, performing of the transaction and finally delivery of the compulsory service. The transactions are then recorded from end to end. This process take a long time. The blockchain can reduce this time because of it nature of validity and authenticity. Since a large number of events connected to life built pension such as getting expenses from active customers, beneficiaries obtaining their payments and taxes on pensions are basically contract controlled payments. Sestoft [43] has suggested the use of Ethereum as the algorithm should work on self-regulated contracts. A prerequisite here is the fact that such an autonomous system will need event insurance relates life event triggers from other trusted bodies, so that self-executing contracts can act on them.
Sesoft proposed a distributed system for an Autonomous Pension Fund which is a contract based system which would manage life based pension funds without any intermediary.

Taxation
Blockchain can help in the collection of taxes from end to end and expenditure of taxes by the government. Taxation is one area where blockchain can possibly make a big impact. The key terms of blockchain, transparency, provenance and traceability can be related to the needs of taxation systems. Blockchain can be applied to tax transactions, VAT, stamp duties and withholding tax etc. Shifting taxation cab remove the responsibility of tax authorities where they collect taxes. While the tax provenance aspect is very important so also is the consumption of tax incomes. The biggest issue, however, would be to digitize the non-digital sellers who reply mostly on paper records.

Healthcare
Healthcare is moving towards digitization with an increased number of hospitals, doctors, healthcare machinery to record patient's record digitally [44]. Digitization of medical data allows sharing and retrieval easily for decision making purposes. However such digitization is risky in terms of patient privacy violation. A blockchain-based Healthcare Data Gateway (HDG) was proposed by Yue et al. [45]. They used a private blockchain cloud to guarantee that the medical data cannot be changed by anybody including the patient himself and/or the physicians. A blockchain-based interoperable Electronic Health Record (EHR) framework proposed by [46] provides important reliability and security requirements. It enables different organizations of variant internal structures to communicate with each other using the existing EHR infrastructure of organizations.
Reference [25] has also proposed MeDShare, a blockchain based system for distribution of medical data between cloud service providers. MeDShare would provide auditing, data access control and provenance. Blocking of malicious users and the use of smart contracts for data behavior recognition from data access patterns, is also proposed in same work. Medchain presented in [47] suggests an efficient data sharing system via blockchain.

Voting
In the year 2014, a Danish political party was the first to use blockchain technology for voting [48]. 'Followmyvote' offers an online voting platform which follows blockchain technology for secure voting system [49].
A challenge for fair voting system which keeps users' voting privacy and that provides transparency and flexibility of electronic system is solved in this paper. A novel blockchain application for fair electronic voting is proposed by [50] which eliminates some of the existing systems issues. It particularly addresses the election process which reduces the cost of conducting elections nationwide.

Insurance
With the use of blockchain, travel insurance, crop insurance, property and casualty insurance and most importantly health insurance are all going to change [51]. A shared network of hospital insurance authorities, funeral houses and health departments can be created. This set up will provide non dependency on third parties speed up the whole process of claiming insurance, it can also eliminate frauds.
In Reference [52], blockchain is proposed to handle the transactions related to insurance process efficiently. They have used hyperledger fabric for the design implementation which is an open source permissioned blockchain platform.

Smart Cities
In smart cities information and communication technologies are used to share resources. Blockchain is used in smart cities to reduce transaction costs, to achieve data immutability and accountability. The problem in [53] of data storage from sensors and its management is solved using blockchain technology. The blockchain answers to the request of accessibility and validity by offering smart contract facility where sensor information is managed and control logic is implemented.

Internet of Things (IOT)
The Internet of Things (IoT) is a network of connected vehicles, home appliances, physical devices, and other items that are accessible through the Internet [54]. IoT is widely used in smart homes, smart grid, intelligent manufacturing, intelligent transportation system, and other fields [55,56]. The traditional centralized network does not guarantee trusted interaction among devices and security of sensitive information. Therefore, the combination of blockchain and IoT is an expected trend, where smart contracts will help to automate, promote resource sharing, complex workflow, ensure safety, efficiency and save costs [57]. A smart home model is proposed by Dorri et al. [58] which is based on blockchain and smart contracts. They discussed how through simulations the cost of daily management of IoT devices can be reduced. They also discussed in the model, various interaction processes.

Blockchain in Social Media
Blockchain has played an important role in social media applications. The reason it is spreading is privacy. Being on blockchain takes away the concept of being centralized. Common examples are Ushare [59], DUST, BeeChat etc. Some of those applications provide anonymity which may give way to malicious behavior. We now discuss some of the top blockchain based social media networks as shown in Figure 2.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 11 of 44 tions provide anonymity which may give way to malicious behavior. We now discuss some of the top blockchain based social media networks as shown in Figure 2. Steemit provides the services of both Redit and Facebook and so it is one of the top blockchain based social media apps. This platform allows users to post their pictures, posts, music and video and get paid for the content. This platform automatically distributes Steemit currency units to active users.

Earn
Earn is better than LinkedIn. Earn allows users to earn by completing microtasks. Users need to create a profile and they receive paid messages or they would get an opportunity to join people with similar skills. The paid email system of Earn can increase the chances of making money.

SocialX
SocialX is very much similar to Instagram and Facebook except that it's decentralized. This platform has all the social network features and it allows users to post pictures and videos on a highly secure platform. SocialX has a built-in license management which gives users the choice to sell their photos and videos or keep them to themselves.

Obsidian
Obsidian provides a wide collection of blockchain based apps but the main service is secure messenger. This allows users to chat 100% privately and securely. Obsidian provides end to end encryption which proves the files and messages are seen only by the intended recipient.

Indorse
Indorse is a professional platform based on the Ethereum blockchain. This is a LinkedIn equivalent which increases the chances for users to get profit for their skills. Users get paid or get impressive rewards for their contributions. For example if a user is good at coding he will be validated by experts or a user can get a good job by showing business skills.

Earn
Earn is better than LinkedIn. Earn allows users to earn by completing microtasks. Users need to create a profile and they receive paid messages or they would get an opportunity to join people with similar skills. The paid email system of Earn can increase the chances of making money.

SocialX
SocialX is very much similar to Instagram and Facebook except that it's decentralized. This platform has all the social network features and it allows users to post pictures and videos on a highly secure platform. SocialX has a built-in license management which gives users the choice to sell their photos and videos or keep them to themselves.

Obsidian
Obsidian provides a wide collection of blockchain based apps but the main service is secure messenger. This allows users to chat 100% privately and securely. Obsidian provides end to end encryption which proves the files and messages are seen only by the intended recipient.

Indorse
Indorse is a professional platform based on the Ethereum blockchain. This is a LinkedIn equivalent which increases the chances for users to get profit for their skills. Users get paid or get impressive rewards for their contributions. For example if a user is good at coding he will be validated by experts or a user can get a good job by showing business skills.

Blockchain in Power
Another area of blockchain is to enable customers to quickly switch power suppliers. Companies are also using blockchain for meter registration to make the process less costly and more efficient. Blockchain may also make existing electric industry methods more efficient by helping the utilities' "smart grid" management systems that spontaneously diagnose network problems and emergencies and in reaction reconfigure the network [60].

Blockchain's Architecture
As discussed earlier, the initial block in a block chain is known as the genesis block. A genesis block does not contain a previous hash but its own hash. Figure 3 shows a general view of a blockchain. A block contains the transactions, hash of the previous block and hash of the next block [61]. This information is stored in a block using a cryptographic mechanism. A block in the chain can come from any miner. While creating the chain of blocks, the hash of the previous block is added to the current block. Thus a miner creates a new block by using the hash of the previous block, combines it with its own set of messages, and creates a new hash out of it. This way a new block is formed. This recently formed block now turn out to be the new end for the chain. By this mechanism the chain grows as more blocks are added by the miners. cess less costly and more efficient. Blockchain may also make existing electric industry methods more efficient by helping the utilities' "smart grid" management systems that spontaneously diagnose network problems and emergencies and in reaction reconfigure the network [60].

Blockchain's Architecture
As discussed earlier, the initial block in a block chain is known as the genesis block. A genesis block does not contain a previous hash but its own hash. Figure 3 shows a general view of a blockchain. A block contains the transactions, hash of the previous block and hash of the next block [61]. This information is stored in a block using a cryptographic mechanism. A block in the chain can come from any miner. While creating the chain of blocks, the hash of the previous block is added to the current block. Thus a miner creates a new block by using the hash of the previous block, combines it with its own set of messages, and creates a new hash out of it. This way a new block is formed. This recently formed block now turn out to be the new end for the chain. By this mechanism the chain grows as more blocks are added by the miners. Double-spending is the problem where the sender uses the same money at more than one place for gaining goods or services from multiple dealers. The use of centralized authority solves the double-spending problem, but another main issue arises which is the cost of maintaining and creating the centralized authority itself. Blockchain however prevents double-spending by grouping the transactions and timestamping them and then broadcasting them in the network to all the participant nodes. The transactions are mathematically related to previous ones and are timestamped, hence impossible to tamper with.
There are also some other fields in the block header which are shown in Figure 4. We explain each of them.

Previous Hash
This field contains a hash of the previous block which connects the current block with its parent in the chain. A hash value is calculated from all the information of the previous block and this value is given to the field prev_hash which resides in the new block. This hash value is calculated from SHA 256 in bitcoin. Double-spending is the problem where the sender uses the same money at more than one place for gaining goods or services from multiple dealers. The use of centralized authority solves the double-spending problem, but another main issue arises which is the cost of maintaining and creating the centralized authority itself. Blockchain however prevents double-spending by grouping the transactions and timestamping them and then broadcasting them in the network to all the participant nodes. The transactions are mathematically related to previous ones and are timestamped, hence impossible to tamper with.
There are also some other fields in the block header which are shown in Figure 4. We explain each of them.

Previous Hash
This field contains a hash of the previous block which connects the current block with its parent in the chain. A hash value is calculated from all the information of the previous block and this value is given to the field prev_hash which resides in the new block. This hash value is calculated from SHA 256 in bitcoin.

Timestamp
This is the time when a new block is created [63].

Tx-Root
This field is also known as the Merkle root, and it contains the hash value of the block which has all the validated transactions [64]. As shown in Figure 2, a hash value is calculated out of transactions where these transactions are combined pair by pair and are then combined for another hash function. These steps are repeated until they all are combined in a single entity called Merkle root.

Version
This contains the version of protocol used by that particular node which proposes a block to the chain.

Nonce
This field is used in PoW, which proves the efforts that a node has paid for getting the right to append his block to the chain. This field will be presented in the next section.

Bits
This field represents the difficulty level of the PoW [65].

Transactions List
A transaction in a broad s e n s e is an exchange, agreement, understanding, contract, or transfer of cash/assets or property that happens between more than two parties and launches a legal compulsion. Transactions are recorded first in a journal and then dispatched to a ledger. A transaction is an interchange of goods or services between a seller and a buyer. Every transaction has three constituents: (1) transfer of service/good and money, (2) transfer of exchange privileges and (3) transfer of label which may or may not be complemented by a transfer of ownership. Blockchain transaction is a public record of all transactions that is executed on Blockchain. A block is the recent part of a blockchain which records the current information. Once a block is completed, it publishes into the blockchain as a lasting database creating a new block.

Consensus Algorithms
We know that blockchain is a decentralized distributed network that provides security, immutability, transparency and privacy. There is no concept of centralization to verify and validate the transactions, but still transactions in the blockchain are con-

Timestamp
This is the time when a new block is created [63].

Tx-Root
This field is also known as the Merkle root, and it contains the hash value of the block which has all the validated transactions [64]. As shown in Figure 2, a hash value is calculated out of transactions where these transactions are combined pair by pair and are then combined for another hash function. These steps are repeated until they all are combined in a single entity called Merkle root.

Version
This contains the version of protocol used by that particular node which proposes a block to the chain.

Nonce
This field is used in PoW, which proves the efforts that a node has paid for getting the right to append his block to the chain. This field will be presented in the next section.

Bits
This field represents the difficulty level of the PoW [65].

Transactions List
A transaction in a broad sense is an exchange, agreement, understanding, contract, or transfer of cash/assets or property that happens between more than two parties and launches a legal compulsion. Transactions are recorded first in a journal and then dispatched to a ledger. A transaction is an interchange of goods or services between a seller and a buyer. Every transaction has three constituents: (1) transfer of service/good and money, (2) transfer of exchange privileges and (3) transfer of label which may or may not be complemented by a transfer of ownership. Blockchain transaction is a public record of all transactions that is executed on Blockchain. A block is the recent part of a blockchain which records the current information. Once a block is completed, it publishes into the blockchain as a lasting database creating a new block.

Consensus Algorithms
We know that blockchain is a decentralized distributed network that provides security, immutability, transparency and privacy. There is no concept of centralization to verify and validate the transactions, but still transactions in the blockchain are considered to be completely verified and secured. This is the result of a core algorithm present in every blockchain network called a consensus protocol.
A consensus algorithm is a technique through which all the peers of the blockchain network reach a common agreement about the current state of the distributed ledger. Therefore, consensus algorithms provide trust and reliability among unknown peers in a distributed environment. A consensus mechanism ensures that every new block added to the blockchain is the only truth which is agreed upon by all the blockchain nodes [66].
The blockchain consensus protocol comprises some specific aims that are coming to an agreement, co-operation, collaboration, mandatory participation of each node in the consensus process and equal rights to every node. Hence, a consensus algorithm targets at finding a common agreement that is a win for the whole network. The above discussed applications are categorized and consensus algorithms based on these categories are further discussed below. Figure 5 shows a categorical diagram of the consensus and their distribution.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 14 of 44 sidered to be completely verified and secured. This is the result of a core algorithm present in every blockchain network called a consensus protocol. A consensus algorithm is a technique through which all the peers of the blockchain network reach a common agreement about the current state of the distributed ledger. Therefore, consensus algorithms provide trust and reliability among unknown peers in a distributed environment. A consensus mechanism ensures that every new block added to the blockchain is the only truth which is agreed upon by all the blockchain nodes [66].
The blockchain consensus protocol comprises some specific aims that are coming to an agreement, co-operation, collaboration, mandatory participation of each node in the consensus process and equal rights to every node. Hence, a consensus algorithm targets at finding a common agreement that is a win for the whole network. The above discussed applications are categorized and consensus algorithms based on these categories are further discussed below. Figure 5 shows a categorical diagram of the consensus and their distribution.

Consensus Algorithms Used by Various Cryptocurrencies
Digital currencies have gained faster payment methods by using blockchain. Bitcoin was the first cryptocurrency used by blockchain. After gaining popularity in bitcoin other applications were/are implemented. Table 3 defines some of the important characteristics of consensus algorithms used in cryptocurrencies.

Consensus Algorithms Used by Various Cryptocurrencies
Digital currencies have gained faster payment methods by using blockchain. Bitcoin was the first cryptocurrency used by blockchain. After gaining popularity in bitcoin other applications were/are implemented. Table 3 defines some of the important characteristics of consensus algorithms used in cryptocurrencies.   Proof of Work [67] is the first consensus protocol used by a public blockchain. All the nodes need to solve a cryptographic puzzle by brute force. The node which wins the puzzle is rewarded and all the other nodes computations are wasted. The consensus is achieved as 51% of power.

Delayed Proof of Work
This protocol is designed as a hybrid consensus in which one blockchain takes security from another blockchain through hashing power [68]. A group of nodes are responsible for adding data from the first blockchain onto the second. Both blockchains would then compromise to undermine the security of the first blockchain. Komodo which is attached to the bitcoin blockchain was the first to make use of this protocol.

Proof of Stake (PoS)
• Original PoS: Proof of stake uses the wealth of miners to win a ticket rather than computational power. PoS was first implemented in 2012 as cryptocurrency PeerCoin.
PoS is kind of a hybrid design where PoW is used in the beginning for coin minting and later PoS is used for the security of the whole network. PoS works with the concept of a coin's age which is explained by example. If there are 10 coins which are held for 10 days its age is 100 days. If these coins are spent, their age is consumed. In PoW the main chain with most work is followed, and in PoS a chain with most coin age is followed. • Cardano's Ouroboros: This protocol adds security measures to ensure persistence and liveness within the system. This implementation elects the stakeholders through a delegation process and takes the snapshots of current stakeholders labelled as an 'epoch'. The subset of current stakeholders randomly decide who will be the next epoch stakeholder.

Stellar Consensus Protocol (SCP)
This is a decentralized consensus protocol in which nodes have the ability to choose which nodes to trust. This group of trusted nodes is known as "quorum slice". An agreement is reached by a set of nodes called quorum whereas quorum slice is a subset of a quorum which selects one particular node for an agreement. SCP proposes new candidate values for agreement via a "nomination protocol". Each node will then vote for a single value among these. After this a "ballot protocol" is implemented. In this phase the nodes vote for the previous values to keep or abort them. In case the quorum slice does not reach consensus the value is shifted to a higher valued ballot so that it can be voted on again.

Delegated Proof of Stake (DPOS)
Another form of PoS is delegated proof of stake (DPOS). It is the same as POS except the stakeholders elect their delegates to generate and validate the blocks. As there are fewer nodes to validate, blocks can be validated quickly and the transactions can be confirmed quickly. Delegates can tune the block size and intervals in the meantime [69].

Leased Proof of Stake (LPoS)
Leased Proof of Stake (LPoS) allows the nodes with low balance to participate in solving the blocks [70]. The nodes with low balance takes some amount on lease from the nodes with high balance. The amount is in the control of the wealthy owner. When a block is solved by these nodes the reward is shared with the wealth holders. This approach is more decentralized hence making the blockchain more secure.

Byzantine Fault Tolerance (BFT)
When nodes can generate arbitrary data, byzantine fault tolerance (BFT) is a replication algorithm that can solve the issue of reaching consensus [71]. BFT can guarantee the liveness and safety of a system. It can tolerate up to 33% of faulty nodes [72].

Directed Acyclic Graph (DAG)
In directed acyclic graph (DAG) the data is stored topologically in graph manner. DAG can overcome the problems of data processing, compression and routing. One of the disadvantages of PoW is the creation time of the block which is 10 min. DAG instead of implementing a single chain, works on "side chains" [73]. Therefore, to reduce the time of block creation and validation different transactions are performed on multiple chains. Mining also is a waste of time and energy so in DAG all the transactions are maintained and directed in a certain sequence. DAG is acyclic so there is no chance of finding the parent node as it's a tree of nodes and not the loop of nodes. Some of the basic concepts of DAG are:

•
No More Double Spending: In traditional blockchain, a scenario of more than one miner tries to validate the same blockchain leads to double spending. This also leads to hard or soft forks. The DAG is safer and robust as it validates a particular transaction based on the previous number of transactions. • Less Width: The transaction in another consensus algorithm gets added to the whole network but in DAG the transaction is added to the transaction graph. This makes the whole network less bulky and easy to validate a particular transaction. • Smarter and Faster: As the blockless nature of DAG, it is much faster than PoW and PoS.

•
Favorable to the Smaller Transactions: Bitcoin and Ethereum are not much friendly for the smaller amounts rather DAG seems perfect as transaction fee is neglected.

Proof of Weight (PoWeight)
This is a very good alternative to PoS. In PoS if the participant has more tokens, he is the winner of the block but this idea makes it a bit biased [74]. So to solve this problem of biasedness PoWeight was introduced. It works on other factors than on tokens. Cryptocurrencies like Filecoin, Algorand and chia implement this algorithm. The factors are known as "Weighted Factors". In Filecoin the Interplanetary File System (IPFS) data that a system has is the weighted factor. There are also some other factors like Proof of Reputation and Proof of Spacetime. The proof of weight system provides scalability and customization, however incentivizing it can be a big challenge for this algorithm.

Delegated Byzantine Fault Tolerance (DBFT)
Delegated byzantine fault tolerance (DBFT) is a different version of BFT. This fault tolerance algorithm divides P2P into two types' ordinary nodes and bookkeepers. Bookkeepers are elected by ordinary nodes who vote for the book keepers to take part in the consensus process. A random book keeper broadcasts its transaction to the network and other 66% bookkeepers should agree on the validation of transaction data. Upon validation the transaction is appended to the blockchain. For another consensus process another book keeper is selected via the same process [75].

Ripple Protocol Consensus Algorithm (RPCA)
Ripple cryptocurrency uses this algorithm and it was designed to address other algorithm latency issues. RPCA works as follows:

•
Each server puts all the valid transactions in the "candidate set" which is the public list. • Each server gathers all candidate sets, from other Ripple servers which is found in its unique node list. • Each server votes for the validity of transactions. This voting can be done in one or multiple rounds.
• A minimum of 80% yes is required for all the transactions in the final round to be written into the public ledger and then the ledger is closed [76].

Proof of Importance
Proof of Importance (PoI) is used by the cryptocurrency New Economic Movement (NEM) [75]. NEM is a blockchain project which has created decentralized digital platform used by decentralized applications, and a digital asset having the same name. It was evolved in March 2015 by Singapore-based non-profit organization by the name of NEM.io Foundation. Every account has a vested and unvested XEM balance. Unvested balance is the amount received.
NEM is a blockchain project which has created decentralized digital platform used by decentralized applications, and a digital asset having the same name. Every account has a vested and unvested XEM balance. Unvested balance is the amount received. After every 1440 blocks one tenth of the unvested balance goes into a vested account. XEM is spent from both vested and unvested accounts when a XEM needs to be sent. This is so because both accounts need to retain the same ratio; 10,000 XEM is the minimum amount an account should hold in its vested part in order to be eligible for "Importance Calculation". Importance is calculated on a weighting factor i.e., to check if an account is a part of cluster nodes or an outlier, on amount of vested XEM, the rank of the account within the network. Ranking is held via the NCDawareRank algorithm and NEM network determined two suitable constants.

Proof of Exercise (PoX)
This algorithm is also used for cryptocurrencies. As in proof of luck the computational power is reduced. Proof of exercise uses the computational power for scientific problems. In proof of exercise the employers give the matrix based problems to miners. There are two reasons for using matrices: tuning of the network difficulty becomes easy and they are a principal abstraction for many scientific problems. A "hostage credit" system is placed in the system so that the data for matrices required are readily available. Miners need to bid for a problem to solve and deposit which will be refunded after successful completion of the problem. A sum should be deposited by an employer which should have a greater total cost than the cost of storing the matrix data. The miners send the solution of the problem to the verifiers. Verifiers use a probabilistic verification scheme to verify the data before it is committed to the blockchain. To avoid complicity among miners, verifiers and employers the matrix problem is sent via a shuffling service. This is done either directly after the miner sends the data for verification or directly after the matrix data is being published by an employer. In addition if the bid is won by multiple miners at the same time the coin reward is shared.

Proof of Ownership
Proof of work is prone to Sybil attack where an attacker can do the amount of work multiple times as he acts as multiple participants [75]. Using a Trusted Execution Environment (TEE) a participant needs to own a unique Central Processing Unit (CPU) instead of virtually maintaining participants. An Enhanced Privacy Identity (EPID) signature is used in this protocol which produces pseudonyms which show if the multiple proofs are coming from the same CPU. The algorithm generates unique pseudonyms so that if a malicious user resets the owner epoch register for using it multiple times, the attacker may not be able do that. Therefore, a consensus in blockchain is reached by following a block having most proofs with unique pseudonyms.

Proof of Luck (PoL)
Proof of luck aims to increase transaction throughput and reduce the computational power used by PoW. Each block when mined is given a random number between 0 and 1 which is called a "luck value". Higher numbers are considered as luckier and less unlucky.
The highest luck value is calculated by adding all the values of each block starting from genesis block till the last block. The miners prefer to append their block to the blockchain having the highest luck value. A higher luck value produces less delay and optimizes communication within the system. The original miner will not need to broadcast its block to the network as another miner tries to solve the proof on the first block having higher luck value [77].

Proof of Activity (PoA)
There are many disadvantages of proof of stake which includes keeping coins for long with oneself [75]. Coins are also sent to the transactions which further assigns coins to the rest destroying the coinage but they are not included in PoS. When the node is offline, coins are still collected and this is the main weakness of PoS. When the node is occasionally online, there is a delay in receiving their incentive which results in incentive distributions bursts. If the amount of online nodes are insufficient it may result in attacks.

Proof of Publication (PoP)
Blockchain provides hashes which are linked together; however, the servers may backdate the records by hashing and signing the past timestamps. To handle this issue the timestamps are lined together. This technique takes the timestamp of the digital record's creation and modification, takes a hash out of record and timestamps and links them together. So even if the clocks are incorrect, this technique can give certainty to the complete order of records.

Proof of Burn (PoB)
Proof of burn (PoB) is also known as PoW without energy waste. The miners instead of using heavy power utilizes virtual token coins to burn and destroy in order to get a right to write into the blockchain. The miners buy mining rigs which gives them power to mine blocks. Miners can send and get transactions by burning their own and others coins respectively. More coins burnt results in more virtual mining rigs.

Proof of Retrievability (PoR)
PoR provides mining resources with the additional ability of distributed storage of archival data. It is similar to PoB but it does not just involve computational power but also storage. This consensus is more suitable for cloud computing where a file system (Prover) can give surety to a client (verifier) that the file is intact. PoR is well known for permacoin and koppercoin [78].

Proof of Elapsed Time (PoET)
In proof of elapsed time (PoET) each node is given a randomized timer object from a trusted code. The node having the shortest timer is when expired the node wakes up, propagates a signed certificate to show this node is the block leader. The timer is given randomly so that the malicious user does not try to continuously get a shortest timer [79].

Proof of Capacity (PoC)
Also known as proof of space. Instead of using miner's computational power, mining devices storage capacity is used to store the possible solutions for mining cryptocoins. The more storage space results in higher chances of winning the mining reward. The list of solutions is stored on the device hard drive before the mining process begins.

Proof of Existence
Traditional models of validating the documents are based on central authorities which can lead to security breaches [80]. Through blockchain the document can be stored with a signature and timestamp associated with a legal document. The user can validate the document anytime. This is also advantageous as the blockchain is not centralized so the user can get the privacy and security by having the proof of the document as decentralized where it cannot be modified by a third party.

Proof of Authority
Proof of authority was proposed for private networks as part of the Ethereum ecosystem. In PoA, authority is given to N nodes. Each node is given a unique id. These authorities are responsible for running the consensus and ordering the client's issued transactions. PoA runs on a mining rotation schema in which the responsibility of block creation is distributed fairly among the authorities [81].

Ethash
Ethash is a memory-intensive proof of work algorithm which is used by Ethereum [82]. In bitcoin, a block is created after every 15 s approximately as the difficulty level is adjusted automatically. However Ethereum depends on mining of a 1 GB data set and these data sets are produced out of the headers of previous blocks after every epoch. i.e., after about every 5.2 days or 30,000 blocks. The clients of Ethereum store and generate the future data set in advance because the data set can take a long time to generate. This can prevent delay in mining at the beginning of every epoch. Using block's header mining is one on the nonce and subset from the data set. The SHA3-256 hash of this subset is compared to some threshold, if the hash is less than the threshold, its nonce is valid and the block is appended to the blockchain. Ethereum designed Ethash with an aim of being an "Application Specific Integrated Circuits (ASIC)-resistant" mechanism of which reduced the advantage of joining mining pools. Since blockchain mining centralization can introduce a risk of 51% attack. So Ethereum relies on memory instead of computational power. This also makes ASICs less attractive, as graphic cards of top range are capable of mining Ether [83]. Currently, Ethereum is moving from PoW to proof of stake due to the difficulty in entering the miner system. So the the protection against attacks is more than the PoW.

Proof of Stake Velocity (PoSV)
This is used in red coin cryptocurrency. It is a bit alternate to proof of work (PoW) and PoS. The ownership is referred to as stake and activity is referred as velocity. It is based on the frequency at which a currency unit is used in the economy in a given time period. The higher velocity is a sign of a better economy. Here is the formula to achieve proof of stake stake velocity: Vt = nT/M Here 'Vt' is the currency unit's velocity, 'nT' is the aggregate for transactions while 'M' is the amount of money in circulation [84].

Proof of SpaceTime (PoST)
In proof of spacetime (PoST) a prover has to convince a verifier that data and space has been stored by him/her over a period of time. This data and space storing over a period of time is known as "spacetime" resource. PoST uses less energy as compared to proof of work as it requires that the difficulty level be increased by prolonging the time period in which the data is stored rather than increasing computation costs [85].

A Federated Byzantine Agreement (FBA)
A federated byzantine agreement (FBA) is well known for its low transaction costs, scalability and high throughput. Steller and Ripple cryptocurrencies use this consensus where Steller was the first one to use FBA. It works like a byzantine fault tolerance where a blockchain is a responsibility of each byzantine general which belongs to the same blockchain. Nodes need to be known and verified in advance before the user requests any enactment from the FBA [86]. The notary node selects those nodes who they trust, making quorums of nodes and hence forming the FBA network.

Healthcare Based Consensus
Blockchain is helpful in healthcare as it provides security to the medical records and other security breaches which healthcare faces on a daily basis. Figure 6 shows the patient profile over the blockchain which can be used for information by the concerned doctor, hospital, insurance company or it can be used in the supply chain management.
A federated byzantine agreement (FBA) is well known for its low transaction costs, scalability and high throughput. Steller and Ripple cryptocurrencies use this consensus where Steller was the first one to use FBA. It works like a byzantine fault tolerance where a blockchain is a responsibility of each byzantine general which belongs to the same blockchain. Nodes need to be known and verified in advance before the user requests any enactment from the FBA [86]. The notary node selects those nodes who they trust, making quorums of nodes and hence forming the FBA network.

Healthcare Based Consensus
Blockchain is helpful in healthcare as it provides security to the medical records and other security breaches which healthcare faces on a daily basis. Figure 6 shows the patient profile over the blockchain which can be used for information by the concerned doctor, hospital, insurance company or it can be used in the supply chain management. The consensus algorithms used in healthcare are discussed below.

Proof of Interoperability
Proof of interoperability removes some of the disadvantages of proof of work. This is designed to achieve something fundamentally valuable. This protocol verifies that the incoming messages are interoperable with the known set of semantic and structural constraints. For the use case discussed by Kevin Peterson and Rammohan Deeduvanu in their research work is the FHIR profile (Fast Healthcare Interoperability Resources). This is an evolving standard that shows elements and data formats, along with providing publicly accessible application programming interfaces (APIs) for the reason of exchanging Electronic Health Records. Proof of Interoperability requires a network to reach consensus on the set of allowed FHIR profiles which includes the value sets of the attendant as well. This type of consensus requires a human-based process to reach. Participants negotiate with the help of clinicians and terminology specialists. This consensus cannot, however, be reached programmatically. Network agreement is most likely a humanbased process, where network participants negotiate and collaborate with the help of both terminology specialists and clinicians. This collaboration demands a centralized repository. The value set repository proposed in this paper is the value set authority center (VSAC) [87].A privacy-preserving medical system for data sharing based on Hyperledger Fabric (MedHypChain) proposed by [88]. The authors show that MedHyp-Chain achieves anonymity, confidentiality, unforgeability and traceability. They also fa- The consensus algorithms used in healthcare are discussed below.

Proof of Interoperability
Proof of interoperability removes some of the disadvantages of proof of work. This is designed to achieve something fundamentally valuable. This protocol verifies that the incoming messages are interoperable with the known set of semantic and structural constraints. For the use case discussed by Kevin Peterson and Rammohan Deeduvanu in their research work is the FHIR profile (Fast Healthcare Interoperability Resources). This is an evolving standard that shows elements and data formats, along with providing publicly accessible application programming interfaces (APIs) for the reason of exchanging Electronic Health Records. Proof of Interoperability requires a network to reach consensus on the set of allowed FHIR profiles which includes the value sets of the attendant as well. This type of consensus requires a human-based process to reach. Participants negotiate with the help of clinicians and terminology specialists. This consensus cannot, however, be reached programmatically. Network agreement is most likely a human-based process, where network participants negotiate and collaborate with the help of both terminology specialists and clinicians. This collaboration demands a centralized repository. The value set repository proposed in this paper is the value set authority center (VSAC) [87]. A privacy-preserving medical system for data sharing based on Hyperledger Fabric (MedHypChain) proposed by [88]. The authors show that MedHypChain achieves anonymity, confidentiality, unforgeability and traceability. They also facilitates the patient to manage its information regarding health in the blockchain whereas it can be accessed by an authorized entity.

Proof of Disease
There are several steps in PoD which are as follows: 1.
Mobile devices and desktops are used as user devices and the server is cloud based application. Server and client communication is done via Java Script Object Notation (JSON) objects.

2.
The patients enter their details of disease in simple English and the server runs hunspell using corpus (customized medical dictionary) over the user text.

3.
The user text is parsed using metathesaurus and UMLS and then the text is converted into multiple UMLS (Unified Medical Language System) CUI (Concept Unique Identifier).

4.
UMLS CUI is converted into ICD10 and SNOMED CT (Systemized Nomenclature of Medicine-Clinical Terms) Codes.

5.
The important information is either taken from the user online if the information is not available in EMR/HER (Electronic Medical Record/Health Electronic Record).

6.
Using graph analysis merge SNOMED CD with phonemics databases to determine the fundamental disease concepts in machine understandable ontologies. 7.
The medical specialists called Medical Miner (MM), validates and confirms all the results from the above steps and commits into the blockchain. 8.
Additional biological databases are added and repeated over in cases, when the proof of disease cannot be determined. These are big-data databases Gene Ontology, Human Phenotype Ontology (HPO), Virtual Metabolic Human etc. [89].

Medical Information Sharing Using PBFT (Practical Byzantine Fault Tolerance)
As discussed by Jieying Chen [90] PoW utilizes much energy and resources so instead of PoW they used PBFT in their application of blockchain for medical information sharing. PBFT can tolerate one third of nodes to be malicious hence it is much more efficient in reaching consensus than PoW.

Intelligent Transportation System (ITS) and Vehicular Ad Hoc Networks (VANETS) Consensus Algorithms
Recently smart vehicles have gained much attention in the area of research. A vehicular network is composed of various sensors, on board units (OBU) and road side units (RSU) etc. where communication is exchanged among the nodes. Security issues may arise when an adversary tries to forge the message or tries to divert the traffic in case of platoon. Blockchain helps in securing the communication as all the communication is being done via transactions where they are recorded in a distributed ledger. There are consensus algorithms discussed in different scenarios of vehicular ad hoc networks (VANETS) and intelligent transportation systems (ITS). Figure 7 shows the general concept of blockchain in VANETS.

Proof of Movement
Road miners (smart phones or computers etc.) share their transportation data with the community and get automatic reward (Tokens) called zooz. These tokens can be used to pay for ride sharing and other services. Road miners get more rewards if they drive for long (Incentive layer) [92].

Proof of Driving
Proof of driving (PoD) validates and verifies the vehicles in communication. IV-TP (intelligent vehicle trusted point) is the crypto data which is assigned to each vehicle and if a vehicle wins the consensus competition, it gets more IV-TP from the benefiter IV. The vehicle having more IV-TP is leading the vehicle's communication network. This way it creates a trusted environment between vehicles communication [93].

Proof of Reputation
The paper discusses in this section a decentralized reputation-based blockchain in vehicular networks. The received messages are rated by the elected vehicle from the crowd and then broadcasts its ratings which are in the form of block. Using a vehicle's local knowledge they validate the block and decide to add the block to the blockchain or not.

Proof of Movement
Road miners (smart phones or computers etc.) share their transportation data with the community and get automatic reward (Tokens) called zooz. These tokens can be used to pay for ride sharing and other services. Road miners get more rewards if they drive for long (Incentive layer) [92].

Proof of Driving
Proof of driving (PoD) validates and verifies the vehicles in communication. IV-TP (intelligent vehicle trusted point) is the crypto data which is assigned to each vehicle and if a vehicle wins the consensus competition, it gets more IV-TP from the benefiter IV. The vehicle having more IV-TP is leading the vehicle's communication network. This way it creates a trusted environment between vehicles communication [93].

Proof of Reputation
The paper discusses in this section a decentralized reputation-based blockchain in vehicular networks. The received messages are rated by the elected vehicle from the crowd and then broadcasts its ratings which are in the form of block. Using a vehicle's local knowledge they validate the block and decide to add the block to the blockchain or not. Thus the rating which are stored on the blockchain are said to be reliable enough as these are validated by most of the vehicles in the network [94]. Proof of reputation can also be used generally for almost any business network. Gochain uses proof of reputation for Dapps (Decentralized Applications) and smart contracts that aims to decrease energy consumption, increase performance, provide network security and decentralization.

Consensus in Supply Chain
Supply chain is the service of producing goods and products and delivering to the ultimate customer. It deals with the manufacturers, suppliers, warehouses, organizations, retailers and distribution centers where raw material is changed into fine deliverables. Blockchain has revolutionized the supply chain process drastically by reducing delays, costs and human errors. All the changes made during the process of a supply chain are recorded in the transactions ledger keeping it secure and unchangeable. In Figure 8 the supply chain process is described where raw material is packed with a RFID (Radio Frequency Identification) tag and barcode is used to finish the goods.

Soft Consensus-Based Group Decision Making
Acting in an isolation for the decision in supply chain cannot be that helpful than making joint decisions of planning and execution using supply chain coordination (SCC). A methodology named a fuzzy TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)-based MCDM (Multi Criteria Decision Making) for selection problems of SCC is proposed in this paper. As the decision makers are separated geographically, they give their preferences via the internet. A consensus should be reached for the preferences among the decision makers and in this regard this paper presents a soft consensusbased GDM (Group Decision Making) methodology. All the supply chain partners reach a consensus by forming a decision matrix. This is an objective weight determination methodology which is used for assessment of the weights of the criteria without mediation of the decision makers. This methodology is used as the meeting is internet based [96].

Weight-Based PoS
As discussed by Leng Kaijun [97], a public blockchain consensus has slow speed. The selective incentive weight should be used in common for the agricultural business resources so that these resources reach the underdeveloped and remote areas. Therefore this paper presents a consensus algorithm for the blockchain of agriculture business re-

Soft Consensus-Based Group Decision Making
Acting in an isolation for the decision in supply chain cannot be that helpful than making joint decisions of planning and execution using supply chain coordination (SCC). A methodology named a fuzzy TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)-based MCDM (Multi Criteria Decision Making) for selection problems of SCC is proposed in this paper. As the decision makers are separated geographically, they give their preferences via the internet. A consensus should be reached for the preferences among the decision makers and in this regard this paper presents a soft consensus-based GDM (Group Decision Making) methodology. All the supply chain partners reach a consensus by forming a decision matrix. This is an objective weight determination methodology which is used for assessment of the weights of the criteria without mediation of the decision makers. This methodology is used as the meeting is internet based [96].

Weight-Based PoS
As discussed by Leng Kaijun [97], a public blockchain consensus has slow speed. The selective incentive weight should be used in common for the agricultural business resources so that these resources reach the underdeveloped and remote areas. Therefore this paper presents a consensus algorithm for the blockchain of agriculture business resources. The algorithm considers weight based on PoS.

Consensus in Internet of Things (IoT)
IoT relies on a centralized system where many devices are attached to each other via the cloud or any other central system [98]. The data are sent back from the cloud to the device. This makes the scalability issue as sending and receiving of data from many devices can slow up the central system and security issues may arise. Blockchain has made the IoT more reliable, secure and efficient. IoT produces a massive transaction so a decentralized solution would provide a cost effective solution and a peer to peer communication can provide a standardized management for the massive transactions. Although a peer-to-peer communication model suffers a security challenge but the blockchain technology achieves transparent interactions among different parties. The use of a Proof of work consensus algorithm makes the blockchain distributed ledger more trusted and secure [99]. Figure 9 shows the scenario of blockchain retrieving data from various IoT devices. In different scenarios of IoT and blockchain different or already discussed consensus of the blockchain are discussed below.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 26 of 44 Figure 9 shows the scenario of blockchain retrieving data from various IoT devices. In different scenarios of IoT and blockchain different or already discussed consensus of the blockchain are discussed below.

A Distributed Consensus Algorithm
Global consensus might be the need to facilitate service integration and knowledge sharing. In this paper an idea of local consensus is developed and this is developed by each of IoT edge nodes when needed. Clusters are formed out of network nodes and each cluster reaches a local consensus. This local consensus can be used to make consensus decisions in integration of functional capabilities and knowledge sharing. Any service can become part of the service pool where a local consensus is achieved for all the edge nodes involved in IoT. The proposed matching value-based methods helps in finding the possibility that the existing services can lead to the composition of new services by the existing IoT services. Therefore, the matching values form the nodes are gathered and synthesized to reach a decision which would be acceptable to all. This is helpful in not only to achieve better solutions but also to create trust among nodes and clusters of the network [100].

Consensus Protocol of Diversified Services of Complex Internet of Things Applications
The consensus protocol discussed is the merger of proof of stake and proof of work. Ethereum Casper FFG (Friendly Finality Gadget) [100] uses the same protocol. The implementation of the protocol begins with the genesis block. An appointing committee should be organized which will pay the deposit prior. However the amount to be deposited depends on the actual situation. Instead of each common block this paper focuses on the checkpoint blocks. Members vote for the final winner of the fork. The period in which

A Distributed Consensus Algorithm
Global consensus might be the need to facilitate service integration and knowledge sharing. In this paper an idea of local consensus is developed and this is developed by each of IoT edge nodes when needed. Clusters are formed out of network nodes and each cluster reaches a local consensus. This local consensus can be used to make consensus decisions in integration of functional capabilities and knowledge sharing. Any service can become part of the service pool where a local consensus is achieved for all the edge nodes involved in IoT. The proposed matching value-based methods helps in finding the possibility that the existing services can lead to the composition of new services by the existing IoT services. Therefore, the matching values form the nodes are gathered and synthesized to reach a decision which would be acceptable to all. This is helpful in not only to achieve better solutions but also to create trust among nodes and clusters of the network [100].

Consensus Protocol of Diversified Services of Complex Internet of Things Applications
The consensus protocol discussed is the merger of proof of stake and proof of work. Ethereum Casper FFG (Friendly Finality Gadget) [100] uses the same protocol. The implementation of the protocol begins with the genesis block. An appointing committee should be organized which will pay the deposit prior. However the amount to be deposited depends on the actual situation. Instead of each common block this paper focuses on the checkpoint blocks. Members vote for the final winner of the fork. The period in which voting takes place is called an epoch. The appointing committee members can also issue transactions just like other nodes of the network. Additionally they have the charge of voting at justified checkpoints. Ballots are used by the members in voting where they decide which checkpoint block should be included in the main graph. Then the result of the vote is broadcast to the whole network. If Block checkpoint 1 (BCP1) gets more than 2/3 ballots, the block is acknowledged and prepared and the epoch ends. The transactions that are in leaf blocks and those incompatible transactions are sent to the pool for further processing. In the next cycle BCP1 is committed and finally confirmed once BCP2 is voted and said to be prepared.

Consensus in Big Data
Bitcoin is the most known application of blockchain and yearly its size has increased by 15 GB. Since blockchain is a transaction database distributed among multiple nodes which sort of push it to the big data territory. Figure 10 shows a general picture of big data in blockchain. Blockchain itself has been used in big data architecture using its own consensus protocols. nodes which sort of push it to the big data territory. Figure 10 shows a general picture of big data in blockchain. Blockchain itself has been used in big data architecture using its own consensus protocols.

Paxos Algorithm for Consensus
Paxos is a decentralized consensus algorithm which lets nodes communicate through an asynchronous network. This algorithm is designed in a way that any value accepted by majority will not be changed so that all the nodes have the same copy of the value [101].

Proof of Collaboration
The proof of collaboration is used in "Making Big Data Open in Edges: A Resource-Efficient Blockchain-Based Approach" here if an edge device (node) intends to generate new block it will have to show the collaboration from other edges rather than solving puzzles. This requires less computation power than puzzle solving.

Consensus in Cellular Networks
Blockchain offers great opportunities for different platforms and applications. Mobile networks can also use blockchain as a part of the infrastructure which will provide verifiable and secure digital transactions and can also improve privacy.

Proof-of-Location (PoL)
In cellular network blockchain mobile phones are considered as nodes. The geographical location of a node at certain time is attested by a digital certificate, which is known as proof of location. The proof of location consensus is required to achieve the proof of location certificate. In proof of location consensus there is a "Prover" node and a "Witness" node. The prover node collect proof of location from its close neighbor devices through short range communication technologies. The witnesses are those nodes which provide a proof of location to the prover [102]. Figure 11 describes the scenario.

Paxos Algorithm for Consensus
Paxos is a decentralized consensus algorithm which lets nodes communicate through an asynchronous network. This algorithm is designed in a way that any value accepted by majority will not be changed so that all the nodes have the same copy of the value [101].

Proof of Collaboration
The proof of collaboration is used in "Making Big Data Open in Edges: A Resource-Efficient Blockchain-Based Approach" here if an edge device (node) intends to generate new block it will have to show the collaboration from other edges rather than solving puzzles. This requires less computation power than puzzle solving.

Consensus in Cellular Networks
Blockchain offers great opportunities for different platforms and applications. Mobile networks can also use blockchain as a part of the infrastructure which will provide verifiable and secure digital transactions and can also improve privacy.

Proof-of-Location (PoL)
In cellular network blockchain mobile phones are considered as nodes. The geographical location of a node at certain time is attested by a digital certificate, which is known as proof of location. The proof of location consensus is required to achieve the proof of location certificate. In proof of location consensus there is a "Prover" node and a "Witness" node. The prover node collect proof of location from its close neighbor devices through short range communication technologies. The witnesses are those nodes which provide a proof of location to the prover [102]. Figure 11 describes the scenario. Figure 11. Proof of location.

Consensus in Social Networks
Social networks are rapidly producing personal data. According to a recent report Facebook which is the largest social network has collected personal data of 300 petabytes since its foundation. Blockchain is a viable solution to protect data by providing decentralized privacy.

Proof of Credibility
The contractor signs contracts with different parties and the number of these parties is known as measuring credibility score. A miner in this consensus of blockchain provides proof that he has a high credibility score. This proof is actually an improvement of the previous work of researchers, in which the trust score was on how many good actions a node has made. The improvement calculates the connection between nodes by credibility score. Instead of using a proof of stake the credibility score gives a problem that even if a contract is true or fake the credibility score is added. An attacker can succeed in a 51% attack if he makes fake contracts with false parties in order to increase his credibility score. Later this attacker can join the true parties who will renew the contracts illegally. To settle this issue, a hybrid of proof of credibility and proof of stake is used in this proposed methodology where these proofs are executed alternately. If a miner generates a block using proof of credibility, the next miner will generate a block using proof of stake [103].

Consensus in Distributed Web Services and Storage
When cloud storage and web services are made permissionless, decentralized and secured, it can bring a positive change in standards of unit economics of decentralized storage. Human capital costs as well as high mark-ups will be eliminated. Solana aims to bring this trend to the future of blockchain by introducing a scalable consensus called proof of history (Available: https://iconetwork.io/tag/proof-of-history/: Accessed on 14 March 2020).

Consensus in Social Networks
Social networks are rapidly producing personal data. According to a recent report Facebook which is the largest social network has collected personal data of 300 petabytes since its foundation. Blockchain is a viable solution to protect data by providing decentralized privacy.

Proof of Credibility
The contractor signs contracts with different parties and the number of these parties is known as measuring credibility score. A miner in this consensus of blockchain provides proof that he has a high credibility score. This proof is actually an improvement of the previous work of researchers, in which the trust score was on how many good actions a node has made. The improvement calculates the connection between nodes by credibility score. Instead of using a proof of stake the credibility score gives a problem that even if a contract is true or fake the credibility score is added. An attacker can succeed in a 51% attack if he makes fake contracts with false parties in order to increase his credibility score. Later this attacker can join the true parties who will renew the contracts illegally. To settle this issue, a hybrid of proof of credibility and proof of stake is used in this proposed methodology where these proofs are executed alternately. If a miner generates a block using proof of credibility, the next miner will generate a block using proof of stake [103].

Consensus in Distributed Web Services and Storage
When cloud storage and web services are made permissionless, decentralized and secured, it can bring a positive change in standards of unit economics of decentralized storage. Human capital costs as well as high mark-ups will be eliminated. Solana aims to bring this trend to the future of blockchain by introducing a scalable consensus called proof of history (Available: https://iconetwork.io/tag/proof-of-history/, accessed on 14 March 2020).

Proof of History
Each transaction in a network is time stamped. This protocol verifies the order and duration of time between events. Leaders are designated by the system that can organize and send the user messages to other nodes for further processing. Verifiers execute the transactions and publish the confirmed transactions using computed signatures. These confirmed transactions are actually votes for the consensus algorithm.
Proof of History (PoH) works in collaboration with Proof of Stake. Leader produced current sequence is confirmed using PoS. Next leader selection via voting is also done using PoS. It can also be used to punish any verifier that acts against the agenda of the network. There is an additional layer of security in this network that generates an invalid hash at random intervals and those verifiers who validate it are penalized.

Consensus in Governance
Blockchain can be used in governance though it cannot take full control from the central body but it can be part of it. Being the part of governance blockchain can be used in areas such as voting, transparent budgeting, replacing paper-based systems, secure data entry shown in Figure 12. There are other areas where blockchain can be used, such as digitizing the currency by using cryptocurrency instead which might never be accepted and implemented. There are a lot of consensus protocols such as proof of work and proof of stake stack that can be used in blockchain in governance. Each transaction in a network is time stamped. This protocol verifies the order and duration of time between events. Leaders are designated by the system that can organize and send the user messages to other nodes for further processing. Verifiers execute the transactions and publish the confirmed transactions using computed signatures. These confirmed transactions are actually votes for the consensus algorithm.
Proof of History (PoH) works in collaboration with Proof of Stake. Leader produced current sequence is confirmed using PoS. Next leader selection via voting is also done using PoS. It can also be used to punish any verifier that acts against the agenda of the network. There is an additional layer of security in this network that generates an invalid hash at random intervals and those verifiers who validate it are penalized.

Consensus in Governance
Blockchain can be used in governance though it cannot take full control from the central body but it can be part of it. Being the part of governance blockchain can be used in areas such as voting, transparent budgeting, replacing paper-based systems, secure data entry shown in Figure 12. There are other areas where blockchain can be used, such as digitizing the currency by using cryptocurrency instead which might never be accepted and implemented. There are a lot of consensus protocols such as proof of work and proof of stake stack that can be used in blockchain in governance.

Consensus in Entertainment
Blockchain is also very useful in entertainment business such as "Music on the Blockchain" [104] which protects the copyright information of music by storing it on blockchain. The proof of work and proof of stake stack consensus algorithms are discussed for the implementation of music on the blockchain. More applications of blockchain in entertainment are shown in Figure 13.

Consensus in Entertainment
Blockchain is also very useful in entertainment business such as "Music on the Blockchain" [104] which protects the copyright information of music by storing it on blockchain. The proof of work and proof of stake stack consensus algorithms are discussed for the implementation of music on the blockchain. More applications of blockchain in entertainment are shown in Figure 13. Each transaction in a network is time stamped. This protocol verifies the order and duration of time between events. Leaders are designated by the system that can organize and send the user messages to other nodes for further processing. Verifiers execute the transactions and publish the confirmed transactions using computed signatures. These confirmed transactions are actually votes for the consensus algorithm.
Proof of History (PoH) works in collaboration with Proof of Stake. Leader produced current sequence is confirmed using PoS. Next leader selection via voting is also done using PoS. It can also be used to punish any verifier that acts against the agenda of the network. There is an additional layer of security in this network that generates an invalid hash at random intervals and those verifiers who validate it are penalized.

Consensus in Governance
Blockchain can be used in governance though it cannot take full control from the central body but it can be part of it. Being the part of governance blockchain can be used in areas such as voting, transparent budgeting, replacing paper-based systems, secure data entry shown in Figure 12. There are other areas where blockchain can be used, such as digitizing the currency by using cryptocurrency instead which might never be accepted and implemented. There are a lot of consensus protocols such as proof of work and proof of stake stack that can be used in blockchain in governance.

Consensus in Entertainment
Blockchain is also very useful in entertainment business such as "Music on the Blockchain" [104] which protects the copyright information of music by storing it on blockchain. The proof of work and proof of stake stack consensus algorithms are discussed for the implementation of music on the blockchain. More applications of blockchain in entertainment are shown in Figure 13.

Consensus in Real Estate
Blockchain can be implemented in real estate such as recording of properties titles and deeds [105]. To ensure the safety of the data it is designed to be stored in blockchain and to ensure safe transactions on that blockchain proof of work consensus has been favored. Also for digitizing the land record system by blockchain [106] would make it secure from corruption. The proof of existence is advised to be used for the intellectual properties. Other than that proof of concept is also used in blockchain for real estate [107]. The general image for real estate over the blockchain is shown in Figure 14.

Consensus in Real Estate
Blockchain can be implemented in real estate such as recording of properties titles and deeds [105]. To ensure the safety of the data it is designed to be stored in blockchain and to ensure safe transactions on that blockchain proof of work consensus has been favored. Also for digitizing the land record system by blockchain [106] would make it secure from corruption. The proof of existence is advised to be used for the intellectual properties. Other than that proof of concept is also used in blockchain for real estate [107]. The general image for real estate over the blockchain is shown in Figure 14.

Consensus in Power
Blockchain is going to change the legacy systems of centralized nature by hybrid distributed systems which are made up of solar power micro grids and large power plants. This kind of distributed energy system will be a reliable, efficient and renewable energy delivering system. There is also a possibility that blockchain may change the trading system and businesses would trade off using electricity for example if a factory needs additional power, it can buy unused electricity which another factory is selling for five minutes. These five minutes are actually the unused downtime minutes of a factory. This kind of trade can give efficiency benefits to grid operators.
Each home is installed with a smart meter (SM) in order to achieve better scheduling in the smart grid. These SMs collect real-time data of electricity consumption and utilities use this data to provide smart home services in a better way. The real time data can disclose private data of the user and an adversary can take advantage of this data by reading the usage patterns of the electricity consumption profile of the user. In [108], a privacy-preserving and data efficiency aggregation scheme is proposed via blockchain. Users are divided into groups and a private blockchain is managed by each group for its members. For privacy preservation inside a group each user uses pseudonyms to hide their identity. In addition, proof of work is used to achieve block verification. The said scheme achieves security requirements and better performance than other methods.

General Consensus Algorithms
The algorithms discussed in this section are general purpose which can be used for any type of asset. Table 4 has some of the important features of the general consensus algorithms.

Consensus in Power
Blockchain is going to change the legacy systems of centralized nature by hybrid distributed systems which are made up of solar power micro grids and large power plants. This kind of distributed energy system will be a reliable, efficient and renewable energy delivering system. There is also a possibility that blockchain may change the trading system and businesses would trade off using electricity for example if a factory needs additional power, it can buy unused electricity which another factory is selling for five minutes. These five minutes are actually the unused downtime minutes of a factory. This kind of trade can give efficiency benefits to grid operators.
Each home is installed with a smart meter (SM) in order to achieve better scheduling in the smart grid. These SMs collect real-time data of electricity consumption and utilities use this data to provide smart home services in a better way. The real time data can disclose private data of the user and an adversary can take advantage of this data by reading the usage patterns of the electricity consumption profile of the user. In [108], a privacypreserving and data efficiency aggregation scheme is proposed via blockchain. Users are divided into groups and a private blockchain is managed by each group for its members. For privacy preservation inside a group each user uses pseudonyms to hide their identity. In addition, proof of work is used to achieve block verification. The said scheme achieves security requirements and better performance than other methods.

General Consensus Algorithms
The algorithms discussed in this section are general purpose which can be used for any type of asset. Table 4 has some of the important features of the general consensus algorithms. A proof of vote is built for consortium blockchain where companies develop a partnership and each company represents an officer [109]. These companies share their businessrelated data via coalition committee. Business transactions and operations are recorded on blockchain. The companies do not agree on giving right to any of the companies to produce a block so they decided to hire a butler team. The team is hired from all over the world and the election is held among them on a regular basis. The blocks are produced by the team and are sent to the companies for verification and voting which makes the power decentralized among the team responsible for producing blocks and each block will be submitted to each company for verification and voting, making the power decentralized within the partnership committee. In order to maintain reliability, safety and efficiency the butlers are paid high salaries by the companies. Anyone can join the butler team but the team member is recommended by the coalition and they have to submit a deposit. The members of the coalition supervise the work of a butler and they are graded accordingly so that only the honest ones can survive. Therefore, PoV is a consensus method proposed for consortium blockchain which is maintained by organizations and enterprises in different areas of the world.

Tendermint
Tendermint is a permissioned consensus algorithm. It is the same as PBFT as it can tolerate one-third malicious nodes [110]. In the tendermint protocol the participants are known as validators which vote on their proposed blocks. There are two steps of voting: pre-vote and pre-commit. When more than two third of validators pre-commit in a same round for the same block, it is then added to the blockchain.

Proof of Human Work
Puzzles related to human work are very much similar to PoW except that a human is involved in finding a solution [111]. The problem solver should not be a machine only and this is the main difference between PoW and PoH. A puzzle should be made hard to solve for humans and uneasy to solve for machines. Although we expect the verification to be easy for machines as in PoW.

Simplified Byzantine Fault Tolerance (SBFT)
In simplified byzantine fault tolerance (SBFT), a block gathers all the transactions, batch them and validate them in a new block [112]. All the nodes follow the rules of a block generator to validate all the transactions. A block signer validates these transactions and adds its own signature. So if any of the blocks miss one of the keys, it is rejected. This algorithm uses an adopted version of a Practical PBFT consensus algorithm. This protocol is also aimed to provide improvements over PoW. There is a single validator who is a known party and the nature of the ledger is permissioned. The validator forms a new block with a bundle of proposed transactions. Consensus is achieved when a minimum number of nodes approve a block. The number of nodes to reach consensus is 2f + 1 that has 3f + 1 number of nodes where f is the number of faulty nodes. For example, if a system has seven nodes and two of them are faulty then 5 nodes must agree.

Practical Byzantine Fault Tolerance (PBFT)
A solution to the byzantine general problem is the federated byzantine agreement. In this approach every node knows each other and knows which one is important and which is not [112]. PBFT is an algorithm which uses this approach. Hyperledger uses this principle and its consensus algorithm. The approach is like multicasting. A primary node is responsible to send requests to other nodes in its group. The service is said to be approved if 1/3 different replicas (nodes in the group) approves the receipt of the requests. If the client does not receive any replicas it will send requests to all the nodes instead of sending it to the primary only. This would be the case if the primary is faulty [113].

Raft
Raft can accommodate 50% of malicious nodes [114]. It is a voting-based consensus algorithm which is composed of two stages: leader election and log replication [115]. The ordering of transactions is a task given to the leader. When an existing leader fails, a randomized timeout for each server selects another leader. This way a leader is chosen. After a leader is chosen a replication stage starts. In this stage, the leader makes its own version of transaction log by accepting log entries form clients and broadcasting these transactions. This method has low latency and high throughput. The performance and throughput is dependent on the leader node so if the leader node is infected the whole system will be destroyed. It is not appropriate for IoT because of its low security and restricted throughput.

Proof of Proof
The proof of proof consensus method is used by VeriBlock. This protocol allows other blockchains to take security from other blockchains using proof of work. This creates an ecosystem wherein security initiates on well-known blockchains like bitcoin and spreads to other blockchains. A new type of miner is introduced by proof of proof (Available: https://medium.com/coinmonks/blockchain-consensus-algorithms-an-early-days -overview-2973f0cf49c6 accessed on 14 December 2019) who presents the current states of the blockchain to another blockchain. He does this by periodically performing publications on the current state of the blockchain. These publications are referenced in the event of a potential blockchain reorganization. Proof of proof creates blocks by using local PoW, POS or low-hash rate etc.

Proof of Believability
This protocol is the replacement of PoW as PoW is an expensive mechanism to adopt in every blockchain. Proof of Believability (Available: https://www.btcwires.com/round-the -block/what-is-proof-of-believability/ accessed on 3 December 2019) is developed by IOST (Internet of Service Token). A node is trusted based on its previous contributions. A token named SERVI is used in the IOST system to improve fairness and decentralization of the blockchain. Tokens are awarded to the good actors in order to select the next validator. Each node in proof of believability (PoB) has a believability score based on previous transactions of the node, number of positive reviews of a node, IOST's amount in the node and number of awarded SERVI.

Proof of Property
This proof allows participants not to have a local copy of the full blockchain [116]. Owner of new transaction should have coins enough in their address to fulfil the transaction. New participants can validate the transactions without the need to download a blockchain initially. The new participants need to access the root hash of the Patricia tree system state of the new block. As members of the network can obtain a state from the header so they can delete the old body of the blocks and save a lot of local space which is not the case in traditional blockchain applications.

Development Platforms
Now we discuss the development platforms used by the consensus algorithms. Table 5 describes some of the important features of the development environments.

Ethereum
Ethereum is a crypto currency-based blockchain platform. It allows programmers to write smart contracts [117] which are self-executing methods. The language used for smart contracts writing is solidity. These smart contracts are executed by the Ethereum virtual machine (EVM). Every Ethereum node must have an EVM which keeps the copy of the blockchain. The EVM uses a stack register of 256-bits which is designed to run the same code as expected. EVM is also referred to as Ethereum yellow paper and it has been implemented in C++, Golang, Java, JavaScript, Ruby, Python and many others.

Cosmos
Cosmos is also called the internet of blockchains, which actually is network for parallel blockchains. Before the idea of cosmos, blockchains were separated and isolated. Cosmos makes it easier for developers to build blockchains which can do transactions with each other. The end goal is the decentralized network of blockchains which is also referred to as "blockchain 3.0". It is open source and the Software Development Kit (SDK) is available online (Available: https://github.com/cosmos/sdk-application-tutorial, accessed on 20 January 2020). Currently the SDK is written in Golang but the cosmos team is open for changes. There are two other frameworks of cosmos technology which are Ethermint (Available: https://ethermint.zone/ accessed on 27 January 2020) and Lotion (Available: https://lotionjs.com/ accessed on 27 January 2020). Ethermint provides functionality like standard Ethereum including all the smart contract and EVM the only difference is that Ethermint uses PoS instead of PoW. Lotion is a javascript based tendermint consensus through which developers can make blockchains on the Cosmos network.

Cardano
Cardano is a blockchain technology which allows the development of smart contract platforms. Cardano is made in Haskell programming language and it uses Plutus for smart contracts so both of programming languages are functional programming languages. For decentralized architecture the RINA (Recursive InterNetwork Architecture) network protocol is used for better bandwidth. In Cardano a node does not have the entire blockchain it uses pruning and partitioning but it is not fully implemented yet.

Electro-Optical System (EOS)
EOS is a crypto currency powered by the EOSIO protocol [118]. This platform supports decentralized applications hosting decentralized storage and smart contracts. It uses the delegated proof of stake and is capable of running multithreaded which solves the issue of scalability better than most technologies. The main aim of EOSIO is to be a decentralized operating system which will allow developers to build decentralized applications such as steemit (Available: https://steemit.com/ accessed on 7 February 2020). The token EOS provides storage and bandwidth of the network so the percentage of EOS owned shows the percentage of bandwidth available to the owner. At present only 21 block producers are allowed who can generate blocks in 500 ms.

Bitcoin
Bitcoin is the first cryptocurrency platform and it has the most expensive cryptocurrency. It has a public distributed ledger (the main blockchain) which keeps records of all the transactions of bitcoin currency. Those transactions are verified through cryptography and this cryptography is done by nodes called miners. The miner which solves the cryptographic puzzle first gains a reward in the form of cryptocurrency. In order to solve the cryptographic puzzle first, some miners join together to create a mining pool [119].
Bitcoin is solely a cryptocurrency platform, it also offers documentation (Available: https://bitcoin.org/en/developer-documentation accessed on 18 April 2020) for development but those are focused on wallets managing. It is not as flexible as other platforms, and it does not have any smart contract features or any application platform support.

Hyperledger
The hyperledger block chain technology is out of the box unlike others. It does not have any cryptocurrency, it is just a technology which allows developers to build a whole new blockchain [120]. It is hosted by the Linux foundation designed to build private blockchains [121]. There are many frameworks and tools for hyperledger which are given in the Figure 15.
solve the cryptographic puzzle first, some miners join together to create a mining pool [119].
Bitcoin is solely a cryptocurrency platform, it also offers documentation (Available: https://bitcoin.org/en/developer-documentation Accessed on 18 April 2020) for development but those are focused on wallets managing. It is not as flexible as other platforms, and it does not have any smart contract features or any application platform support.

Hyperledger
The hyperledger block chain technology is out of the box unlike others. It does not have any cryptocurrency, it is just a technology which allows developers to build a whole new blockchain [120]. It is hosted by the Linux foundation designed to build private blockchains [121]. There are many frameworks and tools for hyperledger which are given in the Figure 15.

Corda
Traditional blockchains may not be appropriate for many financial scenarios [122]. Corda provides the platform for smart contracts with some salient features i.e., this rec-

Corda
Traditional blockchains may not be appropriate for many financial scenarios [122]. Corda provides the platform for smart contracts with some salient features i.e., this records and manages financial agreements between parties with compatibility of existing constructs. It supports several consensus mechanisms. Corda supports regulatory observer nodes. It allows access of data to only privileged ones [123]. The languages it supports are Kotlin and Java [124].

Blockchain Challenges
In the following subsection, we discuss blockchain challenges. Although blockchain has improved a lot of applications and has a fault tolerant peer-to-peer network but blockchain always comes up with its vulnerabilities. We discuss the possible attacks on a blockchain ledger.

Denial of Service (DoS) Attacks
The attacker crash a node by flooding a large amount of traffic in a denial of service (DoS) [125]. It prevents authorized users from retrieving the service or resource. Similarly, a distributed denial of service (DDoS) is another type of attack where a node is flooded with malevolent requests. In DDoS multiple attackers attack a single node.

Sybil Attacks
Multiple identities attacking a larger portion of network is called a sybil attack. The invaders can launch numerous false nodes that seem to be honest to their peers. These false nodes take part in falsifying the network to authenticate illegal transactions and to modify valid transactions. They can use virtual machines, several devices, or internet protocol (IP) addresses as bogus nodes for the attack. The peer to peer (P2P) network assumes that every participating node contains only one identity. Thus, numerous forged nodes give attackers the ability to repudiate transmitted blocks and to outvote authentic nodes. When an attacker controls a large number of nodes in the network, it increases the chances of double-spending [126].

Eclipse Attacks
In an eclipse attack [127], specific nodes are isolated from the peer-to-peer network by the attacker. Similar to sybil attacks, it does not attack the entire network. Once the target node is isolated, the attacker controls all outgoing connections of the node [128]. From there on, the attacker can abuse the target network and dispatch distinctive sorts of attack on blockchain mining power and agreement components. These attacks include double spending, engineering block races, selfish mining and splitting mining power.

Routing Attacks
In routing attacks [129], a message is intercepted by the attacker in the blockchain network. The attack alters the message and sends it to its neighbors. Furthermore, this attack is divided into a partitioning attack and delay attack. In partitioning attack, the entire blockchain network is divided into two or more portions. In a delayed attack, the attacker captures the message and tampers with it. Then, it redirects the tamper message to another blockchain network portion.
Different consensus mechanisms are used by blockchain to develop trust among blockchain peers. However, there are some possible attacks on these consensus mechanisms.

The 51% Attacks
A miner, having 51% or more hashing power, can initiate a 51% attack in the blockchain network [130]. The 51% attack, enables the attacker to stop the confirmation of a new block. Additionally, the attacker can reverse transactions already confirmed by the blockchain.

Double Spending
In double spending multiple transactions with the same cryptocurrency are performed by a user [131,132]. This transaction is broadcast to each node in that network. This transaction needs to be confirmed by the nodes, this confirmation is time consumable [131]. This time between two transactions' initiation and confirmation can be a window for the attacker to quickly launch his/her attack [133,134].

Alternative History Attacks
In alternative history attack, a transaction is sent to the merchant by the attacker [135,136]. In addition, a double spending transaction is included by the attacker in an alternative blockchain fork [137,138]. The merchant sends the product after n blocks confirmation. Therefore, the attacker tries to find more than n blocks. If the attacker succeeds, he gains his coins by releasing the fork.

Race Attacks
In the race attack, the attacker creates two transactions. The first transaction is sent to the merchant by the attacker [139,140]. This product is sent by the merchant without confirmation. Meanwhile, the second transaction is broadcast by the attacker to invalidate the first transaction.

Finney Attack
In the finney attack [141], two similar transactions i.e., one crediting the target and the other crediting the attacker are used by the attacker [142,143]. This attack mines a block which including the first transaction and delays publishing it. Meanwhile, the attacker mines the second transaction. When the attacker succeeds, he purchases goods with the first transaction. Then, he releases the pre-mined block which includes the first transaction. The attacker receives both goods and coins whereas the merchant finds their transaction invalid [144,145].

Blockchain Research Issues
We discuss blockchain research issues of different applications in this section.

Blockchain-Based Research Issues in Healthcare
Blockchain has improved the medical and smartphone applications but there are still some security issues as blockchain comes with potential problems. Any industry including healthcare that needs to use blockchain and its devices should train themselves in these areas to improve it. Such an education can improve patient-centered data [146,147]. The blockchain experiments in this research needs a patient to authorize himself before transferring a record and this could lead to threats. Key leakage and management is another issue that is not addressed. If a key is lost by a patient the data is difficult or impossible to be authenticated or recovered. A mechanism should be discovered for recovering data. Traditional blockchain cannot be enough in the case of large amount of patient's storage and sharing data so a double blockchain solution is presented by Lejun Zhang [148].

Blockchain-Based Research Issues/Future Work in Intelligent Transportation System (ITS) and Internet of Things (IoT)
An ITS aims to improve road safety and traffic management [149,150]. Vehicles share the information regarding their position, speed and direction etc. with other vehicles [151,152] as they carry sensing data via dedicated short range communication [153]. In ITS, nodes can communicate with each other via different blockchain apps at a large scale autonomously forming decentralized autonomous organizations (DAOs) or decentralized autonomous systems (DASs). Research is needed into the microscopic level of these autonomous agents. A concrete work is also needed in system modeling of self-adaptive, self-evolving and self-organizing DAO and DASs. Moreover, mechanisms should be designed for crowdsourcing incentives. There are more interesting issues in ITS such as credit evaluation of ITS assets and trust-based management which needs more efforts of research. Further study needs to be undertaken in smart contract-based ITS and data security and privacy issues to prevent the easier 51% attack in ITS. Blockchain can be explored more to incorporate with IoT [154] for improving security and privacy in various domains of smart application [155]. G. Ali [156] suggested a blockchain-based framework for access delegation in IoT which produces high throughput in the case of a large number of concurrent requests. Therefore, further investigation needs to be undertaken in such scenarios.

Blockhain Research Issues/Future Work in Real Estate
Private blockchain using smart contracts can be a best solution for recording transactions of real estate having high transaction fees [157]. Using resource information by a customer can lead to a conclusion about the business work of other customers. So a hybrid blockchain which includes both private and public best features can be deployed to audit the access of data as it provides the most authoritative system for the participating nodes [158].

Conclusions and Future Work
The paper discusses blockchain, its architecture and blockchain applications. The categorization of this paper provides an insight into blockchain technology along with its applications in different areas. We provide extensive knowledge on consensus methods used in not only cryptocurrencies but also in other areas like healthcare, intelligent transportation systems, supply chains, banks, education, and other areas. The consensuses discussed relate to permissioned as well as permissionless, private and public. This paper contributes to helping identify which algorithm should be used in which particular scenario. The paper has also explored some of the development platforms where re-searchers can get a benefit of using them according to their work needs. This survey also highlights some of the blockchain research issues in different applications as well as some common attacks. In future, studies can explore more consensus algorithms as in IoT, machine learning, intelligent transportation systems etc. Applications are not specific to those mentioned in this paper so more applications can be explored and added. Open blockchain-based research issues in academic subjects like software engineering, databases and networks etc must be considered.