Keywords

1 Introduction

In the past few years, there are many social, environmental, and economic issues that arises due to the quick urbanization of the population of the world. These problems influence the living conditions of people and life’s quality significantly. These problems can be resolved by an idea of a smart city. The primary goal of smart cities is the proper utilization of the resources of the public, provide high quality services to citizens, and enhancing the living standard of people. The Information and Communication Technology (ICT) plays a major role in developing the concept of smart cities [1].

A smart city is vulnerable to many security attacks due to the nature of smart devices. It is very necessary to design the secure system to spot those threats and their effects. In this field, many research has been directed like OWASP (Open Web Application Security Project) enlisting generic security attacks, CERT (Computer Emergency Response Teams) giving the probable penetrability in the graphical form, CCSP (Cloud Computer Service Provider) series of G-Cloud is for cloud security. In Smart cities following categories of threat are recognized.

  • Availability Threats

  • Integrity Threats

  • Confidentiality Threats

  • Authenticity Threats

  • Accountability Threats.

The future technology such as blockchain has varied characteristics like trust independence, democracy, transparency, automation, security, pseudonymity, and automation. These characteristics are very useful for enhancing the services of smart cities and support the evolution of smart cities. Enhancing data security is the key benefit of using blockchain technology. In the world of data, security is the most crucial aspect that needed to be focused by all organizations or institutions. Blockchain technology is capable to solve these issues so the deployment of the mechanism of the blockchain is the solution to these problems [2]. The Effects of blockchain on data security are as follows:

  • Considering whole protection: For preventing the data from data-modification attack, blockchain technology is used for encryption of data. The blockchain stores the document as the cryptographic data. This confirms to users that the file is immutable until requesting to save the entire document in the blockchain. The Cross verification of the signature of the file is done by all the blocks due to the decentralized nature of blockchain. If the unauthorized entity tries to modify the file then verification of the signature will fail. The method for authentic and free data verification is undoubtedly given by blockchain. There is no possibility of failure in blockchain technology and cannot be settled by any system because blockchain does not store the record in any central location. The decentralized and scattered ledger of blockchain network modernize regularly in a proportional way. Hackers can fetch all information from a single system or server and attempt to deal with it in traditional networks, which is not possible with networks of blockchain.

  • Decentralized procedure: Blockchain is decentralized in nature so it is independent of any centric authority. Every node preserves an integrated copy of information due to the use of a digital ledger. There is no central control point so the system is suited as extra impartial. For the validation of transactions, various kind of consensus processes. Because it is independent of any middle authority for controlling transactions securely and data are stored in several nodes. Even after failing one or more systems, this technology is intensely secured.

  • Communication environment Effects: The blockchain-based environment of IoT is dependent on the techniques of encryption for delivering security when installing consensus on a distributed environment. If anyone wants to append something to the chain then he/she has the allowance to append a block in the chain. Its mechanism complies with an algorithm and instead requests the use of computing power in excess. For example, the power of computation required for implementing the tasks of networking consumes an equal amount of energy as required by the 159 countries in the bitcoin network in comparison with the previous year. It is dominant to about the need for energy in blockchain deployment in the environment of IoT.

  • Cost factor: Cost is another important challenge in the IoT environment based on Blockchain. Blockchain programs are not effective in the transaction’s accomplishment and the need for components related to energy. For example, the program of bitcoin implements 3–5 transactions in one second and requires a large amount of energy for competing for these transactions while Visa executes transactions about 1,667 per second so it is worst in the performance on comparing with other platforms, therefore the Very high cost is required for establishing the IoT environment based on Blockchain. We cannot spend a huge share of the country’s budget to secure certain computing infrastructure. The budget is very high so only some countries have the economy for supporting these types of schemes of communication. We are required to develop effective methods for their deployment in the IoT based on the blockchain so this is one more problem for the working people of the same domain.

  • Loads from technology blockchain: Blockchain technology is deployed with the dispersed ledger and the algorithms of cryptography. For operating the transaction more resources and time are needed in the transactions of blockchain. To secure the exchange of information is the main aim of the IoT environment based on blockchain technology, this can be done via the deployment of the mechanism of blockchain, but the transaction processing time in the blockchain is extra. Fast data communication is the main need in some domains like healthcare, battlefield, and rescue operations. If the information exchange and processing require more time then the Conscious recipient will not obtain the information in the required time so the concerned authority will not be capable of decision making in the required reaction time. Convenient cryptographic operations required a low cost of communications, computation, and storage for transaction processing, so the use of Convenient cryptographic operations can be used for resolving those problems [3,4,5,6,7,8].

The key contributions of this chapter are as following:

  • In this chapter a state-of-the-art about blockchain technology and frameworks are presented along with protocols, applications, and challenges.

  • This chapter have illustrated the application of blockchain to facilitate security in smart cities such that it improves the performance.

  • This chapter also surveyed application of different blockchain protocols in different sectors of smart city such as healthcare, industries, energy generation, industries, etc.

  • This chapter also surveyed the security aspects of existing techniques and illustrated their challenges faced. This chapter mainly aims to identify the open issues and challenges faced while deploying blockchain as a security solution.

  • This chapter also proposed the blockchain-based framework is proposed for smart cities to incorporate with security issues and provide a trusted environment for user data transactions.

  • In last theoretical comparison of proposed framework is given with existing works that would be beneficial for future research directions.

The remaining section of this chapter are illustrated to be as follows: Sect. 2 introduced the background knowledge of blockchain technology along with that their types, working steps, and protocols are discussed. In Sect. 3 chapter gives an overview of smart cities. Section 4 gives an overview of security issues and challenges faced in smart cities. Section 5 gives an analytical overview about the implementation of blockchain in different applications of smart city. After observing the issues faced during the implementation of blockchain in smart cities, Sect. 6 proposes an architecture to handle security issues in smart cities. Finally, in Sect. 8 conclusion and future research scope are discussed.

2 Overview of Blockchain

In the current time, the living standard of our society has been revolutionized by the latest technologies due to the innovation of semiconductor and communication technologies that allow the devices to link with each other over a network and change the way of association between machines and humans and that concept is Known as IoT. Due to the rapid growth in smart devices and networks with high speed, IoT is in the trend and wide acceptance because low-power lossy networks (LLNs) are used in it. These LLNs can operate the limited resource by very low power consumption. The devices may be remotely controllable to complete the specific task. The sharing of data between the devices is done with the help of a network that employs the communication standard protocols. Properly connected things such as devices have sensors (Detectors) and chips so they differ from simple wearable equipment to large machines [9].

Yet, as the technologies become prevalent the connectivity between devices is enhancing, and also the infrastructure can become very complex. The cyber-attacks vulnerabilities are increasing due to this complexity. The physical devices are stetted in the unsecured environments in the IoT, which could have no defense method from hackers is a great chance for hackers to change the facts transmitting on the network. So, the authorizations of devices and the information root would be a big problem. In the last few years, blockchain technology becomes a technology with many features to solve the different issues of network devices of IoT [10].

Blockchain maintains the database of records that are distributed. Third-party deprive properly, the demonstration of effort between the nodes of network help in resolving the failure problems of a single point. The public trust and get attracted to the IoT network because It’s data cannot be changeable over time and established by the history of networks of IoT. The trust of the public have a very important role in public finance transactions and is the starting of the new world of the divisional economy in the domain of IoT. The blockchain is the series of blocks that hold all the eventful blockchain network transactions. Each block has a block header and block body transaction counter.

Block header contains the following.

  • Block version for indicating the version of software and rules of validation.

  • Merkle Tree root hash for showing the transaction’s hash value and all transaction summary.

  • The timestamp contains the current universal time since January 1970 that is epoch time.

  • N-Bits represents the bit number necessary for verification of the transaction.

  • Any 4-byte number, starting from 0 and rise for every hash of the transaction is known as Nonce.

  • The parent block kept the hash value to point to the previous block.

The Transaction counter is efficient to cover all the transactions and the highest number of the transaction depends on the size of the block. Blockchain technology is defined as the public registry and the list of blocks that records all the completed transactions. The list of blocks increases on adding the new block in the list continuously. For the security of the user, Public-key cryptography and distributed consensus algorithms are implemented. Persistency, anonymity, and audit ability are the key features of blockchain technology used for enhancing efficiency and saving cost [11].

2.1 Types of Blockchain

Public blockchain: It is the system based on the permission-less, non-restrictive dispersed ledger. Anyone can access the blockchain platform via registering and signing in with the help of the Internet. A node (user), who is an element of the public blockchain has the authority to influence records, confirm the transactions, and arrange the mining for the new incoming block. The exchange of cryptocurrencies is the primary use of public blockchain. If the users adhere to the guidelines of security the public blockchain is mostly secured and very risky in the case of users who do not adhere to the guidelines of security. Ethereum, litecoin, and bitcoin are some famous examples of public blockchain [12].

Private blockchain: It works only for closed networks because it is a blockchain with restrictions or permissions. Mostly it is used in the companies or enterprises of selected participants. Authorizations, accessibility, and security are some dominant features used as a command for organization controlling. A private blockchain is similar to a public blockchain, but it has a small or restrictive network. Private blockchain Deployment can be done for performing some fixed operations like management of supply chain, ownership of assets, and voting. Projects of hyperledger and multichain are the example of private blockchain [13].

Consortium Blockchain: It is semi-decentralized so the network of blockchain is managed by many organizations. A private blockchain is operated by only one organization so these both are different in the term of management. In this blockchain, many organizations work as an authority for exchanging and mining the data. These are used in the govt. Companies and banking sectors. R3 and web foundation of energy are some consortium blockchain examples [14,15,16] (Table 1).

Table 1 Comparison of blockchain types

Hybrid Blockchain: The combination of the public and private blockchain platform is represented as the hybrid blockchain. The characteristics of both are appealed in this platform like users can have a “public permission-less system’’ and ‘‘private permission-based system’’. In the platform of hybrid blockchain, users can be capable to control the acquirement of blockchain stored data. Only Some selected data are publicly accessible and the rest data are kept secret in a private network. It is a malleable system so the merging of private blockchain in several public blockchains can be done by the user easily. The certain network will verify the transaction of a private network in the platform of hybrid blockchain and users can also discharge these transactions in public for the process of blockchain. More verifications requirement and an increase in hashing are done by the platform of public blockchain so the transparency and security of the blockchain network get enhanced. Ex of hybrid blockchain—‘‘Dragon chain’’.

2.2 Working Steps of Blockchain

Nodes communicate with the network of blockchain by compositing private & public keys together. The User for signing his transaction uses his private key and access the network with the public key. Each signed transaction is transmitted by that transaction making node.

All the nodes expect the transaction-making node to verify that transaction in the blockchain network and all the invalid transactions are rejected during this process and this entire process is known as the verification process.

The third step is mining in which every effectual transaction is gathered by the nodes of the network in a fixed time into the block and for a finding of its block, a proof-of-work is implemented. The node transmits the block to all participating nodes after finding the nonce.

A newly generated block is collected by each node to check the block contains transaction is legal and declares the efficiency of the parent block by using the hash value. Nodes will append the block to the blockchain and apply the transactions After the completion of confirmation for keeping the blockchain updated. The projected block is refused and the current mining round ends if the confirmation of the block failed.

Blockchain technology resolves issues of duplication by using the asymmetric cryptography assistant, which has privacy and a public key. The public key is common among all nodes while. The private key remains secret for other nodes. Yet the transaction is signed by a node digitally that makes the transaction and is transited to the whole network of blockchain. All the Accepting nodes will confirm the transactions by signature decrypting with the initializing node public key. The verification of the signature represents the modification in the initializing node.

2.3 Protocols

Proof-of-Work (PoW): The process in this case precisely monitors the node that is intended to be attached with the block that has been recently mined and further with the actual chain that commits the presence of certain proof for such conjunction. This process or architecture works on certain proof-based scenario [17]. The broadcast of blocks by the nodes or collection having equally verified transactions, an ambiguity pops up then the transaction will be put into a block by the node. PoW resolves this matter where the computationally tedious puzzle is solved by nodes for the sake of receiving a chance of linking the freshly constructed block to the existing chain. The hash value of all the entities of a decentralized network is required to be calculated on regular basis through the assistance of various arbitrary values known as ‘nonce’. Because of the struggles levied in the prediction of hashing function based outcome values from the set of predefined and existing input variables that shall allow guessing of an improved one has been a complicated task to be executed. As the nonce that is desirable has been achieved, the respective block is being broadcasted by miners to verify the solution it is employed by all other network nodes. When the block is approved by all the blocks, it is linked to the existing chain. To guess a suitable nonce value the effort applied by the nodes is called the PoW.

Addition to this, there are many such situations when numerous of miner resolves the puzzle as well as discovers the nonce [18]. In this condition, the block is tried by these miners to broadcast as well as nonce is calculated in the complete network. An ambiguity amidst the miners is the resultant of this network that block must be desired and attached to the current chain that comes out as a “forking problem”. The generation of a fork or branch is done for the reason being that only the initial first block is verified by the miners and rests are ignored. For handling the forking problem effectively the longest chain rule is employed by PoW.

The entire scenario may result in circumstances where the nonce finding is achieved by the miner by undergoing the solving procedure number of puzzles at the same time [18]. During the situations described above, the main function of the miner is directed towards broadcasting their block in combination with the nonce that has been determined to the complete network architecture. However, there has been certain vagueness and ambiguity amongst these miners arising due to multiple broadcasting phenomenons where it faces a problem with the decision-making process of which block has to be considered for the addition to the chain present that is often referred to as the “forking issue”. The reason for the fork formation is the first consideration of block by the miners and neglecting the remaining others. The forking problem has been tackled by the PoW via the longest chain rule mechanism.

Proof of Stake (PoS): The PoW based energy competent alternative is the PoS where the miners are assigned to work for the block creation that shall be beneficial in attaining the system hold properly; rather than misspending the computational resources in resolving a complicated mathematical puzzle [19]. The wealth of contributing nodes or their stake in the system is completely responsible for providing possibilities to receive a moment for block validation. Moreover, an abundant stake reduces the chances of any hostile or ill activity that can occur on the network. The selection of a validator is done to consider its hold in the network and this stake helps it to place a bet. When the block is successfully approved, then a fee is received by the validators. Because of the ability of PoS in providing latency, better throughput energy efficiency, it is considered to be imperishable in comparison to PoW. Apart from this, PoS has many shortcomings. At first, the nodes with more wealth might get more block validation chances because validators are selected which is mainly dependent on the stakes and their values. The few nodes are being directed, as per the situation, for governing in the network so that it results in centralization or ill interference. And it has less mining cost use in comparison to PoW which makes this consensus protocol susceptible to ill activities.

Proof of Burn (PoB): PoB designing has been achieved to devastate the cryptographic forms of money. The entire process has been designed in two major forms were first being the cryptocurrency address generation attained by a certain programming algorithm that completely crushes the money received in the produced address. Another way of destroying the unauthorized currency is by generating a function that is dedicated towards verification of the addresses where the currency is received in crypto. The PoB validators are being rewarded and are even permitted for separate block generation for the events where they can spend the coins by transmitting them to the addresses that are found to be completely public and verified. The process of the PoB is found to be beneficial in handling the coins in the blockchain along with tackling the energy consumption-related problems with the PoW whose result is an increment in the value of the coin. The important tasks associated with the burning system of coins is maintaining a balance of the coins, coin spending if they are unsold, and most importantly including the transaction work.

Practical Byzantine Fault Tolerance (PBFT): The design of the Byzantine Fault Tolerance (BFT) is so achieved that it helps allow the secure transfer of the consensus across the two communicating hubs/nodes despite the presence of certain malfunctioning vindictive hubs/nodes across a certain distribution network. A certain example of the BFT is the PBFT which is an algorithm of replication that is being designed to serve as a consensus protocol. The arrangement in the algorithm of PBFT has been done by the arrangement of nodes in sequential consecutive order and declaring one as the leader with the other as the backups. The functioning of receiving the signal is done by the leader which further transfers it to the backups that undergo processing mechanism and further generate the result to be sent to the originator via leader. Each node in PBFT contributes to the decision in PBFT which depends on maximum votes by nodes which determines the integrity and the origination of the message. In three phases the whole process of PBFT is determined, namely pre-prepared, prepared, and commit. The movement of a node in the network to the next phase is determined by the votes received from two-third of all the nodes. PBFT consensus mechanism is enabled to run efficiently though there is a presence of some malicious byzantine replicas [20] (Table 2).

Table 2 Comparison of blockchain security protocols

Proof of Authority (PoA): The designing of PoA has been done as a genealogy forming associations with the protocols for the consensus which are constructed specially for permission blockchain. It gains remarkable execution achieved as it was seen capable of producing messages that are lighter for sending over the network when compared with the BFT algorithms. The algorithm of the PoA has the benefit over the PoW consensus algorithm in terms of reduced dependency as well as a reduction in energy consumption. Certain nodes are equipped with authoritative control all across the other nodes that shall assist in the creation of consensus and new block construction [21].

3 Smart City: An Overview

The population of world living in the cities will be growing up to 50–70%, till the year 2050. The requirements for services are increasing on increasing the population so it is necessary to contemplate the scheme of smart cities taking ICT (information from communication technologies). Smart-cities are implemented by uniting the sensors, networks, electronics, etc. Latest ICTs are dominant for smart cities including smart hospitals, technologies of smartphones, Identification of ratio frequency, artificial intelligence, cloud computing, and infrastructure of IoT.

The network of IoT [22, 23] consists of objects engrossed with electronics, smart sensors, software, and connections among them for exchanging and transferring information. Smart cities based on IoT provide services to administration and the public like smart-homes, surveillance systems, vehicular-traffic, smart-parking, smart grids, smart energy, ecological pollution, and climate systems. Due to the intercommunication of the physical and virtual worlds via electronic devices in houses, buildings, streets, and vehicles. At the current time, There are many problems [23, 24] in establishing the infrastructure of IoT in applications of a smart city. Sensors are constituted to cloud in the architecture of a smart city for inspecting the streaming data for decisions making. The paradigm of cloud computing and IoT works to give information and inputs to tasks for getting executed by mobiles, integrated sensors, vehicles, and humans (Fig. 1).

Fig. 1
figure 1

The architecture of smart cities

Qian et al. [25] proposed a framework for Hybrid IoT for computation, proper transmission, and caching of big data provoked by substantial and scattered devices of IoT fixed in the environment of smart cities. The Computation is based on Ultra intensive networking along with providing cloud access for multiple uses. The idea of smart city endorsement is necessary to utilize the control layer of medium access. The research conducted by Fan et al. [26] has focussed on the produces of the random number along with the quadric- residuals, for attaining the cloud-based complete security system that could be further deployed in the healthcare sector. Further, the work by Garg et al. [27] offered a stream for monitoring the transportation framework. They solve the security risk problem in spatial vehicles with the help of run time applications and varying tiers based analytics and calculations. The smart city project may encounter the cyber vulnerability that has been proposed to be solved by the prospective approaches linked with the data structure model to carry out the recognition of such threats. The data has been provided by the ultra spatial vehicles that tend to procure the information from various vehicles and the task of security has been achieved by the aggregators on the time of receiving of data by the edge devices by the transmission of the load. The work by the author however guarantees security during the vehicle's abnormal movements as well. The work on the architecture of the drone and its security issues are being dealt with by Lin et al. [28] whore research is directed towards the working of an unmanned vehicle operation. The issues of data security, its integrity, and the process of accessing it, has been solved by the simple cryptography procedure. The energy-saving problem associated with the smart cities development program shortly has been brought up by Kumar et al. [29]. They have used an infrastructure based on the cloud for decisions making to scrimp the energy for various devices. They aim to reduce the main grid overload by providing the capacity of continuous DC To all the machines of low voltage and having less support on the main grid. The process of development during its peak energy requirement is being analyzed and solved, by making the system more continual to tackle the energy demand evenly. Dener [30] inspected various researches for defining the importance of cloud computing in giving the application of computing, storage, numerous, and database for internet accessibility. These services given by the cloud are used for combining and transferring information among various smart city systems. Further, the research done by Khattak et al. [31] resulted in the development of a model for integrating clouds of vehicular-networking with IoT. The article properly describes the importance associated with the applications of the real-world that includes the formation of smart homes, smart city, and smart lighting of traffic for robotization and simple controlling and its combination with IoT-VC. Daniel et al. [32] offered a policy of management for maintaining small operational latency up to possibility and reducing the latency of the request in the architecture that employs the IoT mechanism linked with the server on the cloud itself in the development of smart cities. The main research is being focused in the article is on the parameters that included the rush hours, outages along with the probability factor that has been considered on periodicity for demonstrating the latency factor of the operation that is found to be small in the contest without any reason to inspected articles. Perera et al. [33] describe the requirement of fog integration and computing on the cloud. In contemplation of characteristics and main advantages of computing fog like higher availability, management of latency, reducing the priority-based big data that hold up the use case scenarios. The sustainability for IoT based smart cities are suggested by the author. Kaur et al. [34] offered architecture that focussed on the development of smart cities by making use of the IoT platform along with the cloud servers. The research article depicts the usage of the IoT framework to bring about an enhancement in the performance of smart cities. The key framework adopted in the methodology selected the cost of the infrastructure and the investment capital as its objective function to be minimized. The Dubai smart city case study is taken by the author with some scenarios based on applications and offered healthcare architecture in a smart city. The work done by the article written by Elhoseny et al. [35] learning approach has been deployed to develop the smart city project. It is feasible to alter the method of learning to advanced technologies i.e. internet of things, big data, and cloud, but making the system of smart learning is the very problematic task of smart cities. The author offered the big data-based model of smart learning that is capable to work in the environment of the smart system. Massobrio et al. [36] proposed an inspection of the smart city-based big data with the help of the infrastructure of cloud computing. Hadoop framework is used for implementation and use of map minimized parallel model. The key focussed area is anticipating the matrix linking the origin to destination services as well as public transport services.

4 Security and Privacy Issues in IoT

In the present century ‘The Internet of Things (IoT)’ is considered as a technology having much disruption. It is also like the incursion of devices for the city to make it smart which are further integrated with the servers on the cloud for monitoring the functionalities comprising of the system software and applications that are programmed to collect the data and deliver it to the servers. The conclusion that can be made about the IoT is that it can work on the platform of the internet whose infrastructural overview has been shown in Fig. 1. The platform of the internet offers the facility of locating the device easily and IoT is considered to be well supplied with low power, the storage is also limited and restricted processing capacity. There are gateways in IoT employing the connection and linking of various devices with the servers and cloud on the internet and are programmed to communicate with each other during operation. The linking and shrinking of the world into a small village has been gained with the help of IoT, smarter, and therefore extraordinarily effective. The sensors having a cheap rate and this linkage between “things” produce much more data than they produced ever. In this way, the information carried by these data creates an analytical as well as smart environment. Like, analyzing the data accumulated for providing every individual customized service. The IoT has attracted the attention of researchers as well as industries and thus experiencing extreme growth. Famous and successful corporations like Amazon AWS IoT and Google Cloud IoT have invested billions of dollars in the construction of IoT platforms. IoT has brought much ease to governments as well as individuals; likewise, the handling of the enormous number of devices delivering consequently enormous data on the cloud becomes an uphill task as they are interlinked with a grid of complex connections. The hackers could try to perforate the vast range of IoT devices. In this way, in the system of IoT, the hackers can target the devices that have low security as well as the linkage between smart devices can be. Besides, if the generated data is not stored appropriately then there is much chance for the exposition of privacy of the user and so becomes a matter of concern. There is a threat of safety in IoT like in the year 2016, a company named Dyn has focussed on the development of certain thrust that deploys myriad devices performing interlinked with the online internet platform such as monitors, routers, and cameras. The service was referred to as a distributed denial of service (DDoS). In an IoT system security is the most desirable properties therefore it must be carefully considered [37,38,39,40]:

Data Integrity: The production of the data by IoT systems of any company is of great worth which includes trade secrets that are vital for the prosperity of the company so that confidentiality is maintained from outsiders. Therefore it is a must to keep data confidentially and as it is for its use in the future. The integration of traditional centralized storage into IoT architecture can be performed for example cloud storage because it tends to inherent vulnerabilities. The centralized server is prone to risk and so that it may experience a single point of failure. Apart from this, if many devices are linked to a central server model then it can create many-to-one traffic jams, and therefore can suffer from delayed response as well as system scalability problems. The mechanism of the blockchain on the IoT platform can serve as a key solution in dealing with the hindrances of data getting deleted or copied. There have been myriad explorations and researches for the development of distributed storage systems for the data.

Data Sharing: The main objective of an IoT system is to share details among objects, which helps to manufacture, transport, and it also allows businesses to give good service to the daily life of people [9]. Data production is huge in IoT systems. The research and study performed by a certain businessman from the US, the global index shows 35% of the businessmen that relay their business decisions on the data being procured online from various sensors. But, these data are not free data that is why a suitable, as well as the fair technique of fair data trading, is a must.

Authentication and Access Control: The challenge of IoT systems is their security issue. The definition of security issues may deploy accessing the data and resources that require prior permission for such approvals. For granting traditional authentication and for giving access control to the external resources that mainly rely on a centralized system that produces an appropriate key that relies on access policies. When the quantity of devices increases immensely than the IoT system makes centralized approaches bottleneck and because the tendency of IoT is energetic and powerful so its use leads to complicated trust management, which requires the renunciation of the scalability of the system.

Privacy: With the use of a wide range of smart devices as well as sensors, an IoT system accumulates data for making a broad determination based on customized requirements. But if the configuration of the IoT system is complex then there are many chances that privacy can be violated easily, for example, raw data processing, data acquisition, and data exchange. If there is an abuse of data given by IoT devices then it consequently may try to violate user privacy. Therefore we can say that in IoT systems the conservation of privacy means the privacy of data as well as privacy of entity, which is important and challenging also.

5 Blockchain Usage in Smart City

In the world of IoT security, the emergent blockchain may bring new freedom. A promising blockchain is being explored for IoT security by many companies and researchers. Blockchain is an append-only decentralized digital ledger based on cryptography. To do trusted transactions without a third-party Blockchain offers a platform in which all the tasks, all the transactions, and all the requests are recorded on the chain with a digital signature for the verification of the public. All entity of the system generates and maintains a ledger. In decentralized networking Blockchain is the fundamental techniques with vast excellence, like:

  • Blockchain is disseminated and that’s why it permits various peers to connect the network with no registration, so it has become trouble-free in comparison to traditional centralized systems [41].

  • The dependence on the third party systems for ensuring the creation of trust and security is avoided by the mechanism of the blockchain and the work is achieved by the implantation of the trust in the service system by proof of work (PoW) or Proof of stack (PoS) that form a part of consensus algorithm.

  • Blockchain is inflexible. The bock chain architecture makes use of the entire information as a process them as a copy or shared data. The data when is finally integrated with the chain, information can’t have tampered and it is all because of given attributes of blockchain, in many applications blockchain act as the fundamental mechanism like those included in the determination of cryptocurrencies, the asset management in a company and the decision making segment in the business. The inference about the efficiency of the blockchain can be brought about for revolutionary response in the economics and business sectors.

In Fig. 2 a typical structure of blockchain is shown. Peers connect blockchain with unique private–public key pairs. A block consists of a block header and a block body and that is formed of few transactions signed by a user with her private key which could be cross-checked with the public key. Few fundamental details about the block like block size, version number, timestamp, and transaction numbers are contained by a block header. For generating a hash value of sell and purchase in the given block a Merkle hash tree is generally used for the sake of reducing storage overhead of the chain. The hash value of the past block is also contained by a block for the linkage of the two blocks. The block is propagated to miners as soon as it is generated, which is a must for validating all transactions in the block.

Fig. 2
figure 2

Blockchain architecture

After the transactions in blocks are validated, the consensus protocol, such as PoW, is employed by searching a nonce which makes the hash of the block start with a definite number of zeros. Then the block is linked to the chain and at the same, it telecast all the nodes in the system. The other nodes assent the given block by employing its hash as part of the newly produced block. The main approaches of blockchain are Ethereum and Bitcoin. The main distinction between the both is, to track the transfer of ownership of cryptocurrencies whereas Ethereum blockchain mainly targets running programming codes on the platform, that obtains very robust functions like voting and ballots. The Ethereum system works for an account-based model with state transitions, and these accounts are of two types, one is private and another is coded in contracts. The accounts which are externally owned are administered by private keys and contract accounts are administered by codes in contracts. Contracts are generated by transactions with a special “to” address.

5.1 Applications of Blockchain

The area of communication and accordingly operation deploys the ides of IoT (Internet of Things) in which different kind of computing devices, people and electromechanical devices interacts and transfer the information over an internet vie the identities like IP address associated with these objects without any interference of human. These associated identities are responsible for making these objects efficient for this work. The Smart cities or IoT based on Blockchain has several functionalities in cities (Fig. 3).

Fig. 3
figure 3

Blockchain application in smart cities

Smart Healthcare comprising of Blockchain: Another probable application of IoT (Internet of Things) is the intellectual and smart system of healthcare. Many smart healthcare devices (wearable health devices and implantable medical devices) are used in these types of environments of communication and they also consist of different kinds of users, Doctors for a medicinal recommendation, health staff (nurses and other staff) for monitoring the health of the patient. All the data are received and transmitted in a secure technique. The system of recommendation can be established in the communication environment for managing the system in absence of doctors. There are many problems with the intellectual or smart system of healthcare-related to privacy and security. In these types of systems, the data is encrypted and saved in blockchain, with a private key gives access only to the authority. The information of surgery is saved in a blockchain and dispatched as delivery proof to the companies of insurance. Ledger is also used in the system for management of general healthcare like drug inspection, adherence of the rules of consent, recording of the tested results, and healthcare supplies management. So, for securing the data communications in the smart system of healthcare, the blockchain approach is useful.

Blockchain in Smart Transportation: The intelligent or smart system of transportation includes automated vehicles (like automatic cars), fog/cloud servers, and roadside units. These devices can interact with each other with the help of the internet. This is a vast system of network of several antennas, embedded software, sensors, and technologies used for sophisticated route navigation. All decisions of accuracy, speed, and consistency decisions are taken by the System’s intelligent units. So these type of environments of communication supplies a journey safe and comfortable for the passengers. In a system of intelligent transportation, communications become secured and authentic from threats from inside and outside the network.

Blockchain in Smart Industries: The combination of devices and connected machines like manufacturing machines, gas, oil, power generation system is known as a smart Industrial system. Sometimes the system failures and Unplanned downtime in an industry cause the lives of working people so the deployment of the industries based on the IoT is the technique for averting these problems. A System with sensing devices and smart monitoring provides a safe and faithful environment for work. Gateway nodes, many servers, and intellectual IoT devices are included in the environment of IoT. The devices rich in resources like servers can implement the algorithms of machine learning and make a phenomenal prediction. The communications done in these types of environments of communication are penetrable to various types of attacks. So we use the scattered ledger in a blockchain for making communications more reliable and secure against intruders.

Some of the major contributions of research work in the field are given in Table 3.

Table 3 Contribution of blockchain in smart cities applications

Technological initiatives presented by blockchain are presented to make smart cities more efficient, robust, secure, etc. Table 4 represents the technological innovation of blockchain in smart city applications.

Table 4 Technological initiatives of blockchain in smart cities applications

5.2 Problem Domains in Blockchain

In the above sections, blockchain-based security applications in smart cities are discussed. These existing works are focused on the general application of blockchain in smart cities.

These works don’t focus on the trustworthiness of the IoT applications of smart cities. After analyzing the above application and their challenges following problems (Fig. 4). If any bugs are found in blockchain applications such as contract code then it will become a challenging task. At edge nodes of the network, the blockchain model is implemented whose function is to track and authorize all sensor nodes transmitted and received data. If any malicious nodes attempt to attack and mimic an authentic node then blockchain can easily identify it. There is a need to keep all records to identify the origin of malicious activities. So, this work is associated with the implementation of blockchain technology for smart city applications.

Fig. 4
figure 4

Problems identified in blockchain technology

6 Proposed Architecture

In this work blockchain-based framework is proposed for smart cities to incorporate security issues and provide a trusted environment for user data transactions. The proposed cross-layer architecture designing for the smart city platforms through which the data transfer is made more reliable. There are three layers within this approach, sensor layer, application layer, and network layer whose coordination can enhance the IoT performance. Also, different IoT systems utilize different architectures that can lead to problems in convergence; the designing of a generic IoT structure for all the platforms can be cost-effective. Figure 5 illustrated the proposed architecture.

Fig. 5
figure 5

Proposed blockchain-based architecture

The steps for the proposed blockchain secure framework is described as below:

  1. 1.

    Authentication application to access files is sent to the authority server.

  2. 2.

    The authority server checks the credentials and forwards the request to the owner.

  3. 3.

    The data owner sends the license to access the data file in the cloud.

  4. 4.

    License is sent back to the data used to access the file.

  5. 5.

    Then the user initiates the smart contract to the blockchain unit for secure access (transaction) of the file.

  6. 6.

    Blockchain retrieves the file from the cloud and informs the data owner.

  7. 7.

    Finally, the encrypted data is transmitted to the user with a decryption key to access the data file.

Table 5 illustrates the theoretical comparison over existing works. The implementation of proposed architecture will show improvement over existing techniques in terms of security features or aspects.

Table 5 Security features comparison with existing techniques

7 Challenges and Future Research Directions

Many existing reviews or surveys are presented on blockchain technology and smart cities that can be extensively used to study. The existing surveys are mainly focused on issues related to blockchain and its application in smart cities. There are no past works that have provided a profound description of blockchain and smart cities along with the broad application of blockchain in smart cities. This chapter also explores the technological innovations that are done with blockchain integrated smart city. This chapter gives a brief description of challenges and issues related to blockchain implementation in smart cities. To resolve these issues, this chapter also proposed architecture and also redirects the researchers towards future research scopes. Table 6 represents the state-of-art reviews related to blockchain applications in smart cities. This table represents the all review aspects that are presented in existing surveys.

Table 6 Comparative analysis of features included in existing survey

Rather than an all-embracing summary of the area under study, the existing research ideas need to be understood for potential research. This chapter gives a brief overview about blockchain and its issues while implementing in smart cities. Some of the challenges for future research work are presented in Fig. 6. In this chapter a comprehensive framework is proposed which can give direction for future research work. Besides, some of the fields overlap and communicate with one another. In the interest of conciseness, this chapter does not explore these overlaps and interactions. For the same reason, an in-depth discussion of subjects that, while relevant, are not unique to smart cities, such as the use of blockchain to counter the outbreak of pandemics, was also not discussed. Consequently, the system should not be seen as a model that determines the limits of current research but as an inspiration for future research to take up a subject and to carry out an in-depth analysis. To explore the value that blockchain can create in combination with various architectures such as cloud, fog, and edge computing, IoT [48, 49]. Further research is also needed. This particularly applies to the scalability problem solution given by such architectures. Likewise, blockchain and Artificial Intelligence (AI) combinations present exciting new research possibilities for many areas of application.

Fig. 6
figure 6

Current challenges in blockchain integrated smart cities

8 Conclusion

The increasing number of smart devices number leads to increased challenges amongst the IOT services and their efficient performance. One of the emerging applications of IoT is smart cities that are designed to scale up the urban environment and ultimately improve the life of the citizens. With the growing development in IoT based resources, the challenges associated with security is the key concern of the research area. The problems and consequences however are found to be resolved using the mechanism of the blockchain in these systems. In this chapter, the architecture of blockchain and its application in different areas are illustrated which showed up their benefits. Along with that a blockchain security model is proposed for future direction in this field. The proposed algorithm can be fruitful in providing a better quality of services even in a complex environment.