# The Security of Big Data in Fog-Enabled IoT Applications Including Blockchain: A Survey
## 6 Blockchain: A Versatile Security Solution  
The concept of blockchain was coined in 2008 [148] for bitcoin cryptocurrency network. Therefore, bitcoin is strongly supported by blockchain that is an unassailable log, which keeps record of network transactions. The blockchain incorporates a distributed ledger to accommodate each and every transaction of underlying network. Participants on network, manage blockchain in a distributed method by using variable Public Key (PK). The new records are added in blocks through a process called mining via certain nodes that are known as miners. The process of bitcoin mining comprises of Proof of Work (PoW), which is actually a cryptographic puzzle that consumes the enormous amount of resources. Because of the key features of blockchain such as anonymity, decentralization and security, it is very useful technology to cater to the above-mentioned security and privacy problems in fog-enabled IoT systems in an easy, efficient, trustworthy and secured manner. In addition, it has been widely implemented for provision of authorized identity to IoT devices. The decentralization ability of blockchain ensures security, authentication and integrity of transmitted data by IoT devices to be cryptographically proofed, assigned by authentic sender using unique public key and GUID (Global Unique IDentifier). Blockchain has made easy the secure tracking of any IoT device transaction [149]. There are many domains such as (but not limited to) eHealth [150], smart home automation [151], authentication and secure communication [152], and data preserving and integrity [153] where blockchain has a remarkable impact, as shown in Table 6.  
Another very useful feature of blockchain is smart contracts which provide effective rules to authenticate the IoT devices, with nominal complexity as compared to conventional protocols for authorization. Furthermore, smart contracts are also capable of providing privacy to data either in transit or at rest with already set rules and conditions to allow the access to single or multiple users. Furthermore, smart contracts are useful in sensing and averting malicious actions. The system refuses the breached blockchain updates of the device. It also eliminates centralized entity where devices do not need any centralized device for their secure communication. Instead, they can securely communicate with each other, share information and automatically perform executions with the help of smart contracts. Another advantage to implement blockchain is that it provides unique GUID and symmetric key pair to each IoT device connected to blockchain network which completely omits the process of key management and distribution. This simplifies the other security protocols as well, as there is no need left for exchanging PKI certificates or creating master and session keys for the purpose of encryption coding parameters at handshake phase. This way, feasibility of light-weight protocols increases as it would fit the memory resources requirement of IoT devices. In addition, it provides secure communication among devices that enable the verification of device's identity validity and ensure verified cryptography of the transactions made by authentic user. Moreover, there is no single failure point as identical information is recorded on several computers and devices [126; 154]. Apart from above-mentioned advantages, there are a few challenges associated with using blockchain in IoT domain [155; 156]. In many instances of IoT devices, adaptive and lightweight blockchain security solutions are necessary due to constrained computational and storage capacities. The computations regarding PoW may be disregarded in this scenario. In addition, bitcoin blockchain also poses latency in terms of response time for transaction validation and hence is not suitable in real time domains. Moreover, as discussed above, IoT devices generate huge amount of data as the result of numerous transactions, which consumes colossal amount of bandwidth consequently.