Keywords

1 Introduction

Presently, there is a huge advancement in technology. There is advancement in various fields such as agriculture, space, automobiles, etc. But the most important advancement has been made in the field of health care. The new technologies such as IoT have helped in covering and monitoring the health of remote population. People who don’t have access to doctors due to lack of availability of doctors in such areas can get their health checkups on regular basis with the help of IoT and also get recommendations and prescription based on the data retrieved during the checkups. All this is possible while the patients don’t have any means to contact the doctor face to face. All the data respective to the patient collected during the checkups or during the treatment which includes BP level, pulse rate, ECG, etc. are stored on the website. Both patient and doctors can access those data to monitor and analyze the patient medical history and recovery.

But with the advancement in the technology and huge amount of data is being generated and there comes the threat of tampering of data which can be fatal especially in the case of health care. As the data can be misused this can harm the patients’ health. Hackers can also modify the data which will result in the distortion of the treatment going on. Since the security of the data is very essential in the healthcare applications, therefore, the data must be dealt with care and must be prevented from any kind of data tampering with the most secured technology such as blockchain.

Blockchain is the decentralized distributed ledger, which is based on the peer-to-peer network method. As the blockchain is mainly developed for implementation in the virtual cryptocurrency such as bitcoin, so its main purpose is clear that is security. To hack or corrupt the data secured by the blockchain, one need to change entire chain of blocks, which requires huge computational power and therefore is very difficult to do. This paper deals with the implementation of the blockchain in securing the healthcare data and preventing it from data manipulations by hackers.

2 Literature Survey

Bhabendu Kumar Mohanta states in his paper about the various components and the principles on which smart contract works. Moreover, he also states the various application and uses cases of smart contracts in blockchain [1].

You Sun has proposed a decentralized attribute-based scheme in his paper for blockchain implication in healthcare system for effective verification of authenticity of signer’s identity. Even holistic on-chain and off-chain collaborative storage system was proposed in his paper [2].

Tran Le Nguyen, in his paper, proposed an application to store and create a database for doctors and patients and this paper is based on simulation space conceptual model. In this paper, he proposed bitcoin to be paid as a payment to the doctors [3].

Culver [4] indicated that collecting information to audit Medical Loss Ratio (MLR) and improper payment for subsidized programs creates substantial overhead for both providers and health care plans. This paper suggests an architectural model which is a solution to groups like providers, health plans and government which are the main stakeholders for payment process. The benefit of this model is the majority of health plan process will enable the providers to submit claims and providers to submit claims and provide other stakeholders through 15 nodes in blockchain. Each node has smart contract and the same so that all stakeholders can view applicable data or interface directly with the Blockchain to executive the agreed-upon contracts. One more advantage of this model is the third-party nodes are present in nodes outside of the three main stakeholders [4].

Atlam’s paper provides an overview of the integration of the blockchain with the IoT by highlighting the integration benefits and challenges. The future research directions of blockchain with IoT are also discussed. In his paper, he concluded that the combination of blockchain and IoT may provide a powerful approach which can significantly pave the way for new business models and distributed applications [5].

3 Proposed Model

Looking at the problem of insecurity of data in the above existing system, the proposed system introduces the concept of blockchain. Blockchain is the decentralized distributed ledger, which is based on the peer-to-peer network method. It is a global online database which anyone, anywhere with an internet connection can use. Unlike traditional databases which are maintained and third party based, the blockchain doesn’t belong to anyone. Blockchain stores information permanently across a network of personal computers, this not only decentralize the network but distributes it too [6]. Every new block which is added in the blockchain is shared with the other blocks with the timestamp and thus each block in the blockchain contains the information of the other blocks. This makes the blockchain hack-proof and difficult to tamper with.

3.1 Integration of IoT with Blockchain

IoT is making huge advancement in wireless communication, sensor-based technology a and if we combine it with the technologies like big data and Artificial Intelligence it makes the system more intelligent while not exceeding the cost. But taking into consideration the limited maintenance cost and management cost, there is restricted privacy of data and also insecure exchange of data among the personal computers. There comes concept of Blockchain into play [7]. Blockchain which is based on the distributed ledger technology can be implemented to IoT networks which themselves are distributed in nature. Therefore, these networks can be secured and shielded from any kind of data tampering at any point [8].

3.2 Blockchain in Health Care

Remote healthcare monitoring and analysis requires cloud storage for resilience and easy access of the data retrieved. Even though the cloud is the best platform for privacy and sharing of data among various subjects involved in healthcare monitoring analysis such as patients, doctors, data analyst, etc., it does not support interoperability among the above-mentioned stakeholders and also it does not guarantee the integrity and authenticity of medical data [9]. So, to mitigate the above flaws, blockchain technology can be incorporated in this model which ensures and enhance integrity, consistency, and also authenticity of the medical records stored [10]. High security and confidentiality of medical data is the first and foremost thing of concern for the patients and all this data should be accessed by only an authorized person. This concern is placated with the help of this technology–Blockchain (Fig. 1).

Fig. 1
figure 1

Digital signature formation

And once we add the concept of Artificial Intelligence into the concept of securing medical data in the blockchain, it will eventually become smarter and more secure by automatically realizing that this data is of concern and to be secured and which one needs to be discarded [11].

3.3 Technologies Used and Software

3.3.1 Smart Contracts

Smart contracts are the brain of blockchain so is the most important component to be deployed along with blockchain to IoT devices. Specifically, smart contracts can be considered as scripts and are written in the form of conditional statements and if true actions will be triggered else not [12].

