{'fraction_non_alphanumeric': 0.021722587340020753, 'fraction_numerical': 0.0051539259771705296, 'mean_word_length': 5.152585656522664, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Approaches towards Blockchain Innovation: A Survey and Future Directions

A blockchain is a decentralized peer to peer platform which provides security services based on some key concepts, namely authentication, confidentiality, integrity and authorization. It is the process of recording and keeping track of the resources without the intervention of a centralized authority. This paper provides an overview of blockchains, the structure of blockchains, consensus algorithms, etc., It compares the algorithms based on their utility and limitations. Though blockchains provide secure communication, there are some minimal data leaks which are discussed. Various security issues in blockchains are discussed such as denial of service attacks, etc., In addition to security, some other blockchain challenges are presented like scalability, reliability, interoperability, privacy and consensus mechanisms for integration with AI, IoT and edge computing. This paper also explains about the importance of blockchains in the fields of smart healthcare, smart grid, and smart financial systems. Overall, this paper gives the glimpse of various protocols, algorithms, applications, challenges and opportunities that are found in the blockchain domain.


Introduction
A blockchain is a distributed data structure which is replicated on various nodes or various computer systems that are not linked based on memory addresses, giving a different notion of linking between nodes and each of these nodes is called a block. We can imagine a blockchain as a series of blocks where each block in the blockchain is connected to its previous block and so it is replicated all over the blocks. The fundamental benefit of this replication is that, on the off chance that one of the imitation blocks becomes corrupted, different reproductions are available to ensure that the honesty of the information contained in the data structure is maintained and furthermore replication gives one some sort of assurance of the trustworthiness of the data, conveyed as a guarantee that the distinctive PCs engaged in the blockchain platform are really running appropriate calculations to ensure the data consistency and fiability. The consistency of the data is maintained by a process called consensus. Consensus is that everybody agrees that the data that goes into the data called structure is what they agree to put there. For linking, we cannot use memory addresses, so we rely on the cryptographic technique called hashing. Blockchains use hash linking and the integrity of the data is thus maintained because of the use of cryptographic techniques and consensus and replication. Therefore, a blockchain is an information structure that is distributed, duplicated and maintains the integrity of data, i.e., the information cannot be altered. Another view is that blockchain is an immutable ledger of events/transactions, a log that cannot be changed by a malicious party or by mistake. Any tampering with the data is made virtually impossible. Figure 1 shows a step by step view of a blockchain. At first, a user requests a transaction. Once a request is made, a block representing the transaction is created, this block contain a timestamp, hash value, block version and data. Then, this block is communicated to every one of the other nodes of the network. Each and every node in the network validates the block and the transaction. Once the validation is done, the block is added to the chain. The main motivation is to distribute the computational task to all nodes, i.e., to create a decentralized network which provides more security.

Background Study
A blockchain is a decentralized computation and data sharing stage that empowers numerous definitive spaces, who don't confide in one another to collaborate, cooperate and coordinate in a normal dynamic cycle. Figure 2 describes the structure of a block. Each block is linked via a reference hash. The first block in a blockchain network is known as the genesis block. Each block in a blockchain contains a 4 byte Nonce which starts from 0 and augments in each hash task, the size of the hash value, current timestamp, and block version, of the previous hash value which is 256 bits and a Merkle root tree which contains all the hashes of the transaction. Each transaction in a block is checked and approved by so-called miners. To validate the transaction, miners employ an asymmetric cryptography algorithm such as a digital signature [1]. Blockchains are classified into three kinds based on their authentication and control mechanism: public blockchains, private blockchains and consortium blockchains, which are depicted in Figure 3.
A public blockchain is a decentralized and open source platform where each individual can join and perform mining autonomous of its organisation where the participants are resilient and anonymous [2]. Here the transaction approval frequency is too long. Energy consumption and scalability are high. This public blockchain is powerless against Sybil attacks since the members are obscure prior to mining. Proof-of-work (PoW), Proof of stack (PoS) and delegated proof of stack (DPoS) are few consensus algorithm used in public blockchains. Proof-of-work (PoW) consensus is one of the efficient mechanisms which can overcome this issue of Sybil attacks, but it is still vulnerable to applications which deal with voluminous data.
A private blockchain is a restricted controlled platform and only an authorised user can join and perform mining dependent on their organisation where the participants are trusted [3,4]. Here the transaction approval frequency is moderate, energy consumption is low and transparency and scalability are high. Practical Byzantine fault tolerance (PBFT) and Raft are some of the few consensus algorithms used in private blockchains. PBFT consensus is the most efficient mechanism which provides transparency in private blockchains. Private blockchains are suitable for banks and other monetary-related associations [5].
A consortium blockchain [6] is a blend of both public and private blockchains. Here the transaction approval frequency is short. Mining is done by a multi-signature scheme and validation is done only if it is signed by an authorized node. Though it provides high transparency and efficiency, it suffers from tampering attacks [7].

Blockchain Architecture
A blockchain is a peer-peer distributed ledger [8] which is a type of data structure that records the transaction of asserts and the details are recorded in multiple places at the same time. Figure 4 explains the detailed architecture of a blockchain [6,9]. Figure 5, explains its layers.

Data Layer
The information model captures the present status of the ledger, a time-stamped sequence of cryptographically encoded transactions. As a blockchain consists of a list of blocks, each block stores information which could be personal information, government information, a list of transactions that depends on the application. To secure this information hashing is done. Hashing uses different algorithms (such as MD5, SHA-256, SHA-512) to generate a simple hash key for the block data. The hash key is 256 bits though the input size is different. The reason for utilizing hashing is that in the event that anybody attempts to change the content of information, it will influence the hash value [10].
The primary motivation behind the information model is to epitomize the time stamped information block. In each block, confirmed transactions are stored which contain timestamps (time when the block was made) which empower situating and the recognizability of information. Metadata, Nonces, and Merkle roots are utilized to check the trustworthiness of information and the hashes of past blocks.

Network Layer
In a blockchain network communication is done between participants [11]. The primary obligation of the network layer is to confirm and advance the transaction along the network. When the transaction is done, this data is communicated to the adjoining nodes that confirm the transaction depending on a predefined determination. Once the verification is done the verified transaction is forwarded to other node or otherwise it will be discarded. In order to verify the transaction a digital signature mechanism is used [12]. Signing and verification are done using digital signatures. During the signing phase, a signature is generated after block creation using a private key. In the verification phase, the signature is verified using a public key. This layer provides a data verification and communication mechanism [7,13].

Consensus Layer
Since a blockchain a decentralized network, it doesn't contain any trusted third party to authenticate a node. To overcome this a consensus mechanism is used for decentralized nodes. Table 1 below lists a few consensus protocols for blockchains [14].

Incentive Layer
When a miner does the verification process and adds a block into a chain, that miner will get a reward for performing the verification task. Based on their contributions towards the validation process, miners will get incentives (such as digital currency) as rewards. This process motivates each node to contribute their power to validate the transaction [9].

Contract Layer
Here any type of programming code built into the blockchain is represented as a smart contract. Each node executes this code to update the ledger. A smart contract is a self-upholding understanding embedded in the programming code in the blockchain. Using this self-verification, self-execution and tamper resistance are achieved. Fewer intermediaries are achieved using smart contracts. Smart contracts can be written in any language depending on the need that fits a project. A smart contract development framework is used to deploy and test smart contracts. Table 2 below shows a list of frameworks used to build smart contracts [20].

Application Layer
The application layer consists of the user interface, scripts, and APIs that act as an intermediate step between an end client and the blockchain network. The end user initiates the transaction. There are various applications such as smart cities, IoT [4], financial applications, business applications and market security. Application layers use a software development kit/command line tool to communicate with the blockchain network.

Blockchain Applications
Nowadays, smart cities have become quite popular in many countries that are planning to implement this smart technology. For the implementation and deployment of this technology though we need high financial investment and skilled human resources, and smart cities face several technological challenges in security and privacy [21]. To implement and deploy this technology we need blockchain technology which possesses some features that provide effective solutions for the major challenges in smart cities. This blockchain technology is a decentralized network which eliminates single point of failure, offers immutability by using cryptography, and uses consensus algorithms for decision making process which leads to their democracy, while providing privacy for user identity by using pseudonymous addresses and also providing security and transparency. Because of these features this blockchain technology is used in several democratic cities [22]. In this section, existing blockchain works are explained from various points of view.

Smart HealthCare
Smart healthcare is the technology that uses IoT devices to monitor patients and provide services [23,24]. These devices gather patient data such as heartbeat rate, glucose level, pulse, blood pressure, etc., and administrators monitor and gather this data and produce reports, were each report is investigated by a specialist who can suggest a treatment [25,26]. This report is shared on the network in an encrypted format and stored it in a cloud platform, and when the patient requests the cloud service provider to access this report then the encrypted file is transferred to the patient. By using this setup hospital expenses are reduced and they provide timely treatment for various health conditions [27,28]. To secure this patient records blockchain technology is used so as to guarantee their transparency, privacy and security [21].
Mettler et al. proposed a blockchain technology against falsifying the medication in public medical care boards based on Ethereum which results in tamperproof information audits and secure information access, yet at the same time it isn't appropriate for an enormous number of clients. To address this versatility issue in health services Zhang et al. have proposed a DApp which ensures transparency and security but doesn't ensure information accessibility and distance access. Yue et al. proposed a medical care information entryway which gives regulatory and legal provisions in health care systems but doesn't thinking about the incentive mechanism. Zhang et al. proposed a blockchain innovation for information sharing and to build up secure connections to access healthcare data, yet this framework doesn't ensure tamperproof information. Wang et al. used a consortium blockchain for data access but it has vulnerability in data integrity and scalability. Ismail et al. proposed a PBFT algorithm for a healthcare network, this avoiding the forking problem but real implementation is not yet been done. Jiang [29] proposed BlocHIE, a blockchain-based healthcare information exchange system using two approximately coupled blockchains to deal with various medical care information situations while providing privacy and authentication services. To improve the system throughput two fairness-based packing algorithms are proposed.

Smart Transportation
Smart transportation uses IoT devices which gather data like toll systems, traffic management, vehicle tracking, vehicle to vehicle communication, etc. Applying blockchain technology to a transport system provides efficient data processing, privacy, network monitoring and secure service delivery to end users. Li et al. [30] proposed this blockchain technology for transportation systems to provide security and privacy. Knirsch et al. proposed blockchain-based four phase protocols for charging EVs utilizing bitcoin technology for data identified with charging station offers; although it provides transparency it is not reasonable for huge arrangements of information. Zhang et al. [31] proposed a consortium blockchain-based plan utilizing a PoW algorithm to improve electricity trading in vehicles for enhancement, but the adaptability was not completely clarified. Sadiq et al. [32]

Smart Grids
Most of the countries like the UK, use the electrical grid for energy distribution between networks [34]. It interconnects the generating stations to end users using a transmission and distribution system. Here a centralized power generating station is used to feed power into the grid so as to supply energy to customers. Forecasting the load depends on time slots. The load will be different based on the time slot. To monitor the load demand a separate team is used. When there is a sudden change in load it may lead to changes in frequency and voltage which result in problems like brownouts. When the load demands an increase in one area, they need to cut-off the essential loads and provide supply to that particular area, due to this load shedding a problem may arise To overcome such issues, smart grids have been introduced which are advanced electricity generation and delivery systems. These systems are properly managed, monitored and metered. Here lots of data is exchanged between customers and the electrical end. This system is a bidirectional data communication system, which balances the supply and demand and provides stability and safe system. This system uses sensors, smart meters, artificial intelligence and wireless communication to provide a stable system which is an effective use of renewable energy. Since the data is exchanged between nodes, security and privacy need to be considered.
Blockchains take the smart grid concept to next level to provide security and privacy. Here the measure of energy abundance is shared or offered to the electrical grid. By doing so the power lattice pays a certain measure of cash for individuals who contribute energy. Blockchain innovation is utilized to get this exchange log. By utilizing certain agreement calculations it shields the information from weaknesses [35].
Guo et al. [36] proposed a PoW consensus mechanism with stacks to high latency in traditional methods under a blockchain-based electricity trading ecosystem. Samy et al. [37] proposed a protected blockchain model utilizing a PoW algorithm to secure the information created by smart meters. This framework ensures information uprightness and classification however it doesn't ensure information flexibility. Muhammad et al. [38] proposed 6G-enabled smart grids to prevent cyberattacks. Niloy et al. [39] utilized a microgrid framework for customers to transfer energy to the grid in an appropriate adjustment of energy utilization through the use of renewable energy. Tao et al. [40] proposed a multi-microgrid strategy to optimize the load, improving economic and environmental protection, speed and accuracy. This framework also guarantees security. Ayaz et al. [41] proposed a proof of quality factor-based blockchain model for vehicular message scattering which reduces validation process failures.

Financial Systems
Blockchain technology is used in financial systems to secure transactions between two people in a decentralized manner. In a decentralized system we need to preserve the privacy of the customer and we should also maintain security for the transaction data.
Utilizing blockchain innovation, an agreement is first sent by the payer to the bank, and afterward this agreement is forwarded to the arranging bank. This arranging bank in turn sends an encouraging letter to the payee requesting affirmation. Presently the payee sends the archive to the arranging bank which is sent to the bank. This archive is delivered to the payer who can utilize it to start a smart agreement with the payee. In this way a protected exchange is done between two individuals utilizing a blockchain.
Chen et al. proposed a BPCSS for secure exchange between stock stores and clients utilizing bitcoin innovation. This framework empowers straightforwardness and dependability of the framework yet doesn't recognize deceitfulness assaults. McCallig et al. incorporated conveyed capacity with network examination and multiparty calculation to guarantee straightforwardness and to decrease the office cost of monetary announcing frameworks. Kabra et al. incorporated staggered confirmation, a QR age strategy and two factor verification conventions by utilizing PoA calculation for consistent progression of activity without including any delegates. Gao et al. organized a back proliferation neural organization, with PSO and SVR calculation to update fitting effects on yield rate assumptions.

Security Attacks in Blockchain
Security and privacy play a major role in blockchain technology. For example, if you take smart cities which are an emerging platform to provide high quality facilities to people by optimising the resources, smart cities develop the daily life of citizens in aspects like transport, health, education and energy consumption. Smart technology should have good properties like transparency, decentralization and immutability while using this blockchain technology. Security mechanisms in smart cities should focus on communication, monitoring and response, booting, updating and patching, authentication and access control and application protection. To address these security issues in blockchain technology, the paper explains a few security attacks that can threaten blockchain technology [42]. Blockchain technology faces many security issues based on technology. Here we categorize these issues into five attacks as described in Figure 6.

Blockchain Network Attacks
Blockchain networks are made up of nodes which create a transaction and provide necessary services. For example, if you take a smart grid, each home network will have a smart meter which stores the history of transactions it made; it can also add a new transaction into the ledger. For the energy exchange process each node sends and receives a transaction and miners will add and approve the transactions. Here, cybercriminals seekfor network vulnerability. DDoS attacks try to disconnect a network mining pool, bringing down a server. In 2017, Bitfinex suffered from a DDoS attack [43]. Transaction malleability attacks will try to trick the victim to pay twice for a transaction. The Mt. Gox bitcoin exchange went bankrupt in 2014 at as result of a malleability attack. They solved this problem by introducing a segregated witness process. In timejacking attacks the hacker modifies the organization time counter of a hub and power of the hub to acknowledge the transaction. This will add fake peers to the network. Routing attacks will tamper with the transaction in ways which will be difficult to detect. These attacks may partition the network or tamper with the messages [44]. During Sybil attacks, the victim is surrounded by fake nodes; during verification the hacker takes control of the network mining, which may lead to double spending attacks [45]. Eclipse attacks will take control of IP addresses.
Here the attacker will overwrite the address and wait until the node restarts. Long range attacks on PoS networks copy the transactions of authorized nodes.

User Wallet Attacks
The user wallet is the main target for a hacker [46]. Here the attacker seeks weaknesses in the cryptographic algorithm. In 2018 wallet hacking was done on the IOTA wallet. In a dictionary attack, the hacker tries to find cryptographic hash values such as user credentials, and also vulnerability in the cryptographic signatures. Defective key age is powerless in key age; here the programmer gains admittance to private keys. Attacks on cold wallets lead to access to the private key as well as PINs. Attacks on hot wallets are also possible where all the keys are stored in internet-connected apps.

Smart Contract Attacks
Smart contract attacks are related to bugs in the source code, runtime environment, and virtual machines [46]. If there is a vulnerability in the source code, such as bugs in an Ethereum contract cost, there is the possibility of delegating control to an untrusted function. Vulnerability can also occur in EVM when a smart contract is executed. Here bugs in access control, immutable defects, and short address attack will occur [46].

Transaction Verification Mechanism Attacks
Double spending [47] is the common transaction attack which occurs during the verification process. It is an act of spending the same digital currency twice by creating a fake transaction. The majority of these attacks occur in a situation where a miner owns over half of all the organization's hash power, which in turn may act maliciously and lead to vulnerability of the network [46,48]. This attack can double-spend your money or prevent the transaction from being confirmed, but it cannot create a new account, cannot steal funds, reverse transactions or create false transactions.

Mining Pool Attacks
In blockchain technology it is impossible to earn profits, so the miners use their computational power by creating mining pools. If the miners create more blocks they will receive more rewards [46]. For example, BTC.com, AntPool and ViaBTC are the largest bitcoin mining pools. Vulnerability is also present in mining pools; these are a few attacks that can occur in mining pools like selfish attacks and forks after withholding. [49] In selfish attacks the miners increase their reward but they don't broadcast the mined block, then after some time they broadcast the blocks in network at once and make other miners lose their blocks. This attack can be prevented by adding trusted miners [50]. Table 3 explains the various attacks in blockchain such as its types, impact and solutions.

Challenges
The major challenge in blockchains is how to maintain security and privacy [42]. One of the main issues when maintaining security and privacy in blockchain networks is that the users in such network could be someone who uses a false name and cannot be identified by name. With the straightforward idea of blockchain technology, this prompts following of user exercises and again admittance to privileged insights. Therefore, in blockchain the main challenge is how to ensure anonymity [57].
Most of the applications in blockchains use cloud services for storage due to the need for large storage capacity and computational resources [58]. Several centralized data storage schemes has been proposed, still there is a vulnerability to DoS attacks and the untrusted nature of cloud service providesr leads to the proposal of a blockchain-based decentralized storage scheme. Chavan et al. proposed a decentralized token system by using proof of retrievability to file storage and earning digital coins for contributions. Ruj et al. proposed a decentralized storage framework to ensure higher transparency and security. Here, free storage space in a wallet is assigned for rent. Though there are many schemes for decentralizing storage systems, they suffer from trust, privacy and security issues.
One of the most serious issues in blockchain technology is how to reduce the energy costs. Several consensus algorithms are used for security purposes, but some consensus algorithms still do not consider the energy efficiency issue. For example if you take a PoW consensus algorithm, it requires more energy to solve mathematical puzzles and its complex computational calculations. Thus this consensus algorithm is not an energyefficient approach. However if one considers less computationally expensive algorithms like PoS, PBFT and DPoS, though they require less energy they are reasonable for enormous scope frameworks. A new algorithm proof of trust has been proposed to address this issue but still it needs to be investigated [59].
Due to the enormous number of data formats involved in blockchains the implementation of interoperability is a challenging task nowadays [60]. This complexity of implementation is increased further due to the different consensus mechanisms used by blockchain systems. For example PoW algorithms use Ethereum and PBFT algorithms use hyperledger, and these two mechanism cannot be synchronized, thus interoperable blockchain systems need to be developed.
Decentralizing the blockchain platform is also one of the major issues to be considered [61]. For example, if you take cryptocurrencies many countries have banned their use due to regulatory issues. Here in blockchain technology different unstructured data formats are generated, and stringing this type of data into a blockchain is not an effective approach. Regulatory rules to be ensured in blockchains for data integrity [62].
Supply chains in blockchain platforms are also one of the major issues to be considered. Jiang [63] explained critical challenges in supply chains in terms of versatility, throughput, access control, information recovery and surveyed the promising arrangements [64]. Table 4 explains the current issues in blockchain technology and what needs to be investigated in the future.

Conclusions
Nowadays decentralized computation and data sharing systems are quite popular for many new technologies. This challenge can be addressed by introducing blockchain technology which has properties like decentralization, immutability, transparency, and auditability. In this paper, blockchain-related consensus algorithms are explained along with their benefits and also the security issues related to these algorithms. The main motivation behind this work is to apply this technology to the realm of smart cities, expllaining the impacts of applying consensus algorithms in smart cities. Based on the survey it focuses on future challenges that need to be investigated. Further, this paper audits the utility of blockchains in smart innovation applications like smart grids, financial systems, transport and healthcare. This paper also explains the various attacks that may occur in blockchain networks. Overall, this paper gives the brief look at the types of blockchain, various protocols (consensus algorithms), applications, difficulties, attacks and recent research challenges in blockchain technology.
Author Contributions: All authors contributed equally to this work and were involved at every stage in its development. All authors have read and agreed to the published version of the manuscript.
Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflict of interest.