3.3.2 Ethereum

Ethereum is a distributed computing platform, which is based on blockchain and is open source and public. It also features smart contract functionality [13]. It is actually a modified version of Nakamoto consensus through state transition, which is based on transaction. For example, Cryptocurrency like ether is generated by this blockchain platform. It is written in Go, C++, and Rust [1].

3.3.3 Python

Python is a high-level general-purpose programming language. It is utilized in both machine learning and blockchain applications because of its scalability, portability, robustness, powerful design, etc. Python is also very easy to implement as compared to the other programming languages. It is well equipped with the huge number of inbuilt libraries which can be directly implemented in the AI and Blockchain.

3.3.4 Decentralized Apps (DApps)

Ethereum is a distributed computing platform, which is based on blockchain and is open source and public. It also features smart contract functionality [13]. It is actually modified version of Nakamoto consensus through state transition which is based on transaction. Example Cryptocurrency like ether is generated by this blockchain platform. It is written in Go, C++ and Rust [1].

4 Working

First of all, the IoT devices containing sensors will be provided to each patient and the sensors installed in them will continuously monitor the health of the patient carrying that device. The reports of the monitored data will be sent to the doctor on his mobile device and also to the server through a GSM module. Moreover, the data could also be viewed on a website (as shown in Fig. 2). And also, any abrupt change in the normal behavior in the patient’s health will also be reported with a warning notification to the doctor (Fig. 3).

Fig. 2
figure 2

Comparison between Apps and DApps

Fig. 3
figure 3

Patient’s health data

But with so much of data stored on the cloud, there is a need to secure that humongous amount of data and prevent it from tampering. This virtue is done with help of blockchain. For this, first of all we will have to write a code for the blocks in programming language like Python. Here we will create a class Block with a Block number, data, a pointer to the next block, and a hash function of the block. Most importantly a block has the hash function of the previous block which makes a blockchain immutable. There is also a timestamp related to a block; this timestamp helps in synchronization of the blockchain [14]. Now once the data of a patient is stored in the form of a string on the block, it gets added to the node along with hash describing the location of the block. Now the smart contract will come into play by connecting it with blockchain which will maintain the privacy and security of the blockchain. The patient–client relation is secured by deploying smart contracts on blockchain. And the data generated by sensors such as Blood Pressure Level, ECG, etc., will be sent and stored in off-chain database like IPFS through gateways like mobiles and laptops. A hash included in blockchain which will be sent via notification will tell the location and will be sent through client, for example, clients of Ethereum–geth or PyEth.

As shown in Fig. 4, a patient’s health will be detected by sensors and a node is created by Arduino Uno and another node is created at a database IPFS. The patient at a remote location with sensors gets its checkups done and a block will be created with data and hash on it. The patient’s block will hold a private key. An authorized doctor will only be able to access that crypt block using its public key and no one else. Later on, using smart contracts the data will be stored on an off-chain database IPFS and communication between doctor and patient will occur when the doctor will receive the notification about any abrupt change in the normal behavior or the reports of the patient.

Fig. 4
figure 4

Block diagram of the proposed model

Here, we are working on Ethereum environment we are working on the public domain. The authorized doctor will use his public key to access that information. After a new health report, a new block is added to the previous ledger using the hash of the previous block and a new hash is assigned to the new block. Since a cryptic language is used and a chain of blocks is made which is interconnected, now if a hacker will perform some tampering in any one of the blocks, he will have to change the data of in every block because a hash function is linked with each block. Moreover, the patient and the doctor will get to know about tampering. So now it becomes very tedious and almost impossible to tamper the data.

4.1 Observed Database Table

The Database Table will contain the patient id and name of the doctor assigned to the patient, respectively, along with the patient’s details such as date of report, temperature, ECG value, and Blood Pressure. Blockchain-related details like timestamp and hash history will also be found in the table (Fig. 5).

Fig. 5
figure 5

Observed database table

4.2 Flowchart of Working

As shown in figure, the real-time sensors will collect data such as ECG reading, pulse rating, blood pressure, and temperature data from their respective IoT sensors. These data will then be integrated into single unit based upon the time of the data retrieval and time stamp is allotted to the data unit in order to preserve date and time of the originated data. Since timestamps of the data are stored simultaneously in database, it prevents any possible malpractice with the data in future. With the help of hash function the data is then encrypted and stored in IFPS data server. The stored data is first extracted from IFPS data server and then decrypted in order to display it either on the patient’s account or the doctor’s account on server. The registered doctor can monitor patient’s health statistics anytime he feels like. If in case any aberration is found in patient’s health data, SMS will automatically be sent to the registered mobile number of doctor and relatives of patient (Fig. 6).

Fig. 6
figure 6

Flowchart of the working of proposed mode

5 Conclusions and Future Scope

The research paper findings state that huge and critical data can be secured and be saved from any kind of tamper from the accomplice. So, we can conclude by denoting that Blockchain is the upcoming and the safest technology for security of data. All the necessary data can be saved on cloud and data analytics can be performed to observe some patterns on health problems based upon region, climate, time, number of patients with similar symptoms, etc. Patients who are willing to share their health records and medical data can be given some incentives in cash, which will inspire more patients to cooperate and aid in analysis. Further, the fees of prescribed doctors can also be paid through in-system online cash service which will also be protected by the blockchain. Also, the authorized family members and guardians can be provided facility through which they can access the website and monitor the patient’s condition from the distant location